status
stringclasses 1
value | repo_name
stringclasses 31
values | repo_url
stringclasses 31
values | issue_id
int64 1
104k
| title
stringlengths 4
369
| body
stringlengths 0
254k
⌀ | issue_url
stringlengths 37
56
| pull_url
stringlengths 37
54
| before_fix_sha
stringlengths 40
40
| after_fix_sha
stringlengths 40
40
| report_datetime
unknown | language
stringclasses 5
values | commit_datetime
unknown | updated_file
stringlengths 4
188
| file_content
stringlengths 0
5.12M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
closed | dagger/dagger | https://github.com/dagger/dagger | 3,173 | finish the services API | The services API is incomplete.
Mainly:
- Convert to New Core API
- Restructure to be multi-process (just like buildkit)
- Support non-interactive mode (e.g. for launching a db etc, we don't want tty streaming etc)
- cloak attach is hardcoded to localhost
- Tests
We should either address this or remove the services API for release.
See #3123 for more details | https://github.com/dagger/dagger/issues/3173 | https://github.com/dagger/dagger/pull/6347 | b7f85d14478b32a940857d29a4a54a87ac1cf16c | 6bf18c7e0568f542567c8d63408cde9331f099c8 | "2022-09-28T23:45:48Z" | go | "2024-01-04T10:01:28Z" | sdk/java/pom.xml | <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.dagger</groupId>
<artifactId>dagger-sdk-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>dagger-codegen-maven-plugin</module>
<module>dagger-java-sdk</module>
<module>dagger-java-samples</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.dagger</groupId>
<artifactId>dagger-java-sdk</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-graphql-client-api</artifactId>
<version>${smallrye-graphql.version}</version>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-graphql-client-implementation-vertx</artifactId>
<version>${smallrye-graphql.version}</version>
</dependency>
<dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
<version>${jakarta.json-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.json.bind</groupId>
<artifactId>jakarta.json.bind-api</artifactId>
<version>${jakarta.json.bind-api.version}</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>${json-path.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
<version>${yasson.version}</version>
</dependency>
<dependency>
<groupId>com.squareup</groupId>
<artifactId>javapoet</artifactId>
<version>${javapoet.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang.version}</version>
</dependency>
<dependency>
<groupId>net.kothar</groupId>
<artifactId>xdg-java</artifactId>
<version>${xdg-java.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>${commons-compress.version}</version>
</dependency>
<dependency>
<groupId>com.ongres</groupId>
<artifactId>fluent-process</artifactId>
<version>${fluent-process.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven-plugin-api.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>${maven-project.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j-api.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j-simple.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>${maven-plugin-annotations.version}</version>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>uk.org.webcompere</groupId>
<artifactId>system-stubs-jupiter</artifactId>
<version>${system-stubs-jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj-core.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito-core.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>maven-versions-plugin</artifactId>
<version>${maven-versions-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>de.m3y.maven</groupId>
<artifactId>inject-maven-plugin</artifactId>
<version>${inject-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.spotify.fmt</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>${fmt-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>io.dagger</groupId>
<artifactId>dagger-codegen-maven-plugin</artifactId>
<version>${project.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skipITs>true</skipITs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<daggerengine.version>devel</daggerengine.version>
<assertj-core.version>3.24.2</assertj-core.version>
<commons-compress.version>1.24.0</commons-compress.version>
<commons-lang.version>3.13.0</commons-lang.version>
<exec-maven-plugin.version>3.1.0</exec-maven-plugin.version>
<fluent-process.version>1.0.1</fluent-process.version>
<fmt-maven-plugin.version>2.21.1</fmt-maven-plugin.version>
<inject-maven-plugin.version>1.4</inject-maven-plugin.version>
<jakarta.json-api.version>2.1.2</jakarta.json-api.version>
<jakarta.json.bind-api.version>3.0.0</jakarta.json.bind-api.version>
<javapoet.version>1.13.0</javapoet.version>
<json-path.version>2.8.0</json-path.version>
<junit.version>5.10.0</junit.version>
<maven-assembly-plugin.version>3.6.0</maven-assembly-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-failsafe-plugin.version>3.0.0</maven-failsafe-plugin.version>
<maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
<maven-plugin-api.version>3.8.8</maven-plugin-api.version>
<maven-plugin-annotations.version>3.8.1</maven-plugin-annotations.version>
<maven-project.version>2.2.1</maven-project.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
<maven-versions-plugin.version>2.16.0</maven-versions-plugin.version>
<mockito-core.version>5.6.0</mockito-core.version>
<slf4j-api.version>2.0.0</slf4j-api.version>
<slf4j-simple.version>2.0.7</slf4j-simple.version>
<smallrye-graphql.version>2.5.1</smallrye-graphql.version>
<system-stubs-jupiter.version>2.1.3</system-stubs-jupiter.version>
<xdg-java.version>0.1.1</xdg-java.version>
<yasson.version>3.0.3</yasson.version>
</properties>
</project>
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,266 | 🐞 shim: panic when exec-ing an unknown command | ### What is the issue?
Noticed during #6117 that some integration tests were causing a panic to show in the TUI. @sipsma reported in https://github.com/dagger/dagger/pull/6117#pullrequestreview-1778643232.
The tests pass fine and the SDK gets a correct `dagger.ExecError`, but the panic pollutes the screen and makes it seem like there's a bigger problem.
The issue is in the shim:
https://github.com/dagger/dagger/blob/970bcfe512cfc699005c46992f52a8f1d17c2af3/cmd/shim/main.go#L285-L293
Where `runWithNesting` isn't returning an expected `exiterr.ExitError`. Instead of panicking should try set the right exit code (from `runWithNesting`) or default to `exitCode = -1`.
### Log output
```shell
❯ dagger run --focus go run main.go
✘ sync ERROR [0.54s]
✘ exec foobar ERROR [0.12s]
┃ panic: exec: "foobar": executable file not found in $PATH goroutine 1 [running, locked to
┃ read]:
┃ runtime/debug.Stack()
┃ /usr/local/go/src/runtime/debug/stack.go:24 +0x64
┃ main.main.func1()
┃ /app/cmd/shim/main.go:63 +0x34
┃ panic({0xa7d960?, 0x4000528b00?})
┃ /usr/local/go/src/runtime/panic.go:914 +0x218
┃ main.shim()
┃ /app/cmd/shim/main.go:291 +0xda8
┃ main.main()
┃ /app/cmd/shim/main.go:76 +0x98
• Engine: f4abd4cd1f6c (version v0.9.4)
⧗ 14.47s ✔ 12 ✘ 2
```
### Steps to reproduce
Just try exec-ing a non-existing command or getting a directory that doesn't exist:
```go
package main
import (
"context"
"fmt"
"log"
"dagger.io/dagger"
)
func main() {
ctx := context.Background()
client, err := dagger.Connect(ctx)
if err != nil {
log.Println(err)
return
}
defer client.Close()
_, err = client.Container().From("alpine").WithExec([]string{"foobar"}).Sync(ctx)
if err != nil {
log.Println(err)
return
}
fmt.Println("Done!")
}
```
### Dagger version
dagger v0.9.4 (registry.dagger.io/engine) darwin/arm64 | https://github.com/dagger/dagger/issues/6266 | https://github.com/dagger/dagger/pull/6356 | 7a13be4bb56171c7d841fc603bbcea34ee8b50b5 | 25e858ba1900134a7f3d84de66286f29680273c5 | "2023-12-13T13:05:51Z" | go | "2024-01-04T13:07:53Z" | .changes/unreleased/Fixed-20240104-003032.yaml | |
closed | dagger/dagger | https://github.com/dagger/dagger | 6,266 | 🐞 shim: panic when exec-ing an unknown command | ### What is the issue?
Noticed during #6117 that some integration tests were causing a panic to show in the TUI. @sipsma reported in https://github.com/dagger/dagger/pull/6117#pullrequestreview-1778643232.
The tests pass fine and the SDK gets a correct `dagger.ExecError`, but the panic pollutes the screen and makes it seem like there's a bigger problem.
The issue is in the shim:
https://github.com/dagger/dagger/blob/970bcfe512cfc699005c46992f52a8f1d17c2af3/cmd/shim/main.go#L285-L293
Where `runWithNesting` isn't returning an expected `exiterr.ExitError`. Instead of panicking should try set the right exit code (from `runWithNesting`) or default to `exitCode = -1`.
### Log output
```shell
❯ dagger run --focus go run main.go
✘ sync ERROR [0.54s]
✘ exec foobar ERROR [0.12s]
┃ panic: exec: "foobar": executable file not found in $PATH goroutine 1 [running, locked to
┃ read]:
┃ runtime/debug.Stack()
┃ /usr/local/go/src/runtime/debug/stack.go:24 +0x64
┃ main.main.func1()
┃ /app/cmd/shim/main.go:63 +0x34
┃ panic({0xa7d960?, 0x4000528b00?})
┃ /usr/local/go/src/runtime/panic.go:914 +0x218
┃ main.shim()
┃ /app/cmd/shim/main.go:291 +0xda8
┃ main.main()
┃ /app/cmd/shim/main.go:76 +0x98
• Engine: f4abd4cd1f6c (version v0.9.4)
⧗ 14.47s ✔ 12 ✘ 2
```
### Steps to reproduce
Just try exec-ing a non-existing command or getting a directory that doesn't exist:
```go
package main
import (
"context"
"fmt"
"log"
"dagger.io/dagger"
)
func main() {
ctx := context.Background()
client, err := dagger.Connect(ctx)
if err != nil {
log.Println(err)
return
}
defer client.Close()
_, err = client.Container().From("alpine").WithExec([]string{"foobar"}).Sync(ctx)
if err != nil {
log.Println(err)
return
}
fmt.Println("Done!")
}
```
### Dagger version
dagger v0.9.4 (registry.dagger.io/engine) darwin/arm64 | https://github.com/dagger/dagger/issues/6266 | https://github.com/dagger/dagger/pull/6356 | 7a13be4bb56171c7d841fc603bbcea34ee8b50b5 | 25e858ba1900134a7f3d84de66286f29680273c5 | "2023-12-13T13:05:51Z" | go | "2024-01-04T13:07:53Z" | cmd/shim/main.go | package main
import (
"bufio"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net"
"net/http"
"os"
"os/exec"
"os/signal"
"path/filepath"
"runtime"
"runtime/debug"
"strconv"
"strings"
"sync"
"syscall"
"time"
"github.com/cenkalti/backoff/v4"
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/engine/buildkit"
"github.com/dagger/dagger/engine/client"
"github.com/dagger/dagger/network"
"github.com/google/uuid"
"github.com/opencontainers/go-digest"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/vito/progrock"
"golang.org/x/sys/unix"
)
const (
metaMountPath = "/.dagger_meta_mount"
stdinPath = metaMountPath + "/stdin"
exitCodePath = metaMountPath + "/exitCode"
runcPath = "/usr/local/bin/runc"
shimPath = "/_shim"
errorExitCode = 125
)
var (
stdoutPath = metaMountPath + "/stdout"
stderrPath = metaMountPath + "/stderr"
pipeWg sync.WaitGroup
)
/*
There are two "subcommands" of this binary:
1. The setupBundle command, which is invoked by buildkitd as the oci executor. It updates the
spec provided by buildkitd's executor to wrap the command in our shim (described below).
It then exec's to runc which will do the actual container setup+execution.
2. The shim, which is included in each Container.Exec and enables us to capture/redirect stdio,
capture the exit code, etc.
*/
func main() {
defer func() {
if err := recover(); err != nil {
fmt.Fprintf(os.Stderr, "panic: %v %s\n", err, string(debug.Stack()))
os.Exit(errorExitCode)
}
}()
if os.Args[0] == shimPath {
if _, found := internalEnv("_DAGGER_INTERNAL_COMMAND"); found {
os.Exit(internalCommand())
return
}
// If we're being executed as `/_shim`, then we're inside the container and should shim
// the user command.
os.Exit(shim())
} else {
// Otherwise, we're being invoked directly by buildkitd and should setup the bundle.
os.Exit(setupBundle())
}
}
func internalCommand() int {
if len(os.Args) < 2 {
fmt.Fprintf(os.Stderr, "usage: %s <command> [<args>]\n", os.Args[0])
return errorExitCode
}
cmd := os.Args[1]
args := os.Args[2:]
switch cmd {
case "check":
if err := check(args); err != nil {
fmt.Fprintln(os.Stderr, err)
return errorExitCode
}
return 0
case "tunnel":
if err := tunnel(args); err != nil {
fmt.Fprintln(os.Stderr, err)
return 1
}
return 0
default:
fmt.Fprintf(os.Stderr, "unknown command: %s\n", cmd)
return errorExitCode
}
}
func check(args []string) error {
if len(args) == 0 {
return fmt.Errorf("usage: check <host> port/tcp [port/udp ...]")
}
host, ports := args[0], args[1:]
for _, port := range ports {
port, network, ok := strings.Cut(port, "/")
if !ok {
network = "tcp"
}
pollAddr := net.JoinHostPort(host, port)
fmt.Println("polling for port", pollAddr)
reached, err := pollForPort(network, pollAddr)
if err != nil {
return fmt.Errorf("poll %s: %w", pollAddr, err)
}
fmt.Println("port is up at", reached)
}
return nil
}
func pollForPort(network, addr string) (string, error) {
retry := backoff.NewExponentialBackOff()
retry.InitialInterval = 100 * time.Millisecond
dialer := net.Dialer{
Timeout: time.Second,
}
var reached string
err := backoff.Retry(func() error {
// NB(vito): it's a _little_ silly to dial a UDP network to see that it's
// up, since it'll be a false positive even if they're not listening yet,
// but it at least checks that we're able to resolve the container address.
conn, err := dialer.Dial(network, addr)
if err != nil {
fmt.Fprintf(os.Stderr, "port not ready: %s; elapsed: %s\n", err, retry.GetElapsedTime())
return err
}
reached = conn.RemoteAddr().String()
_ = conn.Close()
return nil
}, retry)
if err != nil {
return "", err
}
return reached, nil
}
func shim() (returnExitCode int) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
if len(os.Args) < 2 {
fmt.Fprintf(os.Stderr, "usage: %s <path> [<args>]\n", os.Args[0])
return errorExitCode
}
name := os.Args[1]
args := []string{}
if len(os.Args) > 2 {
args = os.Args[2:]
}
cmd := exec.Command(name, args...)
_, isTTY := internalEnv(core.ShimEnableTTYEnvVar)
if isTTY {
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
} else {
if stdinFile, err := os.Open(stdinPath); err == nil {
defer stdinFile.Close()
cmd.Stdin = stdinFile
} else {
cmd.Stdin = nil
}
var secretsToScrub core.SecretToScrubInfo
secretsToScrubVar, found := internalEnv("_DAGGER_SCRUB_SECRETS")
if found {
err := json.Unmarshal([]byte(secretsToScrubVar), &secretsToScrub)
if err != nil {
panic(fmt.Errorf("cannot load secrets to scrub: %w", err))
}
}
currentDirPath := "/"
shimFS := os.DirFS(currentDirPath)
stdoutFile, err := os.Create(stdoutPath)
if err != nil {
panic(err)
}
defer stdoutFile.Close()
stdoutRedirect := io.Discard
stdoutRedirectPath, found := internalEnv("_DAGGER_REDIRECT_STDOUT")
if found {
stdoutRedirectFile, err := os.Create(stdoutRedirectPath)
if err != nil {
panic(err)
}
defer stdoutRedirectFile.Close()
stdoutRedirect = stdoutRedirectFile
}
stderrFile, err := os.Create(stderrPath)
if err != nil {
panic(err)
}
defer stderrFile.Close()
stderrRedirect := io.Discard
stderrRedirectPath, found := internalEnv("_DAGGER_REDIRECT_STDERR")
if found {
stderrRedirectFile, err := os.Create(stderrRedirectPath)
if err != nil {
panic(err)
}
defer stderrRedirectFile.Close()
stderrRedirect = stderrRedirectFile
}
outWriter := io.MultiWriter(stdoutFile, stdoutRedirect, os.Stdout)
errWriter := io.MultiWriter(stderrFile, stderrRedirect, os.Stderr)
if len(secretsToScrub.Envs) == 0 && len(secretsToScrub.Files) == 0 {
cmd.Stdout = outWriter
cmd.Stderr = errWriter
} else {
// Get pipes for command's stdout and stderr and process output
// through secret scrub reader in multiple goroutines:
envToScrub := os.Environ()
stdoutPipe, err := cmd.StdoutPipe()
if err != nil {
panic(err)
}
scrubOutReader, err := NewSecretScrubReader(stdoutPipe, currentDirPath, shimFS, envToScrub, secretsToScrub)
if err != nil {
panic(err)
}
pipeWg.Add(1)
go func() {
defer pipeWg.Done()
io.Copy(outWriter, scrubOutReader)
}()
stderrPipe, err := cmd.StderrPipe()
if err != nil {
panic(err)
}
scrubErrReader, err := NewSecretScrubReader(stderrPipe, currentDirPath, shimFS, envToScrub, secretsToScrub)
if err != nil {
panic(err)
}
pipeWg.Add(1)
go func() {
defer pipeWg.Done()
io.Copy(errWriter, scrubErrReader)
}()
}
}
exitCode := 0
if err := runWithNesting(ctx, cmd); err != nil {
exitCode = errorExitCode
if exiterr, ok := err.(*exec.ExitError); ok {
exitCode = exiterr.ExitCode()
} else {
panic(err)
}
}
if err := os.WriteFile(exitCodePath, []byte(fmt.Sprintf("%d", exitCode)), 0o600); err != nil {
panic(err)
}
return exitCode
}
func setupBundle() int {
// Figure out the path to the bundle dir, in which we can obtain the
// oci runtime config.json
var bundleDir string
var isRun bool
for i, arg := range os.Args {
if arg == "--bundle" && i+1 < len(os.Args) {
bundleDir = os.Args[i+1]
}
if arg == "run" {
isRun = true
}
}
if bundleDir == "" || !isRun {
// this may be a different runc command, just passthrough
return execRunc()
}
configPath := filepath.Join(bundleDir, "config.json")
configBytes, err := os.ReadFile(configPath)
if err != nil {
fmt.Printf("Error reading config.json: %v\n", err)
return errorExitCode
}
var spec specs.Spec
if err := json.Unmarshal(configBytes, &spec); err != nil {
fmt.Printf("Error parsing config.json: %v\n", err)
return errorExitCode
}
// Check to see if this is a dagger exec, currently by using
// the presence of the dagger meta mount. If it is, set up the
// shim to be invoked as the init process. Otherwise, just
// pass through as is
var isDaggerExec bool
for _, mnt := range spec.Mounts {
if mnt.Destination == metaMountPath {
isDaggerExec = true
break
}
}
// We're running an internal shim command, i.e. a service health check
for _, env := range spec.Process.Env {
if strings.HasPrefix(env, "_DAGGER_INTERNAL_COMMAND=") {
isDaggerExec = true
break
}
}
if isDaggerExec {
// mount this executable into the container so it can be invoked as the shim
selfPath, err := os.Executable()
if err != nil {
fmt.Printf("Error getting self path: %v\n", err)
return errorExitCode
}
selfPath, err = filepath.EvalSymlinks(selfPath)
if err != nil {
fmt.Printf("Error getting self path: %v\n", err)
return errorExitCode
}
spec.Mounts = append(spec.Mounts, specs.Mount{
Destination: shimPath,
Type: "bind",
Source: selfPath,
Options: []string{"rbind", "ro"},
})
spec.Hooks = &specs.Hooks{}
if gpuSupportEnabled := os.Getenv("_EXPERIMENTAL_DAGGER_GPU_SUPPORT"); gpuSupportEnabled != "" {
spec.Hooks.Prestart = []specs.Hook{
{
Args: []string{
"nvidia-container-runtime-hook",
"prestart",
},
Path: "/usr/bin/nvidia-container-runtime-hook",
},
}
}
// update the args to specify the shim as the init process
spec.Process.Args = append([]string{shimPath}, spec.Process.Args...)
}
execMetadata := new(buildkit.ContainerExecUncachedMetadata)
for i, env := range spec.Process.Env {
found, err := execMetadata.FromEnv(env)
if err != nil {
fmt.Printf("Error parsing env: %v\n", err)
return errorExitCode
}
if found {
// remove the ftp_proxy env var from being set in the container
spec.Process.Env = append(spec.Process.Env[:i], spec.Process.Env[i+1:]...)
break
}
}
var searchDomains []string
for _, parentClientID := range execMetadata.ParentClientIDs {
searchDomains = append(searchDomains, network.ClientDomain(parentClientID))
}
if len(searchDomains) > 0 {
spec.Process.Env = append(spec.Process.Env, "_DAGGER_PARENT_CLIENT_IDS="+strings.Join(execMetadata.ParentClientIDs, " "))
}
var hostsFilePath string
for i, mnt := range spec.Mounts {
switch mnt.Destination {
case "/etc/hosts":
hostsFilePath = mnt.Source
case "/etc/resolv.conf":
if len(searchDomains) == 0 {
break
}
newResolvPath := filepath.Join(bundleDir, "resolv.conf")
newResolv, err := os.Create(newResolvPath)
if err != nil {
panic(err)
}
if err := replaceSearch(newResolv, mnt.Source, searchDomains); err != nil {
panic(err)
}
if err := newResolv.Close(); err != nil {
panic(err)
}
spec.Mounts[i].Source = newResolvPath
}
}
var gpuParams string
keepEnv := []string{}
for _, env := range spec.Process.Env {
switch {
case strings.HasPrefix(env, "_DAGGER_ENABLE_NESTING="):
// keep the env var; we use it at runtime
keepEnv = append(keepEnv, env)
// provide the server id to connect back to
if execMetadata.ServerID == "" {
fmt.Fprintln(os.Stderr, "missing server id")
return errorExitCode
}
keepEnv = append(keepEnv, "_DAGGER_SERVER_ID="+execMetadata.ServerID)
// mount buildkit sock since it's nesting
spec.Mounts = append(spec.Mounts, specs.Mount{
Destination: "/.runner.sock",
Type: "bind",
Options: []string{"rbind"},
Source: "/run/buildkit/buildkitd.sock",
})
// mount dagger CLI
spec.Mounts = append(spec.Mounts, specs.Mount{
Destination: "/bin/dagger",
Type: "bind",
Options: []string{"rbind", "ro"},
Source: "/usr/local/bin/dagger",
})
// also need the progsock path for forwarding progress
if execMetadata.ProgSockPath == "" {
fmt.Fprintln(os.Stderr, "missing progsock path")
return errorExitCode
}
spec.Mounts = append(spec.Mounts, specs.Mount{
Destination: "/.progrock.sock",
Type: "bind",
Options: []string{"rbind"},
Source: execMetadata.ProgSockPath,
})
case strings.HasPrefix(env, "_DAGGER_SERVER_ID="):
case strings.HasPrefix(env, aliasPrefix):
// NB: don't keep this env var, it's only for the bundling step
// keepEnv = append(keepEnv, env)
if err := appendHostAlias(hostsFilePath, env, searchDomains); err != nil {
fmt.Fprintln(os.Stderr, "host alias:", err)
return errorExitCode
}
case strings.HasPrefix(env, "_EXPERIMENTAL_DAGGER_GPU_PARAMS"):
splits := strings.Split(env, "=")
gpuParams = splits[1]
default:
keepEnv = append(keepEnv, env)
}
}
spec.Process.Env = keepEnv
if gpuParams != "" {
spec.Process.Env = append(spec.Process.Env, fmt.Sprintf("NVIDIA_VISIBLE_DEVICES=%s", gpuParams))
}
// write the updated config
configBytes, err = json.Marshal(spec)
if err != nil {
fmt.Printf("Error marshaling config.json: %v\n", err)
return errorExitCode
}
if err := os.WriteFile(configPath, configBytes, 0o600); err != nil {
fmt.Printf("Error writing config.json: %v\n", err)
return errorExitCode
}
// Run the actual runc binary as a child process with the (possibly updated) config
// Run it in a separate goroutine locked to the OS thread to ensure that Pdeathsig
// is never sent incorrectly: https://github.com/golang/go/issues/27505
exitCodeCh := make(chan int)
go func() {
runtime.LockOSThread()
defer runtime.UnlockOSThread()
defer close(exitCodeCh)
// #nosec G204
cmd := exec.Command(runcPath, os.Args[1:]...)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.SysProcAttr = &syscall.SysProcAttr{
Pdeathsig: syscall.SIGKILL,
}
sigCh := make(chan os.Signal, 32)
signal.Notify(sigCh)
if err := cmd.Start(); err != nil {
fmt.Printf("Error starting runc: %v", err)
exitCodeCh <- errorExitCode
return
}
go func() {
for sig := range sigCh {
cmd.Process.Signal(sig)
}
}()
if err := cmd.Wait(); err != nil {
if exiterr, ok := err.(*exec.ExitError); ok {
if waitStatus, ok := exiterr.Sys().(syscall.WaitStatus); ok {
exitcode := waitStatus.ExitStatus()
if exitcode < 0 {
exitcode = errorExitCode
}
exitCodeCh <- exitcode
return
}
}
fmt.Printf("Error waiting for runc: %v", err)
exitCodeCh <- errorExitCode
return
}
}()
return <-exitCodeCh
}
const aliasPrefix = "_DAGGER_HOSTNAME_ALIAS_"
func appendHostAlias(hostsFilePath string, env string, searchDomains []string) error {
alias, target, ok := strings.Cut(strings.TrimPrefix(env, aliasPrefix), "=")
if !ok {
return fmt.Errorf("malformed host alias: %s", env)
}
var ips []net.IP
var errs error
for _, domain := range append([]string{""}, searchDomains...) {
qualified := target
if domain != "" {
qualified += "." + domain
}
var err error
ips, err = net.LookupIP(qualified)
if err == nil {
errs = nil // ignore prior failures
break
}
errs = errors.Join(errs, err)
}
if errs != nil {
return errs
}
hostsFile, err := os.OpenFile(hostsFilePath, os.O_APPEND|os.O_WRONLY, 0o777)
if err != nil {
return err
}
for _, ip := range ips {
if _, err := fmt.Fprintf(hostsFile, "\n%s\t%s\n", ip, alias); err != nil {
return err
}
}
return hostsFile.Close()
}
// nolint: unparam
func execRunc() int {
args := []string{runcPath}
args = append(args, os.Args[1:]...)
if err := unix.Exec(runcPath, args, os.Environ()); err != nil {
fmt.Printf("Error execing runc: %v\n", err)
return errorExitCode
}
panic("congratulations: you've reached unreachable code, please report a bug!")
}
func internalEnv(name string) (string, bool) {
val, found := os.LookupEnv(name)
if !found {
return "", false
}
os.Unsetenv(name)
return val, true
}
func runWithNesting(ctx context.Context, cmd *exec.Cmd) error {
if _, found := internalEnv("_DAGGER_ENABLE_NESTING"); !found {
// no nesting; run as normal
if err := cmd.Start(); err != nil {
return err
}
// Wait for stdout and stderr copy goroutines to finish:
pipeWg.Wait()
if err := cmd.Wait(); err != nil {
return err
}
return nil
}
// setup a session and associated env vars for the container
sessionToken, engineErr := uuid.NewRandom()
if engineErr != nil {
return fmt.Errorf("error generating session token: %w", engineErr)
}
l, engineErr := net.Listen("tcp", "127.0.0.1:0")
if engineErr != nil {
return fmt.Errorf("error listening on session socket: %w", engineErr)
}
sessionPort := l.Addr().(*net.TCPAddr).Port
parentClientIDsVal, _ := internalEnv("_DAGGER_PARENT_CLIENT_IDS")
clientParams := client.Params{
SecretToken: sessionToken.String(),
RunnerHost: "unix:///.runner.sock",
ParentClientIDs: strings.Fields(parentClientIDsVal),
}
if _, ok := internalEnv("_DAGGER_ENABLE_NESTING_IN_SAME_SESSION"); ok {
serverID, ok := internalEnv("_DAGGER_SERVER_ID")
if !ok {
return fmt.Errorf("missing _DAGGER_SERVER_ID")
}
clientParams.ServerID = serverID
}
moduleCallerDigest, ok := internalEnv("_DAGGER_MODULE_CALLER_DIGEST")
if ok {
clientParams.ModuleCallerDigest = digest.Digest(moduleCallerDigest)
}
progW, err := progrock.DialRPC(ctx, "unix:///.progrock.sock")
if err != nil {
return fmt.Errorf("error connecting to progrock: %w", err)
}
clientParams.ProgrockWriter = progW
sess, ctx, err := client.Connect(ctx, clientParams)
if err != nil {
return fmt.Errorf("error connecting to engine: %w", err)
}
defer sess.Close()
_ = ctx // avoid ineffasign lint
go http.Serve(l, sess) //nolint:gosec
// pass dagger session along to any SDKs that run in the container
os.Setenv("DAGGER_SESSION_PORT", strconv.Itoa(sessionPort))
os.Setenv("DAGGER_SESSION_TOKEN", sessionToken.String())
err = cmd.Start()
if err != nil {
return err
}
pipeWg.Wait()
err = cmd.Wait()
if err != nil {
return err
}
return nil
}
func replaceSearch(dst io.Writer, resolv string, searchDomains []string) error {
src, err := os.Open(resolv)
if err != nil {
return nil
}
defer src.Close()
srcScan := bufio.NewScanner(src)
var replaced bool
for srcScan.Scan() {
if !strings.HasPrefix(srcScan.Text(), "search") {
fmt.Fprintln(dst, srcScan.Text())
continue
}
oldDomains := strings.Fields(srcScan.Text())[1:]
newDomains := append([]string{}, searchDomains...)
newDomains = append(newDomains, oldDomains...)
fmt.Fprintln(dst, "search", strings.Join(newDomains, " "))
replaced = true
}
if !replaced {
fmt.Fprintln(dst, "search", strings.Join(searchDomains, " "))
}
return nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,369 | 🐞 Optional type in module field yields error | ### What is the issue?
When using `Optional` in a module field type (combined with constructors) Dagger yields the following error:
> Error: query module objects: json: error calling MarshalJSON for type *dagger.Module: returned error 400 Bad Request: failed to get schema for module "ci": failed to create field: failed to get mod type for field "githubActor"
### Dagger version
dagger v0.9.5 (registry.dagger.io/engine) darwin/arm64
### Steps to reproduce
Create a module with optional fields:
```go
type Ci struct {
GithubActor Optional[string]
GithubToken Optional[*Secret]
}
func New(
// Actor the token belongs to.
githubActor Optional[string],
// Token to access the GitHub API.
githubToken Optional[*Secret],
) *Ci {
return &Ci{
GithubActor: githubActor,
GithubToken: githubToken,
}
}
```
Run `dagger call` with any parameters.
### Log output
Error: query module objects: json: error calling MarshalJSON for type *dagger.Module: returned error 400 Bad Request: failed to get schema for module "ci": failed to create field: failed to get mod type for field "githubActor" | https://github.com/dagger/dagger/issues/6369 | https://github.com/dagger/dagger/pull/6370 | 42d9870f1535cff19dc2ca85134aee6ffcd3f0dd | 25955caab25bc35543ebcd1c0746c857533c7021 | "2024-01-07T22:56:03Z" | go | "2024-01-09T11:09:04Z" | cmd/codegen/generator/go/templates/module_objects.go | package templates
import (
"fmt"
"go/ast"
"go/types"
"maps"
"reflect"
"sort"
"strconv"
"strings"
. "github.com/dave/jennifer/jen" // nolint:revive,stylecheck
)
func (ps *parseState) parseGoStruct(t *types.Struct, named *types.Named) (*parsedObjectType, error) {
spec := &parsedObjectType{
goType: t,
}
if named == nil {
return nil, fmt.Errorf("struct types must be named")
}
spec.name = named.Obj().Name()
if spec.name == "" {
return nil, fmt.Errorf("struct types must be named")
}
// We don't support extending objects from outside this module, so we will
// be skipping it. But first we want to verify the user isn't adding methods
// to it (in which case we error out).
objectIsDaggerGenerated := ps.isDaggerGenerated(named.Obj())
goFuncTypes := []*types.Func{}
methodSet := types.NewMethodSet(types.NewPointer(named))
for i := 0; i < methodSet.Len(); i++ {
methodObj := methodSet.At(i).Obj()
if ps.isDaggerGenerated(methodObj) {
// We don't care about pre-existing methods on core types or objects from dependency modules.
continue
}
if objectIsDaggerGenerated {
return nil, fmt.Errorf("cannot define methods on objects from outside this module")
}
goFuncType, ok := methodObj.(*types.Func)
if !ok {
return nil, fmt.Errorf("expected method to be a func, got %T", methodObj)
}
if !goFuncType.Exported() {
continue
}
goFuncTypes = append(goFuncTypes, goFuncType)
}
if objectIsDaggerGenerated {
return nil, nil
}
sort.Slice(goFuncTypes, func(i, j int) bool {
return goFuncTypes[i].Pos() < goFuncTypes[j].Pos()
})
for _, goFuncType := range goFuncTypes {
funcTypeSpec, err := ps.parseGoFunc(named, goFuncType)
if err != nil {
return nil, fmt.Errorf("failed to parse method %s: %w", goFuncType.Name(), err)
}
spec.methods = append(spec.methods, funcTypeSpec)
}
// get the comment above the struct (if any)
astSpec, err := ps.astSpecForNamedType(named)
if err != nil {
return nil, fmt.Errorf("failed to find decl for named type %s: %w", spec.name, err)
}
spec.doc = astSpec.Doc.Text()
astStructType, ok := astSpec.Type.(*ast.StructType)
if !ok {
return nil, fmt.Errorf("expected type spec to be a struct, got %T", astSpec.Type)
}
// Fill out the static fields of the struct (if any)
astFields := unpackASTFields(astStructType.Fields)
for i := 0; i < t.NumFields(); i++ {
field := t.Field(i)
if !field.Exported() {
continue
}
fieldSpec := &fieldSpec{goType: field.Type()}
fieldSpec.typeSpec, err = ps.parseGoTypeReference(field.Type(), nil, false)
if err != nil {
return nil, fmt.Errorf("failed to parse field type: %w", err)
}
fieldSpec.goName = field.Name()
fieldSpec.name = fieldSpec.goName
// override the name with the json tag if it was set - otherwise, we
// end up asking for a name that we won't unmarshal correctly
tag := reflect.StructTag(t.Tag(i))
if dt := tag.Get("json"); dt != "" {
dt, _, _ = strings.Cut(dt, ",")
if dt == "-" {
continue
}
fieldSpec.name = dt
}
docPragmas, docComment := parsePragmaComment(astFields[i].Doc.Text())
linePragmas, lineComment := parsePragmaComment(astFields[i].Comment.Text())
comment := strings.TrimSpace(docComment)
if comment == "" {
comment = strings.TrimSpace(lineComment)
}
pragmas := make(map[string]string)
maps.Copy(pragmas, docPragmas)
maps.Copy(pragmas, linePragmas)
if v, ok := pragmas["private"]; ok {
if v == "" {
fieldSpec.isPrivate = true
} else {
fieldSpec.isPrivate, _ = strconv.ParseBool(v)
}
}
fieldSpec.doc = comment
spec.fields = append(spec.fields, fieldSpec)
}
if ps.isMainModuleObject(spec.name) && ps.constructor != nil {
spec.constructor, err = ps.parseGoFunc(nil, ps.constructor)
if err != nil {
return nil, fmt.Errorf("failed to parse constructor: %w", err)
}
}
return spec, nil
}
type parsedObjectType struct {
name string
doc string
fields []*fieldSpec
methods []*funcTypeSpec
constructor *funcTypeSpec
goType *types.Struct
}
var _ NamedParsedType = &parsedObjectType{}
func (spec *parsedObjectType) TypeDefCode() (*Statement, error) {
withObjectArgsCode := []Code{
Lit(spec.name),
}
withObjectOptsCode := []Code{}
if spec.doc != "" {
withObjectOptsCode = append(withObjectOptsCode, Id("Description").Op(":").Lit(strings.TrimSpace(spec.doc)))
}
if len(withObjectOptsCode) > 0 {
withObjectArgsCode = append(withObjectArgsCode, Id("TypeDefWithObjectOpts").Values(withObjectOptsCode...))
}
typeDefCode := Qual("dag", "TypeDef").Call().Dot("WithObject").Call(withObjectArgsCode...)
for _, method := range spec.methods {
fnTypeDefCode, err := method.TypeDefCode()
if err != nil {
return nil, fmt.Errorf("failed to convert method %s to function def: %w", method.name, err)
}
typeDefCode = dotLine(typeDefCode, "WithFunction").Call(Add(Line(), fnTypeDefCode))
}
for _, field := range spec.fields {
if field.isPrivate {
continue
}
fieldTypeDefCode, err := field.typeSpec.TypeDefCode()
if err != nil {
return nil, fmt.Errorf("failed to convert field type: %w", err)
}
withFieldArgsCode := []Code{
Lit(field.name),
fieldTypeDefCode,
}
if field.doc != "" {
withFieldArgsCode = append(withFieldArgsCode,
Id("TypeDefWithFieldOpts").Values(
Id("Description").Op(":").Lit(field.doc),
))
}
typeDefCode = dotLine(typeDefCode, "WithField").Call(withFieldArgsCode...)
}
if spec.constructor != nil {
fnTypeDefCode, err := spec.constructor.TypeDefCode()
if err != nil {
return nil, fmt.Errorf("failed to convert constructor to function def: %w", err)
}
typeDefCode = dotLine(typeDefCode, "WithConstructor").Call(Add(Line(), fnTypeDefCode))
}
return typeDefCode, nil
}
func (spec *parsedObjectType) GoType() types.Type {
return spec.goType
}
func (spec *parsedObjectType) GoSubTypes() []types.Type {
var subTypes []types.Type
for _, method := range spec.methods {
subTypes = append(subTypes, method.GoSubTypes()...)
}
for _, field := range spec.fields {
if field.isPrivate {
continue
}
subTypes = append(subTypes, field.typeSpec.GoSubTypes()...)
}
if spec.constructor != nil {
subTypes = append(subTypes, spec.constructor.GoSubTypes()...)
}
return subTypes
}
func (spec *parsedObjectType) Name() string {
return spec.name
}
/*
Extra generated code needed for the object implementation.
Right now, this is just an UnmarshalJSON method. This is needed because objects may have fields
of an interface type, which the JSON unmarshaller can't handle on its own. Instead, this custom
unmarshaller will unmarshal the JSON into a struct where all the fields are concrete types,
including the underlying concrete struct implementation of any interface fields.
After it unmarshals into that, it copies the fields to the real object fields, handling any
special cases around interface conversions (e.g. converting a slice of structs to a slice of
interfaces).
e.g.:
func (r *Test) UnmarshalJSON(bs []byte) error {
var concrete struct {
Iface *customIfaceImpl
IfaceList []*customIfaceImpl
OtherIfaceList []*otherIfaceImpl
}
err := json.Unmarshal(bs, &concrete)
if err != nil {
return err
}
r.Iface = concrete.Iface.toIface()
r.IfaceList = convertSlice(concrete.IfaceList, (*customIfaceImpl).toIface)
r.OtherIfaceList = convertSlice(concrete.OtherIfaceList, (*otherIfaceImpl).toIface)
return nil
}
*/
func (spec *parsedObjectType) ImplementationCode() (*Statement, error) {
concreteFields := make([]Code, 0, len(spec.fields))
setFieldCodes := make([]*Statement, 0, len(spec.fields))
for _, field := range spec.fields {
fieldTypeCode, err := spec.concreteFieldTypeCode(field.typeSpec)
if err != nil {
return nil, fmt.Errorf("failed to generate field type code: %w", err)
}
fieldCode := Id(field.goName).Add(fieldTypeCode)
if field.goName != field.name {
fieldCode.Tag(map[string]string{"json": field.name})
}
concreteFields = append(concreteFields, fieldCode)
setFieldCode, err := spec.setFieldsFromConcreteStructCode(field)
if err != nil {
return nil, fmt.Errorf("failed to generate set field code: %w", err)
}
setFieldCodes = append(setFieldCodes, setFieldCode)
}
return Func().Params(Id("r").Op("*").Id(spec.name)).
Id("UnmarshalJSON").
Params(Id("bs").Id("[]byte")).
Params(Id("error")).
BlockFunc(func(g *Group) {
g.Var().Id("concrete").Struct(concreteFields...)
g.Id("err").Op(":=").Id("json").Dot("Unmarshal").Call(Id("bs"), Op("&").Id("concrete"))
g.If(Id("err").Op("!=").Nil()).Block(Return(Id("err")))
for _, setFieldCode := range setFieldCodes {
g.Add(setFieldCode)
}
g.Return(Nil())
}), nil
}
/*
The code for the type of a field in the concrete struct unmarshalled into. Mainly needs to handle
interface types, which need to be converted to their concrete struct implementations.
*/
func (spec *parsedObjectType) concreteFieldTypeCode(typeSpec ParsedType) (*Statement, error) {
s := Empty()
switch typeSpec := typeSpec.(type) {
case *parsedPrimitiveType:
if typeSpec.isPtr {
s.Op("*")
}
if typeSpec.alias != "" {
s.Id(typeSpec.alias)
} else {
s.Id(typeSpec.GoType().String())
}
case *parsedSliceType:
fieldTypeCode, err := spec.concreteFieldTypeCode(typeSpec.underlying)
if err != nil {
return nil, fmt.Errorf("failed to generate slice field type code: %w", err)
}
s.Index().Add(fieldTypeCode)
case *parsedObjectTypeReference:
if typeSpec.isPtr {
s.Op("*")
}
s.Id(typeSpec.name)
case *parsedIfaceTypeReference:
s.Op("*").Id(formatIfaceImplName(typeSpec.name))
default:
return nil, fmt.Errorf("unsupported concrete field type %T", typeSpec)
}
return s, nil
}
/*
The code for setting the fields of the real object from the concrete struct unmarshalled into. e.g.:
r.Iface = concrete.Iface.toIface()
r.IfaceList = convertSlice(concrete.IfaceList, (*customIfaceImpl).toIface)
*/
func (spec *parsedObjectType) setFieldsFromConcreteStructCode(field *fieldSpec) (*Statement, error) {
s := Empty()
switch typeSpec := field.typeSpec.(type) {
case *parsedPrimitiveType, *parsedObjectTypeReference:
s.Id("r").Dot(field.goName).Op("=").Id("concrete").Dot(field.goName)
case *parsedSliceType:
switch underlyingTypeSpec := typeSpec.underlying.(type) {
case *parsedIfaceTypeReference:
s.Id("r").Dot(field.goName).Op("=").Id("convertSlice").Call(
Id("concrete").Dot(field.goName),
Parens(Op("*").Id(formatIfaceImplName(underlyingTypeSpec.name))).Dot("toIface"),
)
default:
s.Id("r").Dot(field.goName).Op("=").Id("concrete").Dot(field.goName)
}
case *parsedIfaceTypeReference:
s.Id("r").Dot(field.goName).Op("=").Id("concrete").Dot(field.goName).Dot("toIface").Call()
default:
return nil, fmt.Errorf("unsupported field type %T", typeSpec)
}
return s, nil
}
type fieldSpec struct {
name string
doc string
typeSpec ParsedType
// isPrivate is true if the field is marked with the +private pragma
isPrivate bool
// goName is the name of the field in the Go struct. It may be different than name if the user changed the name of the field via a json tag
goName string
goType types.Type
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,304 | tests: flaky rust test | cc @dagger/sdk-rust :heart:
I frequently see this rust test failing: https://github.com/dagger/dagger/actions/runs/7263920431/job/19790293305 (which passes upon a re-run):
```
Diff < left / right > :
failed to query dagger engine: domain error:
Look at json field for more details
<unexpected status from HEAD request to https://mirror.gcr.io/v2/library/fake.invalid/manifests/latest?ns=docker.io: 429 Too Many Requests
>pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
```
Not quite sure why this shows up, but it appears reasonably frequently, so would be nice to clean up! Will take a look myself if I find some spare time :pray: | https://github.com/dagger/dagger/issues/6304 | https://github.com/dagger/dagger/pull/6385 | e355c57d5af509ba595f7fd0e851c561b0f724de | fcf2f9b1cae19d340f5f42ba788d13bc157e4198 | "2023-12-21T11:02:19Z" | go | "2024-01-10T11:06:34Z" | sdk/rust/crates/dagger-sdk/tests/mod.rs | mod issues;
use dagger_sdk::connect;
use pretty_assertions::assert_eq;
#[tokio::test]
async fn test_example_container() {
let client = connect().await.unwrap();
let alpine = client.container().from("alpine:3.16.2");
let out = alpine
.with_exec(vec!["cat", "/etc/alpine-release"])
.stdout()
.await
.unwrap();
assert_eq!(out, "3.16.2\n".to_string())
}
#[tokio::test]
async fn test_directory() {
let c = connect().await.unwrap();
let contents = c
.directory()
.with_new_file("/hello.txt", "world")
.file("/hello.txt")
.contents()
.await
.unwrap();
assert_eq!("world", contents)
}
#[tokio::test]
async fn test_git() {
let c = connect().await.unwrap();
let tree = c.git("github.com/dagger/dagger").branch("main").tree();
let _ = tree
.entries()
.await
.unwrap()
.iter()
.find(|f| f.as_str() == "README.md")
.unwrap();
let readme_file = tree.file("README.md");
let readme = readme_file.contents().await.unwrap();
assert_eq!(true, readme.find("Dagger").is_some());
let other_readme = c.file(readme_file).contents().await.unwrap();
assert_eq!(readme, other_readme);
}
#[tokio::test]
async fn test_container() {
let client = connect().await.unwrap();
let alpine = client.container().from("alpine:3.16.2");
let contents = alpine.file("/etc/alpine-release").contents().await.unwrap();
assert_eq!(contents, "3.16.2\n".to_string());
let out = alpine
.with_exec(vec!["cat", "/etc/alpine-release"])
.stdout()
.await
.unwrap();
assert_eq!(out, "3.16.2\n".to_string());
let id = alpine.id().await.unwrap();
let contents = client
.container_opts(dagger_sdk::QueryContainerOpts {
id: Some(id),
platform: None,
})
.file("/etc/alpine-release")
.contents()
.await
.unwrap();
assert_eq!(contents, "3.16.2\n".to_string());
}
#[tokio::test]
async fn test_err_message() {
let client = connect().await.unwrap();
let alpine = client.container().from("fake.invalid:latest").id().await;
assert_eq!(alpine.is_err(), true);
let err = alpine.expect_err("Tests expect err");
let error_msg = r#"failed to query dagger engine: domain error:
Look at json field for more details
pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
"#;
assert_eq!(err.to_string().as_str(), error_msg);
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,416 | ✨ Add name field to File | ### What are you trying to do?
Files passed to `dagger call` currently does not preserve the name of a file passed to it.
### Why is this important to you?
Some tools often require the original file name (for example: Spectral requires the file name do determine the file type)
Discussed it with @sipsma here: https://discord.com/channels/707636530424053791/1120503349599543376/1195832958150529165
### How are you currently working around this?
I pass the original file name to the module. | https://github.com/dagger/dagger/issues/6416 | https://github.com/dagger/dagger/pull/6431 | 61bf06b970402efa254a40f13c4aee98adfbdb42 | c716a042f290b11c6122d247f8b31651adb5f1d0 | "2024-01-13T21:04:31Z" | go | "2024-01-17T16:17:48Z" | .changes/unreleased/Added-20240116-163957.yaml | |
closed | dagger/dagger | https://github.com/dagger/dagger | 6,416 | ✨ Add name field to File | ### What are you trying to do?
Files passed to `dagger call` currently does not preserve the name of a file passed to it.
### Why is this important to you?
Some tools often require the original file name (for example: Spectral requires the file name do determine the file type)
Discussed it with @sipsma here: https://discord.com/channels/707636530424053791/1120503349599543376/1195832958150529165
### How are you currently working around this?
I pass the original file name to the module. | https://github.com/dagger/dagger/issues/6416 | https://github.com/dagger/dagger/pull/6431 | 61bf06b970402efa254a40f13c4aee98adfbdb42 | c716a042f290b11c6122d247f8b31651adb5f1d0 | "2024-01-13T21:04:31Z" | go | "2024-01-17T16:17:48Z" | core/integration/file_test.go | package core
import (
"bytes"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"testing"
"time"
"dagger.io/dagger"
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/engine/buildkit"
"github.com/dagger/dagger/internal/testutil"
"github.com/moby/buildkit/identity"
"github.com/stretchr/testify/require"
)
func TestFile(t *testing.T) {
t.Parallel()
var res struct {
Directory struct {
WithNewFile struct {
File struct {
ID core.FileID
Contents string
}
}
}
}
err := testutil.Query(
`{
directory {
withNewFile(path: "some-file", contents: "some-content") {
file(path: "some-file") {
id
contents
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.NotEmpty(t, res.Directory.WithNewFile.File.ID)
require.Equal(t, "some-content", res.Directory.WithNewFile.File.Contents)
}
func TestDirectoryFile(t *testing.T) {
t.Parallel()
var res struct {
Directory struct {
WithNewFile struct {
Directory struct {
File struct {
ID core.FileID
Contents string
}
}
}
}
}
err := testutil.Query(
`{
directory {
withNewFile(path: "some-dir/some-file", contents: "some-content") {
directory(path: "some-dir") {
file(path: "some-file") {
id
contents
}
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.NotEmpty(t, res.Directory.WithNewFile.Directory.File.ID)
require.Equal(t, "some-content", res.Directory.WithNewFile.Directory.File.Contents)
}
func TestFileSize(t *testing.T) {
t.Parallel()
var res struct {
Directory struct {
WithNewFile struct {
File struct {
ID core.FileID
Size int
}
}
}
}
err := testutil.Query(
`{
directory {
withNewFile(path: "some-file", contents: "some-content") {
file(path: "some-file") {
id
size
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.NotEmpty(t, res.Directory.WithNewFile.File.ID)
require.Equal(t, len("some-content"), res.Directory.WithNewFile.File.Size)
}
func TestFileExport(t *testing.T) {
t.Parallel()
wd := t.TempDir()
targetDir := t.TempDir()
c, ctx := connect(t, dagger.WithWorkdir(wd))
file := c.Container().From(alpineImage).File("/etc/alpine-release")
t.Run("to absolute path", func(t *testing.T) {
dest := filepath.Join(targetDir, "some-file")
ok, err := file.Export(ctx, dest)
require.NoError(t, err)
require.True(t, ok)
contents, err := os.ReadFile(dest)
require.NoError(t, err)
require.Equal(t, "3.18.2\n", string(contents))
entries, err := ls(targetDir)
require.NoError(t, err)
require.Len(t, entries, 1)
})
t.Run("to relative path", func(t *testing.T) {
ok, err := file.Export(ctx, "some-file")
require.NoError(t, err)
require.True(t, ok)
contents, err := os.ReadFile(filepath.Join(wd, "some-file"))
require.NoError(t, err)
require.Equal(t, "3.18.2\n", string(contents))
entries, err := ls(wd)
require.NoError(t, err)
require.Len(t, entries, 1)
})
t.Run("to path in outer dir", func(t *testing.T) {
ok, err := file.Export(ctx, "../some-file")
require.Error(t, err)
require.False(t, ok)
})
t.Run("to absolute dir", func(t *testing.T) {
ok, err := file.Export(ctx, targetDir)
require.Error(t, err)
require.False(t, ok)
})
t.Run("to workdir", func(t *testing.T) {
ok, err := file.Export(ctx, ".")
require.Error(t, err)
require.False(t, ok)
})
t.Run("file under subdir", func(t *testing.T) {
dir := c.Directory().
WithNewFile("/file", "content1").
WithNewFile("/subdir/file", "content2")
file := dir.File("/subdir/file")
dest := filepath.Join(targetDir, "da-file")
_, err := file.Export(ctx, dest)
require.NoError(t, err)
contents, err := os.ReadFile(dest)
require.NoError(t, err)
require.Equal(t, "content2", string(contents))
dir = dir.Directory("/subdir")
file = dir.File("file")
dest = filepath.Join(targetDir, "da-file-2")
_, err = file.Export(ctx, dest)
require.NoError(t, err)
contents, err = os.ReadFile(dest)
require.NoError(t, err)
require.Equal(t, "content2", string(contents))
})
t.Run("file larger than max chunk size", func(t *testing.T) {
maxChunkSize := buildkit.MaxFileContentsChunkSize
fileSizeBytes := maxChunkSize*4 + 1 // +1 so it's not an exact number of chunks, to ensure we cover that case
_, err := c.Container().From(alpineImage).WithExec([]string{"sh", "-c",
fmt.Sprintf("dd if=/dev/zero of=/file bs=%d count=1", fileSizeBytes)}).
File("/file").Export(ctx, "some-pretty-big-file")
require.NoError(t, err)
stat, err := os.Stat(filepath.Join(wd, "some-pretty-big-file"))
require.NoError(t, err)
require.EqualValues(t, fileSizeBytes, stat.Size())
})
t.Run("file permissions are retained", func(t *testing.T) {
_, err := c.Directory().WithNewFile("/file", "#!/bin/sh\necho hello", dagger.DirectoryWithNewFileOpts{
Permissions: 0744,
}).File("/file").Export(ctx, "some-executable-file")
require.NoError(t, err)
stat, err := os.Stat(filepath.Join(wd, "some-executable-file"))
require.NoError(t, err)
require.EqualValues(t, 0744, stat.Mode().Perm())
})
}
func TestFileWithTimestamps(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
reallyImportantTime := time.Date(1985, 10, 26, 8, 15, 0, 0, time.UTC)
file := c.Directory().
WithNewFile("sub-dir/sub-file", "sub-content").
File("sub-dir/sub-file").
WithTimestamps(int(reallyImportantTime.Unix()))
ls, err := c.Container().
From(alpineImage).
WithMountedFile("/file", file).
WithEnvVariable("RANDOM", identity.NewID()).
WithExec([]string{"stat", "/file"}).
Stdout(ctx)
require.NoError(t, err)
require.Contains(t, ls, "Access: 1985-10-26 08:15:00.000000000 +0000")
require.Contains(t, ls, "Modify: 1985-10-26 08:15:00.000000000 +0000")
}
func TestFileContents(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
// Set three types of file sizes for test data,
// the third one uses a size larger than the max chunk size:
testFiles := []struct {
size int
hash string
}{
{size: buildkit.MaxFileContentsChunkSize / 2},
{size: buildkit.MaxFileContentsChunkSize},
{size: buildkit.MaxFileContentsChunkSize * 2},
{size: buildkit.MaxFileContentsSize + 1},
}
tempDir := t.TempDir()
for i, testFile := range testFiles {
filename := strconv.Itoa(i)
dest := filepath.Join(tempDir, filename)
var buf bytes.Buffer
for i := 0; i < testFile.size; i++ {
buf.WriteByte('a')
}
err := os.WriteFile(dest, buf.Bytes(), 0o600)
require.NoError(t, err)
// Compute and store hash for generated test data:
testFiles[i].hash = computeMD5FromReader(&buf)
}
hostDir := c.Host().Directory(tempDir)
alpine := c.Container().
From(alpineImage).WithDirectory(".", hostDir)
// Grab file contents and compare hashes to validate integrity:
for i, testFile := range testFiles {
filename := strconv.Itoa(i)
contents, err := alpine.File(filename).Contents(ctx)
// Assert error on larger files:
if testFile.size > buildkit.MaxFileContentsSize {
require.Error(t, err)
continue
}
require.NoError(t, err)
contentsHash := computeMD5FromReader(strings.NewReader(contents))
require.Equal(t, testFile.hash, contentsHash)
}
}
func TestFileSync(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
t.Run("triggers error", func(t *testing.T) {
_, err := c.Directory().File("baz").Sync(ctx)
require.Error(t, err)
require.Contains(t, err.Error(), "no such file")
_, err = c.Container().From(alpineImage).File("/bar").Sync(ctx)
require.Error(t, err)
require.Contains(t, err.Error(), "no such file")
})
t.Run("allows chaining", func(t *testing.T) {
file, err := c.Directory().WithNewFile("foo", "bar").File("foo").Sync(ctx)
require.NoError(t, err)
contents, err := file.Contents(ctx)
require.NoError(t, err)
require.Equal(t, "bar", contents)
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,416 | ✨ Add name field to File | ### What are you trying to do?
Files passed to `dagger call` currently does not preserve the name of a file passed to it.
### Why is this important to you?
Some tools often require the original file name (for example: Spectral requires the file name do determine the file type)
Discussed it with @sipsma here: https://discord.com/channels/707636530424053791/1120503349599543376/1195832958150529165
### How are you currently working around this?
I pass the original file name to the module. | https://github.com/dagger/dagger/issues/6416 | https://github.com/dagger/dagger/pull/6431 | 61bf06b970402efa254a40f13c4aee98adfbdb42 | c716a042f290b11c6122d247f8b31651adb5f1d0 | "2024-01-13T21:04:31Z" | go | "2024-01-17T16:17:48Z" | core/schema/file.go | package schema
import (
"context"
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/dagql"
)
type fileSchema struct {
srv *dagql.Server
}
var _ SchemaResolvers = &fileSchema{}
func (s *fileSchema) Install() {
dagql.Fields[*core.Query]{
dagql.Func("file", s.file).
Deprecated("Use loadFileFromID instead."),
}.Install(s.srv)
dagql.Fields[*core.File]{
Syncer[*core.File]().
Doc(`Force evaluation in the engine.`),
dagql.Func("contents", s.contents).
Doc(`Retrieves the contents of the file.`),
dagql.Func("size", s.size).
Doc(`Retrieves the size of the file, in bytes.`),
dagql.Func("export", s.export).
Impure("Writes to the local host.").
Doc(`Writes the file to a file path on the host.`).
ArgDoc("path", `Location of the written directory (e.g., "output.txt").`).
ArgDoc("allowParentDirPath",
`If allowParentDirPath is true, the path argument can be a directory
path, in which case the file will be created in that directory.`),
dagql.Func("withTimestamps", s.withTimestamps).
Doc(`Retrieves this file with its created/modified timestamps set to the given time.`).
ArgDoc("timestamp", `Timestamp to set dir/files in.`,
`Formatted in seconds following Unix epoch (e.g., 1672531199).`),
}.Install(s.srv)
}
type fileArgs struct {
ID core.FileID
}
func (s *fileSchema) file(ctx context.Context, parent *core.Query, args fileArgs) (*core.File, error) {
val, err := args.ID.Load(ctx, s.srv)
if err != nil {
return nil, err
}
return val.Self, nil
}
func (s *fileSchema) contents(ctx context.Context, file *core.File, args struct{}) (dagql.String, error) {
content, err := file.Contents(ctx)
if err != nil {
return "", err
}
return dagql.NewString(string(content)), nil
}
func (s *fileSchema) size(ctx context.Context, file *core.File, args struct{}) (dagql.Int, error) {
info, err := file.Stat(ctx)
if err != nil {
return 0, err
}
return dagql.NewInt(int(info.Size_)), nil
}
type fileExportArgs struct {
Path string
AllowParentDirPath bool `default:"false"`
}
func (s *fileSchema) export(ctx context.Context, parent *core.File, args fileExportArgs) (dagql.Boolean, error) {
err := parent.Export(ctx, args.Path, args.AllowParentDirPath)
if err != nil {
return false, err
}
return true, nil
}
type fileWithTimestampsArgs struct {
Timestamp int
}
func (s *fileSchema) withTimestamps(ctx context.Context, parent *core.File, args fileWithTimestampsArgs) (*core.File, error) {
return parent.WithTimestamps(ctx, args.Timestamp)
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,416 | ✨ Add name field to File | ### What are you trying to do?
Files passed to `dagger call` currently does not preserve the name of a file passed to it.
### Why is this important to you?
Some tools often require the original file name (for example: Spectral requires the file name do determine the file type)
Discussed it with @sipsma here: https://discord.com/channels/707636530424053791/1120503349599543376/1195832958150529165
### How are you currently working around this?
I pass the original file name to the module. | https://github.com/dagger/dagger/issues/6416 | https://github.com/dagger/dagger/pull/6431 | 61bf06b970402efa254a40f13c4aee98adfbdb42 | c716a042f290b11c6122d247f8b31651adb5f1d0 | "2024-01-13T21:04:31Z" | go | "2024-01-17T16:17:48Z" | docs/docs-graphql/schema.graphqls | """
Indicates that a field may resolve to different values when called repeatedly
with the same inputs, or that the field has side effects. Impure fields are never cached.
"""
directive @impure(
"""
Explains why this element is impure, i.e. whether it performs side effects or
yield a different result with the same arguments.
"""
reason: String!
) on FIELD_DEFINITION
"""
Indicates that a field's selection can be removed from any query without
changing the result. Meta fields are dropped from cache keys.
"""
directive @meta on FIELD_DEFINITION
"""Key value object that represents a build argument."""
input BuildArg {
"""The build argument name."""
name: String!
"""The build argument value."""
value: String!
}
"""Sharing mode of the cache volume."""
enum CacheSharingMode {
"""Shares the cache volume amongst many build pipelines"""
SHARED
"""Keeps a cache volume for a single build pipeline"""
PRIVATE
"""
Shares the cache volume amongst many build pipelines, but will serialize the writes
"""
LOCKED
}
"""A directory whose contents persist across runs."""
type CacheVolume {
"""A unique identifier for this CacheVolume."""
id: CacheVolumeID!
}
"""
The `CacheVolumeID` scalar type represents an identifier for an object of type CacheVolume.
"""
scalar CacheVolumeID
"""An OCI-compatible container, also known as a Docker container."""
type Container {
"""
Turn the container into a Service.
Be sure to set any exposed ports before this conversion.
"""
asService: Service!
"""Returns a File representing the container serialized to a tarball."""
asTarball(
"""
Force each layer of the image to use the specified compression algorithm.
If this is unset, then if a layer already has a compressed blob in the
engine's cache, that will be used (this can result in a mix of compression
algorithms for different layers). If this is unset and a layer has no
compressed blob in the engine's cache, then it will be compressed using Gzip.
"""
forcedCompression: ImageLayerCompression
"""
Use the specified media types for the image's layers.
Defaults to OCI, which is largely compatible with most recent container
runtimes, but Docker may be needed for older runtimes without OCI support.
"""
mediaTypes: ImageMediaTypes = OCIMediaTypes
"""
Identifiers for other platform specific containers.
Used for multi-platform images.
"""
platformVariants: [ContainerID!] = []
): File!
"""Initializes this container from a Dockerfile build."""
build(
"""Additional build arguments."""
buildArgs: [BuildArg!] = []
"""Directory context used by the Dockerfile."""
context: DirectoryID!
"""Path to the Dockerfile to use."""
dockerfile: String = "Dockerfile"
"""
Secrets to pass to the build.
They will be mounted at /run/secrets/[secret-name] in the build container
They can be accessed in the Dockerfile using the "secret" mount type and
mount path /run/secrets/[secret-name], e.g. RUN
--mount=type=secret,id=my-secret curl http://example.com?token=$(cat
/run/secrets/my-secret)
"""
secrets: [SecretID!] = []
"""Target build stage to build."""
target: String = ""
): Container!
"""Retrieves default arguments for future commands."""
defaultArgs: [String!]!
"""
Retrieves a directory at the given path.
Mounts are included.
"""
directory(
"""The path of the directory to retrieve (e.g., "./src")."""
path: String!
): Directory!
"""Retrieves entrypoint to be prepended to the arguments of all commands."""
entrypoint: [String!]!
"""Retrieves the value of the specified environment variable."""
envVariable(
"""The name of the environment variable to retrieve (e.g., "PATH")."""
name: String!
): String
"""Retrieves the list of environment variables passed to commands."""
envVariables: [EnvVariable!]!
"""
EXPERIMENTAL API! Subject to change/removal at any time.
Configures all available GPUs on the host to be accessible to this container.
This currently works for Nvidia devices only.
"""
experimentalWithAllGPUs: Container!
"""
EXPERIMENTAL API! Subject to change/removal at any time.
Configures the provided list of devices to be accesible to this container.
This currently works for Nvidia devices only.
"""
experimentalWithGPU(
"""List of devices to be accessible to this container."""
devices: [String!]!
): Container!
"""
Writes the container as an OCI tarball to the destination file path on the host.
Return true on success.
It can also export platform variants.
"""
export(
"""
Force each layer of the exported image to use the specified compression algorithm.
If this is unset, then if a layer already has a compressed blob in the
engine's cache, that will be used (this can result in a mix of compression
algorithms for different layers). If this is unset and a layer has no
compressed blob in the engine's cache, then it will be compressed using Gzip.
"""
forcedCompression: ImageLayerCompression
"""
Use the specified media types for the exported image's layers.
Defaults to OCI, which is largely compatible with most recent container
runtimes, but Docker may be needed for older runtimes without OCI support.
"""
mediaTypes: ImageMediaTypes = OCIMediaTypes
"""
Host's destination path (e.g., "./tarball").
Path can be relative to the engine's workdir or absolute.
"""
path: String!
"""
Identifiers for other platform specific containers.
Used for multi-platform image.
"""
platformVariants: [ContainerID!] = []
): Boolean!
"""
Retrieves the list of exposed ports.
This includes ports already exposed by the image, even if not explicitly added with dagger.
"""
exposedPorts: [Port!]!
"""
Retrieves a file at the given path.
Mounts are included.
"""
file(
"""The path of the file to retrieve (e.g., "./README.md")."""
path: String!
): File!
"""Initializes this container from a pulled base image."""
from(
"""
Image's address from its registry.
Formatted as [host]/[user]/[repo]:[tag] (e.g., "docker.io/dagger/dagger:main").
"""
address: String!
): Container!
"""A unique identifier for this Container."""
id: ContainerID!
"""
The unique image reference which can only be retrieved immediately after the 'Container.From' call.
"""
imageRef: String!
"""Reads the container from an OCI tarball."""
import(
"""File to read the container from."""
source: FileID!
"""
Identifies the tag to import from the archive, if the archive bundles multiple tags.
"""
tag: String = ""
): Container!
"""Retrieves the value of the specified label."""
label(
"""The name of the label (e.g., "org.opencontainers.artifact.created")."""
name: String!
): String
"""Retrieves the list of labels passed to container."""
labels: [Label!]!
"""Retrieves the list of paths where a directory is mounted."""
mounts: [String!]!
"""Creates a named sub-pipeline."""
pipeline(
"""Description of the sub-pipeline."""
description: String = ""
"""Labels to apply to the sub-pipeline."""
labels: [PipelineLabel!] = []
"""Name of the sub-pipeline."""
name: String!
): Container!
"""The platform this container executes and publishes as."""
platform: Platform!
"""
Publishes this container as a new image to the specified address.
Publish returns a fully qualified ref.
It can also publish platform variants.
"""
publish(
"""
Registry's address to publish the image to.
Formatted as [host]/[user]/[repo]:[tag] (e.g. "docker.io/dagger/dagger:main").
"""
address: String!
"""
Force each layer of the published image to use the specified compression algorithm.
If this is unset, then if a layer already has a compressed blob in the
engine's cache, that will be used (this can result in a mix of compression
algorithms for different layers). If this is unset and a layer has no
compressed blob in the engine's cache, then it will be compressed using Gzip.
"""
forcedCompression: ImageLayerCompression
"""
Use the specified media types for the published image's layers.
Defaults to OCI, which is largely compatible with most recent registries,
but Docker may be needed for older registries without OCI support.
"""
mediaTypes: ImageMediaTypes = OCIMediaTypes
"""
Identifiers for other platform specific containers.
Used for multi-platform image.
"""
platformVariants: [ContainerID!] = []
): String!
"""Retrieves this container's root filesystem. Mounts are not included."""
rootfs: Directory!
"""
Return a websocket endpoint that, if connected to, will start the container with a TTY streamed over the websocket.
Primarily intended for internal use with the dagger CLI.
"""
shellEndpoint: String!
"""
The error stream of the last executed command.
Will execute default command if none is set, or error if there's no default.
"""
stderr: String!
"""
The output stream of the last executed command.
Will execute default command if none is set, or error if there's no default.
"""
stdout: String!
"""
Forces evaluation of the pipeline in the engine.
It doesn't run the default command if no exec has been set.
"""
sync: ContainerID!
"""Retrieves the user to be set for all commands."""
user: String!
"""Configures default arguments for future commands."""
withDefaultArgs(
"""
Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
"""
args: [String!]!
): Container!
"""Retrieves this container plus a directory written at the given path."""
withDirectory(
"""Identifier of the directory to write"""
directory: DirectoryID!
"""
Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
"""
exclude: [String!] = []
"""
Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
"""
include: [String!] = []
"""
A user:group to set for the directory and its contents.
The user and group can either be an ID (1000:1000) or a name (foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
owner: String = ""
"""Location of the written directory (e.g., "/tmp/directory")."""
path: String!
): Container!
"""Retrieves this container but with a different command entrypoint."""
withEntrypoint(
"""Entrypoint to use for future executions (e.g., ["go", "run"])."""
args: [String!]!
"""Don't remove the default arguments when setting the entrypoint."""
keepDefaultArgs: Boolean = false
): Container!
"""Retrieves this container plus the given environment variable."""
withEnvVariable(
"""
Replace `${VAR}` or `$VAR` in the value according to the current environment
variables defined in the container (e.g., "/opt/bin:$PATH").
"""
expand: Boolean = false
"""The name of the environment variable (e.g., "HOST")."""
name: String!
"""The value of the environment variable. (e.g., "localhost")."""
value: String!
): Container!
"""
Retrieves this container after executing the specified command inside it.
"""
withExec(
"""
Command to run instead of the container's default command (e.g., ["run", "main.go"]).
If empty, the container's default command is used.
"""
args: [String!]!
"""
Provides dagger access to the executed command.
Do not use this option unless you trust the command being executed; the
command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
"""
experimentalPrivilegedNesting: Boolean = false
"""
Execute the command with all root capabilities. This is similar to running a
command with "sudo" or executing "docker run" with the "--privileged" flag.
Containerization does not provide any security guarantees when using this
option. It should only be used when absolutely necessary and only with
trusted commands.
"""
insecureRootCapabilities: Boolean = false
"""
Redirect the command's standard error to a file in the container (e.g., "/tmp/stderr").
"""
redirectStderr: String = ""
"""
Redirect the command's standard output to a file in the container (e.g., "/tmp/stdout").
"""
redirectStdout: String = ""
"""
If the container has an entrypoint, ignore it for args rather than using it to wrap them.
"""
skipEntrypoint: Boolean = false
"""
Content to write to the command's standard input before closing (e.g., "Hello world").
"""
stdin: String = ""
): Container!
"""
Expose a network port.
Exposed ports serve two purposes:
- For health checks and introspection, when running services
- For setting the EXPOSE OCI field when publishing the container
"""
withExposedPort(
"""Optional port description"""
description: String
"""Port number to expose"""
port: Int!
"""Transport layer network protocol"""
protocol: NetworkProtocol = TCP
): Container!
"""
Retrieves this container plus the contents of the given file copied to the given path.
"""
withFile(
"""
A user:group to set for the file.
The user and group can either be an ID (1000:1000) or a name (foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
owner: String = ""
"""Location of the copied file (e.g., "/tmp/file.txt")."""
path: String!
"""Permission given to the copied file (e.g., 0600)."""
permissions: Int
"""Identifier of the file to copy."""
source: FileID!
): Container!
"""
Indicate that subsequent operations should be featured more prominently in the UI.
"""
withFocus: Container!
"""Retrieves this container plus the given label."""
withLabel(
"""The name of the label (e.g., "org.opencontainers.artifact.created")."""
name: String!
"""The value of the label (e.g., "2023-01-01T00:00:00Z")."""
value: String!
): Container!
"""
Retrieves this container plus a cache volume mounted at the given path.
"""
withMountedCache(
"""Identifier of the cache volume to mount."""
cache: CacheVolumeID!
"""
A user:group to set for the mounted cache directory.
Note that this changes the ownership of the specified mount along with the
initial filesystem provided by source (if any). It does not have any effect
if/when the cache has already been created.
The user and group can either be an ID (1000:1000) or a name (foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
owner: String = ""
"""Location of the cache directory (e.g., "/cache/node_modules")."""
path: String!
"""Sharing mode of the cache volume."""
sharing: CacheSharingMode = SHARED
"""Identifier of the directory to use as the cache volume's root."""
source: DirectoryID
): Container!
"""Retrieves this container plus a directory mounted at the given path."""
withMountedDirectory(
"""
A user:group to set for the mounted directory and its contents.
The user and group can either be an ID (1000:1000) or a name (foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
owner: String = ""
"""Location of the mounted directory (e.g., "/mnt/directory")."""
path: String!
"""Identifier of the mounted directory."""
source: DirectoryID!
): Container!
"""Retrieves this container plus a file mounted at the given path."""
withMountedFile(
"""
A user or user:group to set for the mounted file.
The user and group can either be an ID (1000:1000) or a name (foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
owner: String = ""
"""Location of the mounted file (e.g., "/tmp/file.txt")."""
path: String!
"""Identifier of the mounted file."""
source: FileID!
): Container!
"""
Retrieves this container plus a secret mounted into a file at the given path.
"""
withMountedSecret(
"""
Permission given to the mounted secret (e.g., 0600).
This option requires an owner to be set to be active.
"""
mode: Int = 256
"""
A user:group to set for the mounted secret.
The user and group can either be an ID (1000:1000) or a name (foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
owner: String = ""
"""Location of the secret file (e.g., "/tmp/secret.txt")."""
path: String!
"""Identifier of the secret to mount."""
source: SecretID!
): Container!
"""
Retrieves this container plus a temporary directory mounted at the given path.
"""
withMountedTemp(
"""Location of the temporary directory (e.g., "/tmp/temp_dir")."""
path: String!
): Container!
"""Retrieves this container plus a new file written at the given path."""
withNewFile(
"""Content of the file to write (e.g., "Hello world!")."""
contents: String = ""
"""
A user:group to set for the file.
The user and group can either be an ID (1000:1000) or a name (foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
owner: String = ""
"""Location of the written file (e.g., "/tmp/file.txt")."""
path: String!
"""Permission given to the written file (e.g., 0600)."""
permissions: Int = 420
): Container!
"""
Retrieves this container with unset default arguments for future commands.
"""
withoutDefaultArgs: Container!
"""Retrieves this container with an unset command entrypoint."""
withoutEntrypoint(
"""Don't remove the default arguments when unsetting the entrypoint."""
keepDefaultArgs: Boolean = false
): Container!
"""Retrieves this container minus the given environment variable."""
withoutEnvVariable(
"""The name of the environment variable (e.g., "HOST")."""
name: String!
): Container!
"""Unexpose a previously exposed port."""
withoutExposedPort(
"""Port number to unexpose"""
port: Int!
"""Port protocol to unexpose"""
protocol: NetworkProtocol = TCP
): Container!
"""
Indicate that subsequent operations should not be featured more prominently in the UI.
This is the initial state of all containers.
"""
withoutFocus: Container!
"""Retrieves this container minus the given environment label."""
withoutLabel(
"""
The name of the label to remove (e.g., "org.opencontainers.artifact.created").
"""
name: String!
): Container!
"""
Retrieves this container after unmounting everything at the given path.
"""
withoutMount(
"""Location of the cache directory (e.g., "/cache/node_modules")."""
path: String!
): Container!
"""
Retrieves this container without the registry authentication of a given address.
"""
withoutRegistryAuth(
"""
Registry's address to remove the authentication from.
Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
"""
address: String!
): Container!
"""Retrieves this container with a previously added Unix socket removed."""
withoutUnixSocket(
"""Location of the socket to remove (e.g., "/tmp/socket")."""
path: String!
): Container!
"""
Retrieves this container with an unset command user.
Should default to root.
"""
withoutUser: Container!
"""
Retrieves this container with an unset working directory.
Should default to "/".
"""
withoutWorkdir: Container!
"""
Retrieves this container with a registry authentication for a given address.
"""
withRegistryAuth(
"""
Registry's address to bind the authentication to.
Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
"""
address: String!
"""The API key, password or token to authenticate to this registry."""
secret: SecretID!
"""The username of the registry's account (e.g., "Dagger")."""
username: String!
): Container!
"""Retrieves the container with the given directory mounted to /."""
withRootfs(
"""Directory to mount."""
directory: DirectoryID!
): Container!
"""
Retrieves this container plus an env variable containing the given secret.
"""
withSecretVariable(
"""The name of the secret variable (e.g., "API_SECRET")."""
name: String!
"""The identifier of the secret value."""
secret: SecretID!
): Container!
"""
Establish a runtime dependency on a service.
The service will be started automatically when needed and detached when it is
no longer needed, executing the default command if none is set.
The service will be reachable from the container via the provided hostname alias.
The service dependency will also convey to any files or directories produced by the container.
"""
withServiceBinding(
"""A name that can be used to reach the service from the container"""
alias: String!
"""Identifier of the service container"""
service: ServiceID!
): Container!
"""
Retrieves this container plus a socket forwarded to the given Unix socket path.
"""
withUnixSocket(
"""
A user:group to set for the mounted socket.
The user and group can either be an ID (1000:1000) or a name (foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
owner: String = ""
"""Location of the forwarded Unix socket (e.g., "/tmp/socket")."""
path: String!
"""Identifier of the socket to forward."""
source: SocketID!
): Container!
"""Retrieves this container with a different command user."""
withUser(
"""The user to set (e.g., "root")."""
name: String!
): Container!
"""Retrieves this container with a different working directory."""
withWorkdir(
"""The path to set as the working directory (e.g., "/app")."""
path: String!
): Container!
"""Retrieves the working directory for all commands."""
workdir: String!
}
"""
The `ContainerID` scalar type represents an identifier for an object of type Container.
"""
scalar ContainerID
"""A directory."""
type Directory {
"""Load the directory as a Dagger module"""
asModule(
"""
An optional subpath of the directory which contains the module's source code.
This is needed when the module code is in a subdirectory but requires parent
directories to be loaded in order to execute. For example, the module source
code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
If not set, the module source code is loaded from the root of the directory.
"""
sourceSubpath: String = ""
): Module!
"""Gets the difference between this directory and an another directory."""
diff(
"""Identifier of the directory to compare."""
other: DirectoryID!
): Directory!
"""Retrieves a directory at the given path."""
directory(
"""Location of the directory to retrieve (e.g., "/src")."""
path: String!
): Directory!
"""Builds a new Docker container from this directory."""
dockerBuild(
"""Build arguments to use in the build."""
buildArgs: [BuildArg!] = []
"""Path to the Dockerfile to use (e.g., "frontend.Dockerfile")."""
dockerfile: String = "Dockerfile"
"""The platform to build."""
platform: Platform
"""
Secrets to pass to the build.
They will be mounted at /run/secrets/[secret-name].
"""
secrets: [SecretID!] = []
"""Target build stage to build."""
target: String = ""
): Container!
"""Returns a list of files and directories at the given path."""
entries(
"""Location of the directory to look at (e.g., "/src")."""
path: String
): [String!]!
"""Writes the contents of the directory to a path on the host."""
export(
"""Location of the copied directory (e.g., "logs/")."""
path: String!
): Boolean!
"""Retrieves a file at the given path."""
file(
"""Location of the file to retrieve (e.g., "README.md")."""
path: String!
): File!
"""Returns a list of files and directories that matche the given pattern."""
glob(
"""Pattern to match (e.g., "*.md")."""
pattern: String!
): [String!]!
"""A unique identifier for this Directory."""
id: DirectoryID!
"""Creates a named sub-pipeline."""
pipeline(
"""Description of the sub-pipeline."""
description: String = ""
"""Labels to apply to the sub-pipeline."""
labels: [PipelineLabel!] = []
"""Name of the sub-pipeline."""
name: String!
): Directory!
"""Force evaluation in the engine."""
sync: DirectoryID!
"""Retrieves this directory plus a directory written at the given path."""
withDirectory(
"""Identifier of the directory to copy."""
directory: DirectoryID!
"""
Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
"""
exclude: [String!] = []
"""
Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
"""
include: [String!] = []
"""Location of the written directory (e.g., "/src/")."""
path: String!
): Directory!
"""
Retrieves this directory plus the contents of the given file copied to the given path.
"""
withFile(
"""Location of the copied file (e.g., "/file.txt")."""
path: String!
"""Permission given to the copied file (e.g., 0600)."""
permissions: Int
"""Identifier of the file to copy."""
source: FileID!
): Directory!
"""
Retrieves this directory plus a new directory created at the given path.
"""
withNewDirectory(
"""Location of the directory created (e.g., "/logs")."""
path: String!
"""Permission granted to the created directory (e.g., 0777)."""
permissions: Int = 420
): Directory!
"""Retrieves this directory plus a new file written at the given path."""
withNewFile(
"""Content of the written file (e.g., "Hello world!")."""
contents: String!
"""Location of the written file (e.g., "/file.txt")."""
path: String!
"""Permission given to the copied file (e.g., 0600)."""
permissions: Int = 420
): Directory!
"""Retrieves this directory with the directory at the given path removed."""
withoutDirectory(
"""Location of the directory to remove (e.g., ".github/")."""
path: String!
): Directory!
"""Retrieves this directory with the file at the given path removed."""
withoutFile(
"""Location of the file to remove (e.g., "/file.txt")."""
path: String!
): Directory!
"""
Retrieves this directory with all file/dir timestamps set to the given time.
"""
withTimestamps(
"""
Timestamp to set dir/files in.
Formatted in seconds following Unix epoch (e.g., 1672531199).
"""
timestamp: Int!
): Directory!
}
"""
The `DirectoryID` scalar type represents an identifier for an object of type Directory.
"""
scalar DirectoryID
"""An environment variable name and value."""
type EnvVariable {
"""A unique identifier for this EnvVariable."""
id: EnvVariableID!
name: String!
value: String!
}
"""
The `EnvVariableID` scalar type represents an identifier for an object of type EnvVariable.
"""
scalar EnvVariableID
"""
A definition of a field on a custom object defined in a Module.
A field on an object has a static value, as opposed to a function on an object
whose value is computed by invoking code (and can accept arguments).
"""
type FieldTypeDef {
description: String!
"""A unique identifier for this FieldTypeDef."""
id: FieldTypeDefID!
name: String!
typeDef: TypeDef!
}
"""
The `FieldTypeDefID` scalar type represents an identifier for an object of type FieldTypeDef.
"""
scalar FieldTypeDefID
"""A file."""
type File {
"""Retrieves the contents of the file."""
contents: String!
"""Writes the file to a file path on the host."""
export(
"""
If allowParentDirPath is true, the path argument can be a directory path, in
which case the file will be created in that directory.
"""
allowParentDirPath: Boolean = false
"""Location of the written directory (e.g., "output.txt")."""
path: String!
): Boolean!
"""A unique identifier for this File."""
id: FileID!
"""Retrieves the size of the file, in bytes."""
size: Int!
"""Force evaluation in the engine."""
sync: FileID!
"""
Retrieves this file with its created/modified timestamps set to the given time.
"""
withTimestamps(
"""
Timestamp to set dir/files in.
Formatted in seconds following Unix epoch (e.g., 1672531199).
"""
timestamp: Int!
): File!
}
"""
The `FileID` scalar type represents an identifier for an object of type File.
"""
scalar FileID
"""
Function represents a resolver provided by a Module.
A function always evaluates against a parent object and is given a set of named arguments.
"""
type Function {
args: [FunctionArg!]!
description: String!
"""A unique identifier for this Function."""
id: FunctionID!
name: String!
returnType: TypeDef!
"""Returns the function with the provided argument"""
withArg(
"""
A default value to use for this argument if not explicitly set by the caller, if any
"""
defaultValue: JSON
"""A doc string for the argument, if any"""
description: String = ""
"""The name of the argument"""
name: String!
"""The type of the argument"""
typeDef: TypeDefID!
): Function!
"""Returns the function with the given doc string."""
withDescription(
"""The doc string to set."""
description: String!
): Function!
}
"""
An argument accepted by a function.
This is a specification for an argument at function definition time, not an argument passed at function call time.
"""
type FunctionArg {
defaultValue: JSON!
description: String!
"""A unique identifier for this FunctionArg."""
id: FunctionArgID!
name: String!
typeDef: TypeDef!
}
"""
The `FunctionArgID` scalar type represents an identifier for an object of type FunctionArg.
"""
scalar FunctionArgID
"""An active function call."""
type FunctionCall {
"""A unique identifier for this FunctionCall."""
id: FunctionCallID!
inputArgs: [FunctionCallArgValue!]!
name: String!
parent: JSON!
parentName: String!
"""Set the return value of the function call to the provided value."""
returnValue(
"""JSON serialization of the return value."""
value: JSON!
): Void
}
"""A value passed as a named argument to a function call."""
type FunctionCallArgValue {
"""A unique identifier for this FunctionCallArgValue."""
id: FunctionCallArgValueID!
name: String!
value: JSON!
}
"""
The `FunctionCallArgValueID` scalar type represents an identifier for an object of type FunctionCallArgValue.
"""
scalar FunctionCallArgValueID
"""
The `FunctionCallID` scalar type represents an identifier for an object of type FunctionCall.
"""
scalar FunctionCallID
"""
The `FunctionID` scalar type represents an identifier for an object of type Function.
"""
scalar FunctionID
"""The result of running an SDK's codegen."""
type GeneratedCode {
code: Directory!
"""A unique identifier for this GeneratedCode."""
id: GeneratedCodeID!
vcsGeneratedPaths: [String!]!
vcsIgnoredPaths: [String!]!
"""Set the list of paths to mark generated in version control."""
withVCSGeneratedPaths(paths: [String!]!): GeneratedCode!
"""Set the list of paths to ignore in version control."""
withVCSIgnoredPaths(paths: [String!]!): GeneratedCode!
}
"""
The `GeneratedCodeID` scalar type represents an identifier for an object of type GeneratedCode.
"""
scalar GeneratedCodeID
"""A git ref (tag, branch, or commit)."""
type GitRef {
"""The resolved commit id at this ref."""
commit: String!
"""A unique identifier for this GitRef."""
id: GitRefID!
"""The filesystem tree at this ref."""
tree(sshAuthSocket: SocketID, sshKnownHosts: String): Directory!
}
"""
The `GitRefID` scalar type represents an identifier for an object of type GitRef.
"""
scalar GitRefID
"""A git repository."""
type GitRepository {
"""Returns details of a branch."""
branch(
"""Branch's name (e.g., "main")."""
name: String!
): GitRef!
"""Returns details of a commit."""
commit(
"""
Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
"""
id: String!
): GitRef!
"""A unique identifier for this GitRepository."""
id: GitRepositoryID!
"""Returns details of a tag."""
tag(
"""Tag's name (e.g., "v0.3.9")."""
name: String!
): GitRef!
}
"""
The `GitRepositoryID` scalar type represents an identifier for an object of type GitRepository.
"""
scalar GitRepositoryID
"""Information about the host environment."""
type Host {
"""Accesses a directory on the host."""
directory(
"""
Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
"""
exclude: [String!] = []
"""
Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
"""
include: [String!] = []
"""Location of the directory to access (e.g., ".")."""
path: String!
): Directory!
"""Accesses a file on the host."""
file(
"""Location of the file to retrieve (e.g., "README.md")."""
path: String!
): File!
"""A unique identifier for this Host."""
id: HostID!
"""
Creates a service that forwards traffic to a specified address via the host.
"""
service(
"""Upstream host to forward traffic to."""
host: String = "localhost"
"""
Ports to expose via the service, forwarding through the host network.
If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
An empty set of ports is not valid; an error will be returned.
"""
ports: [PortForward!]!
): Service!
"""
Sets a secret given a user-defined name and the file path on the host, and returns the secret.
The file is limited to a size of 512000 bytes.
"""
setSecretFile(
"""The user defined name for this secret."""
name: String!
"""Location of the file to set as a secret."""
path: String!
): Secret!
"""Creates a tunnel that forwards traffic from the host to a service."""
tunnel(
"""
Map each service port to the same port on the host, as if the service were running natively.
Note: enabling may result in port conflicts.
"""
native: Boolean = false
"""
Configure explicit port forwarding rules for the tunnel.
If a port's frontend is unspecified or 0, a random port will be chosen by the host.
If no ports are given, all of the service's ports are forwarded. If native
is true, each port maps to the same port on the host. If native is false,
each port maps to a random port chosen by the host.
If ports are given and native is true, the ports are additive.
"""
ports: [PortForward!] = []
"""Service to send traffic from the tunnel."""
service: ServiceID!
): Service!
"""Accesses a Unix socket on the host."""
unixSocket(
"""Location of the Unix socket (e.g., "/var/run/docker.sock")."""
path: String!
): Socket!
}
"""
The `HostID` scalar type represents an identifier for an object of type Host.
"""
scalar HostID
"""Compression algorithm to use for image layers."""
enum ImageLayerCompression {
Gzip
Zstd
EStarGZ
Uncompressed
}
"""Mediatypes to use in published or exported image metadata."""
enum ImageMediaTypes {
OCIMediaTypes
DockerMediaTypes
}
"""A definition of a custom interface defined in a Module."""
type InterfaceTypeDef {
description: String!
functions: [Function!]!
"""A unique identifier for this InterfaceTypeDef."""
id: InterfaceTypeDefID!
name: String!
sourceModuleName: String!
}
"""
The `InterfaceTypeDefID` scalar type represents an identifier for an object of type InterfaceTypeDef.
"""
scalar InterfaceTypeDefID
"""An arbitrary JSON-encoded value."""
scalar JSON
"""A simple key value object that represents a label."""
type Label {
"""A unique identifier for this Label."""
id: LabelID!
name: String!
value: String!
}
"""
The `LabelID` scalar type represents an identifier for an object of type Label.
"""
scalar LabelID
"""A definition of a list type in a Module."""
type ListTypeDef {
elementTypeDef: TypeDef!
"""A unique identifier for this ListTypeDef."""
id: ListTypeDefID!
}
"""
The `ListTypeDefID` scalar type represents an identifier for an object of type ListTypeDef.
"""
scalar ListTypeDefID
"""A Dagger module."""
type Module {
dependencies: [Module!]!
dependencyConfig: [String!]!
description: String
generatedCode: GeneratedCode!
"""A unique identifier for this Module."""
id: ModuleID!
"""Retrieves the module with the objects loaded via its SDK."""
initialize: Module!
interfaces: [TypeDef!]!
name: String!
objects: [TypeDef!]!
sdk: String!
"""
Serve a module's API in the current session.
Note: this can only be called once per session. In the future, it could return
a stream or service to remove the side effect.
"""
serve: Void
sourceDirectory: Directory!
sourceDirectorySubpath: String!
"""This module plus the given Interface type and associated functions"""
withInterface(iface: TypeDefID!): Module!
"""This module plus the given Object type and associated functions."""
withObject(object: TypeDefID!): Module!
"""
Retrieves the module with basic configuration loaded, ready for initialization.
"""
withSource(
"""The directory containing the module's source code."""
directory: DirectoryID!
"""
An optional subpath of the directory which contains the module's source code.
This is needed when the module code is in a subdirectory but requires parent
directories to be loaded in order to execute. For example, the module source
code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
If not set, the module source code is loaded from the root of the directory.
"""
subpath: String = ""
): Module!
}
"""
Static configuration for a module (e.g. parsed contents of dagger.json)
"""
type ModuleConfig {
dependencies: [String!]!
exclude: [String!]!
"""A unique identifier for this ModuleConfig."""
id: ModuleConfigID!
include: [String!]!
name: String!
root: String!
sdk: String!
}
"""
The `ModuleConfigID` scalar type represents an identifier for an object of type ModuleConfig.
"""
scalar ModuleConfigID
"""
The `ModuleID` scalar type represents an identifier for an object of type Module.
"""
scalar ModuleID
"""Transport layer network protocol associated to a port."""
enum NetworkProtocol {
TCP
UDP
}
"""A definition of a custom object defined in a Module."""
type ObjectTypeDef {
constructor: Function
description: String!
fields: [FieldTypeDef!]!
functions: [Function!]!
"""A unique identifier for this ObjectTypeDef."""
id: ObjectTypeDefID!
name: String!
sourceModuleName: String!
}
"""
The `ObjectTypeDefID` scalar type represents an identifier for an object of type ObjectTypeDef.
"""
scalar ObjectTypeDefID
"""Key value object that represents a pipeline label."""
input PipelineLabel {
"""Label name."""
name: String!
"""Label value."""
value: String!
}
"""
The platform config OS and architecture in a Container.
The format is [os]/[platform]/[version] (e.g., "darwin/arm64/v7", "windows/amd64", "linux/arm64").
"""
scalar Platform
"""A port exposed by a container."""
type Port {
description: String
"""A unique identifier for this Port."""
id: PortID!
port: Int!
protocol: NetworkProtocol!
}
"""Port forwarding rules for tunneling network traffic."""
input PortForward {
"""Destination port for traffic."""
backend: Int!
"""Port to expose to clients. If unspecified, a default will be chosen."""
frontend: Int
"""Transport layer protocol to use for traffic."""
protocol: NetworkProtocol = TCP
}
"""
The `PortID` scalar type represents an identifier for an object of type Port.
"""
scalar PortID
"""The root of the DAG."""
type Query {
"""Retrieves a content-addressed blob."""
blob(
"""Digest of the blob"""
digest: String!
"""Media type of the blob"""
mediaType: String!
"""Size of the blob"""
size: Int!
"""Digest of the uncompressed blob"""
uncompressed: String!
): Directory!
"""Constructs a cache volume for a given cache key."""
cacheVolume(
"""
A string identifier to target this cache volume (e.g., "modules-cache").
"""
key: String!
): CacheVolume!
"""
Checks if the current Dagger Engine is compatible with an SDK's required version.
"""
checkVersionCompatibility(
"""Version required by the SDK."""
version: String!
): Boolean!
"""
Creates a scratch container.
Optional platform argument initializes new containers to execute and publish
as that platform. Platform defaults to that of the builder's host.
"""
container(
id: ContainerID
"""Platform to initialize the container with."""
platform: Platform
): Container!
"""
The FunctionCall context that the SDK caller is currently executing in.
If the caller is not currently executing in a function, this will return an error.
"""
currentFunctionCall: FunctionCall!
"""The module currently being served in the session, if any."""
currentModule: Module!
"""
The TypeDef representations of the objects currently being served in the session.
"""
currentTypeDefs: [TypeDef!]!
"""The default platform of the engine."""
defaultPlatform: Platform!
"""Creates an empty directory."""
directory(id: DirectoryID): Directory!
file(id: FileID!): File! @deprecated(reason: "Use loadFileFromID instead.")
"""Creates a function."""
function(
"""
Name of the function, in its original format from the implementation language.
"""
name: String!
"""Return type of the function."""
returnType: TypeDefID!
): Function!
"""
Create a code generation result, given a directory containing the generated code.
"""
generatedCode(code: DirectoryID!): GeneratedCode!
"""Queries a Git repository."""
git(
"""A service which must be started before the repo is fetched."""
experimentalServiceHost: ServiceID
"""Set to true to keep .git directory."""
keepGitDir: Boolean = false
"""Set SSH auth socket"""
sshAuthSocket: SocketID
"""Set SSH known hosts"""
sshKnownHosts: String = ""
"""
URL of the git repository.
Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
Suffix ".git" is optional.
"""
url: String!
): GitRepository!
"""Queries the host environment."""
host: Host!
"""Returns a file containing an http remote url content."""
http(
"""A service which must be started before the URL is fetched."""
experimentalServiceHost: ServiceID
"""HTTP url to get the content from (e.g., "https://docs.dagger.io")."""
url: String!
): File!
"""Load a CacheVolume from its ID."""
loadCacheVolumeFromID(id: CacheVolumeID!): CacheVolume!
"""Load a Container from its ID."""
loadContainerFromID(id: ContainerID!): Container!
"""Load a Directory from its ID."""
loadDirectoryFromID(id: DirectoryID!): Directory!
"""Load a EnvVariable from its ID."""
loadEnvVariableFromID(id: EnvVariableID!): EnvVariable!
"""Load a FieldTypeDef from its ID."""
loadFieldTypeDefFromID(id: FieldTypeDefID!): FieldTypeDef!
"""Load a File from its ID."""
loadFileFromID(id: FileID!): File!
"""Load a FunctionArg from its ID."""
loadFunctionArgFromID(id: FunctionArgID!): FunctionArg!
"""Load a FunctionCallArgValue from its ID."""
loadFunctionCallArgValueFromID(id: FunctionCallArgValueID!): FunctionCallArgValue!
"""Load a FunctionCall from its ID."""
loadFunctionCallFromID(id: FunctionCallID!): FunctionCall!
"""Load a Function from its ID."""
loadFunctionFromID(id: FunctionID!): Function!
"""Load a GeneratedCode from its ID."""
loadGeneratedCodeFromID(id: GeneratedCodeID!): GeneratedCode!
"""Load a GitRef from its ID."""
loadGitRefFromID(id: GitRefID!): GitRef!
"""Load a GitRepository from its ID."""
loadGitRepositoryFromID(id: GitRepositoryID!): GitRepository!
"""Load a Host from its ID."""
loadHostFromID(id: HostID!): Host!
"""Load a InterfaceTypeDef from its ID."""
loadInterfaceTypeDefFromID(id: InterfaceTypeDefID!): InterfaceTypeDef!
"""Load a Label from its ID."""
loadLabelFromID(id: LabelID!): Label!
"""Load a ListTypeDef from its ID."""
loadListTypeDefFromID(id: ListTypeDefID!): ListTypeDef!
"""Load a ModuleConfig from its ID."""
loadModuleConfigFromID(id: ModuleConfigID!): ModuleConfig!
"""Load a Module from its ID."""
loadModuleFromID(id: ModuleID!): Module!
"""Load a ObjectTypeDef from its ID."""
loadObjectTypeDefFromID(id: ObjectTypeDefID!): ObjectTypeDef!
"""Load a Port from its ID."""
loadPortFromID(id: PortID!): Port!
"""Load a Secret from its ID."""
loadSecretFromID(id: SecretID!): Secret!
"""Load a Service from its ID."""
loadServiceFromID(id: ServiceID!): Service!
"""Load a Socket from its ID."""
loadSocketFromID(id: SocketID!): Socket!
"""Load a TypeDef from its ID."""
loadTypeDefFromID(id: TypeDefID!): TypeDef!
"""Create a new module."""
module: Module!
"""
Load the static configuration for a module from the given source directory and optional subpath.
"""
moduleConfig(sourceDirectory: DirectoryID!, subpath: String = ""): ModuleConfig!
"""Creates a named sub-pipeline."""
pipeline(
"""Description of the sub-pipeline."""
description: String = ""
"""Labels to apply to the sub-pipeline."""
labels: [PipelineLabel!]
"""Name of the sub-pipeline."""
name: String!
): Query!
"""Reference a secret by name."""
secret(name: String!): Secret!
"""
Sets a secret given a user defined name to its plaintext and returns the secret.
The plaintext value is limited to a size of 128000 bytes.
"""
setSecret(
"""The user defined name for this secret"""
name: String!
"""The plaintext of the secret"""
plaintext: String!
): Secret!
"""Loads a socket by its ID."""
socket(id: SocketID!): Socket! @deprecated(reason: "Use `loadSocketFromID` instead.")
"""Create a new TypeDef."""
typeDef: TypeDef!
}
"""
A reference to a secret value, which can be handled more safely than the value itself.
"""
type Secret {
"""A unique identifier for this Secret."""
id: SecretID!
"""The value of this secret."""
plaintext: String!
}
"""
The `SecretID` scalar type represents an identifier for an object of type Secret.
"""
scalar SecretID
"""A content-addressed service providing TCP connectivity."""
type Service {
"""
Retrieves an endpoint that clients can use to reach this container.
If no port is specified, the first exposed port is used. If none exist an error is returned.
If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
"""
endpoint(
"""The exposed port number for the endpoint"""
port: Int
"""Return a URL with the given scheme, eg. http for http://"""
scheme: String = ""
): String!
"""
Retrieves a hostname which can be used by clients to reach this container.
"""
hostname: String!
"""A unique identifier for this Service."""
id: ServiceID!
"""Retrieves the list of ports provided by the service."""
ports: [Port!]!
"""
Start the service and wait for its health checks to succeed.
Services bound to a Container do not need to be manually started.
"""
start: ServiceID!
"""Stop the service."""
stop: ServiceID!
}
"""
The `ServiceID` scalar type represents an identifier for an object of type Service.
"""
scalar ServiceID
"""A Unix or TCP/IP socket that can be mounted into a container."""
type Socket {
"""A unique identifier for this Socket."""
id: SocketID!
}
"""
The `SocketID` scalar type represents an identifier for an object of type Socket.
"""
scalar SocketID
"""A definition of a parameter or return type in a Module."""
type TypeDef {
asInterface: InterfaceTypeDef
asList: ListTypeDef
asObject: ObjectTypeDef
"""A unique identifier for this TypeDef."""
id: TypeDefID!
kind: TypeDefKind!
optional: Boolean!
"""
Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
"""
withConstructor(function: FunctionID!): TypeDef!
"""
Adds a static field for an Object TypeDef, failing if the type is not an object.
"""
withField(
"""A doc string for the field, if any"""
description: String = ""
"""The name of the field in the object"""
name: String!
"""The type of the field"""
typeDef: TypeDefID!
): TypeDef!
"""
Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
"""
withFunction(function: FunctionID!): TypeDef!
"""Returns a TypeDef of kind Interface with the provided name."""
withInterface(description: String = "", name: String!): TypeDef!
"""Sets the kind of the type."""
withKind(kind: TypeDefKind!): TypeDef!
"""
Returns a TypeDef of kind List with the provided type for its elements.
"""
withListOf(elementType: TypeDefID!): TypeDef!
"""
Returns a TypeDef of kind Object with the provided name.
Note that an object's fields and functions may be omitted if the intent is
only to refer to an object. This is how functions are able to return their own
object, or any other circular reference.
"""
withObject(description: String = "", name: String!): TypeDef!
"""Sets whether this type can be set to null."""
withOptional(optional: Boolean!): TypeDef!
}
"""
The `TypeDefID` scalar type represents an identifier for an object of type TypeDef.
"""
scalar TypeDefID
"""Distinguishes the different kinds of TypeDefs."""
enum TypeDefKind {
"""A string value."""
STRING_KIND
"""An integer value."""
INTEGER_KIND
"""A boolean value."""
BOOLEAN_KIND
"""
A list of values all having the same type.
Always paired with a ListTypeDef.
"""
LIST_KIND
"""
A named type defined in the GraphQL schema, with fields and functions.
Always paired with an ObjectTypeDef.
"""
OBJECT_KIND
"""
A named type of functions that can be matched+implemented by other objects+interfaces.
Always paired with an InterfaceTypeDef.
"""
INTERFACE_KIND
"""
A special kind used to signify that no value is returned.
This is used for functions that have no return value. The outer TypeDef
specifying this Kind is always Optional, as the Void is never actually represented.
"""
VOID_KIND
}
"""
The absence of a value.
A Null Void is used as a placeholder for resolvers that do not return anything.
"""
scalar Void
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,416 | ✨ Add name field to File | ### What are you trying to do?
Files passed to `dagger call` currently does not preserve the name of a file passed to it.
### Why is this important to you?
Some tools often require the original file name (for example: Spectral requires the file name do determine the file type)
Discussed it with @sipsma here: https://discord.com/channels/707636530424053791/1120503349599543376/1195832958150529165
### How are you currently working around this?
I pass the original file name to the module. | https://github.com/dagger/dagger/issues/6416 | https://github.com/dagger/dagger/pull/6431 | 61bf06b970402efa254a40f13c4aee98adfbdb42 | c716a042f290b11c6122d247f8b31651adb5f1d0 | "2024-01-13T21:04:31Z" | go | "2024-01-17T16:17:48Z" | sdk/elixir/lib/dagger/gen/file.ex | # This file generated by `mix dagger.gen`. Please DO NOT EDIT.
defmodule Dagger.File do
@moduledoc "A file."
use Dagger.QueryBuilder
@type t() :: %__MODULE__{}
@derive Dagger.Sync
defstruct [:selection, :client]
(
@doc "Retrieves the contents of the file."
@spec contents(t()) :: {:ok, Dagger.String.t()} | {:error, term()}
def contents(%__MODULE__{} = file) do
selection = select(file.selection, "contents")
execute(selection, file.client)
end
)
(
@doc "Writes the file to a file path on the host.\n\n## Required Arguments\n\n* `path` - Location of the written directory (e.g., \"output.txt\").\n\n## Optional Arguments\n\n* `allow_parent_dir_path` - If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory."
@spec export(t(), Dagger.String.t(), keyword()) ::
{:ok, Dagger.Boolean.t()} | {:error, term()}
def export(%__MODULE__{} = file, path, optional_args \\ []) do
selection = select(file.selection, "export")
selection = arg(selection, "path", path)
selection =
if is_nil(optional_args[:allow_parent_dir_path]) do
selection
else
arg(selection, "allowParentDirPath", optional_args[:allow_parent_dir_path])
end
execute(selection, file.client)
end
)
(
@doc "A unique identifier for this File."
@spec id(t()) :: {:ok, Dagger.FileID.t()} | {:error, term()}
def id(%__MODULE__{} = file) do
selection = select(file.selection, "id")
execute(selection, file.client)
end
)
(
@doc "Retrieves the size of the file, in bytes."
@spec size(t()) :: {:ok, Dagger.Int.t()} | {:error, term()}
def size(%__MODULE__{} = file) do
selection = select(file.selection, "size")
execute(selection, file.client)
end
)
(
@doc "Force evaluation in the engine."
@spec sync(t()) :: {:ok, Dagger.FileID.t()} | {:error, term()}
def sync(%__MODULE__{} = file) do
selection = select(file.selection, "sync")
execute(selection, file.client)
end
)
(
@doc "Retrieves this file with its created/modified timestamps set to the given time.\n\n## Required Arguments\n\n* `timestamp` - Timestamp to set dir/files in.\n\nFormatted in seconds following Unix epoch (e.g., 1672531199)."
@spec with_timestamps(t(), Dagger.Int.t()) :: Dagger.File.t()
def with_timestamps(%__MODULE__{} = file, timestamp) do
selection = select(file.selection, "withTimestamps")
selection = arg(selection, "timestamp", timestamp)
%Dagger.File{selection: selection, client: file.client}
end
)
end
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,416 | ✨ Add name field to File | ### What are you trying to do?
Files passed to `dagger call` currently does not preserve the name of a file passed to it.
### Why is this important to you?
Some tools often require the original file name (for example: Spectral requires the file name do determine the file type)
Discussed it with @sipsma here: https://discord.com/channels/707636530424053791/1120503349599543376/1195832958150529165
### How are you currently working around this?
I pass the original file name to the module. | https://github.com/dagger/dagger/issues/6416 | https://github.com/dagger/dagger/pull/6431 | 61bf06b970402efa254a40f13c4aee98adfbdb42 | c716a042f290b11c6122d247f8b31651adb5f1d0 | "2024-01-13T21:04:31Z" | go | "2024-01-17T16:17:48Z" | sdk/go/dagger.gen.go | // Code generated by dagger. DO NOT EDIT.
package dagger
import (
"context"
"encoding/json"
"errors"
"fmt"
"reflect"
"github.com/Khan/genqlient/graphql"
"github.com/vektah/gqlparser/v2/gqlerror"
"dagger.io/dagger/querybuilder"
)
// assertNotNil panic if the given value is nil.
// This function is used to validate that input with pointer type are not nil.
// See https://github.com/dagger/dagger/issues/5696 for more context.
func assertNotNil(argName string, value any) {
// We use reflect because just comparing value to nil is not working since
// the value is wrapped into a type when passed as parameter.
// E.g., nil become (*dagger.File)(nil).
if reflect.ValueOf(value).IsNil() {
panic(fmt.Sprintf("unexpected nil pointer for argument %q", argName))
}
}
// ptr returns a pointer to the given value.
func ptr[T any](v T) *T {
return &v
}
// Optional is a helper type to represent optional values. Any method arguments
// that use this wrapper type will be set as optional in the generated API.
//
// To construct an Optional from within a module, use the Opt helper function.
type Optional[T any] struct {
value T
isSet bool
}
// Opt is a helper function to construct an Optional with the given value set.
func Opt[T any](v T) Optional[T] {
return Optional[T]{value: v, isSet: true}
}
// OptEmpty is a helper function to construct an empty Optional.
func OptEmpty[T any]() Optional[T] {
return Optional[T]{}
}
// Get returns the internal value of the optional and a boolean indicating if
// the value was set explicitly by the caller.
func (o *Optional[T]) Get() (T, bool) {
if o == nil {
var empty T
return empty, false
}
return o.value, o.isSet
}
// GetOr returns the internal value of the optional or the given default value
// if the value was not explicitly set by the caller.
func (o *Optional[T]) GetOr(defaultValue T) T {
if o == nil {
return defaultValue
}
if o.isSet {
return o.value
}
return defaultValue
}
func (o *Optional[T]) MarshalJSON() ([]byte, error) {
return json.Marshal(&o.value)
}
func (o *Optional[T]) UnmarshalJSON(dt []byte) error {
o.isSet = true
return json.Unmarshal(dt, &o.value)
}
type DaggerObject querybuilder.GraphQLMarshaller
func convertSlice[I any, O any](in []I, f func(I) O) []O {
out := make([]O, len(in))
for i, v := range in {
out[i] = f(v)
}
return out
}
func convertOptionalVal[I any, O any](opt Optional[I], f func(I) O) Optional[O] {
if !opt.isSet {
return Optional[O]{}
}
return Optional[O]{value: f(opt.value), isSet: true}
}
// getCustomError parses a GraphQL error into a more specific error type.
func getCustomError(err error) error {
var gqlErr *gqlerror.Error
if !errors.As(err, &gqlErr) {
return nil
}
ext := gqlErr.Extensions
typ, ok := ext["_type"].(string)
if !ok {
return nil
}
if typ == "EXEC_ERROR" {
e := &ExecError{
original: err,
}
if code, ok := ext["exitCode"].(float64); ok {
e.ExitCode = int(code)
}
if args, ok := ext["cmd"].([]interface{}); ok {
cmd := make([]string, len(args))
for i, v := range args {
cmd[i] = v.(string)
}
e.Cmd = cmd
}
if stdout, ok := ext["stdout"].(string); ok {
e.Stdout = stdout
}
if stderr, ok := ext["stderr"].(string); ok {
e.Stderr = stderr
}
return e
}
return nil
}
// ExecError is an API error from an exec operation.
type ExecError struct {
original error
Cmd []string
ExitCode int
Stdout string
Stderr string
}
func (e *ExecError) Error() string {
// As a default when just printing the error, include the stdout
// and stderr for visibility
return fmt.Sprintf(
"%s\nStdout:\n%s\nStderr:\n%s",
e.Message(),
e.Stdout,
e.Stderr,
)
}
func (e *ExecError) Message() string {
return e.original.Error()
}
func (e *ExecError) Unwrap() error {
return e.original
}
// The `CacheVolumeID` scalar type represents an identifier for an object of type CacheVolume.
type CacheVolumeID string
// The `ContainerID` scalar type represents an identifier for an object of type Container.
type ContainerID string
// The `DirectoryID` scalar type represents an identifier for an object of type Directory.
type DirectoryID string
// The `EnvVariableID` scalar type represents an identifier for an object of type EnvVariable.
type EnvVariableID string
// The `FieldTypeDefID` scalar type represents an identifier for an object of type FieldTypeDef.
type FieldTypeDefID string
// The `FileID` scalar type represents an identifier for an object of type File.
type FileID string
// The `FunctionArgID` scalar type represents an identifier for an object of type FunctionArg.
type FunctionArgID string
// The `FunctionCallArgValueID` scalar type represents an identifier for an object of type FunctionCallArgValue.
type FunctionCallArgValueID string
// The `FunctionCallID` scalar type represents an identifier for an object of type FunctionCall.
type FunctionCallID string
// The `FunctionID` scalar type represents an identifier for an object of type Function.
type FunctionID string
// The `GeneratedCodeID` scalar type represents an identifier for an object of type GeneratedCode.
type GeneratedCodeID string
// The `GitRefID` scalar type represents an identifier for an object of type GitRef.
type GitRefID string
// The `GitRepositoryID` scalar type represents an identifier for an object of type GitRepository.
type GitRepositoryID string
// The `HostID` scalar type represents an identifier for an object of type Host.
type HostID string
// The `InterfaceTypeDefID` scalar type represents an identifier for an object of type InterfaceTypeDef.
type InterfaceTypeDefID string
// An arbitrary JSON-encoded value.
type JSON string
// The `LabelID` scalar type represents an identifier for an object of type Label.
type LabelID string
// The `ListTypeDefID` scalar type represents an identifier for an object of type ListTypeDef.
type ListTypeDefID string
// The `ModuleConfigID` scalar type represents an identifier for an object of type ModuleConfig.
type ModuleConfigID string
// The `ModuleID` scalar type represents an identifier for an object of type Module.
type ModuleID string
// The `ObjectTypeDefID` scalar type represents an identifier for an object of type ObjectTypeDef.
type ObjectTypeDefID string
// The platform config OS and architecture in a Container.
//
// The format is [os]/[platform]/[version] (e.g., "darwin/arm64/v7", "windows/amd64", "linux/arm64").
type Platform string
// The `PortID` scalar type represents an identifier for an object of type Port.
type PortID string
// The `SecretID` scalar type represents an identifier for an object of type Secret.
type SecretID string
// The `ServiceID` scalar type represents an identifier for an object of type Service.
type ServiceID string
// The `SocketID` scalar type represents an identifier for an object of type Socket.
type SocketID string
// The `TypeDefID` scalar type represents an identifier for an object of type TypeDef.
type TypeDefID string
// The absence of a value.
//
// A Null Void is used as a placeholder for resolvers that do not return anything.
type Void string
// Key value object that represents a build argument.
type BuildArg struct {
// The build argument name.
Name string `json:"name"`
// The build argument value.
Value string `json:"value"`
}
// Key value object that represents a pipeline label.
type PipelineLabel struct {
// Label name.
Name string `json:"name"`
// Label value.
Value string `json:"value"`
}
// Port forwarding rules for tunneling network traffic.
type PortForward struct {
// Destination port for traffic.
Backend int `json:"backend"`
// Port to expose to clients. If unspecified, a default will be chosen.
Frontend int `json:"frontend"`
// Transport layer protocol to use for traffic.
Protocol NetworkProtocol `json:"protocol,omitempty"`
}
// A directory whose contents persist across runs.
type CacheVolume struct {
q *querybuilder.Selection
c graphql.Client
id *CacheVolumeID
}
// A unique identifier for this CacheVolume.
func (r *CacheVolume) ID(ctx context.Context) (CacheVolumeID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response CacheVolumeID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *CacheVolume) XXX_GraphQLType() string {
return "CacheVolume"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *CacheVolume) XXX_GraphQLIDType() string {
return "CacheVolumeID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *CacheVolume) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *CacheVolume) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
// An OCI-compatible container, also known as a Docker container.
type Container struct {
q *querybuilder.Selection
c graphql.Client
envVariable *string
export *bool
id *ContainerID
imageRef *string
label *string
platform *Platform
publish *string
shellEndpoint *string
stderr *string
stdout *string
sync *ContainerID
user *string
workdir *string
}
type WithContainerFunc func(r *Container) *Container
// With calls the provided function with current Container.
//
// This is useful for reusability and readability by not breaking the calling chain.
func (r *Container) With(f WithContainerFunc) *Container {
return f(r)
}
// Turn the container into a Service.
//
// Be sure to set any exposed ports before this conversion.
func (r *Container) AsService() *Service {
q := r.q.Select("asService")
return &Service{
q: q,
c: r.c,
}
}
// ContainerAsTarballOpts contains options for Container.AsTarball
type ContainerAsTarballOpts struct {
// Identifiers for other platform specific containers.
//
// Used for multi-platform images.
PlatformVariants []*Container
// Force each layer of the image to use the specified compression algorithm.
//
// If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
ForcedCompression ImageLayerCompression
// Use the specified media types for the image's layers.
//
// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
MediaTypes ImageMediaTypes
}
// Returns a File representing the container serialized to a tarball.
func (r *Container) AsTarball(opts ...ContainerAsTarballOpts) *File {
q := r.q.Select("asTarball")
for i := len(opts) - 1; i >= 0; i-- {
// `platformVariants` optional argument
if !querybuilder.IsZeroValue(opts[i].PlatformVariants) {
q = q.Arg("platformVariants", opts[i].PlatformVariants)
}
// `forcedCompression` optional argument
if !querybuilder.IsZeroValue(opts[i].ForcedCompression) {
q = q.Arg("forcedCompression", opts[i].ForcedCompression)
}
// `mediaTypes` optional argument
if !querybuilder.IsZeroValue(opts[i].MediaTypes) {
q = q.Arg("mediaTypes", opts[i].MediaTypes)
}
}
return &File{
q: q,
c: r.c,
}
}
// ContainerBuildOpts contains options for Container.Build
type ContainerBuildOpts struct {
// Path to the Dockerfile to use.
Dockerfile string
// Target build stage to build.
Target string
// Additional build arguments.
BuildArgs []BuildArg
// Secrets to pass to the build.
//
// They will be mounted at /run/secrets/[secret-name] in the build container
//
// They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl http://example.com?token=$(cat /run/secrets/my-secret)
Secrets []*Secret
}
// Initializes this container from a Dockerfile build.
func (r *Container) Build(context *Directory, opts ...ContainerBuildOpts) *Container {
assertNotNil("context", context)
q := r.q.Select("build")
for i := len(opts) - 1; i >= 0; i-- {
// `dockerfile` optional argument
if !querybuilder.IsZeroValue(opts[i].Dockerfile) {
q = q.Arg("dockerfile", opts[i].Dockerfile)
}
// `target` optional argument
if !querybuilder.IsZeroValue(opts[i].Target) {
q = q.Arg("target", opts[i].Target)
}
// `buildArgs` optional argument
if !querybuilder.IsZeroValue(opts[i].BuildArgs) {
q = q.Arg("buildArgs", opts[i].BuildArgs)
}
// `secrets` optional argument
if !querybuilder.IsZeroValue(opts[i].Secrets) {
q = q.Arg("secrets", opts[i].Secrets)
}
}
q = q.Arg("context", context)
return &Container{
q: q,
c: r.c,
}
}
// Retrieves default arguments for future commands.
func (r *Container) DefaultArgs(ctx context.Context) ([]string, error) {
q := r.q.Select("defaultArgs")
var response []string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Retrieves a directory at the given path.
//
// Mounts are included.
func (r *Container) Directory(path string) *Directory {
q := r.q.Select("directory")
q = q.Arg("path", path)
return &Directory{
q: q,
c: r.c,
}
}
// Retrieves entrypoint to be prepended to the arguments of all commands.
func (r *Container) Entrypoint(ctx context.Context) ([]string, error) {
q := r.q.Select("entrypoint")
var response []string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Retrieves the value of the specified environment variable.
func (r *Container) EnvVariable(ctx context.Context, name string) (string, error) {
if r.envVariable != nil {
return *r.envVariable, nil
}
q := r.q.Select("envVariable")
q = q.Arg("name", name)
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Retrieves the list of environment variables passed to commands.
func (r *Container) EnvVariables(ctx context.Context) ([]EnvVariable, error) {
q := r.q.Select("envVariables")
q = q.Select("id")
type envVariables struct {
Id EnvVariableID
}
convert := func(fields []envVariables) []EnvVariable {
out := []EnvVariable{}
for i := range fields {
val := EnvVariable{id: &fields[i].Id}
val.q = querybuilder.Query().Select("loadEnvVariableFromID").Arg("id", fields[i].Id)
val.c = r.c
out = append(out, val)
}
return out
}
var response []envVariables
q = q.Bind(&response)
err := q.Execute(ctx, r.c)
if err != nil {
return nil, err
}
return convert(response), nil
}
// EXPERIMENTAL API! Subject to change/removal at any time.
//
// Configures all available GPUs on the host to be accessible to this container.
//
// This currently works for Nvidia devices only.
func (r *Container) ExperimentalWithAllGPUs() *Container {
q := r.q.Select("experimentalWithAllGPUs")
return &Container{
q: q,
c: r.c,
}
}
// EXPERIMENTAL API! Subject to change/removal at any time.
//
// Configures the provided list of devices to be accesible to this container.
//
// This currently works for Nvidia devices only.
func (r *Container) ExperimentalWithGPU(devices []string) *Container {
q := r.q.Select("experimentalWithGPU")
q = q.Arg("devices", devices)
return &Container{
q: q,
c: r.c,
}
}
// ContainerExportOpts contains options for Container.Export
type ContainerExportOpts struct {
// Identifiers for other platform specific containers.
//
// Used for multi-platform image.
PlatformVariants []*Container
// Force each layer of the exported image to use the specified compression algorithm.
//
// If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
ForcedCompression ImageLayerCompression
// Use the specified media types for the exported image's layers.
//
// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
MediaTypes ImageMediaTypes
}
// Writes the container as an OCI tarball to the destination file path on the host.
//
// Return true on success.
//
// It can also export platform variants.
func (r *Container) Export(ctx context.Context, path string, opts ...ContainerExportOpts) (bool, error) {
if r.export != nil {
return *r.export, nil
}
q := r.q.Select("export")
for i := len(opts) - 1; i >= 0; i-- {
// `platformVariants` optional argument
if !querybuilder.IsZeroValue(opts[i].PlatformVariants) {
q = q.Arg("platformVariants", opts[i].PlatformVariants)
}
// `forcedCompression` optional argument
if !querybuilder.IsZeroValue(opts[i].ForcedCompression) {
q = q.Arg("forcedCompression", opts[i].ForcedCompression)
}
// `mediaTypes` optional argument
if !querybuilder.IsZeroValue(opts[i].MediaTypes) {
q = q.Arg("mediaTypes", opts[i].MediaTypes)
}
}
q = q.Arg("path", path)
var response bool
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Retrieves the list of exposed ports.
//
// This includes ports already exposed by the image, even if not explicitly added with dagger.
func (r *Container) ExposedPorts(ctx context.Context) ([]Port, error) {
q := r.q.Select("exposedPorts")
q = q.Select("id")
type exposedPorts struct {
Id PortID
}
convert := func(fields []exposedPorts) []Port {
out := []Port{}
for i := range fields {
val := Port{id: &fields[i].Id}
val.q = querybuilder.Query().Select("loadPortFromID").Arg("id", fields[i].Id)
val.c = r.c
out = append(out, val)
}
return out
}
var response []exposedPorts
q = q.Bind(&response)
err := q.Execute(ctx, r.c)
if err != nil {
return nil, err
}
return convert(response), nil
}
// Retrieves a file at the given path.
//
// Mounts are included.
func (r *Container) File(path string) *File {
q := r.q.Select("file")
q = q.Arg("path", path)
return &File{
q: q,
c: r.c,
}
}
// Initializes this container from a pulled base image.
func (r *Container) From(address string) *Container {
q := r.q.Select("from")
q = q.Arg("address", address)
return &Container{
q: q,
c: r.c,
}
}
// A unique identifier for this Container.
func (r *Container) ID(ctx context.Context) (ContainerID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response ContainerID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *Container) XXX_GraphQLType() string {
return "Container"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *Container) XXX_GraphQLIDType() string {
return "ContainerID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *Container) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *Container) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
func (r *Container) ImageRef(ctx context.Context) (string, error) {
if r.imageRef != nil {
return *r.imageRef, nil
}
q := r.q.Select("imageRef")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// ContainerImportOpts contains options for Container.Import
type ContainerImportOpts struct {
// Identifies the tag to import from the archive, if the archive bundles multiple tags.
Tag string
}
// Reads the container from an OCI tarball.
func (r *Container) Import(source *File, opts ...ContainerImportOpts) *Container {
assertNotNil("source", source)
q := r.q.Select("import")
for i := len(opts) - 1; i >= 0; i-- {
// `tag` optional argument
if !querybuilder.IsZeroValue(opts[i].Tag) {
q = q.Arg("tag", opts[i].Tag)
}
}
q = q.Arg("source", source)
return &Container{
q: q,
c: r.c,
}
}
// Retrieves the value of the specified label.
func (r *Container) Label(ctx context.Context, name string) (string, error) {
if r.label != nil {
return *r.label, nil
}
q := r.q.Select("label")
q = q.Arg("name", name)
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Retrieves the list of labels passed to container.
func (r *Container) Labels(ctx context.Context) ([]Label, error) {
q := r.q.Select("labels")
q = q.Select("id")
type labels struct {
Id LabelID
}
convert := func(fields []labels) []Label {
out := []Label{}
for i := range fields {
val := Label{id: &fields[i].Id}
val.q = querybuilder.Query().Select("loadLabelFromID").Arg("id", fields[i].Id)
val.c = r.c
out = append(out, val)
}
return out
}
var response []labels
q = q.Bind(&response)
err := q.Execute(ctx, r.c)
if err != nil {
return nil, err
}
return convert(response), nil
}
// Retrieves the list of paths where a directory is mounted.
func (r *Container) Mounts(ctx context.Context) ([]string, error) {
q := r.q.Select("mounts")
var response []string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// ContainerPipelineOpts contains options for Container.Pipeline
type ContainerPipelineOpts struct {
// Description of the sub-pipeline.
Description string
// Labels to apply to the sub-pipeline.
Labels []PipelineLabel
}
// Creates a named sub-pipeline.
func (r *Container) Pipeline(name string, opts ...ContainerPipelineOpts) *Container {
q := r.q.Select("pipeline")
for i := len(opts) - 1; i >= 0; i-- {
// `description` optional argument
if !querybuilder.IsZeroValue(opts[i].Description) {
q = q.Arg("description", opts[i].Description)
}
// `labels` optional argument
if !querybuilder.IsZeroValue(opts[i].Labels) {
q = q.Arg("labels", opts[i].Labels)
}
}
q = q.Arg("name", name)
return &Container{
q: q,
c: r.c,
}
}
// The platform this container executes and publishes as.
func (r *Container) Platform(ctx context.Context) (Platform, error) {
if r.platform != nil {
return *r.platform, nil
}
q := r.q.Select("platform")
var response Platform
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// ContainerPublishOpts contains options for Container.Publish
type ContainerPublishOpts struct {
// Identifiers for other platform specific containers.
//
// Used for multi-platform image.
PlatformVariants []*Container
// Force each layer of the published image to use the specified compression algorithm.
//
// If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
ForcedCompression ImageLayerCompression
// Use the specified media types for the published image's layers.
//
// Defaults to OCI, which is largely compatible with most recent registries, but Docker may be needed for older registries without OCI support.
MediaTypes ImageMediaTypes
}
// Publishes this container as a new image to the specified address.
//
// Publish returns a fully qualified ref.
//
// It can also publish platform variants.
func (r *Container) Publish(ctx context.Context, address string, opts ...ContainerPublishOpts) (string, error) {
if r.publish != nil {
return *r.publish, nil
}
q := r.q.Select("publish")
for i := len(opts) - 1; i >= 0; i-- {
// `platformVariants` optional argument
if !querybuilder.IsZeroValue(opts[i].PlatformVariants) {
q = q.Arg("platformVariants", opts[i].PlatformVariants)
}
// `forcedCompression` optional argument
if !querybuilder.IsZeroValue(opts[i].ForcedCompression) {
q = q.Arg("forcedCompression", opts[i].ForcedCompression)
}
// `mediaTypes` optional argument
if !querybuilder.IsZeroValue(opts[i].MediaTypes) {
q = q.Arg("mediaTypes", opts[i].MediaTypes)
}
}
q = q.Arg("address", address)
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Retrieves this container's root filesystem. Mounts are not included.
func (r *Container) Rootfs() *Directory {
q := r.q.Select("rootfs")
return &Directory{
q: q,
c: r.c,
}
}
// Return a websocket endpoint that, if connected to, will start the container with a TTY streamed over the websocket.
//
// Primarily intended for internal use with the dagger CLI.
func (r *Container) ShellEndpoint(ctx context.Context) (string, error) {
if r.shellEndpoint != nil {
return *r.shellEndpoint, nil
}
q := r.q.Select("shellEndpoint")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// The error stream of the last executed command.
//
// Will execute default command if none is set, or error if there's no default.
func (r *Container) Stderr(ctx context.Context) (string, error) {
if r.stderr != nil {
return *r.stderr, nil
}
q := r.q.Select("stderr")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// The output stream of the last executed command.
//
// Will execute default command if none is set, or error if there's no default.
func (r *Container) Stdout(ctx context.Context) (string, error) {
if r.stdout != nil {
return *r.stdout, nil
}
q := r.q.Select("stdout")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Forces evaluation of the pipeline in the engine.
//
// It doesn't run the default command if no exec has been set.
func (r *Container) Sync(ctx context.Context) (*Container, error) {
q := r.q.Select("sync")
return r, q.Execute(ctx, r.c)
}
// Retrieves the user to be set for all commands.
func (r *Container) User(ctx context.Context) (string, error) {
if r.user != nil {
return *r.user, nil
}
q := r.q.Select("user")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Configures default arguments for future commands.
func (r *Container) WithDefaultArgs(args []string) *Container {
q := r.q.Select("withDefaultArgs")
q = q.Arg("args", args)
return &Container{
q: q,
c: r.c,
}
}
// ContainerWithDirectoryOpts contains options for Container.WithDirectory
type ContainerWithDirectoryOpts struct {
// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
Exclude []string
// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
Include []string
// A user:group to set for the directory and its contents.
//
// The user and group can either be an ID (1000:1000) or a name (foo:bar).
//
// If the group is omitted, it defaults to the same as the user.
Owner string
}
// Retrieves this container plus a directory written at the given path.
func (r *Container) WithDirectory(path string, directory *Directory, opts ...ContainerWithDirectoryOpts) *Container {
assertNotNil("directory", directory)
q := r.q.Select("withDirectory")
for i := len(opts) - 1; i >= 0; i-- {
// `exclude` optional argument
if !querybuilder.IsZeroValue(opts[i].Exclude) {
q = q.Arg("exclude", opts[i].Exclude)
}
// `include` optional argument
if !querybuilder.IsZeroValue(opts[i].Include) {
q = q.Arg("include", opts[i].Include)
}
// `owner` optional argument
if !querybuilder.IsZeroValue(opts[i].Owner) {
q = q.Arg("owner", opts[i].Owner)
}
}
q = q.Arg("path", path)
q = q.Arg("directory", directory)
return &Container{
q: q,
c: r.c,
}
}
// ContainerWithEntrypointOpts contains options for Container.WithEntrypoint
type ContainerWithEntrypointOpts struct {
// Don't remove the default arguments when setting the entrypoint.
KeepDefaultArgs bool
}
// Retrieves this container but with a different command entrypoint.
func (r *Container) WithEntrypoint(args []string, opts ...ContainerWithEntrypointOpts) *Container {
q := r.q.Select("withEntrypoint")
for i := len(opts) - 1; i >= 0; i-- {
// `keepDefaultArgs` optional argument
if !querybuilder.IsZeroValue(opts[i].KeepDefaultArgs) {
q = q.Arg("keepDefaultArgs", opts[i].KeepDefaultArgs)
}
}
q = q.Arg("args", args)
return &Container{
q: q,
c: r.c,
}
}
// ContainerWithEnvVariableOpts contains options for Container.WithEnvVariable
type ContainerWithEnvVariableOpts struct {
// Replace `${VAR}` or `$VAR` in the value according to the current environment variables defined in the container (e.g., "/opt/bin:$PATH").
Expand bool
}
// Retrieves this container plus the given environment variable.
func (r *Container) WithEnvVariable(name string, value string, opts ...ContainerWithEnvVariableOpts) *Container {
q := r.q.Select("withEnvVariable")
for i := len(opts) - 1; i >= 0; i-- {
// `expand` optional argument
if !querybuilder.IsZeroValue(opts[i].Expand) {
q = q.Arg("expand", opts[i].Expand)
}
}
q = q.Arg("name", name)
q = q.Arg("value", value)
return &Container{
q: q,
c: r.c,
}
}
// ContainerWithExecOpts contains options for Container.WithExec
type ContainerWithExecOpts struct {
// If the container has an entrypoint, ignore it for args rather than using it to wrap them.
SkipEntrypoint bool
// Content to write to the command's standard input before closing (e.g., "Hello world").
Stdin string
// Redirect the command's standard output to a file in the container (e.g., "/tmp/stdout").
RedirectStdout string
// Redirect the command's standard error to a file in the container (e.g., "/tmp/stderr").
RedirectStderr string
// Provides dagger access to the executed command.
//
// Do not use this option unless you trust the command being executed; the command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
ExperimentalPrivilegedNesting bool
// Execute the command with all root capabilities. This is similar to running a command with "sudo" or executing "docker run" with the "--privileged" flag. Containerization does not provide any security guarantees when using this option. It should only be used when absolutely necessary and only with trusted commands.
InsecureRootCapabilities bool
}
// Retrieves this container after executing the specified command inside it.
func (r *Container) WithExec(args []string, opts ...ContainerWithExecOpts) *Container {
q := r.q.Select("withExec")
for i := len(opts) - 1; i >= 0; i-- {
// `skipEntrypoint` optional argument
if !querybuilder.IsZeroValue(opts[i].SkipEntrypoint) {
q = q.Arg("skipEntrypoint", opts[i].SkipEntrypoint)
}
// `stdin` optional argument
if !querybuilder.IsZeroValue(opts[i].Stdin) {
q = q.Arg("stdin", opts[i].Stdin)
}
// `redirectStdout` optional argument
if !querybuilder.IsZeroValue(opts[i].RedirectStdout) {
q = q.Arg("redirectStdout", opts[i].RedirectStdout)
}
// `redirectStderr` optional argument
if !querybuilder.IsZeroValue(opts[i].RedirectStderr) {
q = q.Arg("redirectStderr", opts[i].RedirectStderr)
}
// `experimentalPrivilegedNesting` optional argument
if !querybuilder.IsZeroValue(opts[i].ExperimentalPrivilegedNesting) {
q = q.Arg("experimentalPrivilegedNesting", opts[i].ExperimentalPrivilegedNesting)
}
// `insecureRootCapabilities` optional argument
if !querybuilder.IsZeroValue(opts[i].InsecureRootCapabilities) {
q = q.Arg("insecureRootCapabilities", opts[i].InsecureRootCapabilities)
}
}
q = q.Arg("args", args)
return &Container{
q: q,
c: r.c,
}
}
// ContainerWithExposedPortOpts contains options for Container.WithExposedPort
type ContainerWithExposedPortOpts struct {
// Transport layer network protocol
Protocol NetworkProtocol
// Optional port description
Description string
}
// Expose a network port.
//
// Exposed ports serve two purposes:
//
// - For health checks and introspection, when running services
//
// - For setting the EXPOSE OCI field when publishing the container
func (r *Container) WithExposedPort(port int, opts ...ContainerWithExposedPortOpts) *Container {
q := r.q.Select("withExposedPort")
for i := len(opts) - 1; i >= 0; i-- {
// `protocol` optional argument
if !querybuilder.IsZeroValue(opts[i].Protocol) {
q = q.Arg("protocol", opts[i].Protocol)
}
// `description` optional argument
if !querybuilder.IsZeroValue(opts[i].Description) {
q = q.Arg("description", opts[i].Description)
}
}
q = q.Arg("port", port)
return &Container{
q: q,
c: r.c,
}
}
// ContainerWithFileOpts contains options for Container.WithFile
type ContainerWithFileOpts struct {
// Permission given to the copied file (e.g., 0600).
Permissions int
// A user:group to set for the file.
//
// The user and group can either be an ID (1000:1000) or a name (foo:bar).
//
// If the group is omitted, it defaults to the same as the user.
Owner string
}
// Retrieves this container plus the contents of the given file copied to the given path.
func (r *Container) WithFile(path string, source *File, opts ...ContainerWithFileOpts) *Container {
assertNotNil("source", source)
q := r.q.Select("withFile")
for i := len(opts) - 1; i >= 0; i-- {
// `permissions` optional argument
if !querybuilder.IsZeroValue(opts[i].Permissions) {
q = q.Arg("permissions", opts[i].Permissions)
}
// `owner` optional argument
if !querybuilder.IsZeroValue(opts[i].Owner) {
q = q.Arg("owner", opts[i].Owner)
}
}
q = q.Arg("path", path)
q = q.Arg("source", source)
return &Container{
q: q,
c: r.c,
}
}
// Indicate that subsequent operations should be featured more prominently in the UI.
func (r *Container) WithFocus() *Container {
q := r.q.Select("withFocus")
return &Container{
q: q,
c: r.c,
}
}
// Retrieves this container plus the given label.
func (r *Container) WithLabel(name string, value string) *Container {
q := r.q.Select("withLabel")
q = q.Arg("name", name)
q = q.Arg("value", value)
return &Container{
q: q,
c: r.c,
}
}
// ContainerWithMountedCacheOpts contains options for Container.WithMountedCache
type ContainerWithMountedCacheOpts struct {
// Identifier of the directory to use as the cache volume's root.
Source *Directory
// Sharing mode of the cache volume.
Sharing CacheSharingMode
// A user:group to set for the mounted cache directory.
//
// Note that this changes the ownership of the specified mount along with the initial filesystem provided by source (if any). It does not have any effect if/when the cache has already been created.
//
// The user and group can either be an ID (1000:1000) or a name (foo:bar).
//
// If the group is omitted, it defaults to the same as the user.
Owner string
}
// Retrieves this container plus a cache volume mounted at the given path.
func (r *Container) WithMountedCache(path string, cache *CacheVolume, opts ...ContainerWithMountedCacheOpts) *Container {
assertNotNil("cache", cache)
q := r.q.Select("withMountedCache")
for i := len(opts) - 1; i >= 0; i-- {
// `source` optional argument
if !querybuilder.IsZeroValue(opts[i].Source) {
q = q.Arg("source", opts[i].Source)
}
// `sharing` optional argument
if !querybuilder.IsZeroValue(opts[i].Sharing) {
q = q.Arg("sharing", opts[i].Sharing)
}
// `owner` optional argument
if !querybuilder.IsZeroValue(opts[i].Owner) {
q = q.Arg("owner", opts[i].Owner)
}
}
q = q.Arg("path", path)
q = q.Arg("cache", cache)
return &Container{
q: q,
c: r.c,
}
}
// ContainerWithMountedDirectoryOpts contains options for Container.WithMountedDirectory
type ContainerWithMountedDirectoryOpts struct {
// A user:group to set for the mounted directory and its contents.
//
// The user and group can either be an ID (1000:1000) or a name (foo:bar).
//
// If the group is omitted, it defaults to the same as the user.
Owner string
}
// Retrieves this container plus a directory mounted at the given path.
func (r *Container) WithMountedDirectory(path string, source *Directory, opts ...ContainerWithMountedDirectoryOpts) *Container {
assertNotNil("source", source)
q := r.q.Select("withMountedDirectory")
for i := len(opts) - 1; i >= 0; i-- {
// `owner` optional argument
if !querybuilder.IsZeroValue(opts[i].Owner) {
q = q.Arg("owner", opts[i].Owner)
}
}
q = q.Arg("path", path)
q = q.Arg("source", source)
return &Container{
q: q,
c: r.c,
}
}
// ContainerWithMountedFileOpts contains options for Container.WithMountedFile
type ContainerWithMountedFileOpts struct {
// A user or user:group to set for the mounted file.
//
// The user and group can either be an ID (1000:1000) or a name (foo:bar).
//
// If the group is omitted, it defaults to the same as the user.
Owner string
}
// Retrieves this container plus a file mounted at the given path.
func (r *Container) WithMountedFile(path string, source *File, opts ...ContainerWithMountedFileOpts) *Container {
assertNotNil("source", source)
q := r.q.Select("withMountedFile")
for i := len(opts) - 1; i >= 0; i-- {
// `owner` optional argument
if !querybuilder.IsZeroValue(opts[i].Owner) {
q = q.Arg("owner", opts[i].Owner)
}
}
q = q.Arg("path", path)
q = q.Arg("source", source)
return &Container{
q: q,
c: r.c,
}
}
// ContainerWithMountedSecretOpts contains options for Container.WithMountedSecret
type ContainerWithMountedSecretOpts struct {
// A user:group to set for the mounted secret.
//
// The user and group can either be an ID (1000:1000) or a name (foo:bar).
//
// If the group is omitted, it defaults to the same as the user.
Owner string
// Permission given to the mounted secret (e.g., 0600).
//
// This option requires an owner to be set to be active.
Mode int
}
// Retrieves this container plus a secret mounted into a file at the given path.
func (r *Container) WithMountedSecret(path string, source *Secret, opts ...ContainerWithMountedSecretOpts) *Container {
assertNotNil("source", source)
q := r.q.Select("withMountedSecret")
for i := len(opts) - 1; i >= 0; i-- {
// `owner` optional argument
if !querybuilder.IsZeroValue(opts[i].Owner) {
q = q.Arg("owner", opts[i].Owner)
}
// `mode` optional argument
if !querybuilder.IsZeroValue(opts[i].Mode) {
q = q.Arg("mode", opts[i].Mode)
}
}
q = q.Arg("path", path)
q = q.Arg("source", source)
return &Container{
q: q,
c: r.c,
}
}
// Retrieves this container plus a temporary directory mounted at the given path.
func (r *Container) WithMountedTemp(path string) *Container {
q := r.q.Select("withMountedTemp")
q = q.Arg("path", path)
return &Container{
q: q,
c: r.c,
}
}
// ContainerWithNewFileOpts contains options for Container.WithNewFile
type ContainerWithNewFileOpts struct {
// Content of the file to write (e.g., "Hello world!").
Contents string
// Permission given to the written file (e.g., 0600).
Permissions int
// A user:group to set for the file.
//
// The user and group can either be an ID (1000:1000) or a name (foo:bar).
//
// If the group is omitted, it defaults to the same as the user.
Owner string
}
// Retrieves this container plus a new file written at the given path.
func (r *Container) WithNewFile(path string, opts ...ContainerWithNewFileOpts) *Container {
q := r.q.Select("withNewFile")
for i := len(opts) - 1; i >= 0; i-- {
// `contents` optional argument
if !querybuilder.IsZeroValue(opts[i].Contents) {
q = q.Arg("contents", opts[i].Contents)
}
// `permissions` optional argument
if !querybuilder.IsZeroValue(opts[i].Permissions) {
q = q.Arg("permissions", opts[i].Permissions)
}
// `owner` optional argument
if !querybuilder.IsZeroValue(opts[i].Owner) {
q = q.Arg("owner", opts[i].Owner)
}
}
q = q.Arg("path", path)
return &Container{
q: q,
c: r.c,
}
}
// Retrieves this container with a registry authentication for a given address.
func (r *Container) WithRegistryAuth(address string, username string, secret *Secret) *Container {
assertNotNil("secret", secret)
q := r.q.Select("withRegistryAuth")
q = q.Arg("address", address)
q = q.Arg("username", username)
q = q.Arg("secret", secret)
return &Container{
q: q,
c: r.c,
}
}
// Retrieves the container with the given directory mounted to /.
func (r *Container) WithRootfs(directory *Directory) *Container {
assertNotNil("directory", directory)
q := r.q.Select("withRootfs")
q = q.Arg("directory", directory)
return &Container{
q: q,
c: r.c,
}
}
// Retrieves this container plus an env variable containing the given secret.
func (r *Container) WithSecretVariable(name string, secret *Secret) *Container {
assertNotNil("secret", secret)
q := r.q.Select("withSecretVariable")
q = q.Arg("name", name)
q = q.Arg("secret", secret)
return &Container{
q: q,
c: r.c,
}
}
// Establish a runtime dependency on a service.
//
// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
//
// The service will be reachable from the container via the provided hostname alias.
//
// The service dependency will also convey to any files or directories produced by the container.
func (r *Container) WithServiceBinding(alias string, service *Service) *Container {
assertNotNil("service", service)
q := r.q.Select("withServiceBinding")
q = q.Arg("alias", alias)
q = q.Arg("service", service)
return &Container{
q: q,
c: r.c,
}
}
// ContainerWithUnixSocketOpts contains options for Container.WithUnixSocket
type ContainerWithUnixSocketOpts struct {
// A user:group to set for the mounted socket.
//
// The user and group can either be an ID (1000:1000) or a name (foo:bar).
//
// If the group is omitted, it defaults to the same as the user.
Owner string
}
// Retrieves this container plus a socket forwarded to the given Unix socket path.
func (r *Container) WithUnixSocket(path string, source *Socket, opts ...ContainerWithUnixSocketOpts) *Container {
assertNotNil("source", source)
q := r.q.Select("withUnixSocket")
for i := len(opts) - 1; i >= 0; i-- {
// `owner` optional argument
if !querybuilder.IsZeroValue(opts[i].Owner) {
q = q.Arg("owner", opts[i].Owner)
}
}
q = q.Arg("path", path)
q = q.Arg("source", source)
return &Container{
q: q,
c: r.c,
}
}
// Retrieves this container with a different command user.
func (r *Container) WithUser(name string) *Container {
q := r.q.Select("withUser")
q = q.Arg("name", name)
return &Container{
q: q,
c: r.c,
}
}
// Retrieves this container with a different working directory.
func (r *Container) WithWorkdir(path string) *Container {
q := r.q.Select("withWorkdir")
q = q.Arg("path", path)
return &Container{
q: q,
c: r.c,
}
}
// Retrieves this container with unset default arguments for future commands.
func (r *Container) WithoutDefaultArgs() *Container {
q := r.q.Select("withoutDefaultArgs")
return &Container{
q: q,
c: r.c,
}
}
// ContainerWithoutEntrypointOpts contains options for Container.WithoutEntrypoint
type ContainerWithoutEntrypointOpts struct {
// Don't remove the default arguments when unsetting the entrypoint.
KeepDefaultArgs bool
}
// Retrieves this container with an unset command entrypoint.
func (r *Container) WithoutEntrypoint(opts ...ContainerWithoutEntrypointOpts) *Container {
q := r.q.Select("withoutEntrypoint")
for i := len(opts) - 1; i >= 0; i-- {
// `keepDefaultArgs` optional argument
if !querybuilder.IsZeroValue(opts[i].KeepDefaultArgs) {
q = q.Arg("keepDefaultArgs", opts[i].KeepDefaultArgs)
}
}
return &Container{
q: q,
c: r.c,
}
}
// Retrieves this container minus the given environment variable.
func (r *Container) WithoutEnvVariable(name string) *Container {
q := r.q.Select("withoutEnvVariable")
q = q.Arg("name", name)
return &Container{
q: q,
c: r.c,
}
}
// ContainerWithoutExposedPortOpts contains options for Container.WithoutExposedPort
type ContainerWithoutExposedPortOpts struct {
// Port protocol to unexpose
Protocol NetworkProtocol
}
// Unexpose a previously exposed port.
func (r *Container) WithoutExposedPort(port int, opts ...ContainerWithoutExposedPortOpts) *Container {
q := r.q.Select("withoutExposedPort")
for i := len(opts) - 1; i >= 0; i-- {
// `protocol` optional argument
if !querybuilder.IsZeroValue(opts[i].Protocol) {
q = q.Arg("protocol", opts[i].Protocol)
}
}
q = q.Arg("port", port)
return &Container{
q: q,
c: r.c,
}
}
// Indicate that subsequent operations should not be featured more prominently in the UI.
//
// This is the initial state of all containers.
func (r *Container) WithoutFocus() *Container {
q := r.q.Select("withoutFocus")
return &Container{
q: q,
c: r.c,
}
}
// Retrieves this container minus the given environment label.
func (r *Container) WithoutLabel(name string) *Container {
q := r.q.Select("withoutLabel")
q = q.Arg("name", name)
return &Container{
q: q,
c: r.c,
}
}
// Retrieves this container after unmounting everything at the given path.
func (r *Container) WithoutMount(path string) *Container {
q := r.q.Select("withoutMount")
q = q.Arg("path", path)
return &Container{
q: q,
c: r.c,
}
}
// Retrieves this container without the registry authentication of a given address.
func (r *Container) WithoutRegistryAuth(address string) *Container {
q := r.q.Select("withoutRegistryAuth")
q = q.Arg("address", address)
return &Container{
q: q,
c: r.c,
}
}
// Retrieves this container with a previously added Unix socket removed.
func (r *Container) WithoutUnixSocket(path string) *Container {
q := r.q.Select("withoutUnixSocket")
q = q.Arg("path", path)
return &Container{
q: q,
c: r.c,
}
}
// Retrieves this container with an unset command user.
//
// Should default to root.
func (r *Container) WithoutUser() *Container {
q := r.q.Select("withoutUser")
return &Container{
q: q,
c: r.c,
}
}
// Retrieves this container with an unset working directory.
//
// Should default to "/".
func (r *Container) WithoutWorkdir() *Container {
q := r.q.Select("withoutWorkdir")
return &Container{
q: q,
c: r.c,
}
}
// Retrieves the working directory for all commands.
func (r *Container) Workdir(ctx context.Context) (string, error) {
if r.workdir != nil {
return *r.workdir, nil
}
q := r.q.Select("workdir")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A directory.
type Directory struct {
q *querybuilder.Selection
c graphql.Client
export *bool
id *DirectoryID
sync *DirectoryID
}
type WithDirectoryFunc func(r *Directory) *Directory
// With calls the provided function with current Directory.
//
// This is useful for reusability and readability by not breaking the calling chain.
func (r *Directory) With(f WithDirectoryFunc) *Directory {
return f(r)
}
// DirectoryAsModuleOpts contains options for Directory.AsModule
type DirectoryAsModuleOpts struct {
// An optional subpath of the directory which contains the module's source code.
//
// This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
//
// If not set, the module source code is loaded from the root of the directory.
SourceSubpath string
}
// Load the directory as a Dagger module
func (r *Directory) AsModule(opts ...DirectoryAsModuleOpts) *Module {
q := r.q.Select("asModule")
for i := len(opts) - 1; i >= 0; i-- {
// `sourceSubpath` optional argument
if !querybuilder.IsZeroValue(opts[i].SourceSubpath) {
q = q.Arg("sourceSubpath", opts[i].SourceSubpath)
}
}
return &Module{
q: q,
c: r.c,
}
}
// Gets the difference between this directory and an another directory.
func (r *Directory) Diff(other *Directory) *Directory {
assertNotNil("other", other)
q := r.q.Select("diff")
q = q.Arg("other", other)
return &Directory{
q: q,
c: r.c,
}
}
// Retrieves a directory at the given path.
func (r *Directory) Directory(path string) *Directory {
q := r.q.Select("directory")
q = q.Arg("path", path)
return &Directory{
q: q,
c: r.c,
}
}
// DirectoryDockerBuildOpts contains options for Directory.DockerBuild
type DirectoryDockerBuildOpts struct {
// The platform to build.
Platform Platform
// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
Dockerfile string
// Target build stage to build.
Target string
// Build arguments to use in the build.
BuildArgs []BuildArg
// Secrets to pass to the build.
//
// They will be mounted at /run/secrets/[secret-name].
Secrets []*Secret
}
// Builds a new Docker container from this directory.
func (r *Directory) DockerBuild(opts ...DirectoryDockerBuildOpts) *Container {
q := r.q.Select("dockerBuild")
for i := len(opts) - 1; i >= 0; i-- {
// `platform` optional argument
if !querybuilder.IsZeroValue(opts[i].Platform) {
q = q.Arg("platform", opts[i].Platform)
}
// `dockerfile` optional argument
if !querybuilder.IsZeroValue(opts[i].Dockerfile) {
q = q.Arg("dockerfile", opts[i].Dockerfile)
}
// `target` optional argument
if !querybuilder.IsZeroValue(opts[i].Target) {
q = q.Arg("target", opts[i].Target)
}
// `buildArgs` optional argument
if !querybuilder.IsZeroValue(opts[i].BuildArgs) {
q = q.Arg("buildArgs", opts[i].BuildArgs)
}
// `secrets` optional argument
if !querybuilder.IsZeroValue(opts[i].Secrets) {
q = q.Arg("secrets", opts[i].Secrets)
}
}
return &Container{
q: q,
c: r.c,
}
}
// DirectoryEntriesOpts contains options for Directory.Entries
type DirectoryEntriesOpts struct {
// Location of the directory to look at (e.g., "/src").
Path string
}
// Returns a list of files and directories at the given path.
func (r *Directory) Entries(ctx context.Context, opts ...DirectoryEntriesOpts) ([]string, error) {
q := r.q.Select("entries")
for i := len(opts) - 1; i >= 0; i-- {
// `path` optional argument
if !querybuilder.IsZeroValue(opts[i].Path) {
q = q.Arg("path", opts[i].Path)
}
}
var response []string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Writes the contents of the directory to a path on the host.
func (r *Directory) Export(ctx context.Context, path string) (bool, error) {
if r.export != nil {
return *r.export, nil
}
q := r.q.Select("export")
q = q.Arg("path", path)
var response bool
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Retrieves a file at the given path.
func (r *Directory) File(path string) *File {
q := r.q.Select("file")
q = q.Arg("path", path)
return &File{
q: q,
c: r.c,
}
}
// Returns a list of files and directories that matche the given pattern.
func (r *Directory) Glob(ctx context.Context, pattern string) ([]string, error) {
q := r.q.Select("glob")
q = q.Arg("pattern", pattern)
var response []string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A unique identifier for this Directory.
func (r *Directory) ID(ctx context.Context) (DirectoryID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response DirectoryID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *Directory) XXX_GraphQLType() string {
return "Directory"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *Directory) XXX_GraphQLIDType() string {
return "DirectoryID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *Directory) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *Directory) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
// DirectoryPipelineOpts contains options for Directory.Pipeline
type DirectoryPipelineOpts struct {
// Description of the sub-pipeline.
Description string
// Labels to apply to the sub-pipeline.
Labels []PipelineLabel
}
// Creates a named sub-pipeline.
func (r *Directory) Pipeline(name string, opts ...DirectoryPipelineOpts) *Directory {
q := r.q.Select("pipeline")
for i := len(opts) - 1; i >= 0; i-- {
// `description` optional argument
if !querybuilder.IsZeroValue(opts[i].Description) {
q = q.Arg("description", opts[i].Description)
}
// `labels` optional argument
if !querybuilder.IsZeroValue(opts[i].Labels) {
q = q.Arg("labels", opts[i].Labels)
}
}
q = q.Arg("name", name)
return &Directory{
q: q,
c: r.c,
}
}
// Force evaluation in the engine.
func (r *Directory) Sync(ctx context.Context) (*Directory, error) {
q := r.q.Select("sync")
return r, q.Execute(ctx, r.c)
}
// DirectoryWithDirectoryOpts contains options for Directory.WithDirectory
type DirectoryWithDirectoryOpts struct {
// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
Exclude []string
// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
Include []string
}
// Retrieves this directory plus a directory written at the given path.
func (r *Directory) WithDirectory(path string, directory *Directory, opts ...DirectoryWithDirectoryOpts) *Directory {
assertNotNil("directory", directory)
q := r.q.Select("withDirectory")
for i := len(opts) - 1; i >= 0; i-- {
// `exclude` optional argument
if !querybuilder.IsZeroValue(opts[i].Exclude) {
q = q.Arg("exclude", opts[i].Exclude)
}
// `include` optional argument
if !querybuilder.IsZeroValue(opts[i].Include) {
q = q.Arg("include", opts[i].Include)
}
}
q = q.Arg("path", path)
q = q.Arg("directory", directory)
return &Directory{
q: q,
c: r.c,
}
}
// DirectoryWithFileOpts contains options for Directory.WithFile
type DirectoryWithFileOpts struct {
// Permission given to the copied file (e.g., 0600).
Permissions int
}
// Retrieves this directory plus the contents of the given file copied to the given path.
func (r *Directory) WithFile(path string, source *File, opts ...DirectoryWithFileOpts) *Directory {
assertNotNil("source", source)
q := r.q.Select("withFile")
for i := len(opts) - 1; i >= 0; i-- {
// `permissions` optional argument
if !querybuilder.IsZeroValue(opts[i].Permissions) {
q = q.Arg("permissions", opts[i].Permissions)
}
}
q = q.Arg("path", path)
q = q.Arg("source", source)
return &Directory{
q: q,
c: r.c,
}
}
// DirectoryWithNewDirectoryOpts contains options for Directory.WithNewDirectory
type DirectoryWithNewDirectoryOpts struct {
// Permission granted to the created directory (e.g., 0777).
Permissions int
}
// Retrieves this directory plus a new directory created at the given path.
func (r *Directory) WithNewDirectory(path string, opts ...DirectoryWithNewDirectoryOpts) *Directory {
q := r.q.Select("withNewDirectory")
for i := len(opts) - 1; i >= 0; i-- {
// `permissions` optional argument
if !querybuilder.IsZeroValue(opts[i].Permissions) {
q = q.Arg("permissions", opts[i].Permissions)
}
}
q = q.Arg("path", path)
return &Directory{
q: q,
c: r.c,
}
}
// DirectoryWithNewFileOpts contains options for Directory.WithNewFile
type DirectoryWithNewFileOpts struct {
// Permission given to the copied file (e.g., 0600).
Permissions int
}
// Retrieves this directory plus a new file written at the given path.
func (r *Directory) WithNewFile(path string, contents string, opts ...DirectoryWithNewFileOpts) *Directory {
q := r.q.Select("withNewFile")
for i := len(opts) - 1; i >= 0; i-- {
// `permissions` optional argument
if !querybuilder.IsZeroValue(opts[i].Permissions) {
q = q.Arg("permissions", opts[i].Permissions)
}
}
q = q.Arg("path", path)
q = q.Arg("contents", contents)
return &Directory{
q: q,
c: r.c,
}
}
// Retrieves this directory with all file/dir timestamps set to the given time.
func (r *Directory) WithTimestamps(timestamp int) *Directory {
q := r.q.Select("withTimestamps")
q = q.Arg("timestamp", timestamp)
return &Directory{
q: q,
c: r.c,
}
}
// Retrieves this directory with the directory at the given path removed.
func (r *Directory) WithoutDirectory(path string) *Directory {
q := r.q.Select("withoutDirectory")
q = q.Arg("path", path)
return &Directory{
q: q,
c: r.c,
}
}
// Retrieves this directory with the file at the given path removed.
func (r *Directory) WithoutFile(path string) *Directory {
q := r.q.Select("withoutFile")
q = q.Arg("path", path)
return &Directory{
q: q,
c: r.c,
}
}
// An environment variable name and value.
type EnvVariable struct {
q *querybuilder.Selection
c graphql.Client
id *EnvVariableID
name *string
value *string
}
// A unique identifier for this EnvVariable.
func (r *EnvVariable) ID(ctx context.Context) (EnvVariableID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response EnvVariableID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *EnvVariable) XXX_GraphQLType() string {
return "EnvVariable"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *EnvVariable) XXX_GraphQLIDType() string {
return "EnvVariableID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *EnvVariable) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *EnvVariable) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
func (r *EnvVariable) Name(ctx context.Context) (string, error) {
if r.name != nil {
return *r.name, nil
}
q := r.q.Select("name")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *EnvVariable) Value(ctx context.Context) (string, error) {
if r.value != nil {
return *r.value, nil
}
q := r.q.Select("value")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A definition of a field on a custom object defined in a Module.
//
// A field on an object has a static value, as opposed to a function on an object whose value is computed by invoking code (and can accept arguments).
type FieldTypeDef struct {
q *querybuilder.Selection
c graphql.Client
description *string
id *FieldTypeDefID
name *string
}
func (r *FieldTypeDef) Description(ctx context.Context) (string, error) {
if r.description != nil {
return *r.description, nil
}
q := r.q.Select("description")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A unique identifier for this FieldTypeDef.
func (r *FieldTypeDef) ID(ctx context.Context) (FieldTypeDefID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response FieldTypeDefID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *FieldTypeDef) XXX_GraphQLType() string {
return "FieldTypeDef"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *FieldTypeDef) XXX_GraphQLIDType() string {
return "FieldTypeDefID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *FieldTypeDef) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *FieldTypeDef) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
func (r *FieldTypeDef) Name(ctx context.Context) (string, error) {
if r.name != nil {
return *r.name, nil
}
q := r.q.Select("name")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *FieldTypeDef) TypeDef() *TypeDef {
q := r.q.Select("typeDef")
return &TypeDef{
q: q,
c: r.c,
}
}
// A file.
type File struct {
q *querybuilder.Selection
c graphql.Client
contents *string
export *bool
id *FileID
size *int
sync *FileID
}
type WithFileFunc func(r *File) *File
// With calls the provided function with current File.
//
// This is useful for reusability and readability by not breaking the calling chain.
func (r *File) With(f WithFileFunc) *File {
return f(r)
}
// Retrieves the contents of the file.
func (r *File) Contents(ctx context.Context) (string, error) {
if r.contents != nil {
return *r.contents, nil
}
q := r.q.Select("contents")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// FileExportOpts contains options for File.Export
type FileExportOpts struct {
// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
AllowParentDirPath bool
}
// Writes the file to a file path on the host.
func (r *File) Export(ctx context.Context, path string, opts ...FileExportOpts) (bool, error) {
if r.export != nil {
return *r.export, nil
}
q := r.q.Select("export")
for i := len(opts) - 1; i >= 0; i-- {
// `allowParentDirPath` optional argument
if !querybuilder.IsZeroValue(opts[i].AllowParentDirPath) {
q = q.Arg("allowParentDirPath", opts[i].AllowParentDirPath)
}
}
q = q.Arg("path", path)
var response bool
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A unique identifier for this File.
func (r *File) ID(ctx context.Context) (FileID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response FileID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *File) XXX_GraphQLType() string {
return "File"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *File) XXX_GraphQLIDType() string {
return "FileID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *File) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *File) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
// Retrieves the size of the file, in bytes.
func (r *File) Size(ctx context.Context) (int, error) {
if r.size != nil {
return *r.size, nil
}
q := r.q.Select("size")
var response int
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Force evaluation in the engine.
func (r *File) Sync(ctx context.Context) (*File, error) {
q := r.q.Select("sync")
return r, q.Execute(ctx, r.c)
}
// Retrieves this file with its created/modified timestamps set to the given time.
func (r *File) WithTimestamps(timestamp int) *File {
q := r.q.Select("withTimestamps")
q = q.Arg("timestamp", timestamp)
return &File{
q: q,
c: r.c,
}
}
// Function represents a resolver provided by a Module.
//
// A function always evaluates against a parent object and is given a set of named arguments.
type Function struct {
q *querybuilder.Selection
c graphql.Client
description *string
id *FunctionID
name *string
}
type WithFunctionFunc func(r *Function) *Function
// With calls the provided function with current Function.
//
// This is useful for reusability and readability by not breaking the calling chain.
func (r *Function) With(f WithFunctionFunc) *Function {
return f(r)
}
func (r *Function) Args(ctx context.Context) ([]FunctionArg, error) {
q := r.q.Select("args")
q = q.Select("id")
type args struct {
Id FunctionArgID
}
convert := func(fields []args) []FunctionArg {
out := []FunctionArg{}
for i := range fields {
val := FunctionArg{id: &fields[i].Id}
val.q = querybuilder.Query().Select("loadFunctionArgFromID").Arg("id", fields[i].Id)
val.c = r.c
out = append(out, val)
}
return out
}
var response []args
q = q.Bind(&response)
err := q.Execute(ctx, r.c)
if err != nil {
return nil, err
}
return convert(response), nil
}
func (r *Function) Description(ctx context.Context) (string, error) {
if r.description != nil {
return *r.description, nil
}
q := r.q.Select("description")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A unique identifier for this Function.
func (r *Function) ID(ctx context.Context) (FunctionID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response FunctionID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *Function) XXX_GraphQLType() string {
return "Function"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *Function) XXX_GraphQLIDType() string {
return "FunctionID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *Function) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *Function) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
func (r *Function) Name(ctx context.Context) (string, error) {
if r.name != nil {
return *r.name, nil
}
q := r.q.Select("name")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *Function) ReturnType() *TypeDef {
q := r.q.Select("returnType")
return &TypeDef{
q: q,
c: r.c,
}
}
// FunctionWithArgOpts contains options for Function.WithArg
type FunctionWithArgOpts struct {
// A doc string for the argument, if any
Description string
// A default value to use for this argument if not explicitly set by the caller, if any
DefaultValue JSON
}
// Returns the function with the provided argument
func (r *Function) WithArg(name string, typeDef *TypeDef, opts ...FunctionWithArgOpts) *Function {
assertNotNil("typeDef", typeDef)
q := r.q.Select("withArg")
for i := len(opts) - 1; i >= 0; i-- {
// `description` optional argument
if !querybuilder.IsZeroValue(opts[i].Description) {
q = q.Arg("description", opts[i].Description)
}
// `defaultValue` optional argument
if !querybuilder.IsZeroValue(opts[i].DefaultValue) {
q = q.Arg("defaultValue", opts[i].DefaultValue)
}
}
q = q.Arg("name", name)
q = q.Arg("typeDef", typeDef)
return &Function{
q: q,
c: r.c,
}
}
// Returns the function with the given doc string.
func (r *Function) WithDescription(description string) *Function {
q := r.q.Select("withDescription")
q = q.Arg("description", description)
return &Function{
q: q,
c: r.c,
}
}
// An argument accepted by a function.
//
// This is a specification for an argument at function definition time, not an argument passed at function call time.
type FunctionArg struct {
q *querybuilder.Selection
c graphql.Client
defaultValue *JSON
description *string
id *FunctionArgID
name *string
}
func (r *FunctionArg) DefaultValue(ctx context.Context) (JSON, error) {
if r.defaultValue != nil {
return *r.defaultValue, nil
}
q := r.q.Select("defaultValue")
var response JSON
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *FunctionArg) Description(ctx context.Context) (string, error) {
if r.description != nil {
return *r.description, nil
}
q := r.q.Select("description")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A unique identifier for this FunctionArg.
func (r *FunctionArg) ID(ctx context.Context) (FunctionArgID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response FunctionArgID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *FunctionArg) XXX_GraphQLType() string {
return "FunctionArg"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *FunctionArg) XXX_GraphQLIDType() string {
return "FunctionArgID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *FunctionArg) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *FunctionArg) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
func (r *FunctionArg) Name(ctx context.Context) (string, error) {
if r.name != nil {
return *r.name, nil
}
q := r.q.Select("name")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *FunctionArg) TypeDef() *TypeDef {
q := r.q.Select("typeDef")
return &TypeDef{
q: q,
c: r.c,
}
}
// An active function call.
type FunctionCall struct {
q *querybuilder.Selection
c graphql.Client
id *FunctionCallID
name *string
parent *JSON
parentName *string
returnValue *Void
}
// A unique identifier for this FunctionCall.
func (r *FunctionCall) ID(ctx context.Context) (FunctionCallID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response FunctionCallID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *FunctionCall) XXX_GraphQLType() string {
return "FunctionCall"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *FunctionCall) XXX_GraphQLIDType() string {
return "FunctionCallID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *FunctionCall) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *FunctionCall) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
func (r *FunctionCall) InputArgs(ctx context.Context) ([]FunctionCallArgValue, error) {
q := r.q.Select("inputArgs")
q = q.Select("id")
type inputArgs struct {
Id FunctionCallArgValueID
}
convert := func(fields []inputArgs) []FunctionCallArgValue {
out := []FunctionCallArgValue{}
for i := range fields {
val := FunctionCallArgValue{id: &fields[i].Id}
val.q = querybuilder.Query().Select("loadFunctionCallArgValueFromID").Arg("id", fields[i].Id)
val.c = r.c
out = append(out, val)
}
return out
}
var response []inputArgs
q = q.Bind(&response)
err := q.Execute(ctx, r.c)
if err != nil {
return nil, err
}
return convert(response), nil
}
func (r *FunctionCall) Name(ctx context.Context) (string, error) {
if r.name != nil {
return *r.name, nil
}
q := r.q.Select("name")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *FunctionCall) Parent(ctx context.Context) (JSON, error) {
if r.parent != nil {
return *r.parent, nil
}
q := r.q.Select("parent")
var response JSON
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *FunctionCall) ParentName(ctx context.Context) (string, error) {
if r.parentName != nil {
return *r.parentName, nil
}
q := r.q.Select("parentName")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Set the return value of the function call to the provided value.
func (r *FunctionCall) ReturnValue(ctx context.Context, value JSON) (Void, error) {
if r.returnValue != nil {
return *r.returnValue, nil
}
q := r.q.Select("returnValue")
q = q.Arg("value", value)
var response Void
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A value passed as a named argument to a function call.
type FunctionCallArgValue struct {
q *querybuilder.Selection
c graphql.Client
id *FunctionCallArgValueID
name *string
value *JSON
}
// A unique identifier for this FunctionCallArgValue.
func (r *FunctionCallArgValue) ID(ctx context.Context) (FunctionCallArgValueID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response FunctionCallArgValueID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *FunctionCallArgValue) XXX_GraphQLType() string {
return "FunctionCallArgValue"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *FunctionCallArgValue) XXX_GraphQLIDType() string {
return "FunctionCallArgValueID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *FunctionCallArgValue) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *FunctionCallArgValue) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
func (r *FunctionCallArgValue) Name(ctx context.Context) (string, error) {
if r.name != nil {
return *r.name, nil
}
q := r.q.Select("name")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *FunctionCallArgValue) Value(ctx context.Context) (JSON, error) {
if r.value != nil {
return *r.value, nil
}
q := r.q.Select("value")
var response JSON
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// The result of running an SDK's codegen.
type GeneratedCode struct {
q *querybuilder.Selection
c graphql.Client
id *GeneratedCodeID
}
type WithGeneratedCodeFunc func(r *GeneratedCode) *GeneratedCode
// With calls the provided function with current GeneratedCode.
//
// This is useful for reusability and readability by not breaking the calling chain.
func (r *GeneratedCode) With(f WithGeneratedCodeFunc) *GeneratedCode {
return f(r)
}
func (r *GeneratedCode) Code() *Directory {
q := r.q.Select("code")
return &Directory{
q: q,
c: r.c,
}
}
// A unique identifier for this GeneratedCode.
func (r *GeneratedCode) ID(ctx context.Context) (GeneratedCodeID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response GeneratedCodeID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *GeneratedCode) XXX_GraphQLType() string {
return "GeneratedCode"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *GeneratedCode) XXX_GraphQLIDType() string {
return "GeneratedCodeID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *GeneratedCode) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *GeneratedCode) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
func (r *GeneratedCode) VcsGeneratedPaths(ctx context.Context) ([]string, error) {
q := r.q.Select("vcsGeneratedPaths")
var response []string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *GeneratedCode) VcsIgnoredPaths(ctx context.Context) ([]string, error) {
q := r.q.Select("vcsIgnoredPaths")
var response []string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Set the list of paths to mark generated in version control.
func (r *GeneratedCode) WithVCSGeneratedPaths(paths []string) *GeneratedCode {
q := r.q.Select("withVCSGeneratedPaths")
q = q.Arg("paths", paths)
return &GeneratedCode{
q: q,
c: r.c,
}
}
// Set the list of paths to ignore in version control.
func (r *GeneratedCode) WithVCSIgnoredPaths(paths []string) *GeneratedCode {
q := r.q.Select("withVCSIgnoredPaths")
q = q.Arg("paths", paths)
return &GeneratedCode{
q: q,
c: r.c,
}
}
// A git ref (tag, branch, or commit).
type GitRef struct {
q *querybuilder.Selection
c graphql.Client
commit *string
id *GitRefID
}
// The resolved commit id at this ref.
func (r *GitRef) Commit(ctx context.Context) (string, error) {
if r.commit != nil {
return *r.commit, nil
}
q := r.q.Select("commit")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A unique identifier for this GitRef.
func (r *GitRef) ID(ctx context.Context) (GitRefID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response GitRefID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *GitRef) XXX_GraphQLType() string {
return "GitRef"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *GitRef) XXX_GraphQLIDType() string {
return "GitRefID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *GitRef) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *GitRef) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
// GitRefTreeOpts contains options for GitRef.Tree
type GitRefTreeOpts struct {
SSHKnownHosts string
SSHAuthSocket *Socket
}
// The filesystem tree at this ref.
func (r *GitRef) Tree(opts ...GitRefTreeOpts) *Directory {
q := r.q.Select("tree")
for i := len(opts) - 1; i >= 0; i-- {
// `sshKnownHosts` optional argument
if !querybuilder.IsZeroValue(opts[i].SSHKnownHosts) {
q = q.Arg("sshKnownHosts", opts[i].SSHKnownHosts)
}
// `sshAuthSocket` optional argument
if !querybuilder.IsZeroValue(opts[i].SSHAuthSocket) {
q = q.Arg("sshAuthSocket", opts[i].SSHAuthSocket)
}
}
return &Directory{
q: q,
c: r.c,
}
}
// A git repository.
type GitRepository struct {
q *querybuilder.Selection
c graphql.Client
id *GitRepositoryID
}
// Returns details of a branch.
func (r *GitRepository) Branch(name string) *GitRef {
q := r.q.Select("branch")
q = q.Arg("name", name)
return &GitRef{
q: q,
c: r.c,
}
}
// Returns details of a commit.
func (r *GitRepository) Commit(id string) *GitRef {
q := r.q.Select("commit")
q = q.Arg("id", id)
return &GitRef{
q: q,
c: r.c,
}
}
// A unique identifier for this GitRepository.
func (r *GitRepository) ID(ctx context.Context) (GitRepositoryID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response GitRepositoryID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *GitRepository) XXX_GraphQLType() string {
return "GitRepository"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *GitRepository) XXX_GraphQLIDType() string {
return "GitRepositoryID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *GitRepository) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *GitRepository) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
// Returns details of a tag.
func (r *GitRepository) Tag(name string) *GitRef {
q := r.q.Select("tag")
q = q.Arg("name", name)
return &GitRef{
q: q,
c: r.c,
}
}
// Information about the host environment.
type Host struct {
q *querybuilder.Selection
c graphql.Client
id *HostID
}
// HostDirectoryOpts contains options for Host.Directory
type HostDirectoryOpts struct {
// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
Exclude []string
// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
Include []string
}
// Accesses a directory on the host.
func (r *Host) Directory(path string, opts ...HostDirectoryOpts) *Directory {
q := r.q.Select("directory")
for i := len(opts) - 1; i >= 0; i-- {
// `exclude` optional argument
if !querybuilder.IsZeroValue(opts[i].Exclude) {
q = q.Arg("exclude", opts[i].Exclude)
}
// `include` optional argument
if !querybuilder.IsZeroValue(opts[i].Include) {
q = q.Arg("include", opts[i].Include)
}
}
q = q.Arg("path", path)
return &Directory{
q: q,
c: r.c,
}
}
// Accesses a file on the host.
func (r *Host) File(path string) *File {
q := r.q.Select("file")
q = q.Arg("path", path)
return &File{
q: q,
c: r.c,
}
}
// A unique identifier for this Host.
func (r *Host) ID(ctx context.Context) (HostID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response HostID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *Host) XXX_GraphQLType() string {
return "Host"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *Host) XXX_GraphQLIDType() string {
return "HostID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *Host) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *Host) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
// HostServiceOpts contains options for Host.Service
type HostServiceOpts struct {
// Upstream host to forward traffic to.
Host string
}
// Creates a service that forwards traffic to a specified address via the host.
func (r *Host) Service(ports []PortForward, opts ...HostServiceOpts) *Service {
q := r.q.Select("service")
for i := len(opts) - 1; i >= 0; i-- {
// `host` optional argument
if !querybuilder.IsZeroValue(opts[i].Host) {
q = q.Arg("host", opts[i].Host)
}
}
q = q.Arg("ports", ports)
return &Service{
q: q,
c: r.c,
}
}
// Sets a secret given a user-defined name and the file path on the host, and returns the secret.
//
// The file is limited to a size of 512000 bytes.
func (r *Host) SetSecretFile(name string, path string) *Secret {
q := r.q.Select("setSecretFile")
q = q.Arg("name", name)
q = q.Arg("path", path)
return &Secret{
q: q,
c: r.c,
}
}
// HostTunnelOpts contains options for Host.Tunnel
type HostTunnelOpts struct {
// Configure explicit port forwarding rules for the tunnel.
//
// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
//
// If no ports are given, all of the service's ports are forwarded. If native is true, each port maps to the same port on the host. If native is false, each port maps to a random port chosen by the host.
//
// If ports are given and native is true, the ports are additive.
Ports []PortForward
// Map each service port to the same port on the host, as if the service were running natively.
//
// Note: enabling may result in port conflicts.
Native bool
}
// Creates a tunnel that forwards traffic from the host to a service.
func (r *Host) Tunnel(service *Service, opts ...HostTunnelOpts) *Service {
assertNotNil("service", service)
q := r.q.Select("tunnel")
for i := len(opts) - 1; i >= 0; i-- {
// `ports` optional argument
if !querybuilder.IsZeroValue(opts[i].Ports) {
q = q.Arg("ports", opts[i].Ports)
}
// `native` optional argument
if !querybuilder.IsZeroValue(opts[i].Native) {
q = q.Arg("native", opts[i].Native)
}
}
q = q.Arg("service", service)
return &Service{
q: q,
c: r.c,
}
}
// Accesses a Unix socket on the host.
func (r *Host) UnixSocket(path string) *Socket {
q := r.q.Select("unixSocket")
q = q.Arg("path", path)
return &Socket{
q: q,
c: r.c,
}
}
// A definition of a custom interface defined in a Module.
type InterfaceTypeDef struct {
q *querybuilder.Selection
c graphql.Client
description *string
id *InterfaceTypeDefID
name *string
sourceModuleName *string
}
func (r *InterfaceTypeDef) Description(ctx context.Context) (string, error) {
if r.description != nil {
return *r.description, nil
}
q := r.q.Select("description")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *InterfaceTypeDef) Functions(ctx context.Context) ([]Function, error) {
q := r.q.Select("functions")
q = q.Select("id")
type functions struct {
Id FunctionID
}
convert := func(fields []functions) []Function {
out := []Function{}
for i := range fields {
val := Function{id: &fields[i].Id}
val.q = querybuilder.Query().Select("loadFunctionFromID").Arg("id", fields[i].Id)
val.c = r.c
out = append(out, val)
}
return out
}
var response []functions
q = q.Bind(&response)
err := q.Execute(ctx, r.c)
if err != nil {
return nil, err
}
return convert(response), nil
}
// A unique identifier for this InterfaceTypeDef.
func (r *InterfaceTypeDef) ID(ctx context.Context) (InterfaceTypeDefID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response InterfaceTypeDefID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *InterfaceTypeDef) XXX_GraphQLType() string {
return "InterfaceTypeDef"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *InterfaceTypeDef) XXX_GraphQLIDType() string {
return "InterfaceTypeDefID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *InterfaceTypeDef) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *InterfaceTypeDef) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
func (r *InterfaceTypeDef) Name(ctx context.Context) (string, error) {
if r.name != nil {
return *r.name, nil
}
q := r.q.Select("name")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *InterfaceTypeDef) SourceModuleName(ctx context.Context) (string, error) {
if r.sourceModuleName != nil {
return *r.sourceModuleName, nil
}
q := r.q.Select("sourceModuleName")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A simple key value object that represents a label.
type Label struct {
q *querybuilder.Selection
c graphql.Client
id *LabelID
name *string
value *string
}
// A unique identifier for this Label.
func (r *Label) ID(ctx context.Context) (LabelID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response LabelID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *Label) XXX_GraphQLType() string {
return "Label"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *Label) XXX_GraphQLIDType() string {
return "LabelID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *Label) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *Label) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
func (r *Label) Name(ctx context.Context) (string, error) {
if r.name != nil {
return *r.name, nil
}
q := r.q.Select("name")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *Label) Value(ctx context.Context) (string, error) {
if r.value != nil {
return *r.value, nil
}
q := r.q.Select("value")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A definition of a list type in a Module.
type ListTypeDef struct {
q *querybuilder.Selection
c graphql.Client
id *ListTypeDefID
}
func (r *ListTypeDef) ElementTypeDef() *TypeDef {
q := r.q.Select("elementTypeDef")
return &TypeDef{
q: q,
c: r.c,
}
}
// A unique identifier for this ListTypeDef.
func (r *ListTypeDef) ID(ctx context.Context) (ListTypeDefID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response ListTypeDefID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *ListTypeDef) XXX_GraphQLType() string {
return "ListTypeDef"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *ListTypeDef) XXX_GraphQLIDType() string {
return "ListTypeDefID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *ListTypeDef) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *ListTypeDef) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
// A Dagger module.
type Module struct {
q *querybuilder.Selection
c graphql.Client
description *string
id *ModuleID
name *string
sdk *string
serve *Void
sourceDirectorySubpath *string
}
type WithModuleFunc func(r *Module) *Module
// With calls the provided function with current Module.
//
// This is useful for reusability and readability by not breaking the calling chain.
func (r *Module) With(f WithModuleFunc) *Module {
return f(r)
}
func (r *Module) Dependencies(ctx context.Context) ([]Module, error) {
q := r.q.Select("dependencies")
q = q.Select("id")
type dependencies struct {
Id ModuleID
}
convert := func(fields []dependencies) []Module {
out := []Module{}
for i := range fields {
val := Module{id: &fields[i].Id}
val.q = querybuilder.Query().Select("loadModuleFromID").Arg("id", fields[i].Id)
val.c = r.c
out = append(out, val)
}
return out
}
var response []dependencies
q = q.Bind(&response)
err := q.Execute(ctx, r.c)
if err != nil {
return nil, err
}
return convert(response), nil
}
func (r *Module) DependencyConfig(ctx context.Context) ([]string, error) {
q := r.q.Select("dependencyConfig")
var response []string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *Module) Description(ctx context.Context) (string, error) {
if r.description != nil {
return *r.description, nil
}
q := r.q.Select("description")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *Module) GeneratedCode() *GeneratedCode {
q := r.q.Select("generatedCode")
return &GeneratedCode{
q: q,
c: r.c,
}
}
// A unique identifier for this Module.
func (r *Module) ID(ctx context.Context) (ModuleID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response ModuleID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *Module) XXX_GraphQLType() string {
return "Module"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *Module) XXX_GraphQLIDType() string {
return "ModuleID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *Module) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *Module) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
// Retrieves the module with the objects loaded via its SDK.
func (r *Module) Initialize() *Module {
q := r.q.Select("initialize")
return &Module{
q: q,
c: r.c,
}
}
func (r *Module) Interfaces(ctx context.Context) ([]TypeDef, error) {
q := r.q.Select("interfaces")
q = q.Select("id")
type interfaces struct {
Id TypeDefID
}
convert := func(fields []interfaces) []TypeDef {
out := []TypeDef{}
for i := range fields {
val := TypeDef{id: &fields[i].Id}
val.q = querybuilder.Query().Select("loadTypeDefFromID").Arg("id", fields[i].Id)
val.c = r.c
out = append(out, val)
}
return out
}
var response []interfaces
q = q.Bind(&response)
err := q.Execute(ctx, r.c)
if err != nil {
return nil, err
}
return convert(response), nil
}
func (r *Module) Name(ctx context.Context) (string, error) {
if r.name != nil {
return *r.name, nil
}
q := r.q.Select("name")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *Module) Objects(ctx context.Context) ([]TypeDef, error) {
q := r.q.Select("objects")
q = q.Select("id")
type objects struct {
Id TypeDefID
}
convert := func(fields []objects) []TypeDef {
out := []TypeDef{}
for i := range fields {
val := TypeDef{id: &fields[i].Id}
val.q = querybuilder.Query().Select("loadTypeDefFromID").Arg("id", fields[i].Id)
val.c = r.c
out = append(out, val)
}
return out
}
var response []objects
q = q.Bind(&response)
err := q.Execute(ctx, r.c)
if err != nil {
return nil, err
}
return convert(response), nil
}
func (r *Module) SDK(ctx context.Context) (string, error) {
if r.sdk != nil {
return *r.sdk, nil
}
q := r.q.Select("sdk")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Serve a module's API in the current session.
//
// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
func (r *Module) Serve(ctx context.Context) (Void, error) {
if r.serve != nil {
return *r.serve, nil
}
q := r.q.Select("serve")
var response Void
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *Module) SourceDirectory() *Directory {
q := r.q.Select("sourceDirectory")
return &Directory{
q: q,
c: r.c,
}
}
func (r *Module) SourceDirectorySubpath(ctx context.Context) (string, error) {
if r.sourceDirectorySubpath != nil {
return *r.sourceDirectorySubpath, nil
}
q := r.q.Select("sourceDirectorySubpath")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// This module plus the given Interface type and associated functions
func (r *Module) WithInterface(iface *TypeDef) *Module {
assertNotNil("iface", iface)
q := r.q.Select("withInterface")
q = q.Arg("iface", iface)
return &Module{
q: q,
c: r.c,
}
}
// This module plus the given Object type and associated functions.
func (r *Module) WithObject(object *TypeDef) *Module {
assertNotNil("object", object)
q := r.q.Select("withObject")
q = q.Arg("object", object)
return &Module{
q: q,
c: r.c,
}
}
// ModuleWithSourceOpts contains options for Module.WithSource
type ModuleWithSourceOpts struct {
// An optional subpath of the directory which contains the module's source code.
//
// This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
//
// If not set, the module source code is loaded from the root of the directory.
Subpath string
}
// Retrieves the module with basic configuration loaded, ready for initialization.
func (r *Module) WithSource(directory *Directory, opts ...ModuleWithSourceOpts) *Module {
assertNotNil("directory", directory)
q := r.q.Select("withSource")
for i := len(opts) - 1; i >= 0; i-- {
// `subpath` optional argument
if !querybuilder.IsZeroValue(opts[i].Subpath) {
q = q.Arg("subpath", opts[i].Subpath)
}
}
q = q.Arg("directory", directory)
return &Module{
q: q,
c: r.c,
}
}
// Static configuration for a module (e.g. parsed contents of dagger.json)
type ModuleConfig struct {
q *querybuilder.Selection
c graphql.Client
id *ModuleConfigID
name *string
root *string
sdk *string
}
func (r *ModuleConfig) Dependencies(ctx context.Context) ([]string, error) {
q := r.q.Select("dependencies")
var response []string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *ModuleConfig) Exclude(ctx context.Context) ([]string, error) {
q := r.q.Select("exclude")
var response []string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A unique identifier for this ModuleConfig.
func (r *ModuleConfig) ID(ctx context.Context) (ModuleConfigID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response ModuleConfigID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *ModuleConfig) XXX_GraphQLType() string {
return "ModuleConfig"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *ModuleConfig) XXX_GraphQLIDType() string {
return "ModuleConfigID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *ModuleConfig) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *ModuleConfig) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
func (r *ModuleConfig) Include(ctx context.Context) ([]string, error) {
q := r.q.Select("include")
var response []string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *ModuleConfig) Name(ctx context.Context) (string, error) {
if r.name != nil {
return *r.name, nil
}
q := r.q.Select("name")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *ModuleConfig) Root(ctx context.Context) (string, error) {
if r.root != nil {
return *r.root, nil
}
q := r.q.Select("root")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *ModuleConfig) SDK(ctx context.Context) (string, error) {
if r.sdk != nil {
return *r.sdk, nil
}
q := r.q.Select("sdk")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A definition of a custom object defined in a Module.
type ObjectTypeDef struct {
q *querybuilder.Selection
c graphql.Client
description *string
id *ObjectTypeDefID
name *string
sourceModuleName *string
}
func (r *ObjectTypeDef) Constructor() *Function {
q := r.q.Select("constructor")
return &Function{
q: q,
c: r.c,
}
}
func (r *ObjectTypeDef) Description(ctx context.Context) (string, error) {
if r.description != nil {
return *r.description, nil
}
q := r.q.Select("description")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *ObjectTypeDef) Fields(ctx context.Context) ([]FieldTypeDef, error) {
q := r.q.Select("fields")
q = q.Select("id")
type fields struct {
Id FieldTypeDefID
}
convert := func(fields []fields) []FieldTypeDef {
out := []FieldTypeDef{}
for i := range fields {
val := FieldTypeDef{id: &fields[i].Id}
val.q = querybuilder.Query().Select("loadFieldTypeDefFromID").Arg("id", fields[i].Id)
val.c = r.c
out = append(out, val)
}
return out
}
var response []fields
q = q.Bind(&response)
err := q.Execute(ctx, r.c)
if err != nil {
return nil, err
}
return convert(response), nil
}
func (r *ObjectTypeDef) Functions(ctx context.Context) ([]Function, error) {
q := r.q.Select("functions")
q = q.Select("id")
type functions struct {
Id FunctionID
}
convert := func(fields []functions) []Function {
out := []Function{}
for i := range fields {
val := Function{id: &fields[i].Id}
val.q = querybuilder.Query().Select("loadFunctionFromID").Arg("id", fields[i].Id)
val.c = r.c
out = append(out, val)
}
return out
}
var response []functions
q = q.Bind(&response)
err := q.Execute(ctx, r.c)
if err != nil {
return nil, err
}
return convert(response), nil
}
// A unique identifier for this ObjectTypeDef.
func (r *ObjectTypeDef) ID(ctx context.Context) (ObjectTypeDefID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response ObjectTypeDefID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *ObjectTypeDef) XXX_GraphQLType() string {
return "ObjectTypeDef"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *ObjectTypeDef) XXX_GraphQLIDType() string {
return "ObjectTypeDefID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *ObjectTypeDef) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *ObjectTypeDef) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
func (r *ObjectTypeDef) Name(ctx context.Context) (string, error) {
if r.name != nil {
return *r.name, nil
}
q := r.q.Select("name")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *ObjectTypeDef) SourceModuleName(ctx context.Context) (string, error) {
if r.sourceModuleName != nil {
return *r.sourceModuleName, nil
}
q := r.q.Select("sourceModuleName")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A port exposed by a container.
type Port struct {
q *querybuilder.Selection
c graphql.Client
description *string
id *PortID
port *int
protocol *NetworkProtocol
}
func (r *Port) Description(ctx context.Context) (string, error) {
if r.description != nil {
return *r.description, nil
}
q := r.q.Select("description")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A unique identifier for this Port.
func (r *Port) ID(ctx context.Context) (PortID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response PortID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *Port) XXX_GraphQLType() string {
return "Port"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *Port) XXX_GraphQLIDType() string {
return "PortID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *Port) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *Port) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
func (r *Port) Port(ctx context.Context) (int, error) {
if r.port != nil {
return *r.port, nil
}
q := r.q.Select("port")
var response int
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *Port) Protocol(ctx context.Context) (NetworkProtocol, error) {
if r.protocol != nil {
return *r.protocol, nil
}
q := r.q.Select("protocol")
var response NetworkProtocol
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
type WithClientFunc func(r *Client) *Client
// With calls the provided function with current Client.
//
// This is useful for reusability and readability by not breaking the calling chain.
func (r *Client) With(f WithClientFunc) *Client {
return f(r)
}
// Retrieves a content-addressed blob.
func (r *Client) Blob(digest string, size int, mediaType string, uncompressed string) *Directory {
q := r.q.Select("blob")
q = q.Arg("digest", digest)
q = q.Arg("size", size)
q = q.Arg("mediaType", mediaType)
q = q.Arg("uncompressed", uncompressed)
return &Directory{
q: q,
c: r.c,
}
}
// Constructs a cache volume for a given cache key.
func (r *Client) CacheVolume(key string) *CacheVolume {
q := r.q.Select("cacheVolume")
q = q.Arg("key", key)
return &CacheVolume{
q: q,
c: r.c,
}
}
// Checks if the current Dagger Engine is compatible with an SDK's required version.
func (r *Client) CheckVersionCompatibility(ctx context.Context, version string) (bool, error) {
q := r.q.Select("checkVersionCompatibility")
q = q.Arg("version", version)
var response bool
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// ContainerOpts contains options for Client.Container
type ContainerOpts struct {
ID ContainerID
// Platform to initialize the container with.
Platform Platform
}
// Creates a scratch container.
//
// Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
func (r *Client) Container(opts ...ContainerOpts) *Container {
q := r.q.Select("container")
for i := len(opts) - 1; i >= 0; i-- {
// `id` optional argument
if !querybuilder.IsZeroValue(opts[i].ID) {
q = q.Arg("id", opts[i].ID)
}
// `platform` optional argument
if !querybuilder.IsZeroValue(opts[i].Platform) {
q = q.Arg("platform", opts[i].Platform)
}
}
return &Container{
q: q,
c: r.c,
}
}
// The FunctionCall context that the SDK caller is currently executing in.
//
// If the caller is not currently executing in a function, this will return an error.
func (r *Client) CurrentFunctionCall() *FunctionCall {
q := r.q.Select("currentFunctionCall")
return &FunctionCall{
q: q,
c: r.c,
}
}
// The module currently being served in the session, if any.
func (r *Client) CurrentModule() *Module {
q := r.q.Select("currentModule")
return &Module{
q: q,
c: r.c,
}
}
// The TypeDef representations of the objects currently being served in the session.
func (r *Client) CurrentTypeDefs(ctx context.Context) ([]TypeDef, error) {
q := r.q.Select("currentTypeDefs")
q = q.Select("id")
type currentTypeDefs struct {
Id TypeDefID
}
convert := func(fields []currentTypeDefs) []TypeDef {
out := []TypeDef{}
for i := range fields {
val := TypeDef{id: &fields[i].Id}
val.q = querybuilder.Query().Select("loadTypeDefFromID").Arg("id", fields[i].Id)
val.c = r.c
out = append(out, val)
}
return out
}
var response []currentTypeDefs
q = q.Bind(&response)
err := q.Execute(ctx, r.c)
if err != nil {
return nil, err
}
return convert(response), nil
}
// The default platform of the engine.
func (r *Client) DefaultPlatform(ctx context.Context) (Platform, error) {
q := r.q.Select("defaultPlatform")
var response Platform
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// DirectoryOpts contains options for Client.Directory
type DirectoryOpts struct {
ID DirectoryID
}
// Creates an empty directory.
func (r *Client) Directory(opts ...DirectoryOpts) *Directory {
q := r.q.Select("directory")
for i := len(opts) - 1; i >= 0; i-- {
// `id` optional argument
if !querybuilder.IsZeroValue(opts[i].ID) {
q = q.Arg("id", opts[i].ID)
}
}
return &Directory{
q: q,
c: r.c,
}
}
// Deprecated: Use loadFileFromID instead.
func (r *Client) File(id FileID) *File {
q := r.q.Select("file")
q = q.Arg("id", id)
return &File{
q: q,
c: r.c,
}
}
// Creates a function.
func (r *Client) Function(name string, returnType *TypeDef) *Function {
assertNotNil("returnType", returnType)
q := r.q.Select("function")
q = q.Arg("name", name)
q = q.Arg("returnType", returnType)
return &Function{
q: q,
c: r.c,
}
}
// Create a code generation result, given a directory containing the generated code.
func (r *Client) GeneratedCode(code *Directory) *GeneratedCode {
assertNotNil("code", code)
q := r.q.Select("generatedCode")
q = q.Arg("code", code)
return &GeneratedCode{
q: q,
c: r.c,
}
}
// GitOpts contains options for Client.Git
type GitOpts struct {
// Set to true to keep .git directory.
KeepGitDir bool
// A service which must be started before the repo is fetched.
ExperimentalServiceHost *Service
// Set SSH known hosts
SSHKnownHosts string
// Set SSH auth socket
SSHAuthSocket *Socket
}
// Queries a Git repository.
func (r *Client) Git(url string, opts ...GitOpts) *GitRepository {
q := r.q.Select("git")
for i := len(opts) - 1; i >= 0; i-- {
// `keepGitDir` optional argument
if !querybuilder.IsZeroValue(opts[i].KeepGitDir) {
q = q.Arg("keepGitDir", opts[i].KeepGitDir)
}
// `experimentalServiceHost` optional argument
if !querybuilder.IsZeroValue(opts[i].ExperimentalServiceHost) {
q = q.Arg("experimentalServiceHost", opts[i].ExperimentalServiceHost)
}
// `sshKnownHosts` optional argument
if !querybuilder.IsZeroValue(opts[i].SSHKnownHosts) {
q = q.Arg("sshKnownHosts", opts[i].SSHKnownHosts)
}
// `sshAuthSocket` optional argument
if !querybuilder.IsZeroValue(opts[i].SSHAuthSocket) {
q = q.Arg("sshAuthSocket", opts[i].SSHAuthSocket)
}
}
q = q.Arg("url", url)
return &GitRepository{
q: q,
c: r.c,
}
}
// Queries the host environment.
func (r *Client) Host() *Host {
q := r.q.Select("host")
return &Host{
q: q,
c: r.c,
}
}
// HTTPOpts contains options for Client.HTTP
type HTTPOpts struct {
// A service which must be started before the URL is fetched.
ExperimentalServiceHost *Service
}
// Returns a file containing an http remote url content.
func (r *Client) HTTP(url string, opts ...HTTPOpts) *File {
q := r.q.Select("http")
for i := len(opts) - 1; i >= 0; i-- {
// `experimentalServiceHost` optional argument
if !querybuilder.IsZeroValue(opts[i].ExperimentalServiceHost) {
q = q.Arg("experimentalServiceHost", opts[i].ExperimentalServiceHost)
}
}
q = q.Arg("url", url)
return &File{
q: q,
c: r.c,
}
}
// Load a CacheVolume from its ID.
func (r *Client) LoadCacheVolumeFromID(id CacheVolumeID) *CacheVolume {
q := r.q.Select("loadCacheVolumeFromID")
q = q.Arg("id", id)
return &CacheVolume{
q: q,
c: r.c,
}
}
// Load a Container from its ID.
func (r *Client) LoadContainerFromID(id ContainerID) *Container {
q := r.q.Select("loadContainerFromID")
q = q.Arg("id", id)
return &Container{
q: q,
c: r.c,
}
}
// Load a Directory from its ID.
func (r *Client) LoadDirectoryFromID(id DirectoryID) *Directory {
q := r.q.Select("loadDirectoryFromID")
q = q.Arg("id", id)
return &Directory{
q: q,
c: r.c,
}
}
// Load a EnvVariable from its ID.
func (r *Client) LoadEnvVariableFromID(id EnvVariableID) *EnvVariable {
q := r.q.Select("loadEnvVariableFromID")
q = q.Arg("id", id)
return &EnvVariable{
q: q,
c: r.c,
}
}
// Load a FieldTypeDef from its ID.
func (r *Client) LoadFieldTypeDefFromID(id FieldTypeDefID) *FieldTypeDef {
q := r.q.Select("loadFieldTypeDefFromID")
q = q.Arg("id", id)
return &FieldTypeDef{
q: q,
c: r.c,
}
}
// Load a File from its ID.
func (r *Client) LoadFileFromID(id FileID) *File {
q := r.q.Select("loadFileFromID")
q = q.Arg("id", id)
return &File{
q: q,
c: r.c,
}
}
// Load a FunctionArg from its ID.
func (r *Client) LoadFunctionArgFromID(id FunctionArgID) *FunctionArg {
q := r.q.Select("loadFunctionArgFromID")
q = q.Arg("id", id)
return &FunctionArg{
q: q,
c: r.c,
}
}
// Load a FunctionCallArgValue from its ID.
func (r *Client) LoadFunctionCallArgValueFromID(id FunctionCallArgValueID) *FunctionCallArgValue {
q := r.q.Select("loadFunctionCallArgValueFromID")
q = q.Arg("id", id)
return &FunctionCallArgValue{
q: q,
c: r.c,
}
}
// Load a FunctionCall from its ID.
func (r *Client) LoadFunctionCallFromID(id FunctionCallID) *FunctionCall {
q := r.q.Select("loadFunctionCallFromID")
q = q.Arg("id", id)
return &FunctionCall{
q: q,
c: r.c,
}
}
// Load a Function from its ID.
func (r *Client) LoadFunctionFromID(id FunctionID) *Function {
q := r.q.Select("loadFunctionFromID")
q = q.Arg("id", id)
return &Function{
q: q,
c: r.c,
}
}
// Load a GeneratedCode from its ID.
func (r *Client) LoadGeneratedCodeFromID(id GeneratedCodeID) *GeneratedCode {
q := r.q.Select("loadGeneratedCodeFromID")
q = q.Arg("id", id)
return &GeneratedCode{
q: q,
c: r.c,
}
}
// Load a GitRef from its ID.
func (r *Client) LoadGitRefFromID(id GitRefID) *GitRef {
q := r.q.Select("loadGitRefFromID")
q = q.Arg("id", id)
return &GitRef{
q: q,
c: r.c,
}
}
// Load a GitRepository from its ID.
func (r *Client) LoadGitRepositoryFromID(id GitRepositoryID) *GitRepository {
q := r.q.Select("loadGitRepositoryFromID")
q = q.Arg("id", id)
return &GitRepository{
q: q,
c: r.c,
}
}
// Load a Host from its ID.
func (r *Client) LoadHostFromID(id HostID) *Host {
q := r.q.Select("loadHostFromID")
q = q.Arg("id", id)
return &Host{
q: q,
c: r.c,
}
}
// Load a InterfaceTypeDef from its ID.
func (r *Client) LoadInterfaceTypeDefFromID(id InterfaceTypeDefID) *InterfaceTypeDef {
q := r.q.Select("loadInterfaceTypeDefFromID")
q = q.Arg("id", id)
return &InterfaceTypeDef{
q: q,
c: r.c,
}
}
// Load a Label from its ID.
func (r *Client) LoadLabelFromID(id LabelID) *Label {
q := r.q.Select("loadLabelFromID")
q = q.Arg("id", id)
return &Label{
q: q,
c: r.c,
}
}
// Load a ListTypeDef from its ID.
func (r *Client) LoadListTypeDefFromID(id ListTypeDefID) *ListTypeDef {
q := r.q.Select("loadListTypeDefFromID")
q = q.Arg("id", id)
return &ListTypeDef{
q: q,
c: r.c,
}
}
// Load a ModuleConfig from its ID.
func (r *Client) LoadModuleConfigFromID(id ModuleConfigID) *ModuleConfig {
q := r.q.Select("loadModuleConfigFromID")
q = q.Arg("id", id)
return &ModuleConfig{
q: q,
c: r.c,
}
}
// Load a Module from its ID.
func (r *Client) LoadModuleFromID(id ModuleID) *Module {
q := r.q.Select("loadModuleFromID")
q = q.Arg("id", id)
return &Module{
q: q,
c: r.c,
}
}
// Load a ObjectTypeDef from its ID.
func (r *Client) LoadObjectTypeDefFromID(id ObjectTypeDefID) *ObjectTypeDef {
q := r.q.Select("loadObjectTypeDefFromID")
q = q.Arg("id", id)
return &ObjectTypeDef{
q: q,
c: r.c,
}
}
// Load a Port from its ID.
func (r *Client) LoadPortFromID(id PortID) *Port {
q := r.q.Select("loadPortFromID")
q = q.Arg("id", id)
return &Port{
q: q,
c: r.c,
}
}
// Load a Secret from its ID.
func (r *Client) LoadSecretFromID(id SecretID) *Secret {
q := r.q.Select("loadSecretFromID")
q = q.Arg("id", id)
return &Secret{
q: q,
c: r.c,
}
}
// Load a Service from its ID.
func (r *Client) LoadServiceFromID(id ServiceID) *Service {
q := r.q.Select("loadServiceFromID")
q = q.Arg("id", id)
return &Service{
q: q,
c: r.c,
}
}
// Load a Socket from its ID.
func (r *Client) LoadSocketFromID(id SocketID) *Socket {
q := r.q.Select("loadSocketFromID")
q = q.Arg("id", id)
return &Socket{
q: q,
c: r.c,
}
}
// Load a TypeDef from its ID.
func (r *Client) LoadTypeDefFromID(id TypeDefID) *TypeDef {
q := r.q.Select("loadTypeDefFromID")
q = q.Arg("id", id)
return &TypeDef{
q: q,
c: r.c,
}
}
// Create a new module.
func (r *Client) Module() *Module {
q := r.q.Select("module")
return &Module{
q: q,
c: r.c,
}
}
// ModuleConfigOpts contains options for Client.ModuleConfig
type ModuleConfigOpts struct {
Subpath string
}
// Load the static configuration for a module from the given source directory and optional subpath.
func (r *Client) ModuleConfig(sourceDirectory *Directory, opts ...ModuleConfigOpts) *ModuleConfig {
assertNotNil("sourceDirectory", sourceDirectory)
q := r.q.Select("moduleConfig")
for i := len(opts) - 1; i >= 0; i-- {
// `subpath` optional argument
if !querybuilder.IsZeroValue(opts[i].Subpath) {
q = q.Arg("subpath", opts[i].Subpath)
}
}
q = q.Arg("sourceDirectory", sourceDirectory)
return &ModuleConfig{
q: q,
c: r.c,
}
}
// PipelineOpts contains options for Client.Pipeline
type PipelineOpts struct {
// Description of the sub-pipeline.
Description string
// Labels to apply to the sub-pipeline.
Labels []PipelineLabel
}
// Creates a named sub-pipeline.
func (r *Client) Pipeline(name string, opts ...PipelineOpts) *Client {
q := r.q.Select("pipeline")
for i := len(opts) - 1; i >= 0; i-- {
// `description` optional argument
if !querybuilder.IsZeroValue(opts[i].Description) {
q = q.Arg("description", opts[i].Description)
}
// `labels` optional argument
if !querybuilder.IsZeroValue(opts[i].Labels) {
q = q.Arg("labels", opts[i].Labels)
}
}
q = q.Arg("name", name)
return &Client{
q: q,
c: r.c,
}
}
// Reference a secret by name.
func (r *Client) Secret(name string) *Secret {
q := r.q.Select("secret")
q = q.Arg("name", name)
return &Secret{
q: q,
c: r.c,
}
}
// Sets a secret given a user defined name to its plaintext and returns the secret.
//
// The plaintext value is limited to a size of 128000 bytes.
func (r *Client) SetSecret(name string, plaintext string) *Secret {
q := r.q.Select("setSecret")
q = q.Arg("name", name)
q = q.Arg("plaintext", plaintext)
return &Secret{
q: q,
c: r.c,
}
}
// Loads a socket by its ID.
//
// Deprecated: Use LoadSocketFromID instead.
func (r *Client) Socket(id SocketID) *Socket {
q := r.q.Select("socket")
q = q.Arg("id", id)
return &Socket{
q: q,
c: r.c,
}
}
// Create a new TypeDef.
func (r *Client) TypeDef() *TypeDef {
q := r.q.Select("typeDef")
return &TypeDef{
q: q,
c: r.c,
}
}
// A reference to a secret value, which can be handled more safely than the value itself.
type Secret struct {
q *querybuilder.Selection
c graphql.Client
id *SecretID
plaintext *string
}
// A unique identifier for this Secret.
func (r *Secret) ID(ctx context.Context) (SecretID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response SecretID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *Secret) XXX_GraphQLType() string {
return "Secret"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *Secret) XXX_GraphQLIDType() string {
return "SecretID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *Secret) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *Secret) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
// The value of this secret.
func (r *Secret) Plaintext(ctx context.Context) (string, error) {
if r.plaintext != nil {
return *r.plaintext, nil
}
q := r.q.Select("plaintext")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A content-addressed service providing TCP connectivity.
type Service struct {
q *querybuilder.Selection
c graphql.Client
endpoint *string
hostname *string
id *ServiceID
start *ServiceID
stop *ServiceID
}
// ServiceEndpointOpts contains options for Service.Endpoint
type ServiceEndpointOpts struct {
// The exposed port number for the endpoint
Port int
// Return a URL with the given scheme, eg. http for http://
Scheme string
}
// Retrieves an endpoint that clients can use to reach this container.
//
// If no port is specified, the first exposed port is used. If none exist an error is returned.
//
// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
func (r *Service) Endpoint(ctx context.Context, opts ...ServiceEndpointOpts) (string, error) {
if r.endpoint != nil {
return *r.endpoint, nil
}
q := r.q.Select("endpoint")
for i := len(opts) - 1; i >= 0; i-- {
// `port` optional argument
if !querybuilder.IsZeroValue(opts[i].Port) {
q = q.Arg("port", opts[i].Port)
}
// `scheme` optional argument
if !querybuilder.IsZeroValue(opts[i].Scheme) {
q = q.Arg("scheme", opts[i].Scheme)
}
}
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Retrieves a hostname which can be used by clients to reach this container.
func (r *Service) Hostname(ctx context.Context) (string, error) {
if r.hostname != nil {
return *r.hostname, nil
}
q := r.q.Select("hostname")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// A unique identifier for this Service.
func (r *Service) ID(ctx context.Context) (ServiceID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response ServiceID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *Service) XXX_GraphQLType() string {
return "Service"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *Service) XXX_GraphQLIDType() string {
return "ServiceID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *Service) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *Service) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
// Retrieves the list of ports provided by the service.
func (r *Service) Ports(ctx context.Context) ([]Port, error) {
q := r.q.Select("ports")
q = q.Select("id")
type ports struct {
Id PortID
}
convert := func(fields []ports) []Port {
out := []Port{}
for i := range fields {
val := Port{id: &fields[i].Id}
val.q = querybuilder.Query().Select("loadPortFromID").Arg("id", fields[i].Id)
val.c = r.c
out = append(out, val)
}
return out
}
var response []ports
q = q.Bind(&response)
err := q.Execute(ctx, r.c)
if err != nil {
return nil, err
}
return convert(response), nil
}
// Start the service and wait for its health checks to succeed.
//
// Services bound to a Container do not need to be manually started.
func (r *Service) Start(ctx context.Context) (*Service, error) {
q := r.q.Select("start")
return r, q.Execute(ctx, r.c)
}
// Stop the service.
func (r *Service) Stop(ctx context.Context) (*Service, error) {
q := r.q.Select("stop")
return r, q.Execute(ctx, r.c)
}
// A Unix or TCP/IP socket that can be mounted into a container.
type Socket struct {
q *querybuilder.Selection
c graphql.Client
id *SocketID
}
// A unique identifier for this Socket.
func (r *Socket) ID(ctx context.Context) (SocketID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response SocketID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *Socket) XXX_GraphQLType() string {
return "Socket"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *Socket) XXX_GraphQLIDType() string {
return "SocketID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *Socket) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *Socket) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
// A definition of a parameter or return type in a Module.
type TypeDef struct {
q *querybuilder.Selection
c graphql.Client
id *TypeDefID
kind *TypeDefKind
optional *bool
}
type WithTypeDefFunc func(r *TypeDef) *TypeDef
// With calls the provided function with current TypeDef.
//
// This is useful for reusability and readability by not breaking the calling chain.
func (r *TypeDef) With(f WithTypeDefFunc) *TypeDef {
return f(r)
}
func (r *TypeDef) AsInterface() *InterfaceTypeDef {
q := r.q.Select("asInterface")
return &InterfaceTypeDef{
q: q,
c: r.c,
}
}
func (r *TypeDef) AsList() *ListTypeDef {
q := r.q.Select("asList")
return &ListTypeDef{
q: q,
c: r.c,
}
}
func (r *TypeDef) AsObject() *ObjectTypeDef {
q := r.q.Select("asObject")
return &ObjectTypeDef{
q: q,
c: r.c,
}
}
// A unique identifier for this TypeDef.
func (r *TypeDef) ID(ctx context.Context) (TypeDefID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response TypeDefID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *TypeDef) XXX_GraphQLType() string {
return "TypeDef"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *TypeDef) XXX_GraphQLIDType() string {
return "TypeDefID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *TypeDef) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *TypeDef) MarshalJSON() ([]byte, error) {
id, err := r.ID(context.Background())
if err != nil {
return nil, err
}
return json.Marshal(id)
}
func (r *TypeDef) Kind(ctx context.Context) (TypeDefKind, error) {
if r.kind != nil {
return *r.kind, nil
}
q := r.q.Select("kind")
var response TypeDefKind
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *TypeDef) Optional(ctx context.Context) (bool, error) {
if r.optional != nil {
return *r.optional, nil
}
q := r.q.Select("optional")
var response bool
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
func (r *TypeDef) WithConstructor(function *Function) *TypeDef {
assertNotNil("function", function)
q := r.q.Select("withConstructor")
q = q.Arg("function", function)
return &TypeDef{
q: q,
c: r.c,
}
}
// TypeDefWithFieldOpts contains options for TypeDef.WithField
type TypeDefWithFieldOpts struct {
// A doc string for the field, if any
Description string
}
// Adds a static field for an Object TypeDef, failing if the type is not an object.
func (r *TypeDef) WithField(name string, typeDef *TypeDef, opts ...TypeDefWithFieldOpts) *TypeDef {
assertNotNil("typeDef", typeDef)
q := r.q.Select("withField")
for i := len(opts) - 1; i >= 0; i-- {
// `description` optional argument
if !querybuilder.IsZeroValue(opts[i].Description) {
q = q.Arg("description", opts[i].Description)
}
}
q = q.Arg("name", name)
q = q.Arg("typeDef", typeDef)
return &TypeDef{
q: q,
c: r.c,
}
}
// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
func (r *TypeDef) WithFunction(function *Function) *TypeDef {
assertNotNil("function", function)
q := r.q.Select("withFunction")
q = q.Arg("function", function)
return &TypeDef{
q: q,
c: r.c,
}
}
// TypeDefWithInterfaceOpts contains options for TypeDef.WithInterface
type TypeDefWithInterfaceOpts struct {
Description string
}
// Returns a TypeDef of kind Interface with the provided name.
func (r *TypeDef) WithInterface(name string, opts ...TypeDefWithInterfaceOpts) *TypeDef {
q := r.q.Select("withInterface")
for i := len(opts) - 1; i >= 0; i-- {
// `description` optional argument
if !querybuilder.IsZeroValue(opts[i].Description) {
q = q.Arg("description", opts[i].Description)
}
}
q = q.Arg("name", name)
return &TypeDef{
q: q,
c: r.c,
}
}
// Sets the kind of the type.
func (r *TypeDef) WithKind(kind TypeDefKind) *TypeDef {
q := r.q.Select("withKind")
q = q.Arg("kind", kind)
return &TypeDef{
q: q,
c: r.c,
}
}
// Returns a TypeDef of kind List with the provided type for its elements.
func (r *TypeDef) WithListOf(elementType *TypeDef) *TypeDef {
assertNotNil("elementType", elementType)
q := r.q.Select("withListOf")
q = q.Arg("elementType", elementType)
return &TypeDef{
q: q,
c: r.c,
}
}
// TypeDefWithObjectOpts contains options for TypeDef.WithObject
type TypeDefWithObjectOpts struct {
Description string
}
// Returns a TypeDef of kind Object with the provided name.
//
// Note that an object's fields and functions may be omitted if the intent is only to refer to an object. This is how functions are able to return their own object, or any other circular reference.
func (r *TypeDef) WithObject(name string, opts ...TypeDefWithObjectOpts) *TypeDef {
q := r.q.Select("withObject")
for i := len(opts) - 1; i >= 0; i-- {
// `description` optional argument
if !querybuilder.IsZeroValue(opts[i].Description) {
q = q.Arg("description", opts[i].Description)
}
}
q = q.Arg("name", name)
return &TypeDef{
q: q,
c: r.c,
}
}
// Sets whether this type can be set to null.
func (r *TypeDef) WithOptional(optional bool) *TypeDef {
q := r.q.Select("withOptional")
q = q.Arg("optional", optional)
return &TypeDef{
q: q,
c: r.c,
}
}
type CacheSharingMode string
func (CacheSharingMode) IsEnum() {}
const (
// Shares the cache volume amongst many build pipelines, but will serialize the writes
Locked CacheSharingMode = "LOCKED"
// Keeps a cache volume for a single build pipeline
Private CacheSharingMode = "PRIVATE"
// Shares the cache volume amongst many build pipelines
Shared CacheSharingMode = "SHARED"
)
type ImageLayerCompression string
func (ImageLayerCompression) IsEnum() {}
const (
Estargz ImageLayerCompression = "EStarGZ"
Gzip ImageLayerCompression = "Gzip"
Uncompressed ImageLayerCompression = "Uncompressed"
Zstd ImageLayerCompression = "Zstd"
)
type ImageMediaTypes string
func (ImageMediaTypes) IsEnum() {}
const (
Dockermediatypes ImageMediaTypes = "DockerMediaTypes"
Ocimediatypes ImageMediaTypes = "OCIMediaTypes"
)
type NetworkProtocol string
func (NetworkProtocol) IsEnum() {}
const (
Tcp NetworkProtocol = "TCP"
Udp NetworkProtocol = "UDP"
)
type TypeDefKind string
func (TypeDefKind) IsEnum() {}
const (
// A boolean value.
BooleanKind TypeDefKind = "BOOLEAN_KIND"
// An integer value.
IntegerKind TypeDefKind = "INTEGER_KIND"
// A named type of functions that can be matched+implemented by other objects+interfaces.
//
// Always paired with an InterfaceTypeDef.
InterfaceKind TypeDefKind = "INTERFACE_KIND"
// A list of values all having the same type.
//
// Always paired with a ListTypeDef.
ListKind TypeDefKind = "LIST_KIND"
// A named type defined in the GraphQL schema, with fields and functions.
//
// Always paired with an ObjectTypeDef.
ObjectKind TypeDefKind = "OBJECT_KIND"
// A string value.
StringKind TypeDefKind = "STRING_KIND"
// A special kind used to signify that no value is returned.
//
// This is used for functions that have no return value. The outer TypeDef specifying this Kind is always Optional, as the Void is never actually represented.
VoidKind TypeDefKind = "VOID_KIND"
)
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,416 | ✨ Add name field to File | ### What are you trying to do?
Files passed to `dagger call` currently does not preserve the name of a file passed to it.
### Why is this important to you?
Some tools often require the original file name (for example: Spectral requires the file name do determine the file type)
Discussed it with @sipsma here: https://discord.com/channels/707636530424053791/1120503349599543376/1195832958150529165
### How are you currently working around this?
I pass the original file name to the module. | https://github.com/dagger/dagger/issues/6416 | https://github.com/dagger/dagger/pull/6431 | 61bf06b970402efa254a40f13c4aee98adfbdb42 | c716a042f290b11c6122d247f8b31651adb5f1d0 | "2024-01-13T21:04:31Z" | go | "2024-01-17T16:17:48Z" | sdk/python/src/dagger/client/gen.py | # Code generated by dagger. DO NOT EDIT.
import warnings
from collections.abc import Callable, Sequence
from dataclasses import dataclass
from ._core import Arg, Root
from ._guards import typecheck
from .base import Enum, Input, Scalar, Type
class CacheVolumeID(Scalar):
"""The `CacheVolumeID` scalar type represents an identifier for an
object of type CacheVolume."""
class ContainerID(Scalar):
"""The `ContainerID` scalar type represents an identifier for an
object of type Container."""
class DirectoryID(Scalar):
"""The `DirectoryID` scalar type represents an identifier for an
object of type Directory."""
class EnvVariableID(Scalar):
"""The `EnvVariableID` scalar type represents an identifier for an
object of type EnvVariable."""
class FieldTypeDefID(Scalar):
"""The `FieldTypeDefID` scalar type represents an identifier for an
object of type FieldTypeDef."""
class FileID(Scalar):
"""The `FileID` scalar type represents an identifier for an object of
type File."""
class FunctionArgID(Scalar):
"""The `FunctionArgID` scalar type represents an identifier for an
object of type FunctionArg."""
class FunctionCallArgValueID(Scalar):
"""The `FunctionCallArgValueID` scalar type represents an identifier
for an object of type FunctionCallArgValue."""
class FunctionCallID(Scalar):
"""The `FunctionCallID` scalar type represents an identifier for an
object of type FunctionCall."""
class FunctionID(Scalar):
"""The `FunctionID` scalar type represents an identifier for an object
of type Function."""
class GeneratedCodeID(Scalar):
"""The `GeneratedCodeID` scalar type represents an identifier for an
object of type GeneratedCode."""
class GitRefID(Scalar):
"""The `GitRefID` scalar type represents an identifier for an object
of type GitRef."""
class GitRepositoryID(Scalar):
"""The `GitRepositoryID` scalar type represents an identifier for an
object of type GitRepository."""
class HostID(Scalar):
"""The `HostID` scalar type represents an identifier for an object of
type Host."""
class InterfaceTypeDefID(Scalar):
"""The `InterfaceTypeDefID` scalar type represents an identifier for
an object of type InterfaceTypeDef."""
class JSON(Scalar):
"""An arbitrary JSON-encoded value."""
class LabelID(Scalar):
"""The `LabelID` scalar type represents an identifier for an object of
type Label."""
class ListTypeDefID(Scalar):
"""The `ListTypeDefID` scalar type represents an identifier for an
object of type ListTypeDef."""
class ModuleConfigID(Scalar):
"""The `ModuleConfigID` scalar type represents an identifier for an
object of type ModuleConfig."""
class ModuleID(Scalar):
"""The `ModuleID` scalar type represents an identifier for an object
of type Module."""
class ObjectTypeDefID(Scalar):
"""The `ObjectTypeDefID` scalar type represents an identifier for an
object of type ObjectTypeDef."""
class Platform(Scalar):
"""The platform config OS and architecture in a Container. The format
is [os]/[platform]/[version] (e.g., "darwin/arm64/v7",
"windows/amd64", "linux/arm64")."""
class PortID(Scalar):
"""The `PortID` scalar type represents an identifier for an object of
type Port."""
class SecretID(Scalar):
"""The `SecretID` scalar type represents an identifier for an object
of type Secret."""
class ServiceID(Scalar):
"""The `ServiceID` scalar type represents an identifier for an object
of type Service."""
class SocketID(Scalar):
"""The `SocketID` scalar type represents an identifier for an object
of type Socket."""
class TypeDefID(Scalar):
"""The `TypeDefID` scalar type represents an identifier for an object
of type TypeDef."""
class Void(Scalar):
"""The absence of a value. A Null Void is used as a placeholder for
resolvers that do not return anything."""
class CacheSharingMode(Enum):
"""Sharing mode of the cache volume."""
LOCKED = "LOCKED"
"""Shares the cache volume amongst many build pipelines, but will serialize the writes"""
PRIVATE = "PRIVATE"
"""Keeps a cache volume for a single build pipeline"""
SHARED = "SHARED"
"""Shares the cache volume amongst many build pipelines"""
class ImageLayerCompression(Enum):
"""Compression algorithm to use for image layers."""
EStarGZ = "EStarGZ"
Gzip = "Gzip"
Uncompressed = "Uncompressed"
Zstd = "Zstd"
class ImageMediaTypes(Enum):
"""Mediatypes to use in published or exported image metadata."""
DockerMediaTypes = "DockerMediaTypes"
OCIMediaTypes = "OCIMediaTypes"
class NetworkProtocol(Enum):
"""Transport layer network protocol associated to a port."""
TCP = "TCP"
UDP = "UDP"
class TypeDefKind(Enum):
"""Distinguishes the different kinds of TypeDefs."""
BOOLEAN_KIND = "BOOLEAN_KIND"
"""A boolean value."""
INTEGER_KIND = "INTEGER_KIND"
"""An integer value."""
INTERFACE_KIND = "INTERFACE_KIND"
"""A named type of functions that can be matched+implemented by other objects+interfaces.
Always paired with an InterfaceTypeDef.
"""
LIST_KIND = "LIST_KIND"
"""A list of values all having the same type.
Always paired with a ListTypeDef.
"""
OBJECT_KIND = "OBJECT_KIND"
"""A named type defined in the GraphQL schema, with fields and functions.
Always paired with an ObjectTypeDef.
"""
STRING_KIND = "STRING_KIND"
"""A string value."""
VOID_KIND = "VOID_KIND"
"""A special kind used to signify that no value is returned.
This is used for functions that have no return value. The outer TypeDef specifying this Kind is always Optional, as the Void is never actually represented.
"""
@dataclass(slots=True)
class BuildArg(Input):
"""Key value object that represents a build argument."""
name: str
"""The build argument name."""
value: str
"""The build argument value."""
@dataclass(slots=True)
class PipelineLabel(Input):
"""Key value object that represents a pipeline label."""
name: str
"""Label name."""
value: str
"""Label value."""
@dataclass(slots=True)
class PortForward(Input):
"""Port forwarding rules for tunneling network traffic."""
backend: int
"""Destination port for traffic."""
frontend: int | None = None
"""Port to expose to clients. If unspecified, a default will be chosen."""
protocol: NetworkProtocol | None = "TCP"
"""Transport layer protocol to use for traffic."""
class CacheVolume(Type):
"""A directory whose contents persist across runs."""
@typecheck
async def id(self) -> CacheVolumeID:
"""A unique identifier for this CacheVolume.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
CacheVolumeID
The `CacheVolumeID` scalar type represents an identifier for an
object of type CacheVolume.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(CacheVolumeID)
class Container(Type):
"""An OCI-compatible container, also known as a Docker container."""
@typecheck
def as_service(self) -> "Service":
"""Turn the container into a Service.
Be sure to set any exposed ports before this conversion.
"""
_args: list[Arg] = []
_ctx = self._select("asService", _args)
return Service(_ctx)
@typecheck
def as_tarball(
self,
*,
platform_variants: Sequence["Container"] | None = [],
forced_compression: ImageLayerCompression | None = None,
media_types: ImageMediaTypes | None = "OCIMediaTypes",
) -> "File":
"""Returns a File representing the container serialized to a tarball.
Parameters
----------
platform_variants:
Identifiers for other platform specific containers.
Used for multi-platform images.
forced_compression:
Force each layer of the image to use the specified compression
algorithm.
If this is unset, then if a layer already has a compressed blob in
the engine's cache, that will be used (this can result in a mix of
compression algorithms for different layers). If this is unset and
a layer has no compressed blob in the engine's cache, then it will
be compressed using Gzip.
media_types:
Use the specified media types for the image's layers.
Defaults to OCI, which is largely compatible with most recent
container runtimes, but Docker may be needed for older runtimes
without OCI support.
"""
_args = [
Arg("platformVariants", platform_variants, []),
Arg("forcedCompression", forced_compression, None),
Arg("mediaTypes", media_types, "OCIMediaTypes"),
]
_ctx = self._select("asTarball", _args)
return File(_ctx)
@typecheck
def build(
self,
context: "Directory",
*,
dockerfile: str | None = "Dockerfile",
target: str | None = "",
build_args: Sequence[BuildArg] | None = [],
secrets: Sequence["Secret"] | None = [],
) -> "Container":
"""Initializes this container from a Dockerfile build.
Parameters
----------
context:
Directory context used by the Dockerfile.
dockerfile:
Path to the Dockerfile to use.
target:
Target build stage to build.
build_args:
Additional build arguments.
secrets:
Secrets to pass to the build.
They will be mounted at /run/secrets/[secret-name] in the build
container
They can be accessed in the Dockerfile using the "secret" mount
type and mount path /run/secrets/[secret-name], e.g. RUN
--mount=type=secret,id=my-secret curl
http://example.com?token=$(cat /run/secrets/my-secret)
"""
_args = [
Arg("context", context),
Arg("dockerfile", dockerfile, "Dockerfile"),
Arg("target", target, ""),
Arg("buildArgs", build_args, []),
Arg("secrets", secrets, []),
]
_ctx = self._select("build", _args)
return Container(_ctx)
@typecheck
async def default_args(self) -> list[str]:
"""Retrieves default arguments for future commands.
Returns
-------
list[str]
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("defaultArgs", _args)
return await _ctx.execute(list[str])
@typecheck
def directory(self, path: str) -> "Directory":
"""Retrieves a directory at the given path.
Mounts are included.
Parameters
----------
path:
The path of the directory to retrieve (e.g., "./src").
"""
_args = [
Arg("path", path),
]
_ctx = self._select("directory", _args)
return Directory(_ctx)
@typecheck
async def entrypoint(self) -> list[str]:
"""Retrieves entrypoint to be prepended to the arguments of all commands.
Returns
-------
list[str]
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("entrypoint", _args)
return await _ctx.execute(list[str])
@typecheck
async def env_variable(self, name: str) -> str | None:
"""Retrieves the value of the specified environment variable.
Parameters
----------
name:
The name of the environment variable to retrieve (e.g., "PATH").
Returns
-------
str | None
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args = [
Arg("name", name),
]
_ctx = self._select("envVariable", _args)
return await _ctx.execute(str | None)
@typecheck
async def env_variables(self) -> list["EnvVariable"]:
"""Retrieves the list of environment variables passed to commands."""
_args: list[Arg] = []
_ctx = self._select("envVariables", _args)
_ctx = EnvVariable(_ctx)._select_multiple(
_name="name",
_value="value",
)
return await _ctx.execute(list[EnvVariable])
@typecheck
def experimental_with_all_gp_us(self) -> "Container":
"""EXPERIMENTAL API! Subject to change/removal at any time.
Configures all available GPUs on the host to be accessible to this
container.
This currently works for Nvidia devices only.
"""
_args: list[Arg] = []
_ctx = self._select("experimentalWithAllGPUs", _args)
return Container(_ctx)
@typecheck
def experimental_with_gpu(self, devices: Sequence[str]) -> "Container":
"""EXPERIMENTAL API! Subject to change/removal at any time.
Configures the provided list of devices to be accesible to this
container.
This currently works for Nvidia devices only.
Parameters
----------
devices:
List of devices to be accessible to this container.
"""
_args = [
Arg("devices", devices),
]
_ctx = self._select("experimentalWithGPU", _args)
return Container(_ctx)
@typecheck
async def export(
self,
path: str,
*,
platform_variants: Sequence["Container"] | None = [],
forced_compression: ImageLayerCompression | None = None,
media_types: ImageMediaTypes | None = "OCIMediaTypes",
) -> bool:
"""Writes the container as an OCI tarball to the destination file path on
the host.
Return true on success.
It can also export platform variants.
Parameters
----------
path:
Host's destination path (e.g., "./tarball").
Path can be relative to the engine's workdir or absolute.
platform_variants:
Identifiers for other platform specific containers.
Used for multi-platform image.
forced_compression:
Force each layer of the exported image to use the specified
compression algorithm.
If this is unset, then if a layer already has a compressed blob in
the engine's cache, that will be used (this can result in a mix of
compression algorithms for different layers). If this is unset and
a layer has no compressed blob in the engine's cache, then it will
be compressed using Gzip.
media_types:
Use the specified media types for the exported image's layers.
Defaults to OCI, which is largely compatible with most recent
container runtimes, but Docker may be needed for older runtimes
without OCI support.
Returns
-------
bool
The `Boolean` scalar type represents `true` or `false`.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args = [
Arg("path", path),
Arg("platformVariants", platform_variants, []),
Arg("forcedCompression", forced_compression, None),
Arg("mediaTypes", media_types, "OCIMediaTypes"),
]
_ctx = self._select("export", _args)
return await _ctx.execute(bool)
@typecheck
async def exposed_ports(self) -> list["Port"]:
"""Retrieves the list of exposed ports.
This includes ports already exposed by the image, even if not
explicitly added with dagger.
"""
_args: list[Arg] = []
_ctx = self._select("exposedPorts", _args)
_ctx = Port(_ctx)._select_multiple(
_description="description",
_port="port",
_protocol="protocol",
)
return await _ctx.execute(list[Port])
@typecheck
def file(self, path: str) -> "File":
"""Retrieves a file at the given path.
Mounts are included.
Parameters
----------
path:
The path of the file to retrieve (e.g., "./README.md").
"""
_args = [
Arg("path", path),
]
_ctx = self._select("file", _args)
return File(_ctx)
@typecheck
def from_(self, address: str) -> "Container":
"""Initializes this container from a pulled base image.
Parameters
----------
address:
Image's address from its registry.
Formatted as [host]/[user]/[repo]:[tag] (e.g.,
"docker.io/dagger/dagger:main").
"""
_args = [
Arg("address", address),
]
_ctx = self._select("from", _args)
return Container(_ctx)
@typecheck
async def id(self) -> ContainerID:
"""A unique identifier for this Container.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
ContainerID
The `ContainerID` scalar type represents an identifier for an
object of type Container.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(ContainerID)
@typecheck
async def image_ref(self) -> str:
"""The unique image reference which can only be retrieved immediately
after the 'Container.From' call.
Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("imageRef", _args)
return await _ctx.execute(str)
@typecheck
def import_(
self,
source: "File",
*,
tag: str | None = "",
) -> "Container":
"""Reads the container from an OCI tarball.
Parameters
----------
source:
File to read the container from.
tag:
Identifies the tag to import from the archive, if the archive
bundles multiple tags.
"""
_args = [
Arg("source", source),
Arg("tag", tag, ""),
]
_ctx = self._select("import", _args)
return Container(_ctx)
@typecheck
async def label(self, name: str) -> str | None:
"""Retrieves the value of the specified label.
Parameters
----------
name:
The name of the label (e.g.,
"org.opencontainers.artifact.created").
Returns
-------
str | None
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args = [
Arg("name", name),
]
_ctx = self._select("label", _args)
return await _ctx.execute(str | None)
@typecheck
async def labels(self) -> list["Label"]:
"""Retrieves the list of labels passed to container."""
_args: list[Arg] = []
_ctx = self._select("labels", _args)
_ctx = Label(_ctx)._select_multiple(
_name="name",
_value="value",
)
return await _ctx.execute(list[Label])
@typecheck
async def mounts(self) -> list[str]:
"""Retrieves the list of paths where a directory is mounted.
Returns
-------
list[str]
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("mounts", _args)
return await _ctx.execute(list[str])
@typecheck
def pipeline(
self,
name: str,
*,
description: str | None = "",
labels: Sequence[PipelineLabel] | None = [],
) -> "Container":
"""Creates a named sub-pipeline.
Parameters
----------
name:
Name of the sub-pipeline.
description:
Description of the sub-pipeline.
labels:
Labels to apply to the sub-pipeline.
"""
_args = [
Arg("name", name),
Arg("description", description, ""),
Arg("labels", labels, []),
]
_ctx = self._select("pipeline", _args)
return Container(_ctx)
@typecheck
async def platform(self) -> Platform:
"""The platform this container executes and publishes as.
Returns
-------
Platform
The platform config OS and architecture in a Container. The
format is [os]/[platform]/[version] (e.g., "darwin/arm64/v7",
"windows/amd64", "linux/arm64").
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("platform", _args)
return await _ctx.execute(Platform)
@typecheck
async def publish(
self,
address: str,
*,
platform_variants: Sequence["Container"] | None = [],
forced_compression: ImageLayerCompression | None = None,
media_types: ImageMediaTypes | None = "OCIMediaTypes",
) -> str:
"""Publishes this container as a new image to the specified address.
Publish returns a fully qualified ref.
It can also publish platform variants.
Parameters
----------
address:
Registry's address to publish the image to.
Formatted as [host]/[user]/[repo]:[tag] (e.g.
"docker.io/dagger/dagger:main").
platform_variants:
Identifiers for other platform specific containers.
Used for multi-platform image.
forced_compression:
Force each layer of the published image to use the specified
compression algorithm.
If this is unset, then if a layer already has a compressed blob in
the engine's cache, that will be used (this can result in a mix of
compression algorithms for different layers). If this is unset and
a layer has no compressed blob in the engine's cache, then it will
be compressed using Gzip.
media_types:
Use the specified media types for the published image's layers.
Defaults to OCI, which is largely compatible with most recent
registries, but Docker may be needed for older registries without
OCI support.
Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args = [
Arg("address", address),
Arg("platformVariants", platform_variants, []),
Arg("forcedCompression", forced_compression, None),
Arg("mediaTypes", media_types, "OCIMediaTypes"),
]
_ctx = self._select("publish", _args)
return await _ctx.execute(str)
@typecheck
def rootfs(self) -> "Directory":
"""Retrieves this container's root filesystem. Mounts are not included."""
_args: list[Arg] = []
_ctx = self._select("rootfs", _args)
return Directory(_ctx)
@typecheck
async def shell_endpoint(self) -> str:
"""Return a websocket endpoint that, if connected to, will start the
container with a TTY streamed over the websocket.
Primarily intended for internal use with the dagger CLI.
Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("shellEndpoint", _args)
return await _ctx.execute(str)
@typecheck
async def stderr(self) -> str:
"""The error stream of the last executed command.
Will execute default command if none is set, or error if there's no
default.
Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("stderr", _args)
return await _ctx.execute(str)
@typecheck
async def stdout(self) -> str:
"""The output stream of the last executed command.
Will execute default command if none is set, or error if there's no
default.
Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("stdout", _args)
return await _ctx.execute(str)
@typecheck
async def sync(self) -> "Container":
"""Forces evaluation of the pipeline in the engine.
It doesn't run the default command if no exec has been set.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("sync", _args)
_id = await _ctx.execute(ContainerID)
_ctx = Client.from_context(_ctx)._select(
"loadContainerFromID", [Arg("id", _id)]
)
return Container(_ctx)
def __await__(self):
return self.sync().__await__()
@typecheck
async def user(self) -> str:
"""Retrieves the user to be set for all commands.
Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("user", _args)
return await _ctx.execute(str)
@typecheck
def with_default_args(self, args: Sequence[str]) -> "Container":
"""Configures default arguments for future commands.
Parameters
----------
args:
Arguments to prepend to future executions (e.g., ["-v", "--no-
cache"]).
"""
_args = [
Arg("args", args),
]
_ctx = self._select("withDefaultArgs", _args)
return Container(_ctx)
@typecheck
def with_directory(
self,
path: str,
directory: "Directory",
*,
exclude: Sequence[str] | None = [],
include: Sequence[str] | None = [],
owner: str | None = "",
) -> "Container":
"""Retrieves this container plus a directory written at the given path.
Parameters
----------
path:
Location of the written directory (e.g., "/tmp/directory").
directory:
Identifier of the directory to write
exclude:
Patterns to exclude in the written directory (e.g.
["node_modules/**", ".gitignore", ".git/"]).
include:
Patterns to include in the written directory (e.g. ["*.go",
"go.mod", "go.sum"]).
owner:
A user:group to set for the directory and its contents.
The user and group can either be an ID (1000:1000) or a name
(foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
_args = [
Arg("path", path),
Arg("directory", directory),
Arg("exclude", exclude, []),
Arg("include", include, []),
Arg("owner", owner, ""),
]
_ctx = self._select("withDirectory", _args)
return Container(_ctx)
@typecheck
def with_entrypoint(
self,
args: Sequence[str],
*,
keep_default_args: bool | None = False,
) -> "Container":
"""Retrieves this container but with a different command entrypoint.
Parameters
----------
args:
Entrypoint to use for future executions (e.g., ["go", "run"]).
keep_default_args:
Don't remove the default arguments when setting the entrypoint.
"""
_args = [
Arg("args", args),
Arg("keepDefaultArgs", keep_default_args, False),
]
_ctx = self._select("withEntrypoint", _args)
return Container(_ctx)
@typecheck
def with_env_variable(
self,
name: str,
value: str,
*,
expand: bool | None = False,
) -> "Container":
"""Retrieves this container plus the given environment variable.
Parameters
----------
name:
The name of the environment variable (e.g., "HOST").
value:
The value of the environment variable. (e.g., "localhost").
expand:
Replace `${VAR}` or `$VAR` in the value according to the current
environment variables defined in the container (e.g.,
"/opt/bin:$PATH").
"""
_args = [
Arg("name", name),
Arg("value", value),
Arg("expand", expand, False),
]
_ctx = self._select("withEnvVariable", _args)
return Container(_ctx)
@typecheck
def with_exec(
self,
args: Sequence[str],
*,
skip_entrypoint: bool | None = False,
stdin: str | None = "",
redirect_stdout: str | None = "",
redirect_stderr: str | None = "",
experimental_privileged_nesting: bool | None = False,
insecure_root_capabilities: bool | None = False,
) -> "Container":
"""Retrieves this container after executing the specified command inside
it.
Parameters
----------
args:
Command to run instead of the container's default command (e.g.,
["run", "main.go"]).
If empty, the container's default command is used.
skip_entrypoint:
If the container has an entrypoint, ignore it for args rather than
using it to wrap them.
stdin:
Content to write to the command's standard input before closing
(e.g., "Hello world").
redirect_stdout:
Redirect the command's standard output to a file in the container
(e.g., "/tmp/stdout").
redirect_stderr:
Redirect the command's standard error to a file in the container
(e.g., "/tmp/stderr").
experimental_privileged_nesting:
Provides dagger access to the executed command.
Do not use this option unless you trust the command being
executed; the command being executed WILL BE GRANTED FULL ACCESS
TO YOUR HOST FILESYSTEM.
insecure_root_capabilities:
Execute the command with all root capabilities. This is similar to
running a command with "sudo" or executing "docker run" with the "
--privileged" flag. Containerization does not provide any security
guarantees when using this option. It should only be used when
absolutely necessary and only with trusted commands.
"""
_args = [
Arg("args", args),
Arg("skipEntrypoint", skip_entrypoint, False),
Arg("stdin", stdin, ""),
Arg("redirectStdout", redirect_stdout, ""),
Arg("redirectStderr", redirect_stderr, ""),
Arg(
"experimentalPrivilegedNesting", experimental_privileged_nesting, False
),
Arg("insecureRootCapabilities", insecure_root_capabilities, False),
]
_ctx = self._select("withExec", _args)
return Container(_ctx)
@typecheck
def with_exposed_port(
self,
port: int,
*,
protocol: NetworkProtocol | None = "TCP",
description: str | None = None,
) -> "Container":
"""Expose a network port.
Exposed ports serve two purposes:
- For health checks and introspection, when running services
- For setting the EXPOSE OCI field when publishing the container
Parameters
----------
port:
Port number to expose
protocol:
Transport layer network protocol
description:
Optional port description
"""
_args = [
Arg("port", port),
Arg("protocol", protocol, "TCP"),
Arg("description", description, None),
]
_ctx = self._select("withExposedPort", _args)
return Container(_ctx)
@typecheck
def with_file(
self,
path: str,
source: "File",
*,
permissions: int | None = None,
owner: str | None = "",
) -> "Container":
"""Retrieves this container plus the contents of the given file copied to
the given path.
Parameters
----------
path:
Location of the copied file (e.g., "/tmp/file.txt").
source:
Identifier of the file to copy.
permissions:
Permission given to the copied file (e.g., 0600).
owner:
A user:group to set for the file.
The user and group can either be an ID (1000:1000) or a name
(foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
_args = [
Arg("path", path),
Arg("source", source),
Arg("permissions", permissions, None),
Arg("owner", owner, ""),
]
_ctx = self._select("withFile", _args)
return Container(_ctx)
@typecheck
def with_focus(self) -> "Container":
"""Indicate that subsequent operations should be featured more
prominently in the UI.
"""
_args: list[Arg] = []
_ctx = self._select("withFocus", _args)
return Container(_ctx)
@typecheck
def with_label(self, name: str, value: str) -> "Container":
"""Retrieves this container plus the given label.
Parameters
----------
name:
The name of the label (e.g.,
"org.opencontainers.artifact.created").
value:
The value of the label (e.g., "2023-01-01T00:00:00Z").
"""
_args = [
Arg("name", name),
Arg("value", value),
]
_ctx = self._select("withLabel", _args)
return Container(_ctx)
@typecheck
def with_mounted_cache(
self,
path: str,
cache: CacheVolume,
*,
source: "Directory | None" = None,
sharing: CacheSharingMode | None = "SHARED",
owner: str | None = "",
) -> "Container":
"""Retrieves this container plus a cache volume mounted at the given
path.
Parameters
----------
path:
Location of the cache directory (e.g., "/cache/node_modules").
cache:
Identifier of the cache volume to mount.
source:
Identifier of the directory to use as the cache volume's root.
sharing:
Sharing mode of the cache volume.
owner:
A user:group to set for the mounted cache directory.
Note that this changes the ownership of the specified mount along
with the initial filesystem provided by source (if any). It does
not have any effect if/when the cache has already been created.
The user and group can either be an ID (1000:1000) or a name
(foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
_args = [
Arg("path", path),
Arg("cache", cache),
Arg("source", source, None),
Arg("sharing", sharing, "SHARED"),
Arg("owner", owner, ""),
]
_ctx = self._select("withMountedCache", _args)
return Container(_ctx)
@typecheck
def with_mounted_directory(
self,
path: str,
source: "Directory",
*,
owner: str | None = "",
) -> "Container":
"""Retrieves this container plus a directory mounted at the given path.
Parameters
----------
path:
Location of the mounted directory (e.g., "/mnt/directory").
source:
Identifier of the mounted directory.
owner:
A user:group to set for the mounted directory and its contents.
The user and group can either be an ID (1000:1000) or a name
(foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
_args = [
Arg("path", path),
Arg("source", source),
Arg("owner", owner, ""),
]
_ctx = self._select("withMountedDirectory", _args)
return Container(_ctx)
@typecheck
def with_mounted_file(
self,
path: str,
source: "File",
*,
owner: str | None = "",
) -> "Container":
"""Retrieves this container plus a file mounted at the given path.
Parameters
----------
path:
Location of the mounted file (e.g., "/tmp/file.txt").
source:
Identifier of the mounted file.
owner:
A user or user:group to set for the mounted file.
The user and group can either be an ID (1000:1000) or a name
(foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
_args = [
Arg("path", path),
Arg("source", source),
Arg("owner", owner, ""),
]
_ctx = self._select("withMountedFile", _args)
return Container(_ctx)
@typecheck
def with_mounted_secret(
self,
path: str,
source: "Secret",
*,
owner: str | None = "",
mode: int | None = 256,
) -> "Container":
"""Retrieves this container plus a secret mounted into a file at the
given path.
Parameters
----------
path:
Location of the secret file (e.g., "/tmp/secret.txt").
source:
Identifier of the secret to mount.
owner:
A user:group to set for the mounted secret.
The user and group can either be an ID (1000:1000) or a name
(foo:bar).
If the group is omitted, it defaults to the same as the user.
mode:
Permission given to the mounted secret (e.g., 0600).
This option requires an owner to be set to be active.
"""
_args = [
Arg("path", path),
Arg("source", source),
Arg("owner", owner, ""),
Arg("mode", mode, 256),
]
_ctx = self._select("withMountedSecret", _args)
return Container(_ctx)
@typecheck
def with_mounted_temp(self, path: str) -> "Container":
"""Retrieves this container plus a temporary directory mounted at the
given path.
Parameters
----------
path:
Location of the temporary directory (e.g., "/tmp/temp_dir").
"""
_args = [
Arg("path", path),
]
_ctx = self._select("withMountedTemp", _args)
return Container(_ctx)
@typecheck
def with_new_file(
self,
path: str,
*,
contents: str | None = "",
permissions: int | None = 420,
owner: str | None = "",
) -> "Container":
"""Retrieves this container plus a new file written at the given path.
Parameters
----------
path:
Location of the written file (e.g., "/tmp/file.txt").
contents:
Content of the file to write (e.g., "Hello world!").
permissions:
Permission given to the written file (e.g., 0600).
owner:
A user:group to set for the file.
The user and group can either be an ID (1000:1000) or a name
(foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
_args = [
Arg("path", path),
Arg("contents", contents, ""),
Arg("permissions", permissions, 420),
Arg("owner", owner, ""),
]
_ctx = self._select("withNewFile", _args)
return Container(_ctx)
@typecheck
def with_registry_auth(
self,
address: str,
username: str,
secret: "Secret",
) -> "Container":
"""Retrieves this container with a registry authentication for a given
address.
Parameters
----------
address:
Registry's address to bind the authentication to.
Formatted as [host]/[user]/[repo]:[tag] (e.g.
docker.io/dagger/dagger:main).
username:
The username of the registry's account (e.g., "Dagger").
secret:
The API key, password or token to authenticate to this registry.
"""
_args = [
Arg("address", address),
Arg("username", username),
Arg("secret", secret),
]
_ctx = self._select("withRegistryAuth", _args)
return Container(_ctx)
@typecheck
def with_rootfs(self, directory: "Directory") -> "Container":
"""Retrieves the container with the given directory mounted to /.
Parameters
----------
directory:
Directory to mount.
"""
_args = [
Arg("directory", directory),
]
_ctx = self._select("withRootfs", _args)
return Container(_ctx)
@typecheck
def with_secret_variable(self, name: str, secret: "Secret") -> "Container":
"""Retrieves this container plus an env variable containing the given
secret.
Parameters
----------
name:
The name of the secret variable (e.g., "API_SECRET").
secret:
The identifier of the secret value.
"""
_args = [
Arg("name", name),
Arg("secret", secret),
]
_ctx = self._select("withSecretVariable", _args)
return Container(_ctx)
@typecheck
def with_service_binding(self, alias: str, service: "Service") -> "Container":
"""Establish a runtime dependency on a service.
The service will be started automatically when needed and detached
when it is no longer needed, executing the default command if none is
set.
The service will be reachable from the container via the provided
hostname alias.
The service dependency will also convey to any files or directories
produced by the container.
Parameters
----------
alias:
A name that can be used to reach the service from the container
service:
Identifier of the service container
"""
_args = [
Arg("alias", alias),
Arg("service", service),
]
_ctx = self._select("withServiceBinding", _args)
return Container(_ctx)
@typecheck
def with_unix_socket(
self,
path: str,
source: "Socket",
*,
owner: str | None = "",
) -> "Container":
"""Retrieves this container plus a socket forwarded to the given Unix
socket path.
Parameters
----------
path:
Location of the forwarded Unix socket (e.g., "/tmp/socket").
source:
Identifier of the socket to forward.
owner:
A user:group to set for the mounted socket.
The user and group can either be an ID (1000:1000) or a name
(foo:bar).
If the group is omitted, it defaults to the same as the user.
"""
_args = [
Arg("path", path),
Arg("source", source),
Arg("owner", owner, ""),
]
_ctx = self._select("withUnixSocket", _args)
return Container(_ctx)
@typecheck
def with_user(self, name: str) -> "Container":
"""Retrieves this container with a different command user.
Parameters
----------
name:
The user to set (e.g., "root").
"""
_args = [
Arg("name", name),
]
_ctx = self._select("withUser", _args)
return Container(_ctx)
@typecheck
def with_workdir(self, path: str) -> "Container":
"""Retrieves this container with a different working directory.
Parameters
----------
path:
The path to set as the working directory (e.g., "/app").
"""
_args = [
Arg("path", path),
]
_ctx = self._select("withWorkdir", _args)
return Container(_ctx)
@typecheck
def without_default_args(self) -> "Container":
"""Retrieves this container with unset default arguments for future
commands.
"""
_args: list[Arg] = []
_ctx = self._select("withoutDefaultArgs", _args)
return Container(_ctx)
@typecheck
def without_entrypoint(
self,
*,
keep_default_args: bool | None = False,
) -> "Container":
"""Retrieves this container with an unset command entrypoint.
Parameters
----------
keep_default_args:
Don't remove the default arguments when unsetting the entrypoint.
"""
_args = [
Arg("keepDefaultArgs", keep_default_args, False),
]
_ctx = self._select("withoutEntrypoint", _args)
return Container(_ctx)
@typecheck
def without_env_variable(self, name: str) -> "Container":
"""Retrieves this container minus the given environment variable.
Parameters
----------
name:
The name of the environment variable (e.g., "HOST").
"""
_args = [
Arg("name", name),
]
_ctx = self._select("withoutEnvVariable", _args)
return Container(_ctx)
@typecheck
def without_exposed_port(
self,
port: int,
*,
protocol: NetworkProtocol | None = "TCP",
) -> "Container":
"""Unexpose a previously exposed port.
Parameters
----------
port:
Port number to unexpose
protocol:
Port protocol to unexpose
"""
_args = [
Arg("port", port),
Arg("protocol", protocol, "TCP"),
]
_ctx = self._select("withoutExposedPort", _args)
return Container(_ctx)
@typecheck
def without_focus(self) -> "Container":
"""Indicate that subsequent operations should not be featured more
prominently in the UI.
This is the initial state of all containers.
"""
_args: list[Arg] = []
_ctx = self._select("withoutFocus", _args)
return Container(_ctx)
@typecheck
def without_label(self, name: str) -> "Container":
"""Retrieves this container minus the given environment label.
Parameters
----------
name:
The name of the label to remove (e.g.,
"org.opencontainers.artifact.created").
"""
_args = [
Arg("name", name),
]
_ctx = self._select("withoutLabel", _args)
return Container(_ctx)
@typecheck
def without_mount(self, path: str) -> "Container":
"""Retrieves this container after unmounting everything at the given
path.
Parameters
----------
path:
Location of the cache directory (e.g., "/cache/node_modules").
"""
_args = [
Arg("path", path),
]
_ctx = self._select("withoutMount", _args)
return Container(_ctx)
@typecheck
def without_registry_auth(self, address: str) -> "Container":
"""Retrieves this container without the registry authentication of a
given address.
Parameters
----------
address:
Registry's address to remove the authentication from.
Formatted as [host]/[user]/[repo]:[tag] (e.g.
docker.io/dagger/dagger:main).
"""
_args = [
Arg("address", address),
]
_ctx = self._select("withoutRegistryAuth", _args)
return Container(_ctx)
@typecheck
def without_unix_socket(self, path: str) -> "Container":
"""Retrieves this container with a previously added Unix socket removed.
Parameters
----------
path:
Location of the socket to remove (e.g., "/tmp/socket").
"""
_args = [
Arg("path", path),
]
_ctx = self._select("withoutUnixSocket", _args)
return Container(_ctx)
@typecheck
def without_user(self) -> "Container":
"""Retrieves this container with an unset command user.
Should default to root.
"""
_args: list[Arg] = []
_ctx = self._select("withoutUser", _args)
return Container(_ctx)
@typecheck
def without_workdir(self) -> "Container":
"""Retrieves this container with an unset working directory.
Should default to "/".
"""
_args: list[Arg] = []
_ctx = self._select("withoutWorkdir", _args)
return Container(_ctx)
@typecheck
async def workdir(self) -> str:
"""Retrieves the working directory for all commands.
Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("workdir", _args)
return await _ctx.execute(str)
def with_(self, cb: Callable[["Container"], "Container"]) -> "Container":
"""Call the provided callable with current Container.
This is useful for reusability and readability by not breaking the calling chain.
"""
return cb(self)
class Directory(Type):
"""A directory."""
@typecheck
def as_module(self, *, source_subpath: str | None = "") -> "Module":
"""Load the directory as a Dagger module
Parameters
----------
source_subpath:
An optional subpath of the directory which contains the module's
source code.
This is needed when the module code is in a subdirectory but
requires parent directories to be loaded in order to execute. For
example, the module source code may need a go.mod, project.toml,
package.json, etc. file from a parent directory.
If not set, the module source code is loaded from the root of the
directory.
"""
_args = [
Arg("sourceSubpath", source_subpath, ""),
]
_ctx = self._select("asModule", _args)
return Module(_ctx)
@typecheck
def diff(self, other: "Directory") -> "Directory":
"""Gets the difference between this directory and an another directory.
Parameters
----------
other:
Identifier of the directory to compare.
"""
_args = [
Arg("other", other),
]
_ctx = self._select("diff", _args)
return Directory(_ctx)
@typecheck
def directory(self, path: str) -> "Directory":
"""Retrieves a directory at the given path.
Parameters
----------
path:
Location of the directory to retrieve (e.g., "/src").
"""
_args = [
Arg("path", path),
]
_ctx = self._select("directory", _args)
return Directory(_ctx)
@typecheck
def docker_build(
self,
*,
platform: Platform | None = None,
dockerfile: str | None = "Dockerfile",
target: str | None = "",
build_args: Sequence[BuildArg] | None = [],
secrets: Sequence["Secret"] | None = [],
) -> Container:
"""Builds a new Docker container from this directory.
Parameters
----------
platform:
The platform to build.
dockerfile:
Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
target:
Target build stage to build.
build_args:
Build arguments to use in the build.
secrets:
Secrets to pass to the build.
They will be mounted at /run/secrets/[secret-name].
"""
_args = [
Arg("platform", platform, None),
Arg("dockerfile", dockerfile, "Dockerfile"),
Arg("target", target, ""),
Arg("buildArgs", build_args, []),
Arg("secrets", secrets, []),
]
_ctx = self._select("dockerBuild", _args)
return Container(_ctx)
@typecheck
async def entries(self, *, path: str | None = None) -> list[str]:
"""Returns a list of files and directories at the given path.
Parameters
----------
path:
Location of the directory to look at (e.g., "/src").
Returns
-------
list[str]
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args = [
Arg("path", path, None),
]
_ctx = self._select("entries", _args)
return await _ctx.execute(list[str])
@typecheck
async def export(self, path: str) -> bool:
"""Writes the contents of the directory to a path on the host.
Parameters
----------
path:
Location of the copied directory (e.g., "logs/").
Returns
-------
bool
The `Boolean` scalar type represents `true` or `false`.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args = [
Arg("path", path),
]
_ctx = self._select("export", _args)
return await _ctx.execute(bool)
@typecheck
def file(self, path: str) -> "File":
"""Retrieves a file at the given path.
Parameters
----------
path:
Location of the file to retrieve (e.g., "README.md").
"""
_args = [
Arg("path", path),
]
_ctx = self._select("file", _args)
return File(_ctx)
@typecheck
async def glob(self, pattern: str) -> list[str]:
"""Returns a list of files and directories that matche the given pattern.
Parameters
----------
pattern:
Pattern to match (e.g., "*.md").
Returns
-------
list[str]
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args = [
Arg("pattern", pattern),
]
_ctx = self._select("glob", _args)
return await _ctx.execute(list[str])
@typecheck
async def id(self) -> DirectoryID:
"""A unique identifier for this Directory.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
DirectoryID
The `DirectoryID` scalar type represents an identifier for an
object of type Directory.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(DirectoryID)
@typecheck
def pipeline(
self,
name: str,
*,
description: str | None = "",
labels: Sequence[PipelineLabel] | None = [],
) -> "Directory":
"""Creates a named sub-pipeline.
Parameters
----------
name:
Name of the sub-pipeline.
description:
Description of the sub-pipeline.
labels:
Labels to apply to the sub-pipeline.
"""
_args = [
Arg("name", name),
Arg("description", description, ""),
Arg("labels", labels, []),
]
_ctx = self._select("pipeline", _args)
return Directory(_ctx)
@typecheck
async def sync(self) -> "Directory":
"""Force evaluation in the engine.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("sync", _args)
_id = await _ctx.execute(DirectoryID)
_ctx = Client.from_context(_ctx)._select(
"loadDirectoryFromID", [Arg("id", _id)]
)
return Directory(_ctx)
def __await__(self):
return self.sync().__await__()
@typecheck
def with_directory(
self,
path: str,
directory: "Directory",
*,
exclude: Sequence[str] | None = [],
include: Sequence[str] | None = [],
) -> "Directory":
"""Retrieves this directory plus a directory written at the given path.
Parameters
----------
path:
Location of the written directory (e.g., "/src/").
directory:
Identifier of the directory to copy.
exclude:
Exclude artifacts that match the given pattern (e.g.,
["node_modules/", ".git*"]).
include:
Include only artifacts that match the given pattern (e.g.,
["app/", "package.*"]).
"""
_args = [
Arg("path", path),
Arg("directory", directory),
Arg("exclude", exclude, []),
Arg("include", include, []),
]
_ctx = self._select("withDirectory", _args)
return Directory(_ctx)
@typecheck
def with_file(
self,
path: str,
source: "File",
*,
permissions: int | None = None,
) -> "Directory":
"""Retrieves this directory plus the contents of the given file copied to
the given path.
Parameters
----------
path:
Location of the copied file (e.g., "/file.txt").
source:
Identifier of the file to copy.
permissions:
Permission given to the copied file (e.g., 0600).
"""
_args = [
Arg("path", path),
Arg("source", source),
Arg("permissions", permissions, None),
]
_ctx = self._select("withFile", _args)
return Directory(_ctx)
@typecheck
def with_new_directory(
self,
path: str,
*,
permissions: int | None = 420,
) -> "Directory":
"""Retrieves this directory plus a new directory created at the given
path.
Parameters
----------
path:
Location of the directory created (e.g., "/logs").
permissions:
Permission granted to the created directory (e.g., 0777).
"""
_args = [
Arg("path", path),
Arg("permissions", permissions, 420),
]
_ctx = self._select("withNewDirectory", _args)
return Directory(_ctx)
@typecheck
def with_new_file(
self,
path: str,
contents: str,
*,
permissions: int | None = 420,
) -> "Directory":
"""Retrieves this directory plus a new file written at the given path.
Parameters
----------
path:
Location of the written file (e.g., "/file.txt").
contents:
Content of the written file (e.g., "Hello world!").
permissions:
Permission given to the copied file (e.g., 0600).
"""
_args = [
Arg("path", path),
Arg("contents", contents),
Arg("permissions", permissions, 420),
]
_ctx = self._select("withNewFile", _args)
return Directory(_ctx)
@typecheck
def with_timestamps(self, timestamp: int) -> "Directory":
"""Retrieves this directory with all file/dir timestamps set to the given
time.
Parameters
----------
timestamp:
Timestamp to set dir/files in.
Formatted in seconds following Unix epoch (e.g., 1672531199).
"""
_args = [
Arg("timestamp", timestamp),
]
_ctx = self._select("withTimestamps", _args)
return Directory(_ctx)
@typecheck
def without_directory(self, path: str) -> "Directory":
"""Retrieves this directory with the directory at the given path removed.
Parameters
----------
path:
Location of the directory to remove (e.g., ".github/").
"""
_args = [
Arg("path", path),
]
_ctx = self._select("withoutDirectory", _args)
return Directory(_ctx)
@typecheck
def without_file(self, path: str) -> "Directory":
"""Retrieves this directory with the file at the given path removed.
Parameters
----------
path:
Location of the file to remove (e.g., "/file.txt").
"""
_args = [
Arg("path", path),
]
_ctx = self._select("withoutFile", _args)
return Directory(_ctx)
def with_(self, cb: Callable[["Directory"], "Directory"]) -> "Directory":
"""Call the provided callable with current Directory.
This is useful for reusability and readability by not breaking the calling chain.
"""
return cb(self)
class EnvVariable(Type):
"""An environment variable name and value."""
__slots__ = (
"_name",
"_value",
)
_name: str | None
_value: str | None
@typecheck
async def id(self) -> EnvVariableID:
"""A unique identifier for this EnvVariable.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
EnvVariableID
The `EnvVariableID` scalar type represents an identifier for an
object of type EnvVariable.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(EnvVariableID)
@typecheck
async def name(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_name"):
return self._name
_args: list[Arg] = []
_ctx = self._select("name", _args)
return await _ctx.execute(str)
@typecheck
async def value(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_value"):
return self._value
_args: list[Arg] = []
_ctx = self._select("value", _args)
return await _ctx.execute(str)
class FieldTypeDef(Type):
"""A definition of a field on a custom object defined in a Module. A
field on an object has a static value, as opposed to a function on an
object whose value is computed by invoking code (and can accept
arguments)."""
__slots__ = (
"_description",
"_name",
)
_description: str | None
_name: str | None
@typecheck
async def description(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_description"):
return self._description
_args: list[Arg] = []
_ctx = self._select("description", _args)
return await _ctx.execute(str)
@typecheck
async def id(self) -> FieldTypeDefID:
"""A unique identifier for this FieldTypeDef.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
FieldTypeDefID
The `FieldTypeDefID` scalar type represents an identifier for an
object of type FieldTypeDef.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(FieldTypeDefID)
@typecheck
async def name(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_name"):
return self._name
_args: list[Arg] = []
_ctx = self._select("name", _args)
return await _ctx.execute(str)
@typecheck
def type_def(self) -> "TypeDef":
_args: list[Arg] = []
_ctx = self._select("typeDef", _args)
return TypeDef(_ctx)
class File(Type):
"""A file."""
@typecheck
async def contents(self) -> str:
"""Retrieves the contents of the file.
Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("contents", _args)
return await _ctx.execute(str)
@typecheck
async def export(
self,
path: str,
*,
allow_parent_dir_path: bool | None = False,
) -> bool:
"""Writes the file to a file path on the host.
Parameters
----------
path:
Location of the written directory (e.g., "output.txt").
allow_parent_dir_path:
If allowParentDirPath is true, the path argument can be a
directory path, in which case the file will be created in that
directory.
Returns
-------
bool
The `Boolean` scalar type represents `true` or `false`.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args = [
Arg("path", path),
Arg("allowParentDirPath", allow_parent_dir_path, False),
]
_ctx = self._select("export", _args)
return await _ctx.execute(bool)
@typecheck
async def id(self) -> FileID:
"""A unique identifier for this File.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
FileID
The `FileID` scalar type represents an identifier for an object of
type File.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(FileID)
@typecheck
async def size(self) -> int:
"""Retrieves the size of the file, in bytes.
Returns
-------
int
The `Int` scalar type represents non-fractional signed whole
numeric values. Int can represent values between -(2^31) and 2^31
- 1.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("size", _args)
return await _ctx.execute(int)
@typecheck
async def sync(self) -> "File":
"""Force evaluation in the engine.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("sync", _args)
_id = await _ctx.execute(FileID)
_ctx = Client.from_context(_ctx)._select("loadFileFromID", [Arg("id", _id)])
return File(_ctx)
def __await__(self):
return self.sync().__await__()
@typecheck
def with_timestamps(self, timestamp: int) -> "File":
"""Retrieves this file with its created/modified timestamps set to the
given time.
Parameters
----------
timestamp:
Timestamp to set dir/files in.
Formatted in seconds following Unix epoch (e.g., 1672531199).
"""
_args = [
Arg("timestamp", timestamp),
]
_ctx = self._select("withTimestamps", _args)
return File(_ctx)
def with_(self, cb: Callable[["File"], "File"]) -> "File":
"""Call the provided callable with current File.
This is useful for reusability and readability by not breaking the calling chain.
"""
return cb(self)
class Function(Type):
"""Function represents a resolver provided by a Module. A function
always evaluates against a parent object and is given a set of named
arguments."""
__slots__ = (
"_description",
"_name",
)
_description: str | None
_name: str | None
@typecheck
async def args(self) -> list["FunctionArg"]:
_args: list[Arg] = []
_ctx = self._select("args", _args)
_ctx = FunctionArg(_ctx)._select_multiple(
_default_value="defaultValue",
_description="description",
_name="name",
)
return await _ctx.execute(list[FunctionArg])
@typecheck
async def description(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_description"):
return self._description
_args: list[Arg] = []
_ctx = self._select("description", _args)
return await _ctx.execute(str)
@typecheck
async def id(self) -> FunctionID:
"""A unique identifier for this Function.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
FunctionID
The `FunctionID` scalar type represents an identifier for an
object of type Function.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(FunctionID)
@typecheck
async def name(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_name"):
return self._name
_args: list[Arg] = []
_ctx = self._select("name", _args)
return await _ctx.execute(str)
@typecheck
def return_type(self) -> "TypeDef":
_args: list[Arg] = []
_ctx = self._select("returnType", _args)
return TypeDef(_ctx)
@typecheck
def with_arg(
self,
name: str,
type_def: "TypeDef",
*,
description: str | None = "",
default_value: JSON | None = None,
) -> "Function":
"""Returns the function with the provided argument
Parameters
----------
name:
The name of the argument
type_def:
The type of the argument
description:
A doc string for the argument, if any
default_value:
A default value to use for this argument if not explicitly set by
the caller, if any
"""
_args = [
Arg("name", name),
Arg("typeDef", type_def),
Arg("description", description, ""),
Arg("defaultValue", default_value, None),
]
_ctx = self._select("withArg", _args)
return Function(_ctx)
@typecheck
def with_description(self, description: str) -> "Function":
"""Returns the function with the given doc string.
Parameters
----------
description:
The doc string to set.
"""
_args = [
Arg("description", description),
]
_ctx = self._select("withDescription", _args)
return Function(_ctx)
def with_(self, cb: Callable[["Function"], "Function"]) -> "Function":
"""Call the provided callable with current Function.
This is useful for reusability and readability by not breaking the calling chain.
"""
return cb(self)
class FunctionArg(Type):
"""An argument accepted by a function. This is a specification for an
argument at function definition time, not an argument passed at
function call time."""
__slots__ = (
"_default_value",
"_description",
"_name",
)
_default_value: JSON | None
_description: str | None
_name: str | None
@typecheck
async def default_value(self) -> JSON:
"""Returns
-------
JSON
An arbitrary JSON-encoded value.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_default_value"):
return self._default_value
_args: list[Arg] = []
_ctx = self._select("defaultValue", _args)
return await _ctx.execute(JSON)
@typecheck
async def description(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_description"):
return self._description
_args: list[Arg] = []
_ctx = self._select("description", _args)
return await _ctx.execute(str)
@typecheck
async def id(self) -> FunctionArgID:
"""A unique identifier for this FunctionArg.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
FunctionArgID
The `FunctionArgID` scalar type represents an identifier for an
object of type FunctionArg.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(FunctionArgID)
@typecheck
async def name(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_name"):
return self._name
_args: list[Arg] = []
_ctx = self._select("name", _args)
return await _ctx.execute(str)
@typecheck
def type_def(self) -> "TypeDef":
_args: list[Arg] = []
_ctx = self._select("typeDef", _args)
return TypeDef(_ctx)
class FunctionCall(Type):
"""An active function call."""
@typecheck
async def id(self) -> FunctionCallID:
"""A unique identifier for this FunctionCall.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
FunctionCallID
The `FunctionCallID` scalar type represents an identifier for an
object of type FunctionCall.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(FunctionCallID)
@typecheck
async def input_args(self) -> list["FunctionCallArgValue"]:
_args: list[Arg] = []
_ctx = self._select("inputArgs", _args)
_ctx = FunctionCallArgValue(_ctx)._select_multiple(
_name="name",
_value="value",
)
return await _ctx.execute(list[FunctionCallArgValue])
@typecheck
async def name(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("name", _args)
return await _ctx.execute(str)
@typecheck
async def parent(self) -> JSON:
"""Returns
-------
JSON
An arbitrary JSON-encoded value.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("parent", _args)
return await _ctx.execute(JSON)
@typecheck
async def parent_name(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("parentName", _args)
return await _ctx.execute(str)
@typecheck
async def return_value(self, value: JSON) -> Void | None:
"""Set the return value of the function call to the provided value.
Parameters
----------
value:
JSON serialization of the return value.
Returns
-------
Void | None
The absence of a value. A Null Void is used as a placeholder for
resolvers that do not return anything.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args = [
Arg("value", value),
]
_ctx = self._select("returnValue", _args)
return await _ctx.execute(Void | None)
class FunctionCallArgValue(Type):
"""A value passed as a named argument to a function call."""
__slots__ = (
"_name",
"_value",
)
_name: str | None
_value: JSON | None
@typecheck
async def id(self) -> FunctionCallArgValueID:
"""A unique identifier for this FunctionCallArgValue.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
FunctionCallArgValueID
The `FunctionCallArgValueID` scalar type represents an identifier
for an object of type FunctionCallArgValue.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(FunctionCallArgValueID)
@typecheck
async def name(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_name"):
return self._name
_args: list[Arg] = []
_ctx = self._select("name", _args)
return await _ctx.execute(str)
@typecheck
async def value(self) -> JSON:
"""Returns
-------
JSON
An arbitrary JSON-encoded value.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_value"):
return self._value
_args: list[Arg] = []
_ctx = self._select("value", _args)
return await _ctx.execute(JSON)
class GeneratedCode(Type):
"""The result of running an SDK's codegen."""
@typecheck
def code(self) -> Directory:
_args: list[Arg] = []
_ctx = self._select("code", _args)
return Directory(_ctx)
@typecheck
async def id(self) -> GeneratedCodeID:
"""A unique identifier for this GeneratedCode.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
GeneratedCodeID
The `GeneratedCodeID` scalar type represents an identifier for an
object of type GeneratedCode.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(GeneratedCodeID)
@typecheck
async def vcs_generated_paths(self) -> list[str]:
"""Returns
-------
list[str]
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("vcsGeneratedPaths", _args)
return await _ctx.execute(list[str])
@typecheck
async def vcs_ignored_paths(self) -> list[str]:
"""Returns
-------
list[str]
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("vcsIgnoredPaths", _args)
return await _ctx.execute(list[str])
@typecheck
def with_vcs_generated_paths(self, paths: Sequence[str]) -> "GeneratedCode":
"""Set the list of paths to mark generated in version control."""
_args = [
Arg("paths", paths),
]
_ctx = self._select("withVCSGeneratedPaths", _args)
return GeneratedCode(_ctx)
@typecheck
def with_vcs_ignored_paths(self, paths: Sequence[str]) -> "GeneratedCode":
"""Set the list of paths to ignore in version control."""
_args = [
Arg("paths", paths),
]
_ctx = self._select("withVCSIgnoredPaths", _args)
return GeneratedCode(_ctx)
def with_(
self, cb: Callable[["GeneratedCode"], "GeneratedCode"]
) -> "GeneratedCode":
"""Call the provided callable with current GeneratedCode.
This is useful for reusability and readability by not breaking the calling chain.
"""
return cb(self)
class GitRef(Type):
"""A git ref (tag, branch, or commit)."""
@typecheck
async def commit(self) -> str:
"""The resolved commit id at this ref.
Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("commit", _args)
return await _ctx.execute(str)
@typecheck
async def id(self) -> GitRefID:
"""A unique identifier for this GitRef.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
GitRefID
The `GitRefID` scalar type represents an identifier for an object
of type GitRef.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(GitRefID)
@typecheck
def tree(
self,
*,
ssh_known_hosts: str | None = None,
ssh_auth_socket: "Socket | None" = None,
) -> Directory:
"""The filesystem tree at this ref."""
_args = [
Arg("sshKnownHosts", ssh_known_hosts, None),
Arg("sshAuthSocket", ssh_auth_socket, None),
]
_ctx = self._select("tree", _args)
return Directory(_ctx)
class GitRepository(Type):
"""A git repository."""
@typecheck
def branch(self, name: str) -> GitRef:
"""Returns details of a branch.
Parameters
----------
name:
Branch's name (e.g., "main").
"""
_args = [
Arg("name", name),
]
_ctx = self._select("branch", _args)
return GitRef(_ctx)
@typecheck
def commit(self, id: str) -> GitRef:
"""Returns details of a commit.
Parameters
----------
id:
Identifier of the commit (e.g.,
"b6315d8f2810962c601af73f86831f6866ea798b").
"""
_args = [
Arg("id", id),
]
_ctx = self._select("commit", _args)
return GitRef(_ctx)
@typecheck
async def id(self) -> GitRepositoryID:
"""A unique identifier for this GitRepository.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
GitRepositoryID
The `GitRepositoryID` scalar type represents an identifier for an
object of type GitRepository.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(GitRepositoryID)
@typecheck
def tag(self, name: str) -> GitRef:
"""Returns details of a tag.
Parameters
----------
name:
Tag's name (e.g., "v0.3.9").
"""
_args = [
Arg("name", name),
]
_ctx = self._select("tag", _args)
return GitRef(_ctx)
class Host(Type):
"""Information about the host environment."""
@typecheck
def directory(
self,
path: str,
*,
exclude: Sequence[str] | None = [],
include: Sequence[str] | None = [],
) -> Directory:
"""Accesses a directory on the host.
Parameters
----------
path:
Location of the directory to access (e.g., ".").
exclude:
Exclude artifacts that match the given pattern (e.g.,
["node_modules/", ".git*"]).
include:
Include only artifacts that match the given pattern (e.g.,
["app/", "package.*"]).
"""
_args = [
Arg("path", path),
Arg("exclude", exclude, []),
Arg("include", include, []),
]
_ctx = self._select("directory", _args)
return Directory(_ctx)
@typecheck
def file(self, path: str) -> File:
"""Accesses a file on the host.
Parameters
----------
path:
Location of the file to retrieve (e.g., "README.md").
"""
_args = [
Arg("path", path),
]
_ctx = self._select("file", _args)
return File(_ctx)
@typecheck
async def id(self) -> HostID:
"""A unique identifier for this Host.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
HostID
The `HostID` scalar type represents an identifier for an object of
type Host.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(HostID)
@typecheck
def service(
self,
ports: Sequence[PortForward],
*,
host: str | None = "localhost",
) -> "Service":
"""Creates a service that forwards traffic to a specified address via the
host.
Parameters
----------
ports:
Ports to expose via the service, forwarding through the host
network.
If a port's frontend is unspecified or 0, it defaults to the same
as the backend port.
An empty set of ports is not valid; an error will be returned.
host:
Upstream host to forward traffic to.
"""
_args = [
Arg("ports", ports),
Arg("host", host, "localhost"),
]
_ctx = self._select("service", _args)
return Service(_ctx)
@typecheck
def set_secret_file(self, name: str, path: str) -> "Secret":
"""Sets a secret given a user-defined name and the file path on the host,
and returns the secret.
The file is limited to a size of 512000 bytes.
Parameters
----------
name:
The user defined name for this secret.
path:
Location of the file to set as a secret.
"""
_args = [
Arg("name", name),
Arg("path", path),
]
_ctx = self._select("setSecretFile", _args)
return Secret(_ctx)
@typecheck
def tunnel(
self,
service: "Service",
*,
ports: Sequence[PortForward] | None = [],
native: bool | None = False,
) -> "Service":
"""Creates a tunnel that forwards traffic from the host to a service.
Parameters
----------
service:
Service to send traffic from the tunnel.
ports:
Configure explicit port forwarding rules for the tunnel.
If a port's frontend is unspecified or 0, a random port will be
chosen by the host.
If no ports are given, all of the service's ports are forwarded.
If native is true, each port maps to the same port on the host. If
native is false, each port maps to a random port chosen by the
host.
If ports are given and native is true, the ports are additive.
native:
Map each service port to the same port on the host, as if the
service were running natively.
Note: enabling may result in port conflicts.
"""
_args = [
Arg("service", service),
Arg("ports", ports, []),
Arg("native", native, False),
]
_ctx = self._select("tunnel", _args)
return Service(_ctx)
@typecheck
def unix_socket(self, path: str) -> "Socket":
"""Accesses a Unix socket on the host.
Parameters
----------
path:
Location of the Unix socket (e.g., "/var/run/docker.sock").
"""
_args = [
Arg("path", path),
]
_ctx = self._select("unixSocket", _args)
return Socket(_ctx)
class InterfaceTypeDef(Type):
"""A definition of a custom interface defined in a Module."""
@typecheck
async def description(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("description", _args)
return await _ctx.execute(str)
@typecheck
async def functions(self) -> list[Function]:
_args: list[Arg] = []
_ctx = self._select("functions", _args)
_ctx = Function(_ctx)._select_multiple(
_description="description",
_name="name",
)
return await _ctx.execute(list[Function])
@typecheck
async def id(self) -> InterfaceTypeDefID:
"""A unique identifier for this InterfaceTypeDef.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
InterfaceTypeDefID
The `InterfaceTypeDefID` scalar type represents an identifier for
an object of type InterfaceTypeDef.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(InterfaceTypeDefID)
@typecheck
async def name(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("name", _args)
return await _ctx.execute(str)
@typecheck
async def source_module_name(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("sourceModuleName", _args)
return await _ctx.execute(str)
class Label(Type):
"""A simple key value object that represents a label."""
__slots__ = (
"_name",
"_value",
)
_name: str | None
_value: str | None
@typecheck
async def id(self) -> LabelID:
"""A unique identifier for this Label.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
LabelID
The `LabelID` scalar type represents an identifier for an object
of type Label.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(LabelID)
@typecheck
async def name(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_name"):
return self._name
_args: list[Arg] = []
_ctx = self._select("name", _args)
return await _ctx.execute(str)
@typecheck
async def value(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_value"):
return self._value
_args: list[Arg] = []
_ctx = self._select("value", _args)
return await _ctx.execute(str)
class ListTypeDef(Type):
"""A definition of a list type in a Module."""
@typecheck
def element_type_def(self) -> "TypeDef":
_args: list[Arg] = []
_ctx = self._select("elementTypeDef", _args)
return TypeDef(_ctx)
@typecheck
async def id(self) -> ListTypeDefID:
"""A unique identifier for this ListTypeDef.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
ListTypeDefID
The `ListTypeDefID` scalar type represents an identifier for an
object of type ListTypeDef.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(ListTypeDefID)
class Module(Type):
"""A Dagger module."""
__slots__ = (
"_dependency_config",
"_description",
"_name",
"_sdk",
"_serve",
"_source_directory_subpath",
)
_dependency_config: str | None
_description: str | None
_name: str | None
_sdk: str | None
_serve: Void | None
_source_directory_subpath: str | None
@typecheck
async def dependencies(self) -> list["Module"]:
_args: list[Arg] = []
_ctx = self._select("dependencies", _args)
_ctx = Module(_ctx)._select_multiple(
_dependency_config="dependencyConfig",
_description="description",
_name="name",
_sdk="sdk",
_serve="serve",
_source_directory_subpath="sourceDirectorySubpath",
)
return await _ctx.execute(list[Module])
@typecheck
async def dependency_config(self) -> list[str]:
"""Returns
-------
list[str]
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_dependency_config"):
return self._dependency_config
_args: list[Arg] = []
_ctx = self._select("dependencyConfig", _args)
return await _ctx.execute(list[str])
@typecheck
async def description(self) -> str | None:
"""Returns
-------
str | None
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_description"):
return self._description
_args: list[Arg] = []
_ctx = self._select("description", _args)
return await _ctx.execute(str | None)
@typecheck
def generated_code(self) -> GeneratedCode:
_args: list[Arg] = []
_ctx = self._select("generatedCode", _args)
return GeneratedCode(_ctx)
@typecheck
async def id(self) -> ModuleID:
"""A unique identifier for this Module.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
ModuleID
The `ModuleID` scalar type represents an identifier for an object
of type Module.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(ModuleID)
@typecheck
def initialize(self) -> "Module":
"""Retrieves the module with the objects loaded via its SDK."""
_args: list[Arg] = []
_ctx = self._select("initialize", _args)
return Module(_ctx)
@typecheck
async def interfaces(self) -> list["TypeDef"]:
_args: list[Arg] = []
_ctx = self._select("interfaces", _args)
_ctx = TypeDef(_ctx)._select_multiple(
_kind="kind",
_optional="optional",
)
return await _ctx.execute(list[TypeDef])
@typecheck
async def name(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_name"):
return self._name
_args: list[Arg] = []
_ctx = self._select("name", _args)
return await _ctx.execute(str)
@typecheck
async def objects(self) -> list["TypeDef"]:
_args: list[Arg] = []
_ctx = self._select("objects", _args)
_ctx = TypeDef(_ctx)._select_multiple(
_kind="kind",
_optional="optional",
)
return await _ctx.execute(list[TypeDef])
@typecheck
async def sdk(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_sdk"):
return self._sdk
_args: list[Arg] = []
_ctx = self._select("sdk", _args)
return await _ctx.execute(str)
@typecheck
async def serve(self) -> Void | None:
"""Serve a module's API in the current session.
Note: this can only be called once per session. In the future, it
could return a stream or service to remove the side effect.
Returns
-------
Void | None
The absence of a value. A Null Void is used as a placeholder for
resolvers that do not return anything.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_serve"):
return self._serve
_args: list[Arg] = []
_ctx = self._select("serve", _args)
return await _ctx.execute(Void | None)
@typecheck
def source_directory(self) -> Directory:
_args: list[Arg] = []
_ctx = self._select("sourceDirectory", _args)
return Directory(_ctx)
@typecheck
async def source_directory_subpath(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_source_directory_subpath"):
return self._source_directory_subpath
_args: list[Arg] = []
_ctx = self._select("sourceDirectorySubpath", _args)
return await _ctx.execute(str)
@typecheck
def with_interface(self, iface: "TypeDef") -> "Module":
"""This module plus the given Interface type and associated functions"""
_args = [
Arg("iface", iface),
]
_ctx = self._select("withInterface", _args)
return Module(_ctx)
@typecheck
def with_object(self, object: "TypeDef") -> "Module":
"""This module plus the given Object type and associated functions."""
_args = [
Arg("object", object),
]
_ctx = self._select("withObject", _args)
return Module(_ctx)
@typecheck
def with_source(
self,
directory: Directory,
*,
subpath: str | None = "",
) -> "Module":
"""Retrieves the module with basic configuration loaded, ready for
initialization.
Parameters
----------
directory:
The directory containing the module's source code.
subpath:
An optional subpath of the directory which contains the module's
source code.
This is needed when the module code is in a subdirectory but
requires parent directories to be loaded in order to execute. For
example, the module source code may need a go.mod, project.toml,
package.json, etc. file from a parent directory.
If not set, the module source code is loaded from the root of the
directory.
"""
_args = [
Arg("directory", directory),
Arg("subpath", subpath, ""),
]
_ctx = self._select("withSource", _args)
return Module(_ctx)
def with_(self, cb: Callable[["Module"], "Module"]) -> "Module":
"""Call the provided callable with current Module.
This is useful for reusability and readability by not breaking the calling chain.
"""
return cb(self)
class ModuleConfig(Type):
"""Static configuration for a module (e.g. parsed contents of
dagger.json)"""
@typecheck
async def dependencies(self) -> list[str]:
"""Returns
-------
list[str]
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("dependencies", _args)
return await _ctx.execute(list[str])
@typecheck
async def exclude(self) -> list[str]:
"""Returns
-------
list[str]
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("exclude", _args)
return await _ctx.execute(list[str])
@typecheck
async def id(self) -> ModuleConfigID:
"""A unique identifier for this ModuleConfig.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
ModuleConfigID
The `ModuleConfigID` scalar type represents an identifier for an
object of type ModuleConfig.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(ModuleConfigID)
@typecheck
async def include(self) -> list[str]:
"""Returns
-------
list[str]
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("include", _args)
return await _ctx.execute(list[str])
@typecheck
async def name(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("name", _args)
return await _ctx.execute(str)
@typecheck
async def root(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("root", _args)
return await _ctx.execute(str)
@typecheck
async def sdk(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("sdk", _args)
return await _ctx.execute(str)
class ObjectTypeDef(Type):
"""A definition of a custom object defined in a Module."""
@typecheck
def constructor(self) -> Function:
_args: list[Arg] = []
_ctx = self._select("constructor", _args)
return Function(_ctx)
@typecheck
async def description(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("description", _args)
return await _ctx.execute(str)
@typecheck
async def fields(self) -> list[FieldTypeDef]:
_args: list[Arg] = []
_ctx = self._select("fields", _args)
_ctx = FieldTypeDef(_ctx)._select_multiple(
_description="description",
_name="name",
)
return await _ctx.execute(list[FieldTypeDef])
@typecheck
async def functions(self) -> list[Function]:
_args: list[Arg] = []
_ctx = self._select("functions", _args)
_ctx = Function(_ctx)._select_multiple(
_description="description",
_name="name",
)
return await _ctx.execute(list[Function])
@typecheck
async def id(self) -> ObjectTypeDefID:
"""A unique identifier for this ObjectTypeDef.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
ObjectTypeDefID
The `ObjectTypeDefID` scalar type represents an identifier for an
object of type ObjectTypeDef.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(ObjectTypeDefID)
@typecheck
async def name(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("name", _args)
return await _ctx.execute(str)
@typecheck
async def source_module_name(self) -> str:
"""Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("sourceModuleName", _args)
return await _ctx.execute(str)
class Port(Type):
"""A port exposed by a container."""
__slots__ = (
"_description",
"_port",
"_protocol",
)
_description: str | None
_port: int | None
_protocol: NetworkProtocol | None
@typecheck
async def description(self) -> str | None:
"""Returns
-------
str | None
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_description"):
return self._description
_args: list[Arg] = []
_ctx = self._select("description", _args)
return await _ctx.execute(str | None)
@typecheck
async def id(self) -> PortID:
"""A unique identifier for this Port.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
PortID
The `PortID` scalar type represents an identifier for an object of
type Port.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(PortID)
@typecheck
async def port(self) -> int:
"""Returns
-------
int
The `Int` scalar type represents non-fractional signed whole
numeric values. Int can represent values between -(2^31) and 2^31
- 1.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_port"):
return self._port
_args: list[Arg] = []
_ctx = self._select("port", _args)
return await _ctx.execute(int)
@typecheck
async def protocol(self) -> NetworkProtocol:
"""Returns
-------
NetworkProtocol
Transport layer network protocol associated to a port.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_protocol"):
return self._protocol
_args: list[Arg] = []
_ctx = self._select("protocol", _args)
return await _ctx.execute(NetworkProtocol)
class Client(Root):
"""The root of the DAG."""
@typecheck
def blob(
self,
digest: str,
size: int,
media_type: str,
uncompressed: str,
) -> Directory:
"""Retrieves a content-addressed blob.
Parameters
----------
digest:
Digest of the blob
size:
Size of the blob
media_type:
Media type of the blob
uncompressed:
Digest of the uncompressed blob
"""
_args = [
Arg("digest", digest),
Arg("size", size),
Arg("mediaType", media_type),
Arg("uncompressed", uncompressed),
]
_ctx = self._select("blob", _args)
return Directory(_ctx)
@typecheck
def cache_volume(self, key: str) -> CacheVolume:
"""Constructs a cache volume for a given cache key.
Parameters
----------
key:
A string identifier to target this cache volume (e.g., "modules-
cache").
"""
_args = [
Arg("key", key),
]
_ctx = self._select("cacheVolume", _args)
return CacheVolume(_ctx)
@typecheck
async def check_version_compatibility(self, version: str) -> bool:
"""Checks if the current Dagger Engine is compatible with an SDK's
required version.
Parameters
----------
version:
Version required by the SDK.
Returns
-------
bool
The `Boolean` scalar type represents `true` or `false`.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args = [
Arg("version", version),
]
_ctx = self._select("checkVersionCompatibility", _args)
return await _ctx.execute(bool)
@typecheck
def container(
self,
*,
id: ContainerID | None = None,
platform: Platform | None = None,
) -> Container:
"""Creates a scratch container.
Optional platform argument initializes new containers to execute and
publish as that platform. Platform defaults to that of the builder's
host.
Parameters
----------
id:
platform:
Platform to initialize the container with.
"""
_args = [
Arg("id", id, None),
Arg("platform", platform, None),
]
_ctx = self._select("container", _args)
return Container(_ctx)
@typecheck
def current_function_call(self) -> FunctionCall:
"""The FunctionCall context that the SDK caller is currently executing
in.
If the caller is not currently executing in a function, this will
return an error.
"""
_args: list[Arg] = []
_ctx = self._select("currentFunctionCall", _args)
return FunctionCall(_ctx)
@typecheck
def current_module(self) -> Module:
"""The module currently being served in the session, if any."""
_args: list[Arg] = []
_ctx = self._select("currentModule", _args)
return Module(_ctx)
@typecheck
async def current_type_defs(self) -> list["TypeDef"]:
"""The TypeDef representations of the objects currently being served in
the session.
"""
_args: list[Arg] = []
_ctx = self._select("currentTypeDefs", _args)
_ctx = TypeDef(_ctx)._select_multiple(
_kind="kind",
_optional="optional",
)
return await _ctx.execute(list[TypeDef])
@typecheck
async def default_platform(self) -> Platform:
"""The default platform of the engine.
Returns
-------
Platform
The platform config OS and architecture in a Container. The
format is [os]/[platform]/[version] (e.g., "darwin/arm64/v7",
"windows/amd64", "linux/arm64").
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("defaultPlatform", _args)
return await _ctx.execute(Platform)
@typecheck
def directory(self, *, id: DirectoryID | None = None) -> Directory:
"""Creates an empty directory."""
_args = [
Arg("id", id, None),
]
_ctx = self._select("directory", _args)
return Directory(_ctx)
@typecheck
def file(self, id: FileID) -> File:
""".. deprecated::
Use loadFileFromID instead.
"""
warnings.warn(
'Method "file" is deprecated: Use loadFileFromID instead.',
DeprecationWarning,
stacklevel=4,
)
_args = [
Arg("id", id),
]
_ctx = self._select("file", _args)
return File(_ctx)
@typecheck
def function(self, name: str, return_type: "TypeDef") -> Function:
"""Creates a function.
Parameters
----------
name:
Name of the function, in its original format from the
implementation language.
return_type:
Return type of the function.
"""
_args = [
Arg("name", name),
Arg("returnType", return_type),
]
_ctx = self._select("function", _args)
return Function(_ctx)
@typecheck
def generated_code(self, code: Directory) -> GeneratedCode:
"""Create a code generation result, given a directory containing the
generated code.
"""
_args = [
Arg("code", code),
]
_ctx = self._select("generatedCode", _args)
return GeneratedCode(_ctx)
@typecheck
def git(
self,
url: str,
*,
keep_git_dir: bool | None = False,
experimental_service_host: "Service | None" = None,
ssh_known_hosts: str | None = "",
ssh_auth_socket: "Socket | None" = None,
) -> GitRepository:
"""Queries a Git repository.
Parameters
----------
url:
URL of the git repository.
Can be formatted as `https://{host}/{owner}/{repo}`,
`git@{host}:{owner}/{repo}`.
Suffix ".git" is optional.
keep_git_dir:
Set to true to keep .git directory.
experimental_service_host:
A service which must be started before the repo is fetched.
ssh_known_hosts:
Set SSH known hosts
ssh_auth_socket:
Set SSH auth socket
"""
_args = [
Arg("url", url),
Arg("keepGitDir", keep_git_dir, False),
Arg("experimentalServiceHost", experimental_service_host, None),
Arg("sshKnownHosts", ssh_known_hosts, ""),
Arg("sshAuthSocket", ssh_auth_socket, None),
]
_ctx = self._select("git", _args)
return GitRepository(_ctx)
@typecheck
def host(self) -> Host:
"""Queries the host environment."""
_args: list[Arg] = []
_ctx = self._select("host", _args)
return Host(_ctx)
@typecheck
def http(
self,
url: str,
*,
experimental_service_host: "Service | None" = None,
) -> File:
"""Returns a file containing an http remote url content.
Parameters
----------
url:
HTTP url to get the content from (e.g., "https://docs.dagger.io").
experimental_service_host:
A service which must be started before the URL is fetched.
"""
_args = [
Arg("url", url),
Arg("experimentalServiceHost", experimental_service_host, None),
]
_ctx = self._select("http", _args)
return File(_ctx)
@typecheck
def load_cache_volume_from_id(self, id: CacheVolumeID) -> CacheVolume:
"""Load a CacheVolume from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadCacheVolumeFromID", _args)
return CacheVolume(_ctx)
@typecheck
def load_container_from_id(self, id: ContainerID) -> Container:
"""Load a Container from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadContainerFromID", _args)
return Container(_ctx)
@typecheck
def load_directory_from_id(self, id: DirectoryID) -> Directory:
"""Load a Directory from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadDirectoryFromID", _args)
return Directory(_ctx)
@typecheck
def load_env_variable_from_id(self, id: EnvVariableID) -> EnvVariable:
"""Load a EnvVariable from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadEnvVariableFromID", _args)
return EnvVariable(_ctx)
@typecheck
def load_field_type_def_from_id(self, id: FieldTypeDefID) -> FieldTypeDef:
"""Load a FieldTypeDef from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadFieldTypeDefFromID", _args)
return FieldTypeDef(_ctx)
@typecheck
def load_file_from_id(self, id: FileID) -> File:
"""Load a File from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadFileFromID", _args)
return File(_ctx)
@typecheck
def load_function_arg_from_id(self, id: FunctionArgID) -> FunctionArg:
"""Load a FunctionArg from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadFunctionArgFromID", _args)
return FunctionArg(_ctx)
@typecheck
def load_function_call_arg_value_from_id(
self, id: FunctionCallArgValueID
) -> FunctionCallArgValue:
"""Load a FunctionCallArgValue from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadFunctionCallArgValueFromID", _args)
return FunctionCallArgValue(_ctx)
@typecheck
def load_function_call_from_id(self, id: FunctionCallID) -> FunctionCall:
"""Load a FunctionCall from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadFunctionCallFromID", _args)
return FunctionCall(_ctx)
@typecheck
def load_function_from_id(self, id: FunctionID) -> Function:
"""Load a Function from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadFunctionFromID", _args)
return Function(_ctx)
@typecheck
def load_generated_code_from_id(self, id: GeneratedCodeID) -> GeneratedCode:
"""Load a GeneratedCode from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadGeneratedCodeFromID", _args)
return GeneratedCode(_ctx)
@typecheck
def load_git_ref_from_id(self, id: GitRefID) -> GitRef:
"""Load a GitRef from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadGitRefFromID", _args)
return GitRef(_ctx)
@typecheck
def load_git_repository_from_id(self, id: GitRepositoryID) -> GitRepository:
"""Load a GitRepository from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadGitRepositoryFromID", _args)
return GitRepository(_ctx)
@typecheck
def load_host_from_id(self, id: HostID) -> Host:
"""Load a Host from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadHostFromID", _args)
return Host(_ctx)
@typecheck
def load_interface_type_def_from_id(
self, id: InterfaceTypeDefID
) -> InterfaceTypeDef:
"""Load a InterfaceTypeDef from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadInterfaceTypeDefFromID", _args)
return InterfaceTypeDef(_ctx)
@typecheck
def load_label_from_id(self, id: LabelID) -> Label:
"""Load a Label from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadLabelFromID", _args)
return Label(_ctx)
@typecheck
def load_list_type_def_from_id(self, id: ListTypeDefID) -> ListTypeDef:
"""Load a ListTypeDef from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadListTypeDefFromID", _args)
return ListTypeDef(_ctx)
@typecheck
def load_module_config_from_id(self, id: ModuleConfigID) -> ModuleConfig:
"""Load a ModuleConfig from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadModuleConfigFromID", _args)
return ModuleConfig(_ctx)
@typecheck
def load_module_from_id(self, id: ModuleID) -> Module:
"""Load a Module from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadModuleFromID", _args)
return Module(_ctx)
@typecheck
def load_object_type_def_from_id(self, id: ObjectTypeDefID) -> ObjectTypeDef:
"""Load a ObjectTypeDef from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadObjectTypeDefFromID", _args)
return ObjectTypeDef(_ctx)
@typecheck
def load_port_from_id(self, id: PortID) -> Port:
"""Load a Port from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadPortFromID", _args)
return Port(_ctx)
@typecheck
def load_secret_from_id(self, id: SecretID) -> "Secret":
"""Load a Secret from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadSecretFromID", _args)
return Secret(_ctx)
@typecheck
def load_service_from_id(self, id: ServiceID) -> "Service":
"""Load a Service from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadServiceFromID", _args)
return Service(_ctx)
@typecheck
def load_socket_from_id(self, id: SocketID) -> "Socket":
"""Load a Socket from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadSocketFromID", _args)
return Socket(_ctx)
@typecheck
def load_type_def_from_id(self, id: TypeDefID) -> "TypeDef":
"""Load a TypeDef from its ID."""
_args = [
Arg("id", id),
]
_ctx = self._select("loadTypeDefFromID", _args)
return TypeDef(_ctx)
@typecheck
def module(self) -> Module:
"""Create a new module."""
_args: list[Arg] = []
_ctx = self._select("module", _args)
return Module(_ctx)
@typecheck
def module_config(
self,
source_directory: Directory,
*,
subpath: str | None = "",
) -> ModuleConfig:
"""Load the static configuration for a module from the given source
directory and optional subpath.
"""
_args = [
Arg("sourceDirectory", source_directory),
Arg("subpath", subpath, ""),
]
_ctx = self._select("moduleConfig", _args)
return ModuleConfig(_ctx)
@typecheck
def pipeline(
self,
name: str,
*,
description: str | None = "",
labels: Sequence[PipelineLabel] | None = None,
) -> "Client":
"""Creates a named sub-pipeline.
Parameters
----------
name:
Name of the sub-pipeline.
description:
Description of the sub-pipeline.
labels:
Labels to apply to the sub-pipeline.
"""
_args = [
Arg("name", name),
Arg("description", description, ""),
Arg("labels", labels, None),
]
_ctx = self._select("pipeline", _args)
return Client(_ctx)
@typecheck
def secret(self, name: str) -> "Secret":
"""Reference a secret by name."""
_args = [
Arg("name", name),
]
_ctx = self._select("secret", _args)
return Secret(_ctx)
@typecheck
def set_secret(self, name: str, plaintext: str) -> "Secret":
"""Sets a secret given a user defined name to its plaintext and returns
the secret.
The plaintext value is limited to a size of 128000 bytes.
Parameters
----------
name:
The user defined name for this secret
plaintext:
The plaintext of the secret
"""
_args = [
Arg("name", name),
Arg("plaintext", plaintext),
]
_ctx = self._select("setSecret", _args)
return Secret(_ctx)
@typecheck
def socket(self, id: SocketID) -> "Socket":
"""Loads a socket by its ID.
.. deprecated::
Use :py:meth:`load_socket_from_id` instead.
"""
warnings.warn(
'Method "socket" is deprecated: Use "load_socket_from_id" instead.',
DeprecationWarning,
stacklevel=4,
)
_args = [
Arg("id", id),
]
_ctx = self._select("socket", _args)
return Socket(_ctx)
@typecheck
def type_def(self) -> "TypeDef":
"""Create a new TypeDef."""
_args: list[Arg] = []
_ctx = self._select("typeDef", _args)
return TypeDef(_ctx)
def with_(self, cb: Callable[["Client"], "Client"]) -> "Client":
"""Call the provided callable with current Client.
This is useful for reusability and readability by not breaking the calling chain.
"""
return cb(self)
class Secret(Type):
"""A reference to a secret value, which can be handled more safely
than the value itself."""
@typecheck
async def id(self) -> SecretID:
"""A unique identifier for this Secret.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
SecretID
The `SecretID` scalar type represents an identifier for an object
of type Secret.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(SecretID)
@typecheck
async def plaintext(self) -> str:
"""The value of this secret.
Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("plaintext", _args)
return await _ctx.execute(str)
class Service(Type):
"""A content-addressed service providing TCP connectivity."""
@typecheck
async def endpoint(
self,
*,
port: int | None = None,
scheme: str | None = "",
) -> str:
"""Retrieves an endpoint that clients can use to reach this container.
If no port is specified, the first exposed port is used. If none exist
an error is returned.
If a scheme is specified, a URL is returned. Otherwise, a host:port
pair is returned.
Parameters
----------
port:
The exposed port number for the endpoint
scheme:
Return a URL with the given scheme, eg. http for http://
Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args = [
Arg("port", port, None),
Arg("scheme", scheme, ""),
]
_ctx = self._select("endpoint", _args)
return await _ctx.execute(str)
@typecheck
async def hostname(self) -> str:
"""Retrieves a hostname which can be used by clients to reach this
container.
Returns
-------
str
The `String` scalar type represents textual data, represented as
UTF-8 character sequences. The String type is most often used by
GraphQL to represent free-form human-readable text.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("hostname", _args)
return await _ctx.execute(str)
@typecheck
async def id(self) -> ServiceID:
"""A unique identifier for this Service.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
ServiceID
The `ServiceID` scalar type represents an identifier for an object
of type Service.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(ServiceID)
@typecheck
async def ports(self) -> list[Port]:
"""Retrieves the list of ports provided by the service."""
_args: list[Arg] = []
_ctx = self._select("ports", _args)
_ctx = Port(_ctx)._select_multiple(
_description="description",
_port="port",
_protocol="protocol",
)
return await _ctx.execute(list[Port])
@typecheck
async def start(self) -> "Service":
"""Start the service and wait for its health checks to succeed.
Services bound to a Container do not need to be manually started.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("start", _args)
_id = await _ctx.execute(ServiceID)
_ctx = Client.from_context(_ctx)._select("loadServiceFromID", [Arg("id", _id)])
return Service(_ctx)
@typecheck
async def stop(self) -> "Service":
"""Stop the service.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("stop", _args)
_id = await _ctx.execute(ServiceID)
_ctx = Client.from_context(_ctx)._select("loadServiceFromID", [Arg("id", _id)])
return Service(_ctx)
class Socket(Type):
"""A Unix or TCP/IP socket that can be mounted into a container."""
@typecheck
async def id(self) -> SocketID:
"""A unique identifier for this Socket.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
SocketID
The `SocketID` scalar type represents an identifier for an object
of type Socket.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(SocketID)
class TypeDef(Type):
"""A definition of a parameter or return type in a Module."""
__slots__ = (
"_kind",
"_optional",
)
_kind: TypeDefKind | None
_optional: bool | None
@typecheck
def as_interface(self) -> InterfaceTypeDef:
_args: list[Arg] = []
_ctx = self._select("asInterface", _args)
return InterfaceTypeDef(_ctx)
@typecheck
def as_list(self) -> ListTypeDef:
_args: list[Arg] = []
_ctx = self._select("asList", _args)
return ListTypeDef(_ctx)
@typecheck
def as_object(self) -> ObjectTypeDef:
_args: list[Arg] = []
_ctx = self._select("asObject", _args)
return ObjectTypeDef(_ctx)
@typecheck
async def id(self) -> TypeDefID:
"""A unique identifier for this TypeDef.
Note
----
This is lazily evaluated, no operation is actually run.
Returns
-------
TypeDefID
The `TypeDefID` scalar type represents an identifier for an object
of type TypeDef.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
_args: list[Arg] = []
_ctx = self._select("id", _args)
return await _ctx.execute(TypeDefID)
@typecheck
async def kind(self) -> TypeDefKind:
"""Returns
-------
TypeDefKind
Distinguishes the different kinds of TypeDefs.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_kind"):
return self._kind
_args: list[Arg] = []
_ctx = self._select("kind", _args)
return await _ctx.execute(TypeDefKind)
@typecheck
async def optional(self) -> bool:
"""Returns
-------
bool
The `Boolean` scalar type represents `true` or `false`.
Raises
------
ExecuteTimeoutError
If the time to execute the query exceeds the configured timeout.
QueryError
If the API returns an error.
"""
if hasattr(self, "_optional"):
return self._optional
_args: list[Arg] = []
_ctx = self._select("optional", _args)
return await _ctx.execute(bool)
@typecheck
def with_constructor(self, function: Function) -> "TypeDef":
"""Adds a function for constructing a new instance of an Object TypeDef,
failing if the type is not an object.
"""
_args = [
Arg("function", function),
]
_ctx = self._select("withConstructor", _args)
return TypeDef(_ctx)
@typecheck
def with_field(
self,
name: str,
type_def: "TypeDef",
*,
description: str | None = "",
) -> "TypeDef":
"""Adds a static field for an Object TypeDef, failing if the type is not
an object.
Parameters
----------
name:
The name of the field in the object
type_def:
The type of the field
description:
A doc string for the field, if any
"""
_args = [
Arg("name", name),
Arg("typeDef", type_def),
Arg("description", description, ""),
]
_ctx = self._select("withField", _args)
return TypeDef(_ctx)
@typecheck
def with_function(self, function: Function) -> "TypeDef":
"""Adds a function for an Object or Interface TypeDef, failing if the
type is not one of those kinds.
"""
_args = [
Arg("function", function),
]
_ctx = self._select("withFunction", _args)
return TypeDef(_ctx)
@typecheck
def with_interface(
self,
name: str,
*,
description: str | None = "",
) -> "TypeDef":
"""Returns a TypeDef of kind Interface with the provided name."""
_args = [
Arg("name", name),
Arg("description", description, ""),
]
_ctx = self._select("withInterface", _args)
return TypeDef(_ctx)
@typecheck
def with_kind(self, kind: TypeDefKind) -> "TypeDef":
"""Sets the kind of the type."""
_args = [
Arg("kind", kind),
]
_ctx = self._select("withKind", _args)
return TypeDef(_ctx)
@typecheck
def with_list_of(self, element_type: "TypeDef") -> "TypeDef":
"""Returns a TypeDef of kind List with the provided type for its
elements.
"""
_args = [
Arg("elementType", element_type),
]
_ctx = self._select("withListOf", _args)
return TypeDef(_ctx)
@typecheck
def with_object(
self,
name: str,
*,
description: str | None = "",
) -> "TypeDef":
"""Returns a TypeDef of kind Object with the provided name.
Note that an object's fields and functions may be omitted if the
intent is only to refer to an object. This is how functions are able
to return their own object, or any other circular reference.
"""
_args = [
Arg("name", name),
Arg("description", description, ""),
]
_ctx = self._select("withObject", _args)
return TypeDef(_ctx)
@typecheck
def with_optional(self, optional: bool) -> "TypeDef":
"""Sets whether this type can be set to null."""
_args = [
Arg("optional", optional),
]
_ctx = self._select("withOptional", _args)
return TypeDef(_ctx)
def with_(self, cb: Callable[["TypeDef"], "TypeDef"]) -> "TypeDef":
"""Call the provided callable with current TypeDef.
This is useful for reusability and readability by not breaking the calling chain.
"""
return cb(self)
dag = Client()
"""The global client instance."""
__all__ = [
"BuildArg",
"CacheSharingMode",
"CacheVolume",
"CacheVolumeID",
"Client",
"Container",
"ContainerID",
"Directory",
"DirectoryID",
"EnvVariable",
"EnvVariableID",
"FieldTypeDef",
"FieldTypeDefID",
"File",
"FileID",
"Function",
"FunctionArg",
"FunctionArgID",
"FunctionCall",
"FunctionCallArgValue",
"FunctionCallArgValueID",
"FunctionCallID",
"FunctionID",
"GeneratedCode",
"GeneratedCodeID",
"GitRef",
"GitRefID",
"GitRepository",
"GitRepositoryID",
"Host",
"HostID",
"ImageLayerCompression",
"ImageMediaTypes",
"InterfaceTypeDef",
"InterfaceTypeDefID",
"JSON",
"Label",
"LabelID",
"ListTypeDef",
"ListTypeDefID",
"Module",
"ModuleConfig",
"ModuleConfigID",
"ModuleID",
"NetworkProtocol",
"ObjectTypeDef",
"ObjectTypeDefID",
"PipelineLabel",
"Platform",
"Port",
"PortForward",
"PortID",
"Secret",
"SecretID",
"Service",
"ServiceID",
"Socket",
"SocketID",
"TypeDef",
"TypeDefID",
"TypeDefKind",
"Void",
"dag",
]
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,416 | ✨ Add name field to File | ### What are you trying to do?
Files passed to `dagger call` currently does not preserve the name of a file passed to it.
### Why is this important to you?
Some tools often require the original file name (for example: Spectral requires the file name do determine the file type)
Discussed it with @sipsma here: https://discord.com/channels/707636530424053791/1120503349599543376/1195832958150529165
### How are you currently working around this?
I pass the original file name to the module. | https://github.com/dagger/dagger/issues/6416 | https://github.com/dagger/dagger/pull/6431 | 61bf06b970402efa254a40f13c4aee98adfbdb42 | c716a042f290b11c6122d247f8b31651adb5f1d0 | "2024-01-13T21:04:31Z" | go | "2024-01-17T16:17:48Z" | sdk/rust/crates/dagger-sdk/src/gen.rs | use crate::core::graphql_client::DynGraphQLClient;
use crate::errors::DaggerError;
use crate::querybuilder::Selection;
use derive_builder::Builder;
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use tokio::process::Child;
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct CacheVolumeId(pub String);
impl Into<CacheVolumeId> for &str {
fn into(self) -> CacheVolumeId {
CacheVolumeId(self.to_string())
}
}
impl Into<CacheVolumeId> for String {
fn into(self) -> CacheVolumeId {
CacheVolumeId(self.clone())
}
}
impl CacheVolumeId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ContainerId(pub String);
impl Into<ContainerId> for &str {
fn into(self) -> ContainerId {
ContainerId(self.to_string())
}
}
impl Into<ContainerId> for String {
fn into(self) -> ContainerId {
ContainerId(self.clone())
}
}
impl ContainerId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct DirectoryId(pub String);
impl Into<DirectoryId> for &str {
fn into(self) -> DirectoryId {
DirectoryId(self.to_string())
}
}
impl Into<DirectoryId> for String {
fn into(self) -> DirectoryId {
DirectoryId(self.clone())
}
}
impl DirectoryId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct EnvVariableId(pub String);
impl Into<EnvVariableId> for &str {
fn into(self) -> EnvVariableId {
EnvVariableId(self.to_string())
}
}
impl Into<EnvVariableId> for String {
fn into(self) -> EnvVariableId {
EnvVariableId(self.clone())
}
}
impl EnvVariableId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct FieldTypeDefId(pub String);
impl Into<FieldTypeDefId> for &str {
fn into(self) -> FieldTypeDefId {
FieldTypeDefId(self.to_string())
}
}
impl Into<FieldTypeDefId> for String {
fn into(self) -> FieldTypeDefId {
FieldTypeDefId(self.clone())
}
}
impl FieldTypeDefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct FileId(pub String);
impl Into<FileId> for &str {
fn into(self) -> FileId {
FileId(self.to_string())
}
}
impl Into<FileId> for String {
fn into(self) -> FileId {
FileId(self.clone())
}
}
impl FileId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct FunctionArgId(pub String);
impl Into<FunctionArgId> for &str {
fn into(self) -> FunctionArgId {
FunctionArgId(self.to_string())
}
}
impl Into<FunctionArgId> for String {
fn into(self) -> FunctionArgId {
FunctionArgId(self.clone())
}
}
impl FunctionArgId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct FunctionCallArgValueId(pub String);
impl Into<FunctionCallArgValueId> for &str {
fn into(self) -> FunctionCallArgValueId {
FunctionCallArgValueId(self.to_string())
}
}
impl Into<FunctionCallArgValueId> for String {
fn into(self) -> FunctionCallArgValueId {
FunctionCallArgValueId(self.clone())
}
}
impl FunctionCallArgValueId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct FunctionCallId(pub String);
impl Into<FunctionCallId> for &str {
fn into(self) -> FunctionCallId {
FunctionCallId(self.to_string())
}
}
impl Into<FunctionCallId> for String {
fn into(self) -> FunctionCallId {
FunctionCallId(self.clone())
}
}
impl FunctionCallId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct FunctionId(pub String);
impl Into<FunctionId> for &str {
fn into(self) -> FunctionId {
FunctionId(self.to_string())
}
}
impl Into<FunctionId> for String {
fn into(self) -> FunctionId {
FunctionId(self.clone())
}
}
impl FunctionId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct GeneratedCodeId(pub String);
impl Into<GeneratedCodeId> for &str {
fn into(self) -> GeneratedCodeId {
GeneratedCodeId(self.to_string())
}
}
impl Into<GeneratedCodeId> for String {
fn into(self) -> GeneratedCodeId {
GeneratedCodeId(self.clone())
}
}
impl GeneratedCodeId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct GitRefId(pub String);
impl Into<GitRefId> for &str {
fn into(self) -> GitRefId {
GitRefId(self.to_string())
}
}
impl Into<GitRefId> for String {
fn into(self) -> GitRefId {
GitRefId(self.clone())
}
}
impl GitRefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct GitRepositoryId(pub String);
impl Into<GitRepositoryId> for &str {
fn into(self) -> GitRepositoryId {
GitRepositoryId(self.to_string())
}
}
impl Into<GitRepositoryId> for String {
fn into(self) -> GitRepositoryId {
GitRepositoryId(self.clone())
}
}
impl GitRepositoryId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct HostId(pub String);
impl Into<HostId> for &str {
fn into(self) -> HostId {
HostId(self.to_string())
}
}
impl Into<HostId> for String {
fn into(self) -> HostId {
HostId(self.clone())
}
}
impl HostId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct InterfaceTypeDefId(pub String);
impl Into<InterfaceTypeDefId> for &str {
fn into(self) -> InterfaceTypeDefId {
InterfaceTypeDefId(self.to_string())
}
}
impl Into<InterfaceTypeDefId> for String {
fn into(self) -> InterfaceTypeDefId {
InterfaceTypeDefId(self.clone())
}
}
impl InterfaceTypeDefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct Json(pub String);
impl Into<Json> for &str {
fn into(self) -> Json {
Json(self.to_string())
}
}
impl Into<Json> for String {
fn into(self) -> Json {
Json(self.clone())
}
}
impl Json {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct LabelId(pub String);
impl Into<LabelId> for &str {
fn into(self) -> LabelId {
LabelId(self.to_string())
}
}
impl Into<LabelId> for String {
fn into(self) -> LabelId {
LabelId(self.clone())
}
}
impl LabelId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ListTypeDefId(pub String);
impl Into<ListTypeDefId> for &str {
fn into(self) -> ListTypeDefId {
ListTypeDefId(self.to_string())
}
}
impl Into<ListTypeDefId> for String {
fn into(self) -> ListTypeDefId {
ListTypeDefId(self.clone())
}
}
impl ListTypeDefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ModuleConfigId(pub String);
impl Into<ModuleConfigId> for &str {
fn into(self) -> ModuleConfigId {
ModuleConfigId(self.to_string())
}
}
impl Into<ModuleConfigId> for String {
fn into(self) -> ModuleConfigId {
ModuleConfigId(self.clone())
}
}
impl ModuleConfigId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ModuleId(pub String);
impl Into<ModuleId> for &str {
fn into(self) -> ModuleId {
ModuleId(self.to_string())
}
}
impl Into<ModuleId> for String {
fn into(self) -> ModuleId {
ModuleId(self.clone())
}
}
impl ModuleId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ObjectTypeDefId(pub String);
impl Into<ObjectTypeDefId> for &str {
fn into(self) -> ObjectTypeDefId {
ObjectTypeDefId(self.to_string())
}
}
impl Into<ObjectTypeDefId> for String {
fn into(self) -> ObjectTypeDefId {
ObjectTypeDefId(self.clone())
}
}
impl ObjectTypeDefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct Platform(pub String);
impl Into<Platform> for &str {
fn into(self) -> Platform {
Platform(self.to_string())
}
}
impl Into<Platform> for String {
fn into(self) -> Platform {
Platform(self.clone())
}
}
impl Platform {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct PortId(pub String);
impl Into<PortId> for &str {
fn into(self) -> PortId {
PortId(self.to_string())
}
}
impl Into<PortId> for String {
fn into(self) -> PortId {
PortId(self.clone())
}
}
impl PortId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct SecretId(pub String);
impl Into<SecretId> for &str {
fn into(self) -> SecretId {
SecretId(self.to_string())
}
}
impl Into<SecretId> for String {
fn into(self) -> SecretId {
SecretId(self.clone())
}
}
impl SecretId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct ServiceId(pub String);
impl Into<ServiceId> for &str {
fn into(self) -> ServiceId {
ServiceId(self.to_string())
}
}
impl Into<ServiceId> for String {
fn into(self) -> ServiceId {
ServiceId(self.clone())
}
}
impl ServiceId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct SocketId(pub String);
impl Into<SocketId> for &str {
fn into(self) -> SocketId {
SocketId(self.to_string())
}
}
impl Into<SocketId> for String {
fn into(self) -> SocketId {
SocketId(self.clone())
}
}
impl SocketId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct TypeDefId(pub String);
impl Into<TypeDefId> for &str {
fn into(self) -> TypeDefId {
TypeDefId(self.to_string())
}
}
impl Into<TypeDefId> for String {
fn into(self) -> TypeDefId {
TypeDefId(self.clone())
}
}
impl TypeDefId {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct Void(pub String);
impl Into<Void> for &str {
fn into(self) -> Void {
Void(self.to_string())
}
}
impl Into<Void> for String {
fn into(self) -> Void {
Void(self.clone())
}
}
impl Void {
fn quote(&self) -> String {
format!("\"{}\"", self.0.clone())
}
}
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct BuildArg {
pub name: String,
pub value: String,
}
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct PipelineLabel {
pub name: String,
pub value: String,
}
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct PortForward {
pub backend: isize,
pub frontend: isize,
pub protocol: NetworkProtocol,
}
#[derive(Clone)]
pub struct CacheVolume {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl CacheVolume {
/// A unique identifier for this CacheVolume.
pub async fn id(&self) -> Result<CacheVolumeId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Container {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerAsTarballOpts {
/// Force each layer of the image to use the specified compression algorithm.
/// If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
#[builder(setter(into, strip_option), default)]
pub forced_compression: Option<ImageLayerCompression>,
/// Use the specified media types for the image's layers.
/// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
#[builder(setter(into, strip_option), default)]
pub media_types: Option<ImageMediaTypes>,
/// Identifiers for other platform specific containers.
/// Used for multi-platform images.
#[builder(setter(into, strip_option), default)]
pub platform_variants: Option<Vec<ContainerId>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerBuildOpts<'a> {
/// Additional build arguments.
#[builder(setter(into, strip_option), default)]
pub build_args: Option<Vec<BuildArg>>,
/// Path to the Dockerfile to use.
#[builder(setter(into, strip_option), default)]
pub dockerfile: Option<&'a str>,
/// Secrets to pass to the build.
/// They will be mounted at /run/secrets/[secret-name] in the build container
/// They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl http://example.com?token=$(cat /run/secrets/my-secret)
#[builder(setter(into, strip_option), default)]
pub secrets: Option<Vec<SecretId>>,
/// Target build stage to build.
#[builder(setter(into, strip_option), default)]
pub target: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerExportOpts {
/// Force each layer of the exported image to use the specified compression algorithm.
/// If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
#[builder(setter(into, strip_option), default)]
pub forced_compression: Option<ImageLayerCompression>,
/// Use the specified media types for the exported image's layers.
/// Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
#[builder(setter(into, strip_option), default)]
pub media_types: Option<ImageMediaTypes>,
/// Identifiers for other platform specific containers.
/// Used for multi-platform image.
#[builder(setter(into, strip_option), default)]
pub platform_variants: Option<Vec<ContainerId>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerImportOpts<'a> {
/// Identifies the tag to import from the archive, if the archive bundles multiple tags.
#[builder(setter(into, strip_option), default)]
pub tag: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerPipelineOpts<'a> {
/// Description of the sub-pipeline.
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
/// Labels to apply to the sub-pipeline.
#[builder(setter(into, strip_option), default)]
pub labels: Option<Vec<PipelineLabel>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerPublishOpts {
/// Force each layer of the published image to use the specified compression algorithm.
/// If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
#[builder(setter(into, strip_option), default)]
pub forced_compression: Option<ImageLayerCompression>,
/// Use the specified media types for the published image's layers.
/// Defaults to OCI, which is largely compatible with most recent registries, but Docker may be needed for older registries without OCI support.
#[builder(setter(into, strip_option), default)]
pub media_types: Option<ImageMediaTypes>,
/// Identifiers for other platform specific containers.
/// Used for multi-platform image.
#[builder(setter(into, strip_option), default)]
pub platform_variants: Option<Vec<ContainerId>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithDirectoryOpts<'a> {
/// Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
#[builder(setter(into, strip_option), default)]
pub exclude: Option<Vec<&'a str>>,
/// Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
/// A user:group to set for the directory and its contents.
/// The user and group can either be an ID (1000:1000) or a name (foo:bar).
/// If the group is omitted, it defaults to the same as the user.
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithEntrypointOpts {
/// Don't remove the default arguments when setting the entrypoint.
#[builder(setter(into, strip_option), default)]
pub keep_default_args: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithEnvVariableOpts {
/// Replace `${VAR}` or `$VAR` in the value according to the current environment variables defined in the container (e.g., "/opt/bin:$PATH").
#[builder(setter(into, strip_option), default)]
pub expand: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithExecOpts<'a> {
/// Provides dagger access to the executed command.
/// Do not use this option unless you trust the command being executed; the command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
#[builder(setter(into, strip_option), default)]
pub experimental_privileged_nesting: Option<bool>,
/// Execute the command with all root capabilities. This is similar to running a command with "sudo" or executing "docker run" with the "--privileged" flag. Containerization does not provide any security guarantees when using this option. It should only be used when absolutely necessary and only with trusted commands.
#[builder(setter(into, strip_option), default)]
pub insecure_root_capabilities: Option<bool>,
/// Redirect the command's standard error to a file in the container (e.g., "/tmp/stderr").
#[builder(setter(into, strip_option), default)]
pub redirect_stderr: Option<&'a str>,
/// Redirect the command's standard output to a file in the container (e.g., "/tmp/stdout").
#[builder(setter(into, strip_option), default)]
pub redirect_stdout: Option<&'a str>,
/// If the container has an entrypoint, ignore it for args rather than using it to wrap them.
#[builder(setter(into, strip_option), default)]
pub skip_entrypoint: Option<bool>,
/// Content to write to the command's standard input before closing (e.g., "Hello world").
#[builder(setter(into, strip_option), default)]
pub stdin: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithExposedPortOpts<'a> {
/// Optional port description
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
/// Transport layer network protocol
#[builder(setter(into, strip_option), default)]
pub protocol: Option<NetworkProtocol>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithFileOpts<'a> {
/// A user:group to set for the file.
/// The user and group can either be an ID (1000:1000) or a name (foo:bar).
/// If the group is omitted, it defaults to the same as the user.
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
/// Permission given to the copied file (e.g., 0600).
#[builder(setter(into, strip_option), default)]
pub permissions: Option<isize>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithMountedCacheOpts<'a> {
/// A user:group to set for the mounted cache directory.
/// Note that this changes the ownership of the specified mount along with the initial filesystem provided by source (if any). It does not have any effect if/when the cache has already been created.
/// The user and group can either be an ID (1000:1000) or a name (foo:bar).
/// If the group is omitted, it defaults to the same as the user.
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
/// Sharing mode of the cache volume.
#[builder(setter(into, strip_option), default)]
pub sharing: Option<CacheSharingMode>,
/// Identifier of the directory to use as the cache volume's root.
#[builder(setter(into, strip_option), default)]
pub source: Option<DirectoryId>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithMountedDirectoryOpts<'a> {
/// A user:group to set for the mounted directory and its contents.
/// The user and group can either be an ID (1000:1000) or a name (foo:bar).
/// If the group is omitted, it defaults to the same as the user.
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithMountedFileOpts<'a> {
/// A user or user:group to set for the mounted file.
/// The user and group can either be an ID (1000:1000) or a name (foo:bar).
/// If the group is omitted, it defaults to the same as the user.
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithMountedSecretOpts<'a> {
/// Permission given to the mounted secret (e.g., 0600).
/// This option requires an owner to be set to be active.
#[builder(setter(into, strip_option), default)]
pub mode: Option<isize>,
/// A user:group to set for the mounted secret.
/// The user and group can either be an ID (1000:1000) or a name (foo:bar).
/// If the group is omitted, it defaults to the same as the user.
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithNewFileOpts<'a> {
/// Content of the file to write (e.g., "Hello world!").
#[builder(setter(into, strip_option), default)]
pub contents: Option<&'a str>,
/// A user:group to set for the file.
/// The user and group can either be an ID (1000:1000) or a name (foo:bar).
/// If the group is omitted, it defaults to the same as the user.
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
/// Permission given to the written file (e.g., 0600).
#[builder(setter(into, strip_option), default)]
pub permissions: Option<isize>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithUnixSocketOpts<'a> {
/// A user:group to set for the mounted socket.
/// The user and group can either be an ID (1000:1000) or a name (foo:bar).
/// If the group is omitted, it defaults to the same as the user.
#[builder(setter(into, strip_option), default)]
pub owner: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithoutEntrypointOpts {
/// Don't remove the default arguments when unsetting the entrypoint.
#[builder(setter(into, strip_option), default)]
pub keep_default_args: Option<bool>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ContainerWithoutExposedPortOpts {
/// Port protocol to unexpose
#[builder(setter(into, strip_option), default)]
pub protocol: Option<NetworkProtocol>,
}
impl Container {
/// Turn the container into a Service.
/// Be sure to set any exposed ports before this conversion.
pub fn as_service(&self) -> Service {
let query = self.selection.select("asService");
return Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns a File representing the container serialized to a tarball.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn as_tarball(&self) -> File {
let query = self.selection.select("asTarball");
return File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns a File representing the container serialized to a tarball.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
let mut query = self.selection.select("asTarball");
if let Some(platform_variants) = opts.platform_variants {
query = query.arg("platformVariants", platform_variants);
}
if let Some(forced_compression) = opts.forced_compression {
query = query.arg_enum("forcedCompression", forced_compression);
}
if let Some(media_types) = opts.media_types {
query = query.arg_enum("mediaTypes", media_types);
}
return File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Initializes this container from a Dockerfile build.
///
/// # Arguments
///
/// * `context` - Directory context used by the Dockerfile.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn build(&self, context: Directory) -> Container {
let mut query = self.selection.select("build");
query = query.arg_lazy(
"context",
Box::new(move || {
let context = context.clone();
Box::pin(async move { context.id().await.unwrap().quote() })
}),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Initializes this container from a Dockerfile build.
///
/// # Arguments
///
/// * `context` - Directory context used by the Dockerfile.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn build_opts<'a>(&self, context: Directory, opts: ContainerBuildOpts<'a>) -> Container {
let mut query = self.selection.select("build");
query = query.arg_lazy(
"context",
Box::new(move || {
let context = context.clone();
Box::pin(async move { context.id().await.unwrap().quote() })
}),
);
if let Some(dockerfile) = opts.dockerfile {
query = query.arg("dockerfile", dockerfile);
}
if let Some(target) = opts.target {
query = query.arg("target", target);
}
if let Some(build_args) = opts.build_args {
query = query.arg("buildArgs", build_args);
}
if let Some(secrets) = opts.secrets {
query = query.arg("secrets", secrets);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves default arguments for future commands.
pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("defaultArgs");
query.execute(self.graphql_client.clone()).await
}
/// Retrieves a directory at the given path.
/// Mounts are included.
///
/// # Arguments
///
/// * `path` - The path of the directory to retrieve (e.g., "./src").
pub fn directory(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("directory");
query = query.arg("path", path.into());
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves entrypoint to be prepended to the arguments of all commands.
pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("entrypoint");
query.execute(self.graphql_client.clone()).await
}
/// Retrieves the value of the specified environment variable.
///
/// # Arguments
///
/// * `name` - The name of the environment variable to retrieve (e.g., "PATH").
pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
let mut query = self.selection.select("envVariable");
query = query.arg("name", name.into());
query.execute(self.graphql_client.clone()).await
}
/// Retrieves the list of environment variables passed to commands.
pub fn env_variables(&self) -> Vec<EnvVariable> {
let query = self.selection.select("envVariables");
return vec![EnvVariable {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}];
}
/// EXPERIMENTAL API! Subject to change/removal at any time.
/// Configures all available GPUs on the host to be accessible to this container.
/// This currently works for Nvidia devices only.
pub fn experimental_with_all_gp_us(&self) -> Container {
let query = self.selection.select("experimentalWithAllGPUs");
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// EXPERIMENTAL API! Subject to change/removal at any time.
/// Configures the provided list of devices to be accesible to this container.
/// This currently works for Nvidia devices only.
///
/// # Arguments
///
/// * `devices` - List of devices to be accessible to this container.
pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
let mut query = self.selection.select("experimentalWithGPU");
query = query.arg(
"devices",
devices
.into_iter()
.map(|i| i.into())
.collect::<Vec<String>>(),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Writes the container as an OCI tarball to the destination file path on the host.
/// Return true on success.
/// It can also export platform variants.
///
/// # Arguments
///
/// * `path` - Host's destination path (e.g., "./tarball").
///
/// Path can be relative to the engine's workdir or absolute.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub async fn export(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
let mut query = self.selection.select("export");
query = query.arg("path", path.into());
query.execute(self.graphql_client.clone()).await
}
/// Writes the container as an OCI tarball to the destination file path on the host.
/// Return true on success.
/// It can also export platform variants.
///
/// # Arguments
///
/// * `path` - Host's destination path (e.g., "./tarball").
///
/// Path can be relative to the engine's workdir or absolute.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub async fn export_opts(
&self,
path: impl Into<String>,
opts: ContainerExportOpts,
) -> Result<bool, DaggerError> {
let mut query = self.selection.select("export");
query = query.arg("path", path.into());
if let Some(platform_variants) = opts.platform_variants {
query = query.arg("platformVariants", platform_variants);
}
if let Some(forced_compression) = opts.forced_compression {
query = query.arg_enum("forcedCompression", forced_compression);
}
if let Some(media_types) = opts.media_types {
query = query.arg_enum("mediaTypes", media_types);
}
query.execute(self.graphql_client.clone()).await
}
/// Retrieves the list of exposed ports.
/// This includes ports already exposed by the image, even if not explicitly added with dagger.
pub fn exposed_ports(&self) -> Vec<Port> {
let query = self.selection.select("exposedPorts");
return vec![Port {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}];
}
/// Retrieves a file at the given path.
/// Mounts are included.
///
/// # Arguments
///
/// * `path` - The path of the file to retrieve (e.g., "./README.md").
pub fn file(&self, path: impl Into<String>) -> File {
let mut query = self.selection.select("file");
query = query.arg("path", path.into());
return File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Initializes this container from a pulled base image.
///
/// # Arguments
///
/// * `address` - Image's address from its registry.
///
/// Formatted as [host]/[user]/[repo]:[tag] (e.g., "docker.io/dagger/dagger:main").
pub fn from(&self, address: impl Into<String>) -> Container {
let mut query = self.selection.select("from");
query = query.arg("address", address.into());
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// A unique identifier for this Container.
pub async fn id(&self) -> Result<ContainerId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
/// The unique image reference which can only be retrieved immediately after the 'Container.From' call.
pub async fn image_ref(&self) -> Result<String, DaggerError> {
let query = self.selection.select("imageRef");
query.execute(self.graphql_client.clone()).await
}
/// Reads the container from an OCI tarball.
///
/// # Arguments
///
/// * `source` - File to read the container from.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn import(&self, source: File) -> Container {
let mut query = self.selection.select("import");
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.id().await.unwrap().quote() })
}),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Reads the container from an OCI tarball.
///
/// # Arguments
///
/// * `source` - File to read the container from.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn import_opts<'a>(&self, source: File, opts: ContainerImportOpts<'a>) -> Container {
let mut query = self.selection.select("import");
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.id().await.unwrap().quote() })
}),
);
if let Some(tag) = opts.tag {
query = query.arg("tag", tag);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves the value of the specified label.
///
/// # Arguments
///
/// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
let mut query = self.selection.select("label");
query = query.arg("name", name.into());
query.execute(self.graphql_client.clone()).await
}
/// Retrieves the list of labels passed to container.
pub fn labels(&self) -> Vec<Label> {
let query = self.selection.select("labels");
return vec![Label {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}];
}
/// Retrieves the list of paths where a directory is mounted.
pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("mounts");
query.execute(self.graphql_client.clone()).await
}
/// Creates a named sub-pipeline.
///
/// # Arguments
///
/// * `name` - Name of the sub-pipeline.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn pipeline(&self, name: impl Into<String>) -> Container {
let mut query = self.selection.select("pipeline");
query = query.arg("name", name.into());
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Creates a named sub-pipeline.
///
/// # Arguments
///
/// * `name` - Name of the sub-pipeline.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn pipeline_opts<'a>(
&self,
name: impl Into<String>,
opts: ContainerPipelineOpts<'a>,
) -> Container {
let mut query = self.selection.select("pipeline");
query = query.arg("name", name.into());
if let Some(description) = opts.description {
query = query.arg("description", description);
}
if let Some(labels) = opts.labels {
query = query.arg("labels", labels);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// The platform this container executes and publishes as.
pub async fn platform(&self) -> Result<Platform, DaggerError> {
let query = self.selection.select("platform");
query.execute(self.graphql_client.clone()).await
}
/// Publishes this container as a new image to the specified address.
/// Publish returns a fully qualified ref.
/// It can also publish platform variants.
///
/// # Arguments
///
/// * `address` - Registry's address to publish the image to.
///
/// Formatted as [host]/[user]/[repo]:[tag] (e.g. "docker.io/dagger/dagger:main").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
let mut query = self.selection.select("publish");
query = query.arg("address", address.into());
query.execute(self.graphql_client.clone()).await
}
/// Publishes this container as a new image to the specified address.
/// Publish returns a fully qualified ref.
/// It can also publish platform variants.
///
/// # Arguments
///
/// * `address` - Registry's address to publish the image to.
///
/// Formatted as [host]/[user]/[repo]:[tag] (e.g. "docker.io/dagger/dagger:main").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub async fn publish_opts(
&self,
address: impl Into<String>,
opts: ContainerPublishOpts,
) -> Result<String, DaggerError> {
let mut query = self.selection.select("publish");
query = query.arg("address", address.into());
if let Some(platform_variants) = opts.platform_variants {
query = query.arg("platformVariants", platform_variants);
}
if let Some(forced_compression) = opts.forced_compression {
query = query.arg_enum("forcedCompression", forced_compression);
}
if let Some(media_types) = opts.media_types {
query = query.arg_enum("mediaTypes", media_types);
}
query.execute(self.graphql_client.clone()).await
}
/// Retrieves this container's root filesystem. Mounts are not included.
pub fn rootfs(&self) -> Directory {
let query = self.selection.select("rootfs");
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Return a websocket endpoint that, if connected to, will start the container with a TTY streamed over the websocket.
/// Primarily intended for internal use with the dagger CLI.
pub async fn shell_endpoint(&self) -> Result<String, DaggerError> {
let query = self.selection.select("shellEndpoint");
query.execute(self.graphql_client.clone()).await
}
/// The error stream of the last executed command.
/// Will execute default command if none is set, or error if there's no default.
pub async fn stderr(&self) -> Result<String, DaggerError> {
let query = self.selection.select("stderr");
query.execute(self.graphql_client.clone()).await
}
/// The output stream of the last executed command.
/// Will execute default command if none is set, or error if there's no default.
pub async fn stdout(&self) -> Result<String, DaggerError> {
let query = self.selection.select("stdout");
query.execute(self.graphql_client.clone()).await
}
/// Forces evaluation of the pipeline in the engine.
/// It doesn't run the default command if no exec has been set.
pub async fn sync(&self) -> Result<ContainerId, DaggerError> {
let query = self.selection.select("sync");
query.execute(self.graphql_client.clone()).await
}
/// Retrieves the user to be set for all commands.
pub async fn user(&self) -> Result<String, DaggerError> {
let query = self.selection.select("user");
query.execute(self.graphql_client.clone()).await
}
/// Configures default arguments for future commands.
///
/// # Arguments
///
/// * `args` - Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
let mut query = self.selection.select("withDefaultArgs");
query = query.arg(
"args",
args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a directory written at the given path.
///
/// # Arguments
///
/// * `path` - Location of the written directory (e.g., "/tmp/directory").
/// * `directory` - Identifier of the directory to write
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_directory(&self, path: impl Into<String>, directory: Directory) -> Container {
let mut query = self.selection.select("withDirectory");
query = query.arg("path", path.into());
query = query.arg_lazy(
"directory",
Box::new(move || {
let directory = directory.clone();
Box::pin(async move { directory.id().await.unwrap().quote() })
}),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a directory written at the given path.
///
/// # Arguments
///
/// * `path` - Location of the written directory (e.g., "/tmp/directory").
/// * `directory` - Identifier of the directory to write
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_directory_opts<'a>(
&self,
path: impl Into<String>,
directory: Directory,
opts: ContainerWithDirectoryOpts<'a>,
) -> Container {
let mut query = self.selection.select("withDirectory");
query = query.arg("path", path.into());
query = query.arg_lazy(
"directory",
Box::new(move || {
let directory = directory.clone();
Box::pin(async move { directory.id().await.unwrap().quote() })
}),
);
if let Some(exclude) = opts.exclude {
query = query.arg("exclude", exclude);
}
if let Some(include) = opts.include {
query = query.arg("include", include);
}
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container but with a different command entrypoint.
///
/// # Arguments
///
/// * `args` - Entrypoint to use for future executions (e.g., ["go", "run"]).
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
let mut query = self.selection.select("withEntrypoint");
query = query.arg(
"args",
args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container but with a different command entrypoint.
///
/// # Arguments
///
/// * `args` - Entrypoint to use for future executions (e.g., ["go", "run"]).
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_entrypoint_opts(
&self,
args: Vec<impl Into<String>>,
opts: ContainerWithEntrypointOpts,
) -> Container {
let mut query = self.selection.select("withEntrypoint");
query = query.arg(
"args",
args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
if let Some(keep_default_args) = opts.keep_default_args {
query = query.arg("keepDefaultArgs", keep_default_args);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus the given environment variable.
///
/// # Arguments
///
/// * `name` - The name of the environment variable (e.g., "HOST").
/// * `value` - The value of the environment variable. (e.g., "localhost").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_env_variable(
&self,
name: impl Into<String>,
value: impl Into<String>,
) -> Container {
let mut query = self.selection.select("withEnvVariable");
query = query.arg("name", name.into());
query = query.arg("value", value.into());
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus the given environment variable.
///
/// # Arguments
///
/// * `name` - The name of the environment variable (e.g., "HOST").
/// * `value` - The value of the environment variable. (e.g., "localhost").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_env_variable_opts(
&self,
name: impl Into<String>,
value: impl Into<String>,
opts: ContainerWithEnvVariableOpts,
) -> Container {
let mut query = self.selection.select("withEnvVariable");
query = query.arg("name", name.into());
query = query.arg("value", value.into());
if let Some(expand) = opts.expand {
query = query.arg("expand", expand);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container after executing the specified command inside it.
///
/// # Arguments
///
/// * `args` - Command to run instead of the container's default command (e.g., ["run", "main.go"]).
///
/// If empty, the container's default command is used.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
let mut query = self.selection.select("withExec");
query = query.arg(
"args",
args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container after executing the specified command inside it.
///
/// # Arguments
///
/// * `args` - Command to run instead of the container's default command (e.g., ["run", "main.go"]).
///
/// If empty, the container's default command is used.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_exec_opts<'a>(
&self,
args: Vec<impl Into<String>>,
opts: ContainerWithExecOpts<'a>,
) -> Container {
let mut query = self.selection.select("withExec");
query = query.arg(
"args",
args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
if let Some(skip_entrypoint) = opts.skip_entrypoint {
query = query.arg("skipEntrypoint", skip_entrypoint);
}
if let Some(stdin) = opts.stdin {
query = query.arg("stdin", stdin);
}
if let Some(redirect_stdout) = opts.redirect_stdout {
query = query.arg("redirectStdout", redirect_stdout);
}
if let Some(redirect_stderr) = opts.redirect_stderr {
query = query.arg("redirectStderr", redirect_stderr);
}
if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
query = query.arg(
"experimentalPrivilegedNesting",
experimental_privileged_nesting,
);
}
if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Expose a network port.
/// Exposed ports serve two purposes:
/// - For health checks and introspection, when running services
/// - For setting the EXPOSE OCI field when publishing the container
///
/// # Arguments
///
/// * `port` - Port number to expose
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_exposed_port(&self, port: isize) -> Container {
let mut query = self.selection.select("withExposedPort");
query = query.arg("port", port);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Expose a network port.
/// Exposed ports serve two purposes:
/// - For health checks and introspection, when running services
/// - For setting the EXPOSE OCI field when publishing the container
///
/// # Arguments
///
/// * `port` - Port number to expose
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_exposed_port_opts<'a>(
&self,
port: isize,
opts: ContainerWithExposedPortOpts<'a>,
) -> Container {
let mut query = self.selection.select("withExposedPort");
query = query.arg("port", port);
if let Some(protocol) = opts.protocol {
query = query.arg_enum("protocol", protocol);
}
if let Some(description) = opts.description {
query = query.arg("description", description);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus the contents of the given file copied to the given path.
///
/// # Arguments
///
/// * `path` - Location of the copied file (e.g., "/tmp/file.txt").
/// * `source` - Identifier of the file to copy.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_file(&self, path: impl Into<String>, source: File) -> Container {
let mut query = self.selection.select("withFile");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.id().await.unwrap().quote() })
}),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus the contents of the given file copied to the given path.
///
/// # Arguments
///
/// * `path` - Location of the copied file (e.g., "/tmp/file.txt").
/// * `source` - Identifier of the file to copy.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_file_opts<'a>(
&self,
path: impl Into<String>,
source: File,
opts: ContainerWithFileOpts<'a>,
) -> Container {
let mut query = self.selection.select("withFile");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.id().await.unwrap().quote() })
}),
);
if let Some(permissions) = opts.permissions {
query = query.arg("permissions", permissions);
}
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Indicate that subsequent operations should be featured more prominently in the UI.
pub fn with_focus(&self) -> Container {
let query = self.selection.select("withFocus");
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus the given label.
///
/// # Arguments
///
/// * `name` - The name of the label (e.g., "org.opencontainers.artifact.created").
/// * `value` - The value of the label (e.g., "2023-01-01T00:00:00Z").
pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
let mut query = self.selection.select("withLabel");
query = query.arg("name", name.into());
query = query.arg("value", value.into());
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a cache volume mounted at the given path.
///
/// # Arguments
///
/// * `path` - Location of the cache directory (e.g., "/cache/node_modules").
/// * `cache` - Identifier of the cache volume to mount.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_mounted_cache(&self, path: impl Into<String>, cache: CacheVolume) -> Container {
let mut query = self.selection.select("withMountedCache");
query = query.arg("path", path.into());
query = query.arg_lazy(
"cache",
Box::new(move || {
let cache = cache.clone();
Box::pin(async move { cache.id().await.unwrap().quote() })
}),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a cache volume mounted at the given path.
///
/// # Arguments
///
/// * `path` - Location of the cache directory (e.g., "/cache/node_modules").
/// * `cache` - Identifier of the cache volume to mount.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_mounted_cache_opts<'a>(
&self,
path: impl Into<String>,
cache: CacheVolume,
opts: ContainerWithMountedCacheOpts<'a>,
) -> Container {
let mut query = self.selection.select("withMountedCache");
query = query.arg("path", path.into());
query = query.arg_lazy(
"cache",
Box::new(move || {
let cache = cache.clone();
Box::pin(async move { cache.id().await.unwrap().quote() })
}),
);
if let Some(source) = opts.source {
query = query.arg("source", source);
}
if let Some(sharing) = opts.sharing {
query = query.arg_enum("sharing", sharing);
}
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a directory mounted at the given path.
///
/// # Arguments
///
/// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
/// * `source` - Identifier of the mounted directory.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_mounted_directory(&self, path: impl Into<String>, source: Directory) -> Container {
let mut query = self.selection.select("withMountedDirectory");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.id().await.unwrap().quote() })
}),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a directory mounted at the given path.
///
/// # Arguments
///
/// * `path` - Location of the mounted directory (e.g., "/mnt/directory").
/// * `source` - Identifier of the mounted directory.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_mounted_directory_opts<'a>(
&self,
path: impl Into<String>,
source: Directory,
opts: ContainerWithMountedDirectoryOpts<'a>,
) -> Container {
let mut query = self.selection.select("withMountedDirectory");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.id().await.unwrap().quote() })
}),
);
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a file mounted at the given path.
///
/// # Arguments
///
/// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
/// * `source` - Identifier of the mounted file.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_mounted_file(&self, path: impl Into<String>, source: File) -> Container {
let mut query = self.selection.select("withMountedFile");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.id().await.unwrap().quote() })
}),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a file mounted at the given path.
///
/// # Arguments
///
/// * `path` - Location of the mounted file (e.g., "/tmp/file.txt").
/// * `source` - Identifier of the mounted file.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_mounted_file_opts<'a>(
&self,
path: impl Into<String>,
source: File,
opts: ContainerWithMountedFileOpts<'a>,
) -> Container {
let mut query = self.selection.select("withMountedFile");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.id().await.unwrap().quote() })
}),
);
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a secret mounted into a file at the given path.
///
/// # Arguments
///
/// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
/// * `source` - Identifier of the secret to mount.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_mounted_secret(&self, path: impl Into<String>, source: Secret) -> Container {
let mut query = self.selection.select("withMountedSecret");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.id().await.unwrap().quote() })
}),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a secret mounted into a file at the given path.
///
/// # Arguments
///
/// * `path` - Location of the secret file (e.g., "/tmp/secret.txt").
/// * `source` - Identifier of the secret to mount.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_mounted_secret_opts<'a>(
&self,
path: impl Into<String>,
source: Secret,
opts: ContainerWithMountedSecretOpts<'a>,
) -> Container {
let mut query = self.selection.select("withMountedSecret");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.id().await.unwrap().quote() })
}),
);
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
if let Some(mode) = opts.mode {
query = query.arg("mode", mode);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a temporary directory mounted at the given path.
///
/// # Arguments
///
/// * `path` - Location of the temporary directory (e.g., "/tmp/temp_dir").
pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
let mut query = self.selection.select("withMountedTemp");
query = query.arg("path", path.into());
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a new file written at the given path.
///
/// # Arguments
///
/// * `path` - Location of the written file (e.g., "/tmp/file.txt").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_new_file(&self, path: impl Into<String>) -> Container {
let mut query = self.selection.select("withNewFile");
query = query.arg("path", path.into());
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a new file written at the given path.
///
/// # Arguments
///
/// * `path` - Location of the written file (e.g., "/tmp/file.txt").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_new_file_opts<'a>(
&self,
path: impl Into<String>,
opts: ContainerWithNewFileOpts<'a>,
) -> Container {
let mut query = self.selection.select("withNewFile");
query = query.arg("path", path.into());
if let Some(contents) = opts.contents {
query = query.arg("contents", contents);
}
if let Some(permissions) = opts.permissions {
query = query.arg("permissions", permissions);
}
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container with a registry authentication for a given address.
///
/// # Arguments
///
/// * `address` - Registry's address to bind the authentication to.
///
/// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
/// * `username` - The username of the registry's account (e.g., "Dagger").
/// * `secret` - The API key, password or token to authenticate to this registry.
pub fn with_registry_auth(
&self,
address: impl Into<String>,
username: impl Into<String>,
secret: Secret,
) -> Container {
let mut query = self.selection.select("withRegistryAuth");
query = query.arg("address", address.into());
query = query.arg("username", username.into());
query = query.arg_lazy(
"secret",
Box::new(move || {
let secret = secret.clone();
Box::pin(async move { secret.id().await.unwrap().quote() })
}),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves the container with the given directory mounted to /.
///
/// # Arguments
///
/// * `directory` - Directory to mount.
pub fn with_rootfs(&self, directory: Directory) -> Container {
let mut query = self.selection.select("withRootfs");
query = query.arg_lazy(
"directory",
Box::new(move || {
let directory = directory.clone();
Box::pin(async move { directory.id().await.unwrap().quote() })
}),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus an env variable containing the given secret.
///
/// # Arguments
///
/// * `name` - The name of the secret variable (e.g., "API_SECRET").
/// * `secret` - The identifier of the secret value.
pub fn with_secret_variable(&self, name: impl Into<String>, secret: Secret) -> Container {
let mut query = self.selection.select("withSecretVariable");
query = query.arg("name", name.into());
query = query.arg_lazy(
"secret",
Box::new(move || {
let secret = secret.clone();
Box::pin(async move { secret.id().await.unwrap().quote() })
}),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Establish a runtime dependency on a service.
/// The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
/// The service will be reachable from the container via the provided hostname alias.
/// The service dependency will also convey to any files or directories produced by the container.
///
/// # Arguments
///
/// * `alias` - A name that can be used to reach the service from the container
/// * `service` - Identifier of the service container
pub fn with_service_binding(&self, alias: impl Into<String>, service: Service) -> Container {
let mut query = self.selection.select("withServiceBinding");
query = query.arg("alias", alias.into());
query = query.arg_lazy(
"service",
Box::new(move || {
let service = service.clone();
Box::pin(async move { service.id().await.unwrap().quote() })
}),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a socket forwarded to the given Unix socket path.
///
/// # Arguments
///
/// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
/// * `source` - Identifier of the socket to forward.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_unix_socket(&self, path: impl Into<String>, source: Socket) -> Container {
let mut query = self.selection.select("withUnixSocket");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.id().await.unwrap().quote() })
}),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container plus a socket forwarded to the given Unix socket path.
///
/// # Arguments
///
/// * `path` - Location of the forwarded Unix socket (e.g., "/tmp/socket").
/// * `source` - Identifier of the socket to forward.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_unix_socket_opts<'a>(
&self,
path: impl Into<String>,
source: Socket,
opts: ContainerWithUnixSocketOpts<'a>,
) -> Container {
let mut query = self.selection.select("withUnixSocket");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.id().await.unwrap().quote() })
}),
);
if let Some(owner) = opts.owner {
query = query.arg("owner", owner);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container with a different command user.
///
/// # Arguments
///
/// * `name` - The user to set (e.g., "root").
pub fn with_user(&self, name: impl Into<String>) -> Container {
let mut query = self.selection.select("withUser");
query = query.arg("name", name.into());
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container with a different working directory.
///
/// # Arguments
///
/// * `path` - The path to set as the working directory (e.g., "/app").
pub fn with_workdir(&self, path: impl Into<String>) -> Container {
let mut query = self.selection.select("withWorkdir");
query = query.arg("path", path.into());
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container with unset default arguments for future commands.
pub fn without_default_args(&self) -> Container {
let query = self.selection.select("withoutDefaultArgs");
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container with an unset command entrypoint.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn without_entrypoint(&self) -> Container {
let query = self.selection.select("withoutEntrypoint");
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container with an unset command entrypoint.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
let mut query = self.selection.select("withoutEntrypoint");
if let Some(keep_default_args) = opts.keep_default_args {
query = query.arg("keepDefaultArgs", keep_default_args);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container minus the given environment variable.
///
/// # Arguments
///
/// * `name` - The name of the environment variable (e.g., "HOST").
pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
let mut query = self.selection.select("withoutEnvVariable");
query = query.arg("name", name.into());
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Unexpose a previously exposed port.
///
/// # Arguments
///
/// * `port` - Port number to unexpose
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn without_exposed_port(&self, port: isize) -> Container {
let mut query = self.selection.select("withoutExposedPort");
query = query.arg("port", port);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Unexpose a previously exposed port.
///
/// # Arguments
///
/// * `port` - Port number to unexpose
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn without_exposed_port_opts(
&self,
port: isize,
opts: ContainerWithoutExposedPortOpts,
) -> Container {
let mut query = self.selection.select("withoutExposedPort");
query = query.arg("port", port);
if let Some(protocol) = opts.protocol {
query = query.arg_enum("protocol", protocol);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Indicate that subsequent operations should not be featured more prominently in the UI.
/// This is the initial state of all containers.
pub fn without_focus(&self) -> Container {
let query = self.selection.select("withoutFocus");
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container minus the given environment label.
///
/// # Arguments
///
/// * `name` - The name of the label to remove (e.g., "org.opencontainers.artifact.created").
pub fn without_label(&self, name: impl Into<String>) -> Container {
let mut query = self.selection.select("withoutLabel");
query = query.arg("name", name.into());
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container after unmounting everything at the given path.
///
/// # Arguments
///
/// * `path` - Location of the cache directory (e.g., "/cache/node_modules").
pub fn without_mount(&self, path: impl Into<String>) -> Container {
let mut query = self.selection.select("withoutMount");
query = query.arg("path", path.into());
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container without the registry authentication of a given address.
///
/// # Arguments
///
/// * `address` - Registry's address to remove the authentication from.
///
/// Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
let mut query = self.selection.select("withoutRegistryAuth");
query = query.arg("address", address.into());
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container with a previously added Unix socket removed.
///
/// # Arguments
///
/// * `path` - Location of the socket to remove (e.g., "/tmp/socket").
pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
let mut query = self.selection.select("withoutUnixSocket");
query = query.arg("path", path.into());
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container with an unset command user.
/// Should default to root.
pub fn without_user(&self) -> Container {
let query = self.selection.select("withoutUser");
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this container with an unset working directory.
/// Should default to "/".
pub fn without_workdir(&self) -> Container {
let query = self.selection.select("withoutWorkdir");
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves the working directory for all commands.
pub async fn workdir(&self) -> Result<String, DaggerError> {
let query = self.selection.select("workdir");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Directory {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryAsModuleOpts<'a> {
/// An optional subpath of the directory which contains the module's source code.
/// This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
/// If not set, the module source code is loaded from the root of the directory.
#[builder(setter(into, strip_option), default)]
pub source_subpath: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryDockerBuildOpts<'a> {
/// Build arguments to use in the build.
#[builder(setter(into, strip_option), default)]
pub build_args: Option<Vec<BuildArg>>,
/// Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
#[builder(setter(into, strip_option), default)]
pub dockerfile: Option<&'a str>,
/// The platform to build.
#[builder(setter(into, strip_option), default)]
pub platform: Option<Platform>,
/// Secrets to pass to the build.
/// They will be mounted at /run/secrets/[secret-name].
#[builder(setter(into, strip_option), default)]
pub secrets: Option<Vec<SecretId>>,
/// Target build stage to build.
#[builder(setter(into, strip_option), default)]
pub target: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryEntriesOpts<'a> {
/// Location of the directory to look at (e.g., "/src").
#[builder(setter(into, strip_option), default)]
pub path: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryPipelineOpts<'a> {
/// Description of the sub-pipeline.
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
/// Labels to apply to the sub-pipeline.
#[builder(setter(into, strip_option), default)]
pub labels: Option<Vec<PipelineLabel>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryWithDirectoryOpts<'a> {
/// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
#[builder(setter(into, strip_option), default)]
pub exclude: Option<Vec<&'a str>>,
/// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryWithFileOpts {
/// Permission given to the copied file (e.g., 0600).
#[builder(setter(into, strip_option), default)]
pub permissions: Option<isize>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryWithNewDirectoryOpts {
/// Permission granted to the created directory (e.g., 0777).
#[builder(setter(into, strip_option), default)]
pub permissions: Option<isize>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct DirectoryWithNewFileOpts {
/// Permission given to the copied file (e.g., 0600).
#[builder(setter(into, strip_option), default)]
pub permissions: Option<isize>,
}
impl Directory {
/// Load the directory as a Dagger module
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn as_module(&self) -> Module {
let query = self.selection.select("asModule");
return Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load the directory as a Dagger module
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
let mut query = self.selection.select("asModule");
if let Some(source_subpath) = opts.source_subpath {
query = query.arg("sourceSubpath", source_subpath);
}
return Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Gets the difference between this directory and an another directory.
///
/// # Arguments
///
/// * `other` - Identifier of the directory to compare.
pub fn diff(&self, other: Directory) -> Directory {
let mut query = self.selection.select("diff");
query = query.arg_lazy(
"other",
Box::new(move || {
let other = other.clone();
Box::pin(async move { other.id().await.unwrap().quote() })
}),
);
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves a directory at the given path.
///
/// # Arguments
///
/// * `path` - Location of the directory to retrieve (e.g., "/src").
pub fn directory(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("directory");
query = query.arg("path", path.into());
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Builds a new Docker container from this directory.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn docker_build(&self) -> Container {
let query = self.selection.select("dockerBuild");
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Builds a new Docker container from this directory.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
let mut query = self.selection.select("dockerBuild");
if let Some(platform) = opts.platform {
query = query.arg("platform", platform);
}
if let Some(dockerfile) = opts.dockerfile {
query = query.arg("dockerfile", dockerfile);
}
if let Some(target) = opts.target {
query = query.arg("target", target);
}
if let Some(build_args) = opts.build_args {
query = query.arg("buildArgs", build_args);
}
if let Some(secrets) = opts.secrets {
query = query.arg("secrets", secrets);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns a list of files and directories at the given path.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("entries");
query.execute(self.graphql_client.clone()).await
}
/// Returns a list of files and directories at the given path.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub async fn entries_opts<'a>(
&self,
opts: DirectoryEntriesOpts<'a>,
) -> Result<Vec<String>, DaggerError> {
let mut query = self.selection.select("entries");
if let Some(path) = opts.path {
query = query.arg("path", path);
}
query.execute(self.graphql_client.clone()).await
}
/// Writes the contents of the directory to a path on the host.
///
/// # Arguments
///
/// * `path` - Location of the copied directory (e.g., "logs/").
pub async fn export(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
let mut query = self.selection.select("export");
query = query.arg("path", path.into());
query.execute(self.graphql_client.clone()).await
}
/// Retrieves a file at the given path.
///
/// # Arguments
///
/// * `path` - Location of the file to retrieve (e.g., "README.md").
pub fn file(&self, path: impl Into<String>) -> File {
let mut query = self.selection.select("file");
query = query.arg("path", path.into());
return File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns a list of files and directories that matche the given pattern.
///
/// # Arguments
///
/// * `pattern` - Pattern to match (e.g., "*.md").
pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
let mut query = self.selection.select("glob");
query = query.arg("pattern", pattern.into());
query.execute(self.graphql_client.clone()).await
}
/// A unique identifier for this Directory.
pub async fn id(&self) -> Result<DirectoryId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
/// Creates a named sub-pipeline.
///
/// # Arguments
///
/// * `name` - Name of the sub-pipeline.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn pipeline(&self, name: impl Into<String>) -> Directory {
let mut query = self.selection.select("pipeline");
query = query.arg("name", name.into());
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Creates a named sub-pipeline.
///
/// # Arguments
///
/// * `name` - Name of the sub-pipeline.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn pipeline_opts<'a>(
&self,
name: impl Into<String>,
opts: DirectoryPipelineOpts<'a>,
) -> Directory {
let mut query = self.selection.select("pipeline");
query = query.arg("name", name.into());
if let Some(description) = opts.description {
query = query.arg("description", description);
}
if let Some(labels) = opts.labels {
query = query.arg("labels", labels);
}
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Force evaluation in the engine.
pub async fn sync(&self) -> Result<DirectoryId, DaggerError> {
let query = self.selection.select("sync");
query.execute(self.graphql_client.clone()).await
}
/// Retrieves this directory plus a directory written at the given path.
///
/// # Arguments
///
/// * `path` - Location of the written directory (e.g., "/src/").
/// * `directory` - Identifier of the directory to copy.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_directory(&self, path: impl Into<String>, directory: Directory) -> Directory {
let mut query = self.selection.select("withDirectory");
query = query.arg("path", path.into());
query = query.arg_lazy(
"directory",
Box::new(move || {
let directory = directory.clone();
Box::pin(async move { directory.id().await.unwrap().quote() })
}),
);
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this directory plus a directory written at the given path.
///
/// # Arguments
///
/// * `path` - Location of the written directory (e.g., "/src/").
/// * `directory` - Identifier of the directory to copy.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_directory_opts<'a>(
&self,
path: impl Into<String>,
directory: Directory,
opts: DirectoryWithDirectoryOpts<'a>,
) -> Directory {
let mut query = self.selection.select("withDirectory");
query = query.arg("path", path.into());
query = query.arg_lazy(
"directory",
Box::new(move || {
let directory = directory.clone();
Box::pin(async move { directory.id().await.unwrap().quote() })
}),
);
if let Some(exclude) = opts.exclude {
query = query.arg("exclude", exclude);
}
if let Some(include) = opts.include {
query = query.arg("include", include);
}
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this directory plus the contents of the given file copied to the given path.
///
/// # Arguments
///
/// * `path` - Location of the copied file (e.g., "/file.txt").
/// * `source` - Identifier of the file to copy.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_file(&self, path: impl Into<String>, source: File) -> Directory {
let mut query = self.selection.select("withFile");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.id().await.unwrap().quote() })
}),
);
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this directory plus the contents of the given file copied to the given path.
///
/// # Arguments
///
/// * `path` - Location of the copied file (e.g., "/file.txt").
/// * `source` - Identifier of the file to copy.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_file_opts(
&self,
path: impl Into<String>,
source: File,
opts: DirectoryWithFileOpts,
) -> Directory {
let mut query = self.selection.select("withFile");
query = query.arg("path", path.into());
query = query.arg_lazy(
"source",
Box::new(move || {
let source = source.clone();
Box::pin(async move { source.id().await.unwrap().quote() })
}),
);
if let Some(permissions) = opts.permissions {
query = query.arg("permissions", permissions);
}
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this directory plus a new directory created at the given path.
///
/// # Arguments
///
/// * `path` - Location of the directory created (e.g., "/logs").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("withNewDirectory");
query = query.arg("path", path.into());
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this directory plus a new directory created at the given path.
///
/// # Arguments
///
/// * `path` - Location of the directory created (e.g., "/logs").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_new_directory_opts(
&self,
path: impl Into<String>,
opts: DirectoryWithNewDirectoryOpts,
) -> Directory {
let mut query = self.selection.select("withNewDirectory");
query = query.arg("path", path.into());
if let Some(permissions) = opts.permissions {
query = query.arg("permissions", permissions);
}
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this directory plus a new file written at the given path.
///
/// # Arguments
///
/// * `path` - Location of the written file (e.g., "/file.txt").
/// * `contents` - Content of the written file (e.g., "Hello world!").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
let mut query = self.selection.select("withNewFile");
query = query.arg("path", path.into());
query = query.arg("contents", contents.into());
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this directory plus a new file written at the given path.
///
/// # Arguments
///
/// * `path` - Location of the written file (e.g., "/file.txt").
/// * `contents` - Content of the written file (e.g., "Hello world!").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_new_file_opts(
&self,
path: impl Into<String>,
contents: impl Into<String>,
opts: DirectoryWithNewFileOpts,
) -> Directory {
let mut query = self.selection.select("withNewFile");
query = query.arg("path", path.into());
query = query.arg("contents", contents.into());
if let Some(permissions) = opts.permissions {
query = query.arg("permissions", permissions);
}
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this directory with all file/dir timestamps set to the given time.
///
/// # Arguments
///
/// * `timestamp` - Timestamp to set dir/files in.
///
/// Formatted in seconds following Unix epoch (e.g., 1672531199).
pub fn with_timestamps(&self, timestamp: isize) -> Directory {
let mut query = self.selection.select("withTimestamps");
query = query.arg("timestamp", timestamp);
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this directory with the directory at the given path removed.
///
/// # Arguments
///
/// * `path` - Location of the directory to remove (e.g., ".github/").
pub fn without_directory(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("withoutDirectory");
query = query.arg("path", path.into());
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves this directory with the file at the given path removed.
///
/// # Arguments
///
/// * `path` - Location of the file to remove (e.g., "/file.txt").
pub fn without_file(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("withoutFile");
query = query.arg("path", path.into());
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
}
#[derive(Clone)]
pub struct EnvVariable {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl EnvVariable {
/// A unique identifier for this EnvVariable.
pub async fn id(&self) -> Result<EnvVariableId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn value(&self) -> Result<String, DaggerError> {
let query = self.selection.select("value");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct FieldTypeDef {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl FieldTypeDef {
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
/// A unique identifier for this FieldTypeDef.
pub async fn id(&self) -> Result<FieldTypeDefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn type_def(&self) -> TypeDef {
let query = self.selection.select("typeDef");
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
}
#[derive(Clone)]
pub struct File {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct FileExportOpts {
/// If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
#[builder(setter(into, strip_option), default)]
pub allow_parent_dir_path: Option<bool>,
}
impl File {
/// Retrieves the contents of the file.
pub async fn contents(&self) -> Result<String, DaggerError> {
let query = self.selection.select("contents");
query.execute(self.graphql_client.clone()).await
}
/// Writes the file to a file path on the host.
///
/// # Arguments
///
/// * `path` - Location of the written directory (e.g., "output.txt").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub async fn export(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
let mut query = self.selection.select("export");
query = query.arg("path", path.into());
query.execute(self.graphql_client.clone()).await
}
/// Writes the file to a file path on the host.
///
/// # Arguments
///
/// * `path` - Location of the written directory (e.g., "output.txt").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub async fn export_opts(
&self,
path: impl Into<String>,
opts: FileExportOpts,
) -> Result<bool, DaggerError> {
let mut query = self.selection.select("export");
query = query.arg("path", path.into());
if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
query = query.arg("allowParentDirPath", allow_parent_dir_path);
}
query.execute(self.graphql_client.clone()).await
}
/// A unique identifier for this File.
pub async fn id(&self) -> Result<FileId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
/// Retrieves the size of the file, in bytes.
pub async fn size(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("size");
query.execute(self.graphql_client.clone()).await
}
/// Force evaluation in the engine.
pub async fn sync(&self) -> Result<FileId, DaggerError> {
let query = self.selection.select("sync");
query.execute(self.graphql_client.clone()).await
}
/// Retrieves this file with its created/modified timestamps set to the given time.
///
/// # Arguments
///
/// * `timestamp` - Timestamp to set dir/files in.
///
/// Formatted in seconds following Unix epoch (e.g., 1672531199).
pub fn with_timestamps(&self, timestamp: isize) -> File {
let mut query = self.selection.select("withTimestamps");
query = query.arg("timestamp", timestamp);
return File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
}
#[derive(Clone)]
pub struct Function {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct FunctionWithArgOpts<'a> {
/// A default value to use for this argument if not explicitly set by the caller, if any
#[builder(setter(into, strip_option), default)]
pub default_value: Option<Json>,
/// A doc string for the argument, if any
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
}
impl Function {
pub fn args(&self) -> Vec<FunctionArg> {
let query = self.selection.select("args");
return vec![FunctionArg {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}];
}
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
/// A unique identifier for this Function.
pub async fn id(&self) -> Result<FunctionId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn return_type(&self) -> TypeDef {
let query = self.selection.select("returnType");
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns the function with the provided argument
///
/// # Arguments
///
/// * `name` - The name of the argument
/// * `type_def` - The type of the argument
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_arg(&self, name: impl Into<String>, type_def: TypeDef) -> Function {
let mut query = self.selection.select("withArg");
query = query.arg("name", name.into());
query = query.arg_lazy(
"typeDef",
Box::new(move || {
let type_def = type_def.clone();
Box::pin(async move { type_def.id().await.unwrap().quote() })
}),
);
return Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns the function with the provided argument
///
/// # Arguments
///
/// * `name` - The name of the argument
/// * `type_def` - The type of the argument
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_arg_opts<'a>(
&self,
name: impl Into<String>,
type_def: TypeDef,
opts: FunctionWithArgOpts<'a>,
) -> Function {
let mut query = self.selection.select("withArg");
query = query.arg("name", name.into());
query = query.arg_lazy(
"typeDef",
Box::new(move || {
let type_def = type_def.clone();
Box::pin(async move { type_def.id().await.unwrap().quote() })
}),
);
if let Some(description) = opts.description {
query = query.arg("description", description);
}
if let Some(default_value) = opts.default_value {
query = query.arg("defaultValue", default_value);
}
return Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns the function with the given doc string.
///
/// # Arguments
///
/// * `description` - The doc string to set.
pub fn with_description(&self, description: impl Into<String>) -> Function {
let mut query = self.selection.select("withDescription");
query = query.arg("description", description.into());
return Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
}
#[derive(Clone)]
pub struct FunctionArg {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl FunctionArg {
pub async fn default_value(&self) -> Result<Json, DaggerError> {
let query = self.selection.select("defaultValue");
query.execute(self.graphql_client.clone()).await
}
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
/// A unique identifier for this FunctionArg.
pub async fn id(&self) -> Result<FunctionArgId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn type_def(&self) -> TypeDef {
let query = self.selection.select("typeDef");
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
}
#[derive(Clone)]
pub struct FunctionCall {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl FunctionCall {
/// A unique identifier for this FunctionCall.
pub async fn id(&self) -> Result<FunctionCallId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub fn input_args(&self) -> Vec<FunctionCallArgValue> {
let query = self.selection.select("inputArgs");
return vec![FunctionCallArgValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}];
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn parent(&self) -> Result<Json, DaggerError> {
let query = self.selection.select("parent");
query.execute(self.graphql_client.clone()).await
}
pub async fn parent_name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("parentName");
query.execute(self.graphql_client.clone()).await
}
/// Set the return value of the function call to the provided value.
///
/// # Arguments
///
/// * `value` - JSON serialization of the return value.
pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
let mut query = self.selection.select("returnValue");
query = query.arg("value", value);
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct FunctionCallArgValue {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl FunctionCallArgValue {
/// A unique identifier for this FunctionCallArgValue.
pub async fn id(&self) -> Result<FunctionCallArgValueId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn value(&self) -> Result<Json, DaggerError> {
let query = self.selection.select("value");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct GeneratedCode {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl GeneratedCode {
pub fn code(&self) -> Directory {
let query = self.selection.select("code");
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// A unique identifier for this GeneratedCode.
pub async fn id(&self) -> Result<GeneratedCodeId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("vcsGeneratedPaths");
query.execute(self.graphql_client.clone()).await
}
pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("vcsIgnoredPaths");
query.execute(self.graphql_client.clone()).await
}
/// Set the list of paths to mark generated in version control.
pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
let mut query = self.selection.select("withVCSGeneratedPaths");
query = query.arg(
"paths",
paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
return GeneratedCode {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Set the list of paths to ignore in version control.
pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
let mut query = self.selection.select("withVCSIgnoredPaths");
query = query.arg(
"paths",
paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
);
return GeneratedCode {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
}
#[derive(Clone)]
pub struct GitRef {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct GitRefTreeOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub ssh_auth_socket: Option<SocketId>,
#[builder(setter(into, strip_option), default)]
pub ssh_known_hosts: Option<&'a str>,
}
impl GitRef {
/// The resolved commit id at this ref.
pub async fn commit(&self) -> Result<String, DaggerError> {
let query = self.selection.select("commit");
query.execute(self.graphql_client.clone()).await
}
/// A unique identifier for this GitRef.
pub async fn id(&self) -> Result<GitRefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
/// The filesystem tree at this ref.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn tree(&self) -> Directory {
let query = self.selection.select("tree");
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// The filesystem tree at this ref.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn tree_opts<'a>(&self, opts: GitRefTreeOpts<'a>) -> Directory {
let mut query = self.selection.select("tree");
if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
query = query.arg("sshKnownHosts", ssh_known_hosts);
}
if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
query = query.arg("sshAuthSocket", ssh_auth_socket);
}
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
}
#[derive(Clone)]
pub struct GitRepository {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl GitRepository {
/// Returns details of a branch.
///
/// # Arguments
///
/// * `name` - Branch's name (e.g., "main").
pub fn branch(&self, name: impl Into<String>) -> GitRef {
let mut query = self.selection.select("branch");
query = query.arg("name", name.into());
return GitRef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns details of a commit.
///
/// # Arguments
///
/// * `id` - Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
pub fn commit(&self, id: impl Into<String>) -> GitRef {
let mut query = self.selection.select("commit");
query = query.arg("id", id.into());
return GitRef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// A unique identifier for this GitRepository.
pub async fn id(&self) -> Result<GitRepositoryId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
/// Returns details of a tag.
///
/// # Arguments
///
/// * `name` - Tag's name (e.g., "v0.3.9").
pub fn tag(&self, name: impl Into<String>) -> GitRef {
let mut query = self.selection.select("tag");
query = query.arg("name", name.into());
return GitRef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
}
#[derive(Clone)]
pub struct Host {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct HostDirectoryOpts<'a> {
/// Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
#[builder(setter(into, strip_option), default)]
pub exclude: Option<Vec<&'a str>>,
/// Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
#[builder(setter(into, strip_option), default)]
pub include: Option<Vec<&'a str>>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct HostServiceOpts<'a> {
/// Upstream host to forward traffic to.
#[builder(setter(into, strip_option), default)]
pub host: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct HostTunnelOpts {
/// Map each service port to the same port on the host, as if the service were running natively.
/// Note: enabling may result in port conflicts.
#[builder(setter(into, strip_option), default)]
pub native: Option<bool>,
/// Configure explicit port forwarding rules for the tunnel.
/// If a port's frontend is unspecified or 0, a random port will be chosen by the host.
/// If no ports are given, all of the service's ports are forwarded. If native is true, each port maps to the same port on the host. If native is false, each port maps to a random port chosen by the host.
/// If ports are given and native is true, the ports are additive.
#[builder(setter(into, strip_option), default)]
pub ports: Option<Vec<PortForward>>,
}
impl Host {
/// Accesses a directory on the host.
///
/// # Arguments
///
/// * `path` - Location of the directory to access (e.g., ".").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn directory(&self, path: impl Into<String>) -> Directory {
let mut query = self.selection.select("directory");
query = query.arg("path", path.into());
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Accesses a directory on the host.
///
/// # Arguments
///
/// * `path` - Location of the directory to access (e.g., ".").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn directory_opts<'a>(
&self,
path: impl Into<String>,
opts: HostDirectoryOpts<'a>,
) -> Directory {
let mut query = self.selection.select("directory");
query = query.arg("path", path.into());
if let Some(exclude) = opts.exclude {
query = query.arg("exclude", exclude);
}
if let Some(include) = opts.include {
query = query.arg("include", include);
}
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Accesses a file on the host.
///
/// # Arguments
///
/// * `path` - Location of the file to retrieve (e.g., "README.md").
pub fn file(&self, path: impl Into<String>) -> File {
let mut query = self.selection.select("file");
query = query.arg("path", path.into());
return File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// A unique identifier for this Host.
pub async fn id(&self) -> Result<HostId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
/// Creates a service that forwards traffic to a specified address via the host.
///
/// # Arguments
///
/// * `ports` - Ports to expose via the service, forwarding through the host network.
///
/// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
///
/// An empty set of ports is not valid; an error will be returned.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn service(&self, ports: Vec<PortForward>) -> Service {
let mut query = self.selection.select("service");
query = query.arg("ports", ports);
return Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Creates a service that forwards traffic to a specified address via the host.
///
/// # Arguments
///
/// * `ports` - Ports to expose via the service, forwarding through the host network.
///
/// If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
///
/// An empty set of ports is not valid; an error will be returned.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
let mut query = self.selection.select("service");
query = query.arg("ports", ports);
if let Some(host) = opts.host {
query = query.arg("host", host);
}
return Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Sets a secret given a user-defined name and the file path on the host, and returns the secret.
/// The file is limited to a size of 512000 bytes.
///
/// # Arguments
///
/// * `name` - The user defined name for this secret.
/// * `path` - Location of the file to set as a secret.
pub fn set_secret_file(&self, name: impl Into<String>, path: impl Into<String>) -> Secret {
let mut query = self.selection.select("setSecretFile");
query = query.arg("name", name.into());
query = query.arg("path", path.into());
return Secret {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Creates a tunnel that forwards traffic from the host to a service.
///
/// # Arguments
///
/// * `service` - Service to send traffic from the tunnel.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn tunnel(&self, service: Service) -> Service {
let mut query = self.selection.select("tunnel");
query = query.arg_lazy(
"service",
Box::new(move || {
let service = service.clone();
Box::pin(async move { service.id().await.unwrap().quote() })
}),
);
return Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Creates a tunnel that forwards traffic from the host to a service.
///
/// # Arguments
///
/// * `service` - Service to send traffic from the tunnel.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn tunnel_opts(&self, service: Service, opts: HostTunnelOpts) -> Service {
let mut query = self.selection.select("tunnel");
query = query.arg_lazy(
"service",
Box::new(move || {
let service = service.clone();
Box::pin(async move { service.id().await.unwrap().quote() })
}),
);
if let Some(ports) = opts.ports {
query = query.arg("ports", ports);
}
if let Some(native) = opts.native {
query = query.arg("native", native);
}
return Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Accesses a Unix socket on the host.
///
/// # Arguments
///
/// * `path` - Location of the Unix socket (e.g., "/var/run/docker.sock").
pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
let mut query = self.selection.select("unixSocket");
query = query.arg("path", path.into());
return Socket {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
}
#[derive(Clone)]
pub struct InterfaceTypeDef {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl InterfaceTypeDef {
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub fn functions(&self) -> Vec<Function> {
let query = self.selection.select("functions");
return vec![Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}];
}
/// A unique identifier for this InterfaceTypeDef.
pub async fn id(&self) -> Result<InterfaceTypeDefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn source_module_name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("sourceModuleName");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Label {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Label {
/// A unique identifier for this Label.
pub async fn id(&self) -> Result<LabelId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn value(&self) -> Result<String, DaggerError> {
let query = self.selection.select("value");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct ListTypeDef {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl ListTypeDef {
pub fn element_type_def(&self) -> TypeDef {
let query = self.selection.select("elementTypeDef");
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// A unique identifier for this ListTypeDef.
pub async fn id(&self) -> Result<ListTypeDefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Module {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ModuleWithSourceOpts<'a> {
/// An optional subpath of the directory which contains the module's source code.
/// This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
/// If not set, the module source code is loaded from the root of the directory.
#[builder(setter(into, strip_option), default)]
pub subpath: Option<&'a str>,
}
impl Module {
pub fn dependencies(&self) -> Vec<Module> {
let query = self.selection.select("dependencies");
return vec![Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}];
}
pub async fn dependency_config(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("dependencyConfig");
query.execute(self.graphql_client.clone()).await
}
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub fn generated_code(&self) -> GeneratedCode {
let query = self.selection.select("generatedCode");
return GeneratedCode {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// A unique identifier for this Module.
pub async fn id(&self) -> Result<ModuleId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
/// Retrieves the module with the objects loaded via its SDK.
pub fn initialize(&self) -> Module {
let query = self.selection.select("initialize");
return Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
pub fn interfaces(&self) -> Vec<TypeDef> {
let query = self.selection.select("interfaces");
return vec![TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}];
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub fn objects(&self) -> Vec<TypeDef> {
let query = self.selection.select("objects");
return vec![TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}];
}
pub async fn sdk(&self) -> Result<String, DaggerError> {
let query = self.selection.select("sdk");
query.execute(self.graphql_client.clone()).await
}
/// Serve a module's API in the current session.
/// Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
pub async fn serve(&self) -> Result<Void, DaggerError> {
let query = self.selection.select("serve");
query.execute(self.graphql_client.clone()).await
}
pub fn source_directory(&self) -> Directory {
let query = self.selection.select("sourceDirectory");
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
pub async fn source_directory_subpath(&self) -> Result<String, DaggerError> {
let query = self.selection.select("sourceDirectorySubpath");
query.execute(self.graphql_client.clone()).await
}
/// This module plus the given Interface type and associated functions
pub fn with_interface(&self, iface: TypeDef) -> Module {
let mut query = self.selection.select("withInterface");
query = query.arg_lazy(
"iface",
Box::new(move || {
let iface = iface.clone();
Box::pin(async move { iface.id().await.unwrap().quote() })
}),
);
return Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// This module plus the given Object type and associated functions.
pub fn with_object(&self, object: TypeDef) -> Module {
let mut query = self.selection.select("withObject");
query = query.arg_lazy(
"object",
Box::new(move || {
let object = object.clone();
Box::pin(async move { object.id().await.unwrap().quote() })
}),
);
return Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves the module with basic configuration loaded, ready for initialization.
///
/// # Arguments
///
/// * `directory` - The directory containing the module's source code.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_source(&self, directory: Directory) -> Module {
let mut query = self.selection.select("withSource");
query = query.arg_lazy(
"directory",
Box::new(move || {
let directory = directory.clone();
Box::pin(async move { directory.id().await.unwrap().quote() })
}),
);
return Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Retrieves the module with basic configuration loaded, ready for initialization.
///
/// # Arguments
///
/// * `directory` - The directory containing the module's source code.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_source_opts<'a>(
&self,
directory: Directory,
opts: ModuleWithSourceOpts<'a>,
) -> Module {
let mut query = self.selection.select("withSource");
query = query.arg_lazy(
"directory",
Box::new(move || {
let directory = directory.clone();
Box::pin(async move { directory.id().await.unwrap().quote() })
}),
);
if let Some(subpath) = opts.subpath {
query = query.arg("subpath", subpath);
}
return Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
}
#[derive(Clone)]
pub struct ModuleConfig {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl ModuleConfig {
pub async fn dependencies(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("dependencies");
query.execute(self.graphql_client.clone()).await
}
pub async fn exclude(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("exclude");
query.execute(self.graphql_client.clone()).await
}
/// A unique identifier for this ModuleConfig.
pub async fn id(&self) -> Result<ModuleConfigId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn include(&self) -> Result<Vec<String>, DaggerError> {
let query = self.selection.select("include");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn root(&self) -> Result<String, DaggerError> {
let query = self.selection.select("root");
query.execute(self.graphql_client.clone()).await
}
pub async fn sdk(&self) -> Result<String, DaggerError> {
let query = self.selection.select("sdk");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct ObjectTypeDef {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl ObjectTypeDef {
pub fn constructor(&self) -> Function {
let query = self.selection.select("constructor");
return Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
pub fn fields(&self) -> Vec<FieldTypeDef> {
let query = self.selection.select("fields");
return vec![FieldTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}];
}
pub fn functions(&self) -> Vec<Function> {
let query = self.selection.select("functions");
return vec![Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}];
}
/// A unique identifier for this ObjectTypeDef.
pub async fn id(&self) -> Result<ObjectTypeDefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("name");
query.execute(self.graphql_client.clone()).await
}
pub async fn source_module_name(&self) -> Result<String, DaggerError> {
let query = self.selection.select("sourceModuleName");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Port {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Port {
pub async fn description(&self) -> Result<String, DaggerError> {
let query = self.selection.select("description");
query.execute(self.graphql_client.clone()).await
}
/// A unique identifier for this Port.
pub async fn id(&self) -> Result<PortId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn port(&self) -> Result<isize, DaggerError> {
let query = self.selection.select("port");
query.execute(self.graphql_client.clone()).await
}
pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
let query = self.selection.select("protocol");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Query {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryContainerOpts {
#[builder(setter(into, strip_option), default)]
pub id: Option<ContainerId>,
/// Platform to initialize the container with.
#[builder(setter(into, strip_option), default)]
pub platform: Option<Platform>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryDirectoryOpts {
#[builder(setter(into, strip_option), default)]
pub id: Option<DirectoryId>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryGitOpts<'a> {
/// A service which must be started before the repo is fetched.
#[builder(setter(into, strip_option), default)]
pub experimental_service_host: Option<ServiceId>,
/// Set to true to keep .git directory.
#[builder(setter(into, strip_option), default)]
pub keep_git_dir: Option<bool>,
/// Set SSH auth socket
#[builder(setter(into, strip_option), default)]
pub ssh_auth_socket: Option<SocketId>,
/// Set SSH known hosts
#[builder(setter(into, strip_option), default)]
pub ssh_known_hosts: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryHttpOpts {
/// A service which must be started before the URL is fetched.
#[builder(setter(into, strip_option), default)]
pub experimental_service_host: Option<ServiceId>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryModuleConfigOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub subpath: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct QueryPipelineOpts<'a> {
/// Description of the sub-pipeline.
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
/// Labels to apply to the sub-pipeline.
#[builder(setter(into, strip_option), default)]
pub labels: Option<Vec<PipelineLabel>>,
}
impl Query {
/// Retrieves a content-addressed blob.
///
/// # Arguments
///
/// * `digest` - Digest of the blob
/// * `size` - Size of the blob
/// * `media_type` - Media type of the blob
/// * `uncompressed` - Digest of the uncompressed blob
pub fn blob(
&self,
digest: impl Into<String>,
size: isize,
media_type: impl Into<String>,
uncompressed: impl Into<String>,
) -> Directory {
let mut query = self.selection.select("blob");
query = query.arg("digest", digest.into());
query = query.arg("size", size);
query = query.arg("mediaType", media_type.into());
query = query.arg("uncompressed", uncompressed.into());
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Constructs a cache volume for a given cache key.
///
/// # Arguments
///
/// * `key` - A string identifier to target this cache volume (e.g., "modules-cache").
pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
let mut query = self.selection.select("cacheVolume");
query = query.arg("key", key.into());
return CacheVolume {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Checks if the current Dagger Engine is compatible with an SDK's required version.
///
/// # Arguments
///
/// * `version` - Version required by the SDK.
pub async fn check_version_compatibility(
&self,
version: impl Into<String>,
) -> Result<bool, DaggerError> {
let mut query = self.selection.select("checkVersionCompatibility");
query = query.arg("version", version.into());
query.execute(self.graphql_client.clone()).await
}
/// Creates a scratch container.
/// Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn container(&self) -> Container {
let query = self.selection.select("container");
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Creates a scratch container.
/// Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
let mut query = self.selection.select("container");
if let Some(id) = opts.id {
query = query.arg("id", id);
}
if let Some(platform) = opts.platform {
query = query.arg("platform", platform);
}
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// The FunctionCall context that the SDK caller is currently executing in.
/// If the caller is not currently executing in a function, this will return an error.
pub fn current_function_call(&self) -> FunctionCall {
let query = self.selection.select("currentFunctionCall");
return FunctionCall {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// The module currently being served in the session, if any.
pub fn current_module(&self) -> Module {
let query = self.selection.select("currentModule");
return Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// The TypeDef representations of the objects currently being served in the session.
pub fn current_type_defs(&self) -> Vec<TypeDef> {
let query = self.selection.select("currentTypeDefs");
return vec![TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}];
}
/// The default platform of the engine.
pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
let query = self.selection.select("defaultPlatform");
query.execute(self.graphql_client.clone()).await
}
/// Creates an empty directory.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn directory(&self) -> Directory {
let query = self.selection.select("directory");
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Creates an empty directory.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn directory_opts(&self, opts: QueryDirectoryOpts) -> Directory {
let mut query = self.selection.select("directory");
if let Some(id) = opts.id {
query = query.arg("id", id);
}
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
pub fn file(&self, id: File) -> File {
let mut query = self.selection.select("file");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Creates a function.
///
/// # Arguments
///
/// * `name` - Name of the function, in its original format from the implementation language.
/// * `return_type` - Return type of the function.
pub fn function(&self, name: impl Into<String>, return_type: TypeDef) -> Function {
let mut query = self.selection.select("function");
query = query.arg("name", name.into());
query = query.arg_lazy(
"returnType",
Box::new(move || {
let return_type = return_type.clone();
Box::pin(async move { return_type.id().await.unwrap().quote() })
}),
);
return Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Create a code generation result, given a directory containing the generated code.
pub fn generated_code(&self, code: Directory) -> GeneratedCode {
let mut query = self.selection.select("generatedCode");
query = query.arg_lazy(
"code",
Box::new(move || {
let code = code.clone();
Box::pin(async move { code.id().await.unwrap().quote() })
}),
);
return GeneratedCode {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Queries a Git repository.
///
/// # Arguments
///
/// * `url` - URL of the git repository.
///
/// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
///
/// Suffix ".git" is optional.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn git(&self, url: impl Into<String>) -> GitRepository {
let mut query = self.selection.select("git");
query = query.arg("url", url.into());
return GitRepository {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Queries a Git repository.
///
/// # Arguments
///
/// * `url` - URL of the git repository.
///
/// Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
///
/// Suffix ".git" is optional.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
let mut query = self.selection.select("git");
query = query.arg("url", url.into());
if let Some(keep_git_dir) = opts.keep_git_dir {
query = query.arg("keepGitDir", keep_git_dir);
}
if let Some(experimental_service_host) = opts.experimental_service_host {
query = query.arg("experimentalServiceHost", experimental_service_host);
}
if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
query = query.arg("sshKnownHosts", ssh_known_hosts);
}
if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
query = query.arg("sshAuthSocket", ssh_auth_socket);
}
return GitRepository {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Queries the host environment.
pub fn host(&self) -> Host {
let query = self.selection.select("host");
return Host {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns a file containing an http remote url content.
///
/// # Arguments
///
/// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn http(&self, url: impl Into<String>) -> File {
let mut query = self.selection.select("http");
query = query.arg("url", url.into());
return File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns a file containing an http remote url content.
///
/// # Arguments
///
/// * `url` - HTTP url to get the content from (e.g., "https://docs.dagger.io").
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn http_opts(&self, url: impl Into<String>, opts: QueryHttpOpts) -> File {
let mut query = self.selection.select("http");
query = query.arg("url", url.into());
if let Some(experimental_service_host) = opts.experimental_service_host {
query = query.arg("experimentalServiceHost", experimental_service_host);
}
return File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a CacheVolume from its ID.
pub fn load_cache_volume_from_id(&self, id: CacheVolume) -> CacheVolume {
let mut query = self.selection.select("loadCacheVolumeFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return CacheVolume {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a Container from its ID.
pub fn load_container_from_id(&self, id: Container) -> Container {
let mut query = self.selection.select("loadContainerFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return Container {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a Directory from its ID.
pub fn load_directory_from_id(&self, id: Directory) -> Directory {
let mut query = self.selection.select("loadDirectoryFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return Directory {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a EnvVariable from its ID.
pub fn load_env_variable_from_id(&self, id: EnvVariable) -> EnvVariable {
let mut query = self.selection.select("loadEnvVariableFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return EnvVariable {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a FieldTypeDef from its ID.
pub fn load_field_type_def_from_id(&self, id: FieldTypeDef) -> FieldTypeDef {
let mut query = self.selection.select("loadFieldTypeDefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return FieldTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a File from its ID.
pub fn load_file_from_id(&self, id: File) -> File {
let mut query = self.selection.select("loadFileFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return File {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a FunctionArg from its ID.
pub fn load_function_arg_from_id(&self, id: FunctionArg) -> FunctionArg {
let mut query = self.selection.select("loadFunctionArgFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return FunctionArg {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a FunctionCallArgValue from its ID.
pub fn load_function_call_arg_value_from_id(
&self,
id: FunctionCallArgValue,
) -> FunctionCallArgValue {
let mut query = self.selection.select("loadFunctionCallArgValueFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return FunctionCallArgValue {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a FunctionCall from its ID.
pub fn load_function_call_from_id(&self, id: FunctionCall) -> FunctionCall {
let mut query = self.selection.select("loadFunctionCallFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return FunctionCall {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a Function from its ID.
pub fn load_function_from_id(&self, id: Function) -> Function {
let mut query = self.selection.select("loadFunctionFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return Function {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a GeneratedCode from its ID.
pub fn load_generated_code_from_id(&self, id: GeneratedCode) -> GeneratedCode {
let mut query = self.selection.select("loadGeneratedCodeFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return GeneratedCode {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a GitRef from its ID.
pub fn load_git_ref_from_id(&self, id: GitRef) -> GitRef {
let mut query = self.selection.select("loadGitRefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return GitRef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a GitRepository from its ID.
pub fn load_git_repository_from_id(&self, id: GitRepository) -> GitRepository {
let mut query = self.selection.select("loadGitRepositoryFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return GitRepository {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a Host from its ID.
pub fn load_host_from_id(&self, id: Host) -> Host {
let mut query = self.selection.select("loadHostFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return Host {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a InterfaceTypeDef from its ID.
pub fn load_interface_type_def_from_id(&self, id: InterfaceTypeDef) -> InterfaceTypeDef {
let mut query = self.selection.select("loadInterfaceTypeDefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return InterfaceTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a Label from its ID.
pub fn load_label_from_id(&self, id: Label) -> Label {
let mut query = self.selection.select("loadLabelFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return Label {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a ListTypeDef from its ID.
pub fn load_list_type_def_from_id(&self, id: ListTypeDef) -> ListTypeDef {
let mut query = self.selection.select("loadListTypeDefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return ListTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a ModuleConfig from its ID.
pub fn load_module_config_from_id(&self, id: ModuleConfig) -> ModuleConfig {
let mut query = self.selection.select("loadModuleConfigFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return ModuleConfig {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a Module from its ID.
pub fn load_module_from_id(&self, id: Module) -> Module {
let mut query = self.selection.select("loadModuleFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a ObjectTypeDef from its ID.
pub fn load_object_type_def_from_id(&self, id: ObjectTypeDef) -> ObjectTypeDef {
let mut query = self.selection.select("loadObjectTypeDefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return ObjectTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a Port from its ID.
pub fn load_port_from_id(&self, id: Port) -> Port {
let mut query = self.selection.select("loadPortFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return Port {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a Secret from its ID.
pub fn load_secret_from_id(&self, id: Secret) -> Secret {
let mut query = self.selection.select("loadSecretFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return Secret {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a Service from its ID.
pub fn load_service_from_id(&self, id: Service) -> Service {
let mut query = self.selection.select("loadServiceFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return Service {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a Socket from its ID.
pub fn load_socket_from_id(&self, id: Socket) -> Socket {
let mut query = self.selection.select("loadSocketFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return Socket {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load a TypeDef from its ID.
pub fn load_type_def_from_id(&self, id: TypeDef) -> TypeDef {
let mut query = self.selection.select("loadTypeDefFromID");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Create a new module.
pub fn module(&self) -> Module {
let query = self.selection.select("module");
return Module {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load the static configuration for a module from the given source directory and optional subpath.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn module_config(&self, source_directory: Directory) -> ModuleConfig {
let mut query = self.selection.select("moduleConfig");
query = query.arg_lazy(
"sourceDirectory",
Box::new(move || {
let source_directory = source_directory.clone();
Box::pin(async move { source_directory.id().await.unwrap().quote() })
}),
);
return ModuleConfig {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Load the static configuration for a module from the given source directory and optional subpath.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn module_config_opts<'a>(
&self,
source_directory: Directory,
opts: QueryModuleConfigOpts<'a>,
) -> ModuleConfig {
let mut query = self.selection.select("moduleConfig");
query = query.arg_lazy(
"sourceDirectory",
Box::new(move || {
let source_directory = source_directory.clone();
Box::pin(async move { source_directory.id().await.unwrap().quote() })
}),
);
if let Some(subpath) = opts.subpath {
query = query.arg("subpath", subpath);
}
return ModuleConfig {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Creates a named sub-pipeline.
///
/// # Arguments
///
/// * `name` - Name of the sub-pipeline.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn pipeline(&self, name: impl Into<String>) -> Query {
let mut query = self.selection.select("pipeline");
query = query.arg("name", name.into());
return Query {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Creates a named sub-pipeline.
///
/// # Arguments
///
/// * `name` - Name of the sub-pipeline.
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn pipeline_opts<'a>(&self, name: impl Into<String>, opts: QueryPipelineOpts<'a>) -> Query {
let mut query = self.selection.select("pipeline");
query = query.arg("name", name.into());
if let Some(description) = opts.description {
query = query.arg("description", description);
}
if let Some(labels) = opts.labels {
query = query.arg("labels", labels);
}
return Query {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Reference a secret by name.
pub fn secret(&self, name: impl Into<String>) -> Secret {
let mut query = self.selection.select("secret");
query = query.arg("name", name.into());
return Secret {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Sets a secret given a user defined name to its plaintext and returns the secret.
/// The plaintext value is limited to a size of 128000 bytes.
///
/// # Arguments
///
/// * `name` - The user defined name for this secret
/// * `plaintext` - The plaintext of the secret
pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
let mut query = self.selection.select("setSecret");
query = query.arg("name", name.into());
query = query.arg("plaintext", plaintext.into());
return Secret {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Loads a socket by its ID.
pub fn socket(&self, id: Socket) -> Socket {
let mut query = self.selection.select("socket");
query = query.arg_lazy(
"id",
Box::new(move || {
let id = id.clone();
Box::pin(async move { id.id().await.unwrap().quote() })
}),
);
return Socket {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Create a new TypeDef.
pub fn type_def(&self) -> TypeDef {
let query = self.selection.select("typeDef");
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
}
#[derive(Clone)]
pub struct Secret {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Secret {
/// A unique identifier for this Secret.
pub async fn id(&self) -> Result<SecretId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
/// The value of this secret.
pub async fn plaintext(&self) -> Result<String, DaggerError> {
let query = self.selection.select("plaintext");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Service {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct ServiceEndpointOpts<'a> {
/// The exposed port number for the endpoint
#[builder(setter(into, strip_option), default)]
pub port: Option<isize>,
/// Return a URL with the given scheme, eg. http for http://
#[builder(setter(into, strip_option), default)]
pub scheme: Option<&'a str>,
}
impl Service {
/// Retrieves an endpoint that clients can use to reach this container.
/// If no port is specified, the first exposed port is used. If none exist an error is returned.
/// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub async fn endpoint(&self) -> Result<String, DaggerError> {
let query = self.selection.select("endpoint");
query.execute(self.graphql_client.clone()).await
}
/// Retrieves an endpoint that clients can use to reach this container.
/// If no port is specified, the first exposed port is used. If none exist an error is returned.
/// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub async fn endpoint_opts<'a>(
&self,
opts: ServiceEndpointOpts<'a>,
) -> Result<String, DaggerError> {
let mut query = self.selection.select("endpoint");
if let Some(port) = opts.port {
query = query.arg("port", port);
}
if let Some(scheme) = opts.scheme {
query = query.arg("scheme", scheme);
}
query.execute(self.graphql_client.clone()).await
}
/// Retrieves a hostname which can be used by clients to reach this container.
pub async fn hostname(&self) -> Result<String, DaggerError> {
let query = self.selection.select("hostname");
query.execute(self.graphql_client.clone()).await
}
/// A unique identifier for this Service.
pub async fn id(&self) -> Result<ServiceId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
/// Retrieves the list of ports provided by the service.
pub fn ports(&self) -> Vec<Port> {
let query = self.selection.select("ports");
return vec![Port {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
}];
}
/// Start the service and wait for its health checks to succeed.
/// Services bound to a Container do not need to be manually started.
pub async fn start(&self) -> Result<ServiceId, DaggerError> {
let query = self.selection.select("start");
query.execute(self.graphql_client.clone()).await
}
/// Stop the service.
pub async fn stop(&self) -> Result<ServiceId, DaggerError> {
let query = self.selection.select("stop");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct Socket {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
impl Socket {
/// A unique identifier for this Socket.
pub async fn id(&self) -> Result<SocketId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
}
#[derive(Clone)]
pub struct TypeDef {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
#[derive(Builder, Debug, PartialEq)]
pub struct TypeDefWithFieldOpts<'a> {
/// A doc string for the field, if any
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct TypeDefWithInterfaceOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
}
#[derive(Builder, Debug, PartialEq)]
pub struct TypeDefWithObjectOpts<'a> {
#[builder(setter(into, strip_option), default)]
pub description: Option<&'a str>,
}
impl TypeDef {
pub fn as_interface(&self) -> InterfaceTypeDef {
let query = self.selection.select("asInterface");
return InterfaceTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
pub fn as_list(&self) -> ListTypeDef {
let query = self.selection.select("asList");
return ListTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
pub fn as_object(&self) -> ObjectTypeDef {
let query = self.selection.select("asObject");
return ObjectTypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// A unique identifier for this TypeDef.
pub async fn id(&self) -> Result<TypeDefId, DaggerError> {
let query = self.selection.select("id");
query.execute(self.graphql_client.clone()).await
}
pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
let query = self.selection.select("kind");
query.execute(self.graphql_client.clone()).await
}
pub async fn optional(&self) -> Result<bool, DaggerError> {
let query = self.selection.select("optional");
query.execute(self.graphql_client.clone()).await
}
/// Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
pub fn with_constructor(&self, function: Function) -> TypeDef {
let mut query = self.selection.select("withConstructor");
query = query.arg_lazy(
"function",
Box::new(move || {
let function = function.clone();
Box::pin(async move { function.id().await.unwrap().quote() })
}),
);
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Adds a static field for an Object TypeDef, failing if the type is not an object.
///
/// # Arguments
///
/// * `name` - The name of the field in the object
/// * `type_def` - The type of the field
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_field(&self, name: impl Into<String>, type_def: TypeDef) -> TypeDef {
let mut query = self.selection.select("withField");
query = query.arg("name", name.into());
query = query.arg_lazy(
"typeDef",
Box::new(move || {
let type_def = type_def.clone();
Box::pin(async move { type_def.id().await.unwrap().quote() })
}),
);
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Adds a static field for an Object TypeDef, failing if the type is not an object.
///
/// # Arguments
///
/// * `name` - The name of the field in the object
/// * `type_def` - The type of the field
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_field_opts<'a>(
&self,
name: impl Into<String>,
type_def: TypeDef,
opts: TypeDefWithFieldOpts<'a>,
) -> TypeDef {
let mut query = self.selection.select("withField");
query = query.arg("name", name.into());
query = query.arg_lazy(
"typeDef",
Box::new(move || {
let type_def = type_def.clone();
Box::pin(async move { type_def.id().await.unwrap().quote() })
}),
);
if let Some(description) = opts.description {
query = query.arg("description", description);
}
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
pub fn with_function(&self, function: Function) -> TypeDef {
let mut query = self.selection.select("withFunction");
query = query.arg_lazy(
"function",
Box::new(move || {
let function = function.clone();
Box::pin(async move { function.id().await.unwrap().quote() })
}),
);
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns a TypeDef of kind Interface with the provided name.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
let mut query = self.selection.select("withInterface");
query = query.arg("name", name.into());
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns a TypeDef of kind Interface with the provided name.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_interface_opts<'a>(
&self,
name: impl Into<String>,
opts: TypeDefWithInterfaceOpts<'a>,
) -> TypeDef {
let mut query = self.selection.select("withInterface");
query = query.arg("name", name.into());
if let Some(description) = opts.description {
query = query.arg("description", description);
}
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Sets the kind of the type.
pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
let mut query = self.selection.select("withKind");
query = query.arg_enum("kind", kind);
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns a TypeDef of kind List with the provided type for its elements.
pub fn with_list_of(&self, element_type: TypeDef) -> TypeDef {
let mut query = self.selection.select("withListOf");
query = query.arg_lazy(
"elementType",
Box::new(move || {
let element_type = element_type.clone();
Box::pin(async move { element_type.id().await.unwrap().quote() })
}),
);
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns a TypeDef of kind Object with the provided name.
/// Note that an object's fields and functions may be omitted if the intent is only to refer to an object. This is how functions are able to return their own object, or any other circular reference.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
let mut query = self.selection.select("withObject");
query = query.arg("name", name.into());
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Returns a TypeDef of kind Object with the provided name.
/// Note that an object's fields and functions may be omitted if the intent is only to refer to an object. This is how functions are able to return their own object, or any other circular reference.
///
/// # Arguments
///
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
pub fn with_object_opts<'a>(
&self,
name: impl Into<String>,
opts: TypeDefWithObjectOpts<'a>,
) -> TypeDef {
let mut query = self.selection.select("withObject");
query = query.arg("name", name.into());
if let Some(description) = opts.description {
query = query.arg("description", description);
}
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
/// Sets whether this type can be set to null.
pub fn with_optional(&self, optional: bool) -> TypeDef {
let mut query = self.selection.select("withOptional");
query = query.arg("optional", optional);
return TypeDef {
proc: self.proc.clone(),
selection: query,
graphql_client: self.graphql_client.clone(),
};
}
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum CacheSharingMode {
#[serde(rename = "LOCKED")]
Locked,
#[serde(rename = "PRIVATE")]
Private,
#[serde(rename = "SHARED")]
Shared,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum ImageLayerCompression {
#[serde(rename = "EStarGZ")]
EStarGz,
#[serde(rename = "Gzip")]
Gzip,
#[serde(rename = "Uncompressed")]
Uncompressed,
#[serde(rename = "Zstd")]
Zstd,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum ImageMediaTypes {
#[serde(rename = "DockerMediaTypes")]
DockerMediaTypes,
#[serde(rename = "OCIMediaTypes")]
OciMediaTypes,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum NetworkProtocol {
#[serde(rename = "TCP")]
Tcp,
#[serde(rename = "UDP")]
Udp,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum TypeDefKind {
#[serde(rename = "BOOLEAN_KIND")]
BooleanKind,
#[serde(rename = "INTEGER_KIND")]
IntegerKind,
#[serde(rename = "INTERFACE_KIND")]
InterfaceKind,
#[serde(rename = "LIST_KIND")]
ListKind,
#[serde(rename = "OBJECT_KIND")]
ObjectKind,
#[serde(rename = "STRING_KIND")]
StringKind,
#[serde(rename = "VOID_KIND")]
VoidKind,
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,416 | ✨ Add name field to File | ### What are you trying to do?
Files passed to `dagger call` currently does not preserve the name of a file passed to it.
### Why is this important to you?
Some tools often require the original file name (for example: Spectral requires the file name do determine the file type)
Discussed it with @sipsma here: https://discord.com/channels/707636530424053791/1120503349599543376/1195832958150529165
### How are you currently working around this?
I pass the original file name to the module. | https://github.com/dagger/dagger/issues/6416 | https://github.com/dagger/dagger/pull/6431 | 61bf06b970402efa254a40f13c4aee98adfbdb42 | c716a042f290b11c6122d247f8b31651adb5f1d0 | "2024-01-13T21:04:31Z" | go | "2024-01-17T16:17:48Z" | sdk/typescript/api/client.gen.ts | /**
* This file was auto-generated by `client-gen`.
* Do not make direct changes to the file.
*/
import { Context, defaultContext } from "../context/context.js"
import { computeQuery } from "./utils.js"
/**
* @hidden
*/
export type QueryTree = {
operation: string
args?: Record<string, unknown>
}
/**
* @hidden
*/
export type Metadata = {
[key: string]: {
is_enum?: boolean
}
}
interface ClientConfig {
queryTree?: QueryTree[]
ctx?: Context
}
class BaseClient {
protected _queryTree: QueryTree[]
protected _ctx: Context
/**
* @hidden
*/
constructor({ queryTree, ctx }: ClientConfig = {}) {
this._queryTree = queryTree || []
this._ctx = ctx || new Context()
}
/**
* @hidden
*/
get queryTree() {
return this._queryTree
}
}
export type BuildArg = {
/**
* The build argument name.
*/
name: string
/**
* The build argument value.
*/
value: string
}
/**
* Sharing mode of the cache volume.
*/
export enum CacheSharingMode {
/**
* Shares the cache volume amongst many build pipelines, but will serialize the writes
*/
Locked = "LOCKED",
/**
* Keeps a cache volume for a single build pipeline
*/
Private = "PRIVATE",
/**
* Shares the cache volume amongst many build pipelines
*/
Shared = "SHARED",
}
/**
* The `CacheVolumeID` scalar type represents an identifier for an object of type CacheVolume.
*/
export type CacheVolumeID = string & { __CacheVolumeID: never }
export type ContainerAsTarballOpts = {
/**
* Identifiers for other platform specific containers.
*
* Used for multi-platform images.
*/
platformVariants?: Container[]
/**
* Force each layer of the image to use the specified compression algorithm.
*
* If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
*/
forcedCompression?: ImageLayerCompression
/**
* Use the specified media types for the image's layers.
*
* Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
*/
mediaTypes?: ImageMediaTypes
}
export type ContainerBuildOpts = {
/**
* Path to the Dockerfile to use.
*/
dockerfile?: string
/**
* Target build stage to build.
*/
target?: string
/**
* Additional build arguments.
*/
buildArgs?: BuildArg[]
/**
* Secrets to pass to the build.
*
* They will be mounted at /run/secrets/[secret-name] in the build container
*
* They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl http://example.com?token=$(cat /run/secrets/my-secret)
*/
secrets?: Secret[]
}
export type ContainerExportOpts = {
/**
* Identifiers for other platform specific containers.
*
* Used for multi-platform image.
*/
platformVariants?: Container[]
/**
* Force each layer of the exported image to use the specified compression algorithm.
*
* If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
*/
forcedCompression?: ImageLayerCompression
/**
* Use the specified media types for the exported image's layers.
*
* Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
*/
mediaTypes?: ImageMediaTypes
}
export type ContainerImportOpts = {
/**
* Identifies the tag to import from the archive, if the archive bundles multiple tags.
*/
tag?: string
}
export type ContainerPipelineOpts = {
/**
* Description of the sub-pipeline.
*/
description?: string
/**
* Labels to apply to the sub-pipeline.
*/
labels?: PipelineLabel[]
}
export type ContainerPublishOpts = {
/**
* Identifiers for other platform specific containers.
*
* Used for multi-platform image.
*/
platformVariants?: Container[]
/**
* Force each layer of the published image to use the specified compression algorithm.
*
* If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
*/
forcedCompression?: ImageLayerCompression
/**
* Use the specified media types for the published image's layers.
*
* Defaults to OCI, which is largely compatible with most recent registries, but Docker may be needed for older registries without OCI support.
*/
mediaTypes?: ImageMediaTypes
}
export type ContainerWithDirectoryOpts = {
/**
* Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
*/
exclude?: string[]
/**
* Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
*/
include?: string[]
/**
* A user:group to set for the directory and its contents.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
owner?: string
}
export type ContainerWithEntrypointOpts = {
/**
* Don't remove the default arguments when setting the entrypoint.
*/
keepDefaultArgs?: boolean
}
export type ContainerWithEnvVariableOpts = {
/**
* Replace `${VAR}` or `$VAR` in the value according to the current environment variables defined in the container (e.g., "/opt/bin:$PATH").
*/
expand?: boolean
}
export type ContainerWithExecOpts = {
/**
* If the container has an entrypoint, ignore it for args rather than using it to wrap them.
*/
skipEntrypoint?: boolean
/**
* Content to write to the command's standard input before closing (e.g., "Hello world").
*/
stdin?: string
/**
* Redirect the command's standard output to a file in the container (e.g., "/tmp/stdout").
*/
redirectStdout?: string
/**
* Redirect the command's standard error to a file in the container (e.g., "/tmp/stderr").
*/
redirectStderr?: string
/**
* Provides dagger access to the executed command.
*
* Do not use this option unless you trust the command being executed; the command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
*/
experimentalPrivilegedNesting?: boolean
/**
* Execute the command with all root capabilities. This is similar to running a command with "sudo" or executing "docker run" with the "--privileged" flag. Containerization does not provide any security guarantees when using this option. It should only be used when absolutely necessary and only with trusted commands.
*/
insecureRootCapabilities?: boolean
}
export type ContainerWithExposedPortOpts = {
/**
* Transport layer network protocol
*/
protocol?: NetworkProtocol
/**
* Optional port description
*/
description?: string
}
export type ContainerWithFileOpts = {
/**
* Permission given to the copied file (e.g., 0600).
*/
permissions?: number
/**
* A user:group to set for the file.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
owner?: string
}
export type ContainerWithMountedCacheOpts = {
/**
* Identifier of the directory to use as the cache volume's root.
*/
source?: Directory
/**
* Sharing mode of the cache volume.
*/
sharing?: CacheSharingMode
/**
* A user:group to set for the mounted cache directory.
*
* Note that this changes the ownership of the specified mount along with the initial filesystem provided by source (if any). It does not have any effect if/when the cache has already been created.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
owner?: string
}
export type ContainerWithMountedDirectoryOpts = {
/**
* A user:group to set for the mounted directory and its contents.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
owner?: string
}
export type ContainerWithMountedFileOpts = {
/**
* A user or user:group to set for the mounted file.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
owner?: string
}
export type ContainerWithMountedSecretOpts = {
/**
* A user:group to set for the mounted secret.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
owner?: string
/**
* Permission given to the mounted secret (e.g., 0600).
*
* This option requires an owner to be set to be active.
*/
mode?: number
}
export type ContainerWithNewFileOpts = {
/**
* Content of the file to write (e.g., "Hello world!").
*/
contents?: string
/**
* Permission given to the written file (e.g., 0600).
*/
permissions?: number
/**
* A user:group to set for the file.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
owner?: string
}
export type ContainerWithUnixSocketOpts = {
/**
* A user:group to set for the mounted socket.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
owner?: string
}
export type ContainerWithoutEntrypointOpts = {
/**
* Don't remove the default arguments when unsetting the entrypoint.
*/
keepDefaultArgs?: boolean
}
export type ContainerWithoutExposedPortOpts = {
/**
* Port protocol to unexpose
*/
protocol?: NetworkProtocol
}
/**
* The `ContainerID` scalar type represents an identifier for an object of type Container.
*/
export type ContainerID = string & { __ContainerID: never }
export type DirectoryAsModuleOpts = {
/**
* An optional subpath of the directory which contains the module's source code.
*
* This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
*
* If not set, the module source code is loaded from the root of the directory.
*/
sourceSubpath?: string
}
export type DirectoryDockerBuildOpts = {
/**
* The platform to build.
*/
platform?: Platform
/**
* Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
*/
dockerfile?: string
/**
* Target build stage to build.
*/
target?: string
/**
* Build arguments to use in the build.
*/
buildArgs?: BuildArg[]
/**
* Secrets to pass to the build.
*
* They will be mounted at /run/secrets/[secret-name].
*/
secrets?: Secret[]
}
export type DirectoryEntriesOpts = {
/**
* Location of the directory to look at (e.g., "/src").
*/
path?: string
}
export type DirectoryPipelineOpts = {
/**
* Description of the sub-pipeline.
*/
description?: string
/**
* Labels to apply to the sub-pipeline.
*/
labels?: PipelineLabel[]
}
export type DirectoryWithDirectoryOpts = {
/**
* Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
*/
exclude?: string[]
/**
* Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
*/
include?: string[]
}
export type DirectoryWithFileOpts = {
/**
* Permission given to the copied file (e.g., 0600).
*/
permissions?: number
}
export type DirectoryWithNewDirectoryOpts = {
/**
* Permission granted to the created directory (e.g., 0777).
*/
permissions?: number
}
export type DirectoryWithNewFileOpts = {
/**
* Permission given to the copied file (e.g., 0600).
*/
permissions?: number
}
/**
* The `DirectoryID` scalar type represents an identifier for an object of type Directory.
*/
export type DirectoryID = string & { __DirectoryID: never }
/**
* The `EnvVariableID` scalar type represents an identifier for an object of type EnvVariable.
*/
export type EnvVariableID = string & { __EnvVariableID: never }
/**
* The `FieldTypeDefID` scalar type represents an identifier for an object of type FieldTypeDef.
*/
export type FieldTypeDefID = string & { __FieldTypeDefID: never }
export type FileExportOpts = {
/**
* If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
*/
allowParentDirPath?: boolean
}
/**
* The `FileID` scalar type represents an identifier for an object of type File.
*/
export type FileID = string & { __FileID: never }
export type FunctionWithArgOpts = {
/**
* A doc string for the argument, if any
*/
description?: string
/**
* A default value to use for this argument if not explicitly set by the caller, if any
*/
defaultValue?: JSON
}
/**
* The `FunctionArgID` scalar type represents an identifier for an object of type FunctionArg.
*/
export type FunctionArgID = string & { __FunctionArgID: never }
/**
* The `FunctionCallArgValueID` scalar type represents an identifier for an object of type FunctionCallArgValue.
*/
export type FunctionCallArgValueID = string & {
__FunctionCallArgValueID: never
}
/**
* The `FunctionCallID` scalar type represents an identifier for an object of type FunctionCall.
*/
export type FunctionCallID = string & { __FunctionCallID: never }
/**
* The `FunctionID` scalar type represents an identifier for an object of type Function.
*/
export type FunctionID = string & { __FunctionID: never }
/**
* The `GeneratedCodeID` scalar type represents an identifier for an object of type GeneratedCode.
*/
export type GeneratedCodeID = string & { __GeneratedCodeID: never }
export type GitRefTreeOpts = {
sshKnownHosts?: string
sshAuthSocket?: Socket
}
/**
* The `GitRefID` scalar type represents an identifier for an object of type GitRef.
*/
export type GitRefID = string & { __GitRefID: never }
/**
* The `GitRepositoryID` scalar type represents an identifier for an object of type GitRepository.
*/
export type GitRepositoryID = string & { __GitRepositoryID: never }
export type HostDirectoryOpts = {
/**
* Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
*/
exclude?: string[]
/**
* Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
*/
include?: string[]
}
export type HostServiceOpts = {
/**
* Upstream host to forward traffic to.
*/
host?: string
/**
* Ports to expose via the service, forwarding through the host network.
*
* If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
*
* An empty set of ports is not valid; an error will be returned.
*/
ports: PortForward[]
}
export type HostTunnelOpts = {
/**
* Configure explicit port forwarding rules for the tunnel.
*
* If a port's frontend is unspecified or 0, a random port will be chosen by the host.
*
* If no ports are given, all of the service's ports are forwarded. If native is true, each port maps to the same port on the host. If native is false, each port maps to a random port chosen by the host.
*
* If ports are given and native is true, the ports are additive.
*/
ports?: PortForward[]
/**
* Map each service port to the same port on the host, as if the service were running natively.
*
* Note: enabling may result in port conflicts.
*/
native?: boolean
}
/**
* The `HostID` scalar type represents an identifier for an object of type Host.
*/
export type HostID = string & { __HostID: never }
/**
* Compression algorithm to use for image layers.
*/
export enum ImageLayerCompression {
Estargz = "EStarGZ",
Gzip = "Gzip",
Uncompressed = "Uncompressed",
Zstd = "Zstd",
}
/**
* Mediatypes to use in published or exported image metadata.
*/
export enum ImageMediaTypes {
Dockermediatypes = "DockerMediaTypes",
Ocimediatypes = "OCIMediaTypes",
}
/**
* The `InterfaceTypeDefID` scalar type represents an identifier for an object of type InterfaceTypeDef.
*/
export type InterfaceTypeDefID = string & { __InterfaceTypeDefID: never }
/**
* An arbitrary JSON-encoded value.
*/
export type JSON = string & { __JSON: never }
/**
* The `LabelID` scalar type represents an identifier for an object of type Label.
*/
export type LabelID = string & { __LabelID: never }
/**
* The `ListTypeDefID` scalar type represents an identifier for an object of type ListTypeDef.
*/
export type ListTypeDefID = string & { __ListTypeDefID: never }
export type ModuleWithSourceOpts = {
/**
* An optional subpath of the directory which contains the module's source code.
*
* This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
*
* If not set, the module source code is loaded from the root of the directory.
*/
subpath?: string
}
/**
* The `ModuleConfigID` scalar type represents an identifier for an object of type ModuleConfig.
*/
export type ModuleConfigID = string & { __ModuleConfigID: never }
/**
* The `ModuleID` scalar type represents an identifier for an object of type Module.
*/
export type ModuleID = string & { __ModuleID: never }
/**
* Transport layer network protocol associated to a port.
*/
export enum NetworkProtocol {
Tcp = "TCP",
Udp = "UDP",
}
/**
* The `ObjectTypeDefID` scalar type represents an identifier for an object of type ObjectTypeDef.
*/
export type ObjectTypeDefID = string & { __ObjectTypeDefID: never }
export type PipelineLabel = {
/**
* Label name.
*/
name: string
/**
* Label value.
*/
value: string
}
/**
* The platform config OS and architecture in a Container.
*
* The format is [os]/[platform]/[version] (e.g., "darwin/arm64/v7", "windows/amd64", "linux/arm64").
*/
export type Platform = string & { __Platform: never }
export type PortForward = {
/**
* Destination port for traffic.
*/
backend: number
/**
* Port to expose to clients. If unspecified, a default will be chosen.
*/
frontend?: number
/**
* Transport layer protocol to use for traffic.
*/
protocol?: NetworkProtocol
}
/**
* The `PortID` scalar type represents an identifier for an object of type Port.
*/
export type PortID = string & { __PortID: never }
export type ClientContainerOpts = {
id?: ContainerID
/**
* Platform to initialize the container with.
*/
platform?: Platform
}
export type ClientDirectoryOpts = {
id?: DirectoryID
}
export type ClientGitOpts = {
/**
* Set to true to keep .git directory.
*/
keepGitDir?: boolean
/**
* A service which must be started before the repo is fetched.
*/
experimentalServiceHost?: Service
/**
* Set SSH known hosts
*/
sshKnownHosts?: string
/**
* Set SSH auth socket
*/
sshAuthSocket?: Socket
}
export type ClientHttpOpts = {
/**
* A service which must be started before the URL is fetched.
*/
experimentalServiceHost?: Service
}
export type ClientModuleConfigOpts = {
subpath?: string
}
export type ClientPipelineOpts = {
/**
* Description of the sub-pipeline.
*/
description?: string
/**
* Labels to apply to the sub-pipeline.
*/
labels?: PipelineLabel[]
}
/**
* The `SecretID` scalar type represents an identifier for an object of type Secret.
*/
export type SecretID = string & { __SecretID: never }
export type ServiceEndpointOpts = {
/**
* The exposed port number for the endpoint
*/
port?: number
/**
* Return a URL with the given scheme, eg. http for http://
*/
scheme?: string
}
/**
* The `ServiceID` scalar type represents an identifier for an object of type Service.
*/
export type ServiceID = string & { __ServiceID: never }
/**
* The `SocketID` scalar type represents an identifier for an object of type Socket.
*/
export type SocketID = string & { __SocketID: never }
export type TypeDefWithFieldOpts = {
/**
* A doc string for the field, if any
*/
description?: string
}
export type TypeDefWithInterfaceOpts = {
description?: string
}
export type TypeDefWithObjectOpts = {
description?: string
}
/**
* The `TypeDefID` scalar type represents an identifier for an object of type TypeDef.
*/
export type TypeDefID = string & { __TypeDefID: never }
/**
* Distinguishes the different kinds of TypeDefs.
*/
export enum TypeDefKind {
/**
* A boolean value.
*/
BooleanKind = "BOOLEAN_KIND",
/**
* An integer value.
*/
IntegerKind = "INTEGER_KIND",
/**
* A named type of functions that can be matched+implemented by other objects+interfaces.
*
* Always paired with an InterfaceTypeDef.
*/
InterfaceKind = "INTERFACE_KIND",
/**
* A list of values all having the same type.
*
* Always paired with a ListTypeDef.
*/
ListKind = "LIST_KIND",
/**
* A named type defined in the GraphQL schema, with fields and functions.
*
* Always paired with an ObjectTypeDef.
*/
ObjectKind = "OBJECT_KIND",
/**
* A string value.
*/
StringKind = "STRING_KIND",
/**
* A special kind used to signify that no value is returned.
*
* This is used for functions that have no return value. The outer TypeDef specifying this Kind is always Optional, as the Void is never actually represented.
*/
VoidKind = "VOID_KIND",
}
/**
* The absence of a value.
*
* A Null Void is used as a placeholder for resolvers that do not return anything.
*/
export type Void = string & { __Void: never }
export type __TypeEnumValuesOpts = {
includeDeprecated?: boolean
}
export type __TypeFieldsOpts = {
includeDeprecated?: boolean
}
/**
* A directory whose contents persist across runs.
*/
export class CacheVolume extends BaseClient {
private readonly _id?: CacheVolumeID = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: CacheVolumeID
) {
super(parent)
this._id = _id
}
/**
* A unique identifier for this CacheVolume.
*/
id = async (): Promise<CacheVolumeID> => {
if (this._id) {
return this._id
}
const response: Awaited<CacheVolumeID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
}
/**
* An OCI-compatible container, also known as a Docker container.
*/
export class Container extends BaseClient {
private readonly _id?: ContainerID = undefined
private readonly _envVariable?: string = undefined
private readonly _export?: boolean = undefined
private readonly _imageRef?: string = undefined
private readonly _label?: string = undefined
private readonly _platform?: Platform = undefined
private readonly _publish?: string = undefined
private readonly _shellEndpoint?: string = undefined
private readonly _stderr?: string = undefined
private readonly _stdout?: string = undefined
private readonly _sync?: ContainerID = undefined
private readonly _user?: string = undefined
private readonly _workdir?: string = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: ContainerID,
_envVariable?: string,
_export?: boolean,
_imageRef?: string,
_label?: string,
_platform?: Platform,
_publish?: string,
_shellEndpoint?: string,
_stderr?: string,
_stdout?: string,
_sync?: ContainerID,
_user?: string,
_workdir?: string
) {
super(parent)
this._id = _id
this._envVariable = _envVariable
this._export = _export
this._imageRef = _imageRef
this._label = _label
this._platform = _platform
this._publish = _publish
this._shellEndpoint = _shellEndpoint
this._stderr = _stderr
this._stdout = _stdout
this._sync = _sync
this._user = _user
this._workdir = _workdir
}
/**
* A unique identifier for this Container.
*/
id = async (): Promise<ContainerID> => {
if (this._id) {
return this._id
}
const response: Awaited<ContainerID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
/**
* Turn the container into a Service.
*
* Be sure to set any exposed ports before this conversion.
*/
asService = (): Service => {
return new Service({
queryTree: [
...this._queryTree,
{
operation: "asService",
},
],
ctx: this._ctx,
})
}
/**
* Returns a File representing the container serialized to a tarball.
* @param opts.platformVariants Identifiers for other platform specific containers.
*
* Used for multi-platform images.
* @param opts.forcedCompression Force each layer of the image to use the specified compression algorithm.
*
* If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
* @param opts.mediaTypes Use the specified media types for the image's layers.
*
* Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
*/
asTarball = (opts?: ContainerAsTarballOpts): File => {
const metadata: Metadata = {
forcedCompression: { is_enum: true },
mediaTypes: { is_enum: true },
}
return new File({
queryTree: [
...this._queryTree,
{
operation: "asTarball",
args: { ...opts, __metadata: metadata },
},
],
ctx: this._ctx,
})
}
/**
* Initializes this container from a Dockerfile build.
* @param context Directory context used by the Dockerfile.
* @param opts.dockerfile Path to the Dockerfile to use.
* @param opts.target Target build stage to build.
* @param opts.buildArgs Additional build arguments.
* @param opts.secrets Secrets to pass to the build.
*
* They will be mounted at /run/secrets/[secret-name] in the build container
*
* They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl http://example.com?token=$(cat /run/secrets/my-secret)
*/
build = (context: Directory, opts?: ContainerBuildOpts): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "build",
args: { context, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves default arguments for future commands.
*/
defaultArgs = async (): Promise<string[]> => {
const response: Awaited<string[]> = await computeQuery(
[
...this._queryTree,
{
operation: "defaultArgs",
},
],
await this._ctx.connection()
)
return response
}
/**
* Retrieves a directory at the given path.
*
* Mounts are included.
* @param path The path of the directory to retrieve (e.g., "./src").
*/
directory = (path: string): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "directory",
args: { path },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves entrypoint to be prepended to the arguments of all commands.
*/
entrypoint = async (): Promise<string[]> => {
const response: Awaited<string[]> = await computeQuery(
[
...this._queryTree,
{
operation: "entrypoint",
},
],
await this._ctx.connection()
)
return response
}
/**
* Retrieves the value of the specified environment variable.
* @param name The name of the environment variable to retrieve (e.g., "PATH").
*/
envVariable = async (name: string): Promise<string> => {
if (this._envVariable) {
return this._envVariable
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "envVariable",
args: { name },
},
],
await this._ctx.connection()
)
return response
}
/**
* Retrieves the list of environment variables passed to commands.
*/
envVariables = async (): Promise<EnvVariable[]> => {
type envVariables = {
id: EnvVariableID
}
const response: Awaited<envVariables[]> = await computeQuery(
[
...this._queryTree,
{
operation: "envVariables",
},
{
operation: "id",
},
],
await this._ctx.connection()
)
return response.map(
(r) =>
new EnvVariable(
{
queryTree: [
{
operation: "loadEnvVariableFromID",
args: { id: r.id },
},
],
ctx: this._ctx,
},
r.id
)
)
}
/**
* EXPERIMENTAL API! Subject to change/removal at any time.
*
* Configures all available GPUs on the host to be accessible to this container.
*
* This currently works for Nvidia devices only.
*/
experimentalWithAllGPUs = (): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "experimentalWithAllGPUs",
},
],
ctx: this._ctx,
})
}
/**
* EXPERIMENTAL API! Subject to change/removal at any time.
*
* Configures the provided list of devices to be accesible to this container.
*
* This currently works for Nvidia devices only.
* @param devices List of devices to be accessible to this container.
*/
experimentalWithGPU = (devices: string[]): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "experimentalWithGPU",
args: { devices },
},
],
ctx: this._ctx,
})
}
/**
* Writes the container as an OCI tarball to the destination file path on the host.
*
* Return true on success.
*
* It can also export platform variants.
* @param path Host's destination path (e.g., "./tarball").
*
* Path can be relative to the engine's workdir or absolute.
* @param opts.platformVariants Identifiers for other platform specific containers.
*
* Used for multi-platform image.
* @param opts.forcedCompression Force each layer of the exported image to use the specified compression algorithm.
*
* If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
* @param opts.mediaTypes Use the specified media types for the exported image's layers.
*
* Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
*/
export = async (
path: string,
opts?: ContainerExportOpts
): Promise<boolean> => {
if (this._export) {
return this._export
}
const metadata: Metadata = {
forcedCompression: { is_enum: true },
mediaTypes: { is_enum: true },
}
const response: Awaited<boolean> = await computeQuery(
[
...this._queryTree,
{
operation: "export",
args: { path, ...opts, __metadata: metadata },
},
],
await this._ctx.connection()
)
return response
}
/**
* Retrieves the list of exposed ports.
*
* This includes ports already exposed by the image, even if not explicitly added with dagger.
*/
exposedPorts = async (): Promise<Port[]> => {
type exposedPorts = {
id: PortID
}
const response: Awaited<exposedPorts[]> = await computeQuery(
[
...this._queryTree,
{
operation: "exposedPorts",
},
{
operation: "id",
},
],
await this._ctx.connection()
)
return response.map(
(r) =>
new Port(
{
queryTree: [
{
operation: "loadPortFromID",
args: { id: r.id },
},
],
ctx: this._ctx,
},
r.id
)
)
}
/**
* Retrieves a file at the given path.
*
* Mounts are included.
* @param path The path of the file to retrieve (e.g., "./README.md").
*/
file = (path: string): File => {
return new File({
queryTree: [
...this._queryTree,
{
operation: "file",
args: { path },
},
],
ctx: this._ctx,
})
}
/**
* Initializes this container from a pulled base image.
* @param address Image's address from its registry.
*
* Formatted as [host]/[user]/[repo]:[tag] (e.g., "docker.io/dagger/dagger:main").
*/
from = (address: string): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "from",
args: { address },
},
],
ctx: this._ctx,
})
}
/**
* The unique image reference which can only be retrieved immediately after the 'Container.From' call.
*/
imageRef = async (): Promise<string> => {
if (this._imageRef) {
return this._imageRef
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "imageRef",
},
],
await this._ctx.connection()
)
return response
}
/**
* Reads the container from an OCI tarball.
* @param source File to read the container from.
* @param opts.tag Identifies the tag to import from the archive, if the archive bundles multiple tags.
*/
import_ = (source: File, opts?: ContainerImportOpts): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "import",
args: { source, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves the value of the specified label.
* @param name The name of the label (e.g., "org.opencontainers.artifact.created").
*/
label = async (name: string): Promise<string> => {
if (this._label) {
return this._label
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "label",
args: { name },
},
],
await this._ctx.connection()
)
return response
}
/**
* Retrieves the list of labels passed to container.
*/
labels = async (): Promise<Label[]> => {
type labels = {
id: LabelID
}
const response: Awaited<labels[]> = await computeQuery(
[
...this._queryTree,
{
operation: "labels",
},
{
operation: "id",
},
],
await this._ctx.connection()
)
return response.map(
(r) =>
new Label(
{
queryTree: [
{
operation: "loadLabelFromID",
args: { id: r.id },
},
],
ctx: this._ctx,
},
r.id
)
)
}
/**
* Retrieves the list of paths where a directory is mounted.
*/
mounts = async (): Promise<string[]> => {
const response: Awaited<string[]> = await computeQuery(
[
...this._queryTree,
{
operation: "mounts",
},
],
await this._ctx.connection()
)
return response
}
/**
* Creates a named sub-pipeline.
* @param name Name of the sub-pipeline.
* @param opts.description Description of the sub-pipeline.
* @param opts.labels Labels to apply to the sub-pipeline.
*/
pipeline = (name: string, opts?: ContainerPipelineOpts): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "pipeline",
args: { name, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* The platform this container executes and publishes as.
*/
platform = async (): Promise<Platform> => {
if (this._platform) {
return this._platform
}
const response: Awaited<Platform> = await computeQuery(
[
...this._queryTree,
{
operation: "platform",
},
],
await this._ctx.connection()
)
return response
}
/**
* Publishes this container as a new image to the specified address.
*
* Publish returns a fully qualified ref.
*
* It can also publish platform variants.
* @param address Registry's address to publish the image to.
*
* Formatted as [host]/[user]/[repo]:[tag] (e.g. "docker.io/dagger/dagger:main").
* @param opts.platformVariants Identifiers for other platform specific containers.
*
* Used for multi-platform image.
* @param opts.forcedCompression Force each layer of the published image to use the specified compression algorithm.
*
* If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
* @param opts.mediaTypes Use the specified media types for the published image's layers.
*
* Defaults to OCI, which is largely compatible with most recent registries, but Docker may be needed for older registries without OCI support.
*/
publish = async (
address: string,
opts?: ContainerPublishOpts
): Promise<string> => {
if (this._publish) {
return this._publish
}
const metadata: Metadata = {
forcedCompression: { is_enum: true },
mediaTypes: { is_enum: true },
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "publish",
args: { address, ...opts, __metadata: metadata },
},
],
await this._ctx.connection()
)
return response
}
/**
* Retrieves this container's root filesystem. Mounts are not included.
*/
rootfs = (): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "rootfs",
},
],
ctx: this._ctx,
})
}
/**
* Return a websocket endpoint that, if connected to, will start the container with a TTY streamed over the websocket.
*
* Primarily intended for internal use with the dagger CLI.
*/
shellEndpoint = async (): Promise<string> => {
if (this._shellEndpoint) {
return this._shellEndpoint
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "shellEndpoint",
},
],
await this._ctx.connection()
)
return response
}
/**
* The error stream of the last executed command.
*
* Will execute default command if none is set, or error if there's no default.
*/
stderr = async (): Promise<string> => {
if (this._stderr) {
return this._stderr
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "stderr",
},
],
await this._ctx.connection()
)
return response
}
/**
* The output stream of the last executed command.
*
* Will execute default command if none is set, or error if there's no default.
*/
stdout = async (): Promise<string> => {
if (this._stdout) {
return this._stdout
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "stdout",
},
],
await this._ctx.connection()
)
return response
}
/**
* Forces evaluation of the pipeline in the engine.
*
* It doesn't run the default command if no exec has been set.
*/
sync = async (): Promise<Container> => {
await computeQuery(
[
...this._queryTree,
{
operation: "sync",
},
],
await this._ctx.connection()
)
return this
}
/**
* Retrieves the user to be set for all commands.
*/
user = async (): Promise<string> => {
if (this._user) {
return this._user
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "user",
},
],
await this._ctx.connection()
)
return response
}
/**
* Configures default arguments for future commands.
* @param args Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
*/
withDefaultArgs = (args: string[]): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withDefaultArgs",
args: { args },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container plus a directory written at the given path.
* @param path Location of the written directory (e.g., "/tmp/directory").
* @param directory Identifier of the directory to write
* @param opts.exclude Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
* @param opts.include Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
* @param opts.owner A user:group to set for the directory and its contents.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
withDirectory = (
path: string,
directory: Directory,
opts?: ContainerWithDirectoryOpts
): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withDirectory",
args: { path, directory, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container but with a different command entrypoint.
* @param args Entrypoint to use for future executions (e.g., ["go", "run"]).
* @param opts.keepDefaultArgs Don't remove the default arguments when setting the entrypoint.
*/
withEntrypoint = (
args: string[],
opts?: ContainerWithEntrypointOpts
): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withEntrypoint",
args: { args, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container plus the given environment variable.
* @param name The name of the environment variable (e.g., "HOST").
* @param value The value of the environment variable. (e.g., "localhost").
* @param opts.expand Replace `${VAR}` or `$VAR` in the value according to the current environment variables defined in the container (e.g., "/opt/bin:$PATH").
*/
withEnvVariable = (
name: string,
value: string,
opts?: ContainerWithEnvVariableOpts
): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withEnvVariable",
args: { name, value, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container after executing the specified command inside it.
* @param args Command to run instead of the container's default command (e.g., ["run", "main.go"]).
*
* If empty, the container's default command is used.
* @param opts.skipEntrypoint If the container has an entrypoint, ignore it for args rather than using it to wrap them.
* @param opts.stdin Content to write to the command's standard input before closing (e.g., "Hello world").
* @param opts.redirectStdout Redirect the command's standard output to a file in the container (e.g., "/tmp/stdout").
* @param opts.redirectStderr Redirect the command's standard error to a file in the container (e.g., "/tmp/stderr").
* @param opts.experimentalPrivilegedNesting Provides dagger access to the executed command.
*
* Do not use this option unless you trust the command being executed; the command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
* @param opts.insecureRootCapabilities Execute the command with all root capabilities. This is similar to running a command with "sudo" or executing "docker run" with the "--privileged" flag. Containerization does not provide any security guarantees when using this option. It should only be used when absolutely necessary and only with trusted commands.
*/
withExec = (args: string[], opts?: ContainerWithExecOpts): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withExec",
args: { args, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Expose a network port.
*
* Exposed ports serve two purposes:
*
* - For health checks and introspection, when running services
*
* - For setting the EXPOSE OCI field when publishing the container
* @param port Port number to expose
* @param opts.protocol Transport layer network protocol
* @param opts.description Optional port description
*/
withExposedPort = (
port: number,
opts?: ContainerWithExposedPortOpts
): Container => {
const metadata: Metadata = {
protocol: { is_enum: true },
}
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withExposedPort",
args: { port, ...opts, __metadata: metadata },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container plus the contents of the given file copied to the given path.
* @param path Location of the copied file (e.g., "/tmp/file.txt").
* @param source Identifier of the file to copy.
* @param opts.permissions Permission given to the copied file (e.g., 0600).
* @param opts.owner A user:group to set for the file.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
withFile = (
path: string,
source: File,
opts?: ContainerWithFileOpts
): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withFile",
args: { path, source, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Indicate that subsequent operations should be featured more prominently in the UI.
*/
withFocus = (): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withFocus",
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container plus the given label.
* @param name The name of the label (e.g., "org.opencontainers.artifact.created").
* @param value The value of the label (e.g., "2023-01-01T00:00:00Z").
*/
withLabel = (name: string, value: string): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withLabel",
args: { name, value },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container plus a cache volume mounted at the given path.
* @param path Location of the cache directory (e.g., "/cache/node_modules").
* @param cache Identifier of the cache volume to mount.
* @param opts.source Identifier of the directory to use as the cache volume's root.
* @param opts.sharing Sharing mode of the cache volume.
* @param opts.owner A user:group to set for the mounted cache directory.
*
* Note that this changes the ownership of the specified mount along with the initial filesystem provided by source (if any). It does not have any effect if/when the cache has already been created.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
withMountedCache = (
path: string,
cache: CacheVolume,
opts?: ContainerWithMountedCacheOpts
): Container => {
const metadata: Metadata = {
sharing: { is_enum: true },
}
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withMountedCache",
args: { path, cache, ...opts, __metadata: metadata },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container plus a directory mounted at the given path.
* @param path Location of the mounted directory (e.g., "/mnt/directory").
* @param source Identifier of the mounted directory.
* @param opts.owner A user:group to set for the mounted directory and its contents.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
withMountedDirectory = (
path: string,
source: Directory,
opts?: ContainerWithMountedDirectoryOpts
): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withMountedDirectory",
args: { path, source, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container plus a file mounted at the given path.
* @param path Location of the mounted file (e.g., "/tmp/file.txt").
* @param source Identifier of the mounted file.
* @param opts.owner A user or user:group to set for the mounted file.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
withMountedFile = (
path: string,
source: File,
opts?: ContainerWithMountedFileOpts
): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withMountedFile",
args: { path, source, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container plus a secret mounted into a file at the given path.
* @param path Location of the secret file (e.g., "/tmp/secret.txt").
* @param source Identifier of the secret to mount.
* @param opts.owner A user:group to set for the mounted secret.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
* @param opts.mode Permission given to the mounted secret (e.g., 0600).
*
* This option requires an owner to be set to be active.
*/
withMountedSecret = (
path: string,
source: Secret,
opts?: ContainerWithMountedSecretOpts
): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withMountedSecret",
args: { path, source, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container plus a temporary directory mounted at the given path.
* @param path Location of the temporary directory (e.g., "/tmp/temp_dir").
*/
withMountedTemp = (path: string): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withMountedTemp",
args: { path },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container plus a new file written at the given path.
* @param path Location of the written file (e.g., "/tmp/file.txt").
* @param opts.contents Content of the file to write (e.g., "Hello world!").
* @param opts.permissions Permission given to the written file (e.g., 0600).
* @param opts.owner A user:group to set for the file.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
withNewFile = (path: string, opts?: ContainerWithNewFileOpts): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withNewFile",
args: { path, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container with a registry authentication for a given address.
* @param address Registry's address to bind the authentication to.
*
* Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
* @param username The username of the registry's account (e.g., "Dagger").
* @param secret The API key, password or token to authenticate to this registry.
*/
withRegistryAuth = (
address: string,
username: string,
secret: Secret
): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withRegistryAuth",
args: { address, username, secret },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves the container with the given directory mounted to /.
* @param directory Directory to mount.
*/
withRootfs = (directory: Directory): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withRootfs",
args: { directory },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container plus an env variable containing the given secret.
* @param name The name of the secret variable (e.g., "API_SECRET").
* @param secret The identifier of the secret value.
*/
withSecretVariable = (name: string, secret: Secret): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withSecretVariable",
args: { name, secret },
},
],
ctx: this._ctx,
})
}
/**
* Establish a runtime dependency on a service.
*
* The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
*
* The service will be reachable from the container via the provided hostname alias.
*
* The service dependency will also convey to any files or directories produced by the container.
* @param alias A name that can be used to reach the service from the container
* @param service Identifier of the service container
*/
withServiceBinding = (alias: string, service: Service): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withServiceBinding",
args: { alias, service },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container plus a socket forwarded to the given Unix socket path.
* @param path Location of the forwarded Unix socket (e.g., "/tmp/socket").
* @param source Identifier of the socket to forward.
* @param opts.owner A user:group to set for the mounted socket.
*
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
*
* If the group is omitted, it defaults to the same as the user.
*/
withUnixSocket = (
path: string,
source: Socket,
opts?: ContainerWithUnixSocketOpts
): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withUnixSocket",
args: { path, source, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container with a different command user.
* @param name The user to set (e.g., "root").
*/
withUser = (name: string): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withUser",
args: { name },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container with a different working directory.
* @param path The path to set as the working directory (e.g., "/app").
*/
withWorkdir = (path: string): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withWorkdir",
args: { path },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container with unset default arguments for future commands.
*/
withoutDefaultArgs = (): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withoutDefaultArgs",
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container with an unset command entrypoint.
* @param opts.keepDefaultArgs Don't remove the default arguments when unsetting the entrypoint.
*/
withoutEntrypoint = (opts?: ContainerWithoutEntrypointOpts): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withoutEntrypoint",
args: { ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container minus the given environment variable.
* @param name The name of the environment variable (e.g., "HOST").
*/
withoutEnvVariable = (name: string): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withoutEnvVariable",
args: { name },
},
],
ctx: this._ctx,
})
}
/**
* Unexpose a previously exposed port.
* @param port Port number to unexpose
* @param opts.protocol Port protocol to unexpose
*/
withoutExposedPort = (
port: number,
opts?: ContainerWithoutExposedPortOpts
): Container => {
const metadata: Metadata = {
protocol: { is_enum: true },
}
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withoutExposedPort",
args: { port, ...opts, __metadata: metadata },
},
],
ctx: this._ctx,
})
}
/**
* Indicate that subsequent operations should not be featured more prominently in the UI.
*
* This is the initial state of all containers.
*/
withoutFocus = (): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withoutFocus",
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container minus the given environment label.
* @param name The name of the label to remove (e.g., "org.opencontainers.artifact.created").
*/
withoutLabel = (name: string): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withoutLabel",
args: { name },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container after unmounting everything at the given path.
* @param path Location of the cache directory (e.g., "/cache/node_modules").
*/
withoutMount = (path: string): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withoutMount",
args: { path },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container without the registry authentication of a given address.
* @param address Registry's address to remove the authentication from.
*
* Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
*/
withoutRegistryAuth = (address: string): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withoutRegistryAuth",
args: { address },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container with a previously added Unix socket removed.
* @param path Location of the socket to remove (e.g., "/tmp/socket").
*/
withoutUnixSocket = (path: string): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withoutUnixSocket",
args: { path },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container with an unset command user.
*
* Should default to root.
*/
withoutUser = (): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withoutUser",
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this container with an unset working directory.
*
* Should default to "/".
*/
withoutWorkdir = (): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "withoutWorkdir",
},
],
ctx: this._ctx,
})
}
/**
* Retrieves the working directory for all commands.
*/
workdir = async (): Promise<string> => {
if (this._workdir) {
return this._workdir
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "workdir",
},
],
await this._ctx.connection()
)
return response
}
/**
* Call the provided function with current Container.
*
* This is useful for reusability and readability by not breaking the calling chain.
*/
with = (arg: (param: Container) => Container) => {
return arg(this)
}
}
/**
* A directory.
*/
export class Directory extends BaseClient {
private readonly _id?: DirectoryID = undefined
private readonly _export?: boolean = undefined
private readonly _sync?: DirectoryID = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: DirectoryID,
_export?: boolean,
_sync?: DirectoryID
) {
super(parent)
this._id = _id
this._export = _export
this._sync = _sync
}
/**
* A unique identifier for this Directory.
*/
id = async (): Promise<DirectoryID> => {
if (this._id) {
return this._id
}
const response: Awaited<DirectoryID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
/**
* Load the directory as a Dagger module
* @param opts.sourceSubpath An optional subpath of the directory which contains the module's source code.
*
* This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
*
* If not set, the module source code is loaded from the root of the directory.
*/
asModule = (opts?: DirectoryAsModuleOpts): Module_ => {
return new Module_({
queryTree: [
...this._queryTree,
{
operation: "asModule",
args: { ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Gets the difference between this directory and an another directory.
* @param other Identifier of the directory to compare.
*/
diff = (other: Directory): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "diff",
args: { other },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves a directory at the given path.
* @param path Location of the directory to retrieve (e.g., "/src").
*/
directory = (path: string): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "directory",
args: { path },
},
],
ctx: this._ctx,
})
}
/**
* Builds a new Docker container from this directory.
* @param opts.platform The platform to build.
* @param opts.dockerfile Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
* @param opts.target Target build stage to build.
* @param opts.buildArgs Build arguments to use in the build.
* @param opts.secrets Secrets to pass to the build.
*
* They will be mounted at /run/secrets/[secret-name].
*/
dockerBuild = (opts?: DirectoryDockerBuildOpts): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "dockerBuild",
args: { ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Returns a list of files and directories at the given path.
* @param opts.path Location of the directory to look at (e.g., "/src").
*/
entries = async (opts?: DirectoryEntriesOpts): Promise<string[]> => {
const response: Awaited<string[]> = await computeQuery(
[
...this._queryTree,
{
operation: "entries",
args: { ...opts },
},
],
await this._ctx.connection()
)
return response
}
/**
* Writes the contents of the directory to a path on the host.
* @param path Location of the copied directory (e.g., "logs/").
*/
export = async (path: string): Promise<boolean> => {
if (this._export) {
return this._export
}
const response: Awaited<boolean> = await computeQuery(
[
...this._queryTree,
{
operation: "export",
args: { path },
},
],
await this._ctx.connection()
)
return response
}
/**
* Retrieves a file at the given path.
* @param path Location of the file to retrieve (e.g., "README.md").
*/
file = (path: string): File => {
return new File({
queryTree: [
...this._queryTree,
{
operation: "file",
args: { path },
},
],
ctx: this._ctx,
})
}
/**
* Returns a list of files and directories that matche the given pattern.
* @param pattern Pattern to match (e.g., "*.md").
*/
glob = async (pattern: string): Promise<string[]> => {
const response: Awaited<string[]> = await computeQuery(
[
...this._queryTree,
{
operation: "glob",
args: { pattern },
},
],
await this._ctx.connection()
)
return response
}
/**
* Creates a named sub-pipeline.
* @param name Name of the sub-pipeline.
* @param opts.description Description of the sub-pipeline.
* @param opts.labels Labels to apply to the sub-pipeline.
*/
pipeline = (name: string, opts?: DirectoryPipelineOpts): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "pipeline",
args: { name, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Force evaluation in the engine.
*/
sync = async (): Promise<Directory> => {
await computeQuery(
[
...this._queryTree,
{
operation: "sync",
},
],
await this._ctx.connection()
)
return this
}
/**
* Retrieves this directory plus a directory written at the given path.
* @param path Location of the written directory (e.g., "/src/").
* @param directory Identifier of the directory to copy.
* @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
* @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
*/
withDirectory = (
path: string,
directory: Directory,
opts?: DirectoryWithDirectoryOpts
): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "withDirectory",
args: { path, directory, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this directory plus the contents of the given file copied to the given path.
* @param path Location of the copied file (e.g., "/file.txt").
* @param source Identifier of the file to copy.
* @param opts.permissions Permission given to the copied file (e.g., 0600).
*/
withFile = (
path: string,
source: File,
opts?: DirectoryWithFileOpts
): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "withFile",
args: { path, source, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this directory plus a new directory created at the given path.
* @param path Location of the directory created (e.g., "/logs").
* @param opts.permissions Permission granted to the created directory (e.g., 0777).
*/
withNewDirectory = (
path: string,
opts?: DirectoryWithNewDirectoryOpts
): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "withNewDirectory",
args: { path, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this directory plus a new file written at the given path.
* @param path Location of the written file (e.g., "/file.txt").
* @param contents Content of the written file (e.g., "Hello world!").
* @param opts.permissions Permission given to the copied file (e.g., 0600).
*/
withNewFile = (
path: string,
contents: string,
opts?: DirectoryWithNewFileOpts
): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "withNewFile",
args: { path, contents, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this directory with all file/dir timestamps set to the given time.
* @param timestamp Timestamp to set dir/files in.
*
* Formatted in seconds following Unix epoch (e.g., 1672531199).
*/
withTimestamps = (timestamp: number): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "withTimestamps",
args: { timestamp },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this directory with the directory at the given path removed.
* @param path Location of the directory to remove (e.g., ".github/").
*/
withoutDirectory = (path: string): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "withoutDirectory",
args: { path },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves this directory with the file at the given path removed.
* @param path Location of the file to remove (e.g., "/file.txt").
*/
withoutFile = (path: string): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "withoutFile",
args: { path },
},
],
ctx: this._ctx,
})
}
/**
* Call the provided function with current Directory.
*
* This is useful for reusability and readability by not breaking the calling chain.
*/
with = (arg: (param: Directory) => Directory) => {
return arg(this)
}
}
/**
* An environment variable name and value.
*/
export class EnvVariable extends BaseClient {
private readonly _id?: EnvVariableID = undefined
private readonly _name?: string = undefined
private readonly _value?: string = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: EnvVariableID,
_name?: string,
_value?: string
) {
super(parent)
this._id = _id
this._name = _name
this._value = _value
}
/**
* A unique identifier for this EnvVariable.
*/
id = async (): Promise<EnvVariableID> => {
if (this._id) {
return this._id
}
const response: Awaited<EnvVariableID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
name = async (): Promise<string> => {
if (this._name) {
return this._name
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "name",
},
],
await this._ctx.connection()
)
return response
}
value = async (): Promise<string> => {
if (this._value) {
return this._value
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "value",
},
],
await this._ctx.connection()
)
return response
}
}
/**
* A definition of a field on a custom object defined in a Module.
*
* A field on an object has a static value, as opposed to a function on an object whose value is computed by invoking code (and can accept arguments).
*/
export class FieldTypeDef extends BaseClient {
private readonly _id?: FieldTypeDefID = undefined
private readonly _description?: string = undefined
private readonly _name?: string = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: FieldTypeDefID,
_description?: string,
_name?: string
) {
super(parent)
this._id = _id
this._description = _description
this._name = _name
}
/**
* A unique identifier for this FieldTypeDef.
*/
id = async (): Promise<FieldTypeDefID> => {
if (this._id) {
return this._id
}
const response: Awaited<FieldTypeDefID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
description = async (): Promise<string> => {
if (this._description) {
return this._description
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "description",
},
],
await this._ctx.connection()
)
return response
}
name = async (): Promise<string> => {
if (this._name) {
return this._name
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "name",
},
],
await this._ctx.connection()
)
return response
}
typeDef = (): TypeDef => {
return new TypeDef({
queryTree: [
...this._queryTree,
{
operation: "typeDef",
},
],
ctx: this._ctx,
})
}
}
/**
* A file.
*/
export class File extends BaseClient {
private readonly _id?: FileID = undefined
private readonly _contents?: string = undefined
private readonly _export?: boolean = undefined
private readonly _size?: number = undefined
private readonly _sync?: FileID = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: FileID,
_contents?: string,
_export?: boolean,
_size?: number,
_sync?: FileID
) {
super(parent)
this._id = _id
this._contents = _contents
this._export = _export
this._size = _size
this._sync = _sync
}
/**
* A unique identifier for this File.
*/
id = async (): Promise<FileID> => {
if (this._id) {
return this._id
}
const response: Awaited<FileID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
/**
* Retrieves the contents of the file.
*/
contents = async (): Promise<string> => {
if (this._contents) {
return this._contents
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "contents",
},
],
await this._ctx.connection()
)
return response
}
/**
* Writes the file to a file path on the host.
* @param path Location of the written directory (e.g., "output.txt").
* @param opts.allowParentDirPath If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
*/
export = async (path: string, opts?: FileExportOpts): Promise<boolean> => {
if (this._export) {
return this._export
}
const response: Awaited<boolean> = await computeQuery(
[
...this._queryTree,
{
operation: "export",
args: { path, ...opts },
},
],
await this._ctx.connection()
)
return response
}
/**
* Retrieves the size of the file, in bytes.
*/
size = async (): Promise<number> => {
if (this._size) {
return this._size
}
const response: Awaited<number> = await computeQuery(
[
...this._queryTree,
{
operation: "size",
},
],
await this._ctx.connection()
)
return response
}
/**
* Force evaluation in the engine.
*/
sync = async (): Promise<File> => {
await computeQuery(
[
...this._queryTree,
{
operation: "sync",
},
],
await this._ctx.connection()
)
return this
}
/**
* Retrieves this file with its created/modified timestamps set to the given time.
* @param timestamp Timestamp to set dir/files in.
*
* Formatted in seconds following Unix epoch (e.g., 1672531199).
*/
withTimestamps = (timestamp: number): File => {
return new File({
queryTree: [
...this._queryTree,
{
operation: "withTimestamps",
args: { timestamp },
},
],
ctx: this._ctx,
})
}
/**
* Call the provided function with current File.
*
* This is useful for reusability and readability by not breaking the calling chain.
*/
with = (arg: (param: File) => File) => {
return arg(this)
}
}
/**
* Function represents a resolver provided by a Module.
*
* A function always evaluates against a parent object and is given a set of named arguments.
*/
export class Function_ extends BaseClient {
private readonly _id?: FunctionID = undefined
private readonly _description?: string = undefined
private readonly _name?: string = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: FunctionID,
_description?: string,
_name?: string
) {
super(parent)
this._id = _id
this._description = _description
this._name = _name
}
/**
* A unique identifier for this Function.
*/
id = async (): Promise<FunctionID> => {
if (this._id) {
return this._id
}
const response: Awaited<FunctionID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
args = async (): Promise<FunctionArg[]> => {
type args = {
id: FunctionArgID
}
const response: Awaited<args[]> = await computeQuery(
[
...this._queryTree,
{
operation: "args",
},
{
operation: "id",
},
],
await this._ctx.connection()
)
return response.map(
(r) =>
new FunctionArg(
{
queryTree: [
{
operation: "loadFunctionArgFromID",
args: { id: r.id },
},
],
ctx: this._ctx,
},
r.id
)
)
}
description = async (): Promise<string> => {
if (this._description) {
return this._description
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "description",
},
],
await this._ctx.connection()
)
return response
}
name = async (): Promise<string> => {
if (this._name) {
return this._name
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "name",
},
],
await this._ctx.connection()
)
return response
}
returnType = (): TypeDef => {
return new TypeDef({
queryTree: [
...this._queryTree,
{
operation: "returnType",
},
],
ctx: this._ctx,
})
}
/**
* Returns the function with the provided argument
* @param name The name of the argument
* @param typeDef The type of the argument
* @param opts.description A doc string for the argument, if any
* @param opts.defaultValue A default value to use for this argument if not explicitly set by the caller, if any
*/
withArg = (
name: string,
typeDef: TypeDef,
opts?: FunctionWithArgOpts
): Function_ => {
return new Function_({
queryTree: [
...this._queryTree,
{
operation: "withArg",
args: { name, typeDef, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Returns the function with the given doc string.
* @param description The doc string to set.
*/
withDescription = (description: string): Function_ => {
return new Function_({
queryTree: [
...this._queryTree,
{
operation: "withDescription",
args: { description },
},
],
ctx: this._ctx,
})
}
/**
* Call the provided function with current Function.
*
* This is useful for reusability and readability by not breaking the calling chain.
*/
with = (arg: (param: Function_) => Function_) => {
return arg(this)
}
}
/**
* An argument accepted by a function.
*
* This is a specification for an argument at function definition time, not an argument passed at function call time.
*/
export class FunctionArg extends BaseClient {
private readonly _id?: FunctionArgID = undefined
private readonly _defaultValue?: JSON = undefined
private readonly _description?: string = undefined
private readonly _name?: string = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: FunctionArgID,
_defaultValue?: JSON,
_description?: string,
_name?: string
) {
super(parent)
this._id = _id
this._defaultValue = _defaultValue
this._description = _description
this._name = _name
}
/**
* A unique identifier for this FunctionArg.
*/
id = async (): Promise<FunctionArgID> => {
if (this._id) {
return this._id
}
const response: Awaited<FunctionArgID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
defaultValue = async (): Promise<JSON> => {
if (this._defaultValue) {
return this._defaultValue
}
const response: Awaited<JSON> = await computeQuery(
[
...this._queryTree,
{
operation: "defaultValue",
},
],
await this._ctx.connection()
)
return response
}
description = async (): Promise<string> => {
if (this._description) {
return this._description
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "description",
},
],
await this._ctx.connection()
)
return response
}
name = async (): Promise<string> => {
if (this._name) {
return this._name
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "name",
},
],
await this._ctx.connection()
)
return response
}
typeDef = (): TypeDef => {
return new TypeDef({
queryTree: [
...this._queryTree,
{
operation: "typeDef",
},
],
ctx: this._ctx,
})
}
}
/**
* An active function call.
*/
export class FunctionCall extends BaseClient {
private readonly _id?: FunctionCallID = undefined
private readonly _name?: string = undefined
private readonly _parent?: JSON = undefined
private readonly _parentName?: string = undefined
private readonly _returnValue?: Void = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: FunctionCallID,
_name?: string,
_parent?: JSON,
_parentName?: string,
_returnValue?: Void
) {
super(parent)
this._id = _id
this._name = _name
this._parent = _parent
this._parentName = _parentName
this._returnValue = _returnValue
}
/**
* A unique identifier for this FunctionCall.
*/
id = async (): Promise<FunctionCallID> => {
if (this._id) {
return this._id
}
const response: Awaited<FunctionCallID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
inputArgs = async (): Promise<FunctionCallArgValue[]> => {
type inputArgs = {
id: FunctionCallArgValueID
}
const response: Awaited<inputArgs[]> = await computeQuery(
[
...this._queryTree,
{
operation: "inputArgs",
},
{
operation: "id",
},
],
await this._ctx.connection()
)
return response.map(
(r) =>
new FunctionCallArgValue(
{
queryTree: [
{
operation: "loadFunctionCallArgValueFromID",
args: { id: r.id },
},
],
ctx: this._ctx,
},
r.id
)
)
}
name = async (): Promise<string> => {
if (this._name) {
return this._name
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "name",
},
],
await this._ctx.connection()
)
return response
}
parent = async (): Promise<JSON> => {
if (this._parent) {
return this._parent
}
const response: Awaited<JSON> = await computeQuery(
[
...this._queryTree,
{
operation: "parent",
},
],
await this._ctx.connection()
)
return response
}
parentName = async (): Promise<string> => {
if (this._parentName) {
return this._parentName
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "parentName",
},
],
await this._ctx.connection()
)
return response
}
/**
* Set the return value of the function call to the provided value.
* @param value JSON serialization of the return value.
*/
returnValue = async (value: JSON): Promise<Void> => {
if (this._returnValue) {
return this._returnValue
}
const response: Awaited<Void> = await computeQuery(
[
...this._queryTree,
{
operation: "returnValue",
args: { value },
},
],
await this._ctx.connection()
)
return response
}
}
/**
* A value passed as a named argument to a function call.
*/
export class FunctionCallArgValue extends BaseClient {
private readonly _id?: FunctionCallArgValueID = undefined
private readonly _name?: string = undefined
private readonly _value?: JSON = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: FunctionCallArgValueID,
_name?: string,
_value?: JSON
) {
super(parent)
this._id = _id
this._name = _name
this._value = _value
}
/**
* A unique identifier for this FunctionCallArgValue.
*/
id = async (): Promise<FunctionCallArgValueID> => {
if (this._id) {
return this._id
}
const response: Awaited<FunctionCallArgValueID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
name = async (): Promise<string> => {
if (this._name) {
return this._name
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "name",
},
],
await this._ctx.connection()
)
return response
}
value = async (): Promise<JSON> => {
if (this._value) {
return this._value
}
const response: Awaited<JSON> = await computeQuery(
[
...this._queryTree,
{
operation: "value",
},
],
await this._ctx.connection()
)
return response
}
}
/**
* The result of running an SDK's codegen.
*/
export class GeneratedCode extends BaseClient {
private readonly _id?: GeneratedCodeID = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: GeneratedCodeID
) {
super(parent)
this._id = _id
}
/**
* A unique identifier for this GeneratedCode.
*/
id = async (): Promise<GeneratedCodeID> => {
if (this._id) {
return this._id
}
const response: Awaited<GeneratedCodeID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
code = (): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "code",
},
],
ctx: this._ctx,
})
}
vcsGeneratedPaths = async (): Promise<string[]> => {
const response: Awaited<string[]> = await computeQuery(
[
...this._queryTree,
{
operation: "vcsGeneratedPaths",
},
],
await this._ctx.connection()
)
return response
}
vcsIgnoredPaths = async (): Promise<string[]> => {
const response: Awaited<string[]> = await computeQuery(
[
...this._queryTree,
{
operation: "vcsIgnoredPaths",
},
],
await this._ctx.connection()
)
return response
}
/**
* Set the list of paths to mark generated in version control.
*/
withVCSGeneratedPaths = (paths: string[]): GeneratedCode => {
return new GeneratedCode({
queryTree: [
...this._queryTree,
{
operation: "withVCSGeneratedPaths",
args: { paths },
},
],
ctx: this._ctx,
})
}
/**
* Set the list of paths to ignore in version control.
*/
withVCSIgnoredPaths = (paths: string[]): GeneratedCode => {
return new GeneratedCode({
queryTree: [
...this._queryTree,
{
operation: "withVCSIgnoredPaths",
args: { paths },
},
],
ctx: this._ctx,
})
}
/**
* Call the provided function with current GeneratedCode.
*
* This is useful for reusability and readability by not breaking the calling chain.
*/
with = (arg: (param: GeneratedCode) => GeneratedCode) => {
return arg(this)
}
}
/**
* A git ref (tag, branch, or commit).
*/
export class GitRef extends BaseClient {
private readonly _id?: GitRefID = undefined
private readonly _commit?: string = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: GitRefID,
_commit?: string
) {
super(parent)
this._id = _id
this._commit = _commit
}
/**
* A unique identifier for this GitRef.
*/
id = async (): Promise<GitRefID> => {
if (this._id) {
return this._id
}
const response: Awaited<GitRefID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
/**
* The resolved commit id at this ref.
*/
commit = async (): Promise<string> => {
if (this._commit) {
return this._commit
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "commit",
},
],
await this._ctx.connection()
)
return response
}
/**
* The filesystem tree at this ref.
*/
tree = (opts?: GitRefTreeOpts): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "tree",
args: { ...opts },
},
],
ctx: this._ctx,
})
}
}
/**
* A git repository.
*/
export class GitRepository extends BaseClient {
private readonly _id?: GitRepositoryID = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: GitRepositoryID
) {
super(parent)
this._id = _id
}
/**
* A unique identifier for this GitRepository.
*/
id = async (): Promise<GitRepositoryID> => {
if (this._id) {
return this._id
}
const response: Awaited<GitRepositoryID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
/**
* Returns details of a branch.
* @param name Branch's name (e.g., "main").
*/
branch = (name: string): GitRef => {
return new GitRef({
queryTree: [
...this._queryTree,
{
operation: "branch",
args: { name },
},
],
ctx: this._ctx,
})
}
/**
* Returns details of a commit.
* @param id Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
*/
commit = (id: string): GitRef => {
return new GitRef({
queryTree: [
...this._queryTree,
{
operation: "commit",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Returns details of a tag.
* @param name Tag's name (e.g., "v0.3.9").
*/
tag = (name: string): GitRef => {
return new GitRef({
queryTree: [
...this._queryTree,
{
operation: "tag",
args: { name },
},
],
ctx: this._ctx,
})
}
}
/**
* Information about the host environment.
*/
export class Host extends BaseClient {
private readonly _id?: HostID = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: HostID
) {
super(parent)
this._id = _id
}
/**
* A unique identifier for this Host.
*/
id = async (): Promise<HostID> => {
if (this._id) {
return this._id
}
const response: Awaited<HostID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
/**
* Accesses a directory on the host.
* @param path Location of the directory to access (e.g., ".").
* @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
* @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
*/
directory = (path: string, opts?: HostDirectoryOpts): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "directory",
args: { path, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Accesses a file on the host.
* @param path Location of the file to retrieve (e.g., "README.md").
*/
file = (path: string): File => {
return new File({
queryTree: [
...this._queryTree,
{
operation: "file",
args: { path },
},
],
ctx: this._ctx,
})
}
/**
* Creates a service that forwards traffic to a specified address via the host.
* @param opts.host Upstream host to forward traffic to.
* @param opts.ports Ports to expose via the service, forwarding through the host network.
*
* If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
*
* An empty set of ports is not valid; an error will be returned.
*/
service = (opts?: HostServiceOpts): Service => {
return new Service({
queryTree: [
...this._queryTree,
{
operation: "service",
args: { ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Sets a secret given a user-defined name and the file path on the host, and returns the secret.
*
* The file is limited to a size of 512000 bytes.
* @param name The user defined name for this secret.
* @param path Location of the file to set as a secret.
*/
setSecretFile = (name: string, path: string): Secret => {
return new Secret({
queryTree: [
...this._queryTree,
{
operation: "setSecretFile",
args: { name, path },
},
],
ctx: this._ctx,
})
}
/**
* Creates a tunnel that forwards traffic from the host to a service.
* @param service Service to send traffic from the tunnel.
* @param opts.ports Configure explicit port forwarding rules for the tunnel.
*
* If a port's frontend is unspecified or 0, a random port will be chosen by the host.
*
* If no ports are given, all of the service's ports are forwarded. If native is true, each port maps to the same port on the host. If native is false, each port maps to a random port chosen by the host.
*
* If ports are given and native is true, the ports are additive.
* @param opts.native Map each service port to the same port on the host, as if the service were running natively.
*
* Note: enabling may result in port conflicts.
*/
tunnel = (service: Service, opts?: HostTunnelOpts): Service => {
return new Service({
queryTree: [
...this._queryTree,
{
operation: "tunnel",
args: { service, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Accesses a Unix socket on the host.
* @param path Location of the Unix socket (e.g., "/var/run/docker.sock").
*/
unixSocket = (path: string): Socket => {
return new Socket({
queryTree: [
...this._queryTree,
{
operation: "unixSocket",
args: { path },
},
],
ctx: this._ctx,
})
}
}
/**
* A definition of a custom interface defined in a Module.
*/
export class InterfaceTypeDef extends BaseClient {
private readonly _id?: InterfaceTypeDefID = undefined
private readonly _description?: string = undefined
private readonly _name?: string = undefined
private readonly _sourceModuleName?: string = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: InterfaceTypeDefID,
_description?: string,
_name?: string,
_sourceModuleName?: string
) {
super(parent)
this._id = _id
this._description = _description
this._name = _name
this._sourceModuleName = _sourceModuleName
}
/**
* A unique identifier for this InterfaceTypeDef.
*/
id = async (): Promise<InterfaceTypeDefID> => {
if (this._id) {
return this._id
}
const response: Awaited<InterfaceTypeDefID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
description = async (): Promise<string> => {
if (this._description) {
return this._description
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "description",
},
],
await this._ctx.connection()
)
return response
}
functions = async (): Promise<Function_[]> => {
type functions = {
id: FunctionID
}
const response: Awaited<functions[]> = await computeQuery(
[
...this._queryTree,
{
operation: "functions",
},
{
operation: "id",
},
],
await this._ctx.connection()
)
return response.map(
(r) =>
new Function_(
{
queryTree: [
{
operation: "loadFunction_FromID",
args: { id: r.id },
},
],
ctx: this._ctx,
},
r.id
)
)
}
name = async (): Promise<string> => {
if (this._name) {
return this._name
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "name",
},
],
await this._ctx.connection()
)
return response
}
sourceModuleName = async (): Promise<string> => {
if (this._sourceModuleName) {
return this._sourceModuleName
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "sourceModuleName",
},
],
await this._ctx.connection()
)
return response
}
}
/**
* A simple key value object that represents a label.
*/
export class Label extends BaseClient {
private readonly _id?: LabelID = undefined
private readonly _name?: string = undefined
private readonly _value?: string = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: LabelID,
_name?: string,
_value?: string
) {
super(parent)
this._id = _id
this._name = _name
this._value = _value
}
/**
* A unique identifier for this Label.
*/
id = async (): Promise<LabelID> => {
if (this._id) {
return this._id
}
const response: Awaited<LabelID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
name = async (): Promise<string> => {
if (this._name) {
return this._name
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "name",
},
],
await this._ctx.connection()
)
return response
}
value = async (): Promise<string> => {
if (this._value) {
return this._value
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "value",
},
],
await this._ctx.connection()
)
return response
}
}
/**
* A definition of a list type in a Module.
*/
export class ListTypeDef extends BaseClient {
private readonly _id?: ListTypeDefID = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: ListTypeDefID
) {
super(parent)
this._id = _id
}
/**
* A unique identifier for this ListTypeDef.
*/
id = async (): Promise<ListTypeDefID> => {
if (this._id) {
return this._id
}
const response: Awaited<ListTypeDefID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
elementTypeDef = (): TypeDef => {
return new TypeDef({
queryTree: [
...this._queryTree,
{
operation: "elementTypeDef",
},
],
ctx: this._ctx,
})
}
}
/**
* A Dagger module.
*/
export class Module_ extends BaseClient {
private readonly _id?: ModuleID = undefined
private readonly _description?: string = undefined
private readonly _name?: string = undefined
private readonly _sdk?: string = undefined
private readonly _serve?: Void = undefined
private readonly _sourceDirectorySubpath?: string = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: ModuleID,
_description?: string,
_name?: string,
_sdk?: string,
_serve?: Void,
_sourceDirectorySubpath?: string
) {
super(parent)
this._id = _id
this._description = _description
this._name = _name
this._sdk = _sdk
this._serve = _serve
this._sourceDirectorySubpath = _sourceDirectorySubpath
}
/**
* A unique identifier for this Module.
*/
id = async (): Promise<ModuleID> => {
if (this._id) {
return this._id
}
const response: Awaited<ModuleID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
dependencies = async (): Promise<Module_[]> => {
type dependencies = {
id: ModuleID
}
const response: Awaited<dependencies[]> = await computeQuery(
[
...this._queryTree,
{
operation: "dependencies",
},
{
operation: "id",
},
],
await this._ctx.connection()
)
return response.map(
(r) =>
new Module_(
{
queryTree: [
{
operation: "loadModule_FromID",
args: { id: r.id },
},
],
ctx: this._ctx,
},
r.id
)
)
}
dependencyConfig = async (): Promise<string[]> => {
const response: Awaited<string[]> = await computeQuery(
[
...this._queryTree,
{
operation: "dependencyConfig",
},
],
await this._ctx.connection()
)
return response
}
description = async (): Promise<string> => {
if (this._description) {
return this._description
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "description",
},
],
await this._ctx.connection()
)
return response
}
generatedCode = (): GeneratedCode => {
return new GeneratedCode({
queryTree: [
...this._queryTree,
{
operation: "generatedCode",
},
],
ctx: this._ctx,
})
}
/**
* Retrieves the module with the objects loaded via its SDK.
*/
initialize = (): Module_ => {
return new Module_({
queryTree: [
...this._queryTree,
{
operation: "initialize",
},
],
ctx: this._ctx,
})
}
interfaces = async (): Promise<TypeDef[]> => {
type interfaces = {
id: TypeDefID
}
const response: Awaited<interfaces[]> = await computeQuery(
[
...this._queryTree,
{
operation: "interfaces",
},
{
operation: "id",
},
],
await this._ctx.connection()
)
return response.map(
(r) =>
new TypeDef(
{
queryTree: [
{
operation: "loadTypeDefFromID",
args: { id: r.id },
},
],
ctx: this._ctx,
},
r.id
)
)
}
name = async (): Promise<string> => {
if (this._name) {
return this._name
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "name",
},
],
await this._ctx.connection()
)
return response
}
objects = async (): Promise<TypeDef[]> => {
type objects = {
id: TypeDefID
}
const response: Awaited<objects[]> = await computeQuery(
[
...this._queryTree,
{
operation: "objects",
},
{
operation: "id",
},
],
await this._ctx.connection()
)
return response.map(
(r) =>
new TypeDef(
{
queryTree: [
{
operation: "loadTypeDefFromID",
args: { id: r.id },
},
],
ctx: this._ctx,
},
r.id
)
)
}
sdk = async (): Promise<string> => {
if (this._sdk) {
return this._sdk
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "sdk",
},
],
await this._ctx.connection()
)
return response
}
/**
* Serve a module's API in the current session.
*
* Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
*/
serve = async (): Promise<Void> => {
if (this._serve) {
return this._serve
}
const response: Awaited<Void> = await computeQuery(
[
...this._queryTree,
{
operation: "serve",
},
],
await this._ctx.connection()
)
return response
}
sourceDirectory = (): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "sourceDirectory",
},
],
ctx: this._ctx,
})
}
sourceDirectorySubpath = async (): Promise<string> => {
if (this._sourceDirectorySubpath) {
return this._sourceDirectorySubpath
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "sourceDirectorySubpath",
},
],
await this._ctx.connection()
)
return response
}
/**
* This module plus the given Interface type and associated functions
*/
withInterface = (iface: TypeDef): Module_ => {
return new Module_({
queryTree: [
...this._queryTree,
{
operation: "withInterface",
args: { iface },
},
],
ctx: this._ctx,
})
}
/**
* This module plus the given Object type and associated functions.
*/
withObject = (object: TypeDef): Module_ => {
return new Module_({
queryTree: [
...this._queryTree,
{
operation: "withObject",
args: { object },
},
],
ctx: this._ctx,
})
}
/**
* Retrieves the module with basic configuration loaded, ready for initialization.
* @param directory The directory containing the module's source code.
* @param opts.subpath An optional subpath of the directory which contains the module's source code.
*
* This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
*
* If not set, the module source code is loaded from the root of the directory.
*/
withSource = (directory: Directory, opts?: ModuleWithSourceOpts): Module_ => {
return new Module_({
queryTree: [
...this._queryTree,
{
operation: "withSource",
args: { directory, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Call the provided function with current Module.
*
* This is useful for reusability and readability by not breaking the calling chain.
*/
with = (arg: (param: Module_) => Module_) => {
return arg(this)
}
}
/**
* Static configuration for a module (e.g. parsed contents of dagger.json)
*/
export class ModuleConfig extends BaseClient {
private readonly _id?: ModuleConfigID = undefined
private readonly _name?: string = undefined
private readonly _root?: string = undefined
private readonly _sdk?: string = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: ModuleConfigID,
_name?: string,
_root?: string,
_sdk?: string
) {
super(parent)
this._id = _id
this._name = _name
this._root = _root
this._sdk = _sdk
}
/**
* A unique identifier for this ModuleConfig.
*/
id = async (): Promise<ModuleConfigID> => {
if (this._id) {
return this._id
}
const response: Awaited<ModuleConfigID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
dependencies = async (): Promise<string[]> => {
const response: Awaited<string[]> = await computeQuery(
[
...this._queryTree,
{
operation: "dependencies",
},
],
await this._ctx.connection()
)
return response
}
exclude = async (): Promise<string[]> => {
const response: Awaited<string[]> = await computeQuery(
[
...this._queryTree,
{
operation: "exclude",
},
],
await this._ctx.connection()
)
return response
}
include = async (): Promise<string[]> => {
const response: Awaited<string[]> = await computeQuery(
[
...this._queryTree,
{
operation: "include",
},
],
await this._ctx.connection()
)
return response
}
name = async (): Promise<string> => {
if (this._name) {
return this._name
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "name",
},
],
await this._ctx.connection()
)
return response
}
root = async (): Promise<string> => {
if (this._root) {
return this._root
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "root",
},
],
await this._ctx.connection()
)
return response
}
sdk = async (): Promise<string> => {
if (this._sdk) {
return this._sdk
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "sdk",
},
],
await this._ctx.connection()
)
return response
}
}
/**
* A definition of a custom object defined in a Module.
*/
export class ObjectTypeDef extends BaseClient {
private readonly _id?: ObjectTypeDefID = undefined
private readonly _description?: string = undefined
private readonly _name?: string = undefined
private readonly _sourceModuleName?: string = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: ObjectTypeDefID,
_description?: string,
_name?: string,
_sourceModuleName?: string
) {
super(parent)
this._id = _id
this._description = _description
this._name = _name
this._sourceModuleName = _sourceModuleName
}
/**
* A unique identifier for this ObjectTypeDef.
*/
id = async (): Promise<ObjectTypeDefID> => {
if (this._id) {
return this._id
}
const response: Awaited<ObjectTypeDefID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
constructor_ = (): Function_ => {
return new Function_({
queryTree: [
...this._queryTree,
{
operation: "constructor",
},
],
ctx: this._ctx,
})
}
description = async (): Promise<string> => {
if (this._description) {
return this._description
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "description",
},
],
await this._ctx.connection()
)
return response
}
fields = async (): Promise<FieldTypeDef[]> => {
type fields = {
id: FieldTypeDefID
}
const response: Awaited<fields[]> = await computeQuery(
[
...this._queryTree,
{
operation: "fields",
},
{
operation: "id",
},
],
await this._ctx.connection()
)
return response.map(
(r) =>
new FieldTypeDef(
{
queryTree: [
{
operation: "loadFieldTypeDefFromID",
args: { id: r.id },
},
],
ctx: this._ctx,
},
r.id
)
)
}
functions = async (): Promise<Function_[]> => {
type functions = {
id: FunctionID
}
const response: Awaited<functions[]> = await computeQuery(
[
...this._queryTree,
{
operation: "functions",
},
{
operation: "id",
},
],
await this._ctx.connection()
)
return response.map(
(r) =>
new Function_(
{
queryTree: [
{
operation: "loadFunction_FromID",
args: { id: r.id },
},
],
ctx: this._ctx,
},
r.id
)
)
}
name = async (): Promise<string> => {
if (this._name) {
return this._name
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "name",
},
],
await this._ctx.connection()
)
return response
}
sourceModuleName = async (): Promise<string> => {
if (this._sourceModuleName) {
return this._sourceModuleName
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "sourceModuleName",
},
],
await this._ctx.connection()
)
return response
}
}
/**
* A port exposed by a container.
*/
export class Port extends BaseClient {
private readonly _id?: PortID = undefined
private readonly _description?: string = undefined
private readonly _port?: number = undefined
private readonly _protocol?: NetworkProtocol = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: PortID,
_description?: string,
_port?: number,
_protocol?: NetworkProtocol
) {
super(parent)
this._id = _id
this._description = _description
this._port = _port
this._protocol = _protocol
}
/**
* A unique identifier for this Port.
*/
id = async (): Promise<PortID> => {
if (this._id) {
return this._id
}
const response: Awaited<PortID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
description = async (): Promise<string> => {
if (this._description) {
return this._description
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "description",
},
],
await this._ctx.connection()
)
return response
}
port = async (): Promise<number> => {
if (this._port) {
return this._port
}
const response: Awaited<number> = await computeQuery(
[
...this._queryTree,
{
operation: "port",
},
],
await this._ctx.connection()
)
return response
}
protocol = async (): Promise<NetworkProtocol> => {
if (this._protocol) {
return this._protocol
}
const response: Awaited<NetworkProtocol> = await computeQuery(
[
...this._queryTree,
{
operation: "protocol",
},
],
await this._ctx.connection()
)
return response
}
}
/**
* The root of the DAG.
*/
export class Client extends BaseClient {
private readonly _checkVersionCompatibility?: boolean = undefined
private readonly _defaultPlatform?: Platform = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_checkVersionCompatibility?: boolean,
_defaultPlatform?: Platform
) {
super(parent)
this._checkVersionCompatibility = _checkVersionCompatibility
this._defaultPlatform = _defaultPlatform
}
/**
* Retrieves a content-addressed blob.
* @param digest Digest of the blob
* @param size Size of the blob
* @param mediaType Media type of the blob
* @param uncompressed Digest of the uncompressed blob
*/
blob = (
digest: string,
size: number,
mediaType: string,
uncompressed: string
): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "blob",
args: { digest, size, mediaType, uncompressed },
},
],
ctx: this._ctx,
})
}
/**
* Constructs a cache volume for a given cache key.
* @param key A string identifier to target this cache volume (e.g., "modules-cache").
*/
cacheVolume = (key: string): CacheVolume => {
return new CacheVolume({
queryTree: [
...this._queryTree,
{
operation: "cacheVolume",
args: { key },
},
],
ctx: this._ctx,
})
}
/**
* Checks if the current Dagger Engine is compatible with an SDK's required version.
* @param version Version required by the SDK.
*/
checkVersionCompatibility = async (version: string): Promise<boolean> => {
const response: Awaited<boolean> = await computeQuery(
[
...this._queryTree,
{
operation: "checkVersionCompatibility",
args: { version },
},
],
await this._ctx.connection()
)
return response
}
/**
* Creates a scratch container.
*
* Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
* @param opts.platform Platform to initialize the container with.
*/
container = (opts?: ClientContainerOpts): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "container",
args: { ...opts },
},
],
ctx: this._ctx,
})
}
/**
* The FunctionCall context that the SDK caller is currently executing in.
*
* If the caller is not currently executing in a function, this will return an error.
*/
currentFunctionCall = (): FunctionCall => {
return new FunctionCall({
queryTree: [
...this._queryTree,
{
operation: "currentFunctionCall",
},
],
ctx: this._ctx,
})
}
/**
* The module currently being served in the session, if any.
*/
currentModule = (): Module_ => {
return new Module_({
queryTree: [
...this._queryTree,
{
operation: "currentModule",
},
],
ctx: this._ctx,
})
}
/**
* The TypeDef representations of the objects currently being served in the session.
*/
currentTypeDefs = async (): Promise<TypeDef[]> => {
type currentTypeDefs = {
id: TypeDefID
}
const response: Awaited<currentTypeDefs[]> = await computeQuery(
[
...this._queryTree,
{
operation: "currentTypeDefs",
},
{
operation: "id",
},
],
await this._ctx.connection()
)
return response.map(
(r) =>
new TypeDef(
{
queryTree: [
{
operation: "loadTypeDefFromID",
args: { id: r.id },
},
],
ctx: this._ctx,
},
r.id
)
)
}
/**
* The default platform of the engine.
*/
defaultPlatform = async (): Promise<Platform> => {
const response: Awaited<Platform> = await computeQuery(
[
...this._queryTree,
{
operation: "defaultPlatform",
},
],
await this._ctx.connection()
)
return response
}
/**
* Creates an empty directory.
*/
directory = (opts?: ClientDirectoryOpts): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "directory",
args: { ...opts },
},
],
ctx: this._ctx,
})
}
/**
* @deprecated Use loadFileFromID instead.
*/
file = (id: FileID): File => {
return new File({
queryTree: [
...this._queryTree,
{
operation: "file",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Creates a function.
* @param name Name of the function, in its original format from the implementation language.
* @param returnType Return type of the function.
*/
function_ = (name: string, returnType: TypeDef): Function_ => {
return new Function_({
queryTree: [
...this._queryTree,
{
operation: "function",
args: { name, returnType },
},
],
ctx: this._ctx,
})
}
/**
* Create a code generation result, given a directory containing the generated code.
*/
generatedCode = (code: Directory): GeneratedCode => {
return new GeneratedCode({
queryTree: [
...this._queryTree,
{
operation: "generatedCode",
args: { code },
},
],
ctx: this._ctx,
})
}
/**
* Queries a Git repository.
* @param url URL of the git repository.
*
* Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
*
* Suffix ".git" is optional.
* @param opts.keepGitDir Set to true to keep .git directory.
* @param opts.experimentalServiceHost A service which must be started before the repo is fetched.
* @param opts.sshKnownHosts Set SSH known hosts
* @param opts.sshAuthSocket Set SSH auth socket
*/
git = (url: string, opts?: ClientGitOpts): GitRepository => {
return new GitRepository({
queryTree: [
...this._queryTree,
{
operation: "git",
args: { url, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Queries the host environment.
*/
host = (): Host => {
return new Host({
queryTree: [
...this._queryTree,
{
operation: "host",
},
],
ctx: this._ctx,
})
}
/**
* Returns a file containing an http remote url content.
* @param url HTTP url to get the content from (e.g., "https://docs.dagger.io").
* @param opts.experimentalServiceHost A service which must be started before the URL is fetched.
*/
http = (url: string, opts?: ClientHttpOpts): File => {
return new File({
queryTree: [
...this._queryTree,
{
operation: "http",
args: { url, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Load a CacheVolume from its ID.
*/
loadCacheVolumeFromID = (id: CacheVolumeID): CacheVolume => {
return new CacheVolume({
queryTree: [
...this._queryTree,
{
operation: "loadCacheVolumeFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a Container from its ID.
*/
loadContainerFromID = (id: ContainerID): Container => {
return new Container({
queryTree: [
...this._queryTree,
{
operation: "loadContainerFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a Directory from its ID.
*/
loadDirectoryFromID = (id: DirectoryID): Directory => {
return new Directory({
queryTree: [
...this._queryTree,
{
operation: "loadDirectoryFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a EnvVariable from its ID.
*/
loadEnvVariableFromID = (id: EnvVariableID): EnvVariable => {
return new EnvVariable({
queryTree: [
...this._queryTree,
{
operation: "loadEnvVariableFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a FieldTypeDef from its ID.
*/
loadFieldTypeDefFromID = (id: FieldTypeDefID): FieldTypeDef => {
return new FieldTypeDef({
queryTree: [
...this._queryTree,
{
operation: "loadFieldTypeDefFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a File from its ID.
*/
loadFileFromID = (id: FileID): File => {
return new File({
queryTree: [
...this._queryTree,
{
operation: "loadFileFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a FunctionArg from its ID.
*/
loadFunctionArgFromID = (id: FunctionArgID): FunctionArg => {
return new FunctionArg({
queryTree: [
...this._queryTree,
{
operation: "loadFunctionArgFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a FunctionCallArgValue from its ID.
*/
loadFunctionCallArgValueFromID = (
id: FunctionCallArgValueID
): FunctionCallArgValue => {
return new FunctionCallArgValue({
queryTree: [
...this._queryTree,
{
operation: "loadFunctionCallArgValueFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a FunctionCall from its ID.
*/
loadFunctionCallFromID = (id: FunctionCallID): FunctionCall => {
return new FunctionCall({
queryTree: [
...this._queryTree,
{
operation: "loadFunctionCallFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a Function from its ID.
*/
loadFunctionFromID = (id: FunctionID): Function_ => {
return new Function_({
queryTree: [
...this._queryTree,
{
operation: "loadFunctionFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a GeneratedCode from its ID.
*/
loadGeneratedCodeFromID = (id: GeneratedCodeID): GeneratedCode => {
return new GeneratedCode({
queryTree: [
...this._queryTree,
{
operation: "loadGeneratedCodeFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a GitRef from its ID.
*/
loadGitRefFromID = (id: GitRefID): GitRef => {
return new GitRef({
queryTree: [
...this._queryTree,
{
operation: "loadGitRefFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a GitRepository from its ID.
*/
loadGitRepositoryFromID = (id: GitRepositoryID): GitRepository => {
return new GitRepository({
queryTree: [
...this._queryTree,
{
operation: "loadGitRepositoryFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a Host from its ID.
*/
loadHostFromID = (id: HostID): Host => {
return new Host({
queryTree: [
...this._queryTree,
{
operation: "loadHostFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a InterfaceTypeDef from its ID.
*/
loadInterfaceTypeDefFromID = (id: InterfaceTypeDefID): InterfaceTypeDef => {
return new InterfaceTypeDef({
queryTree: [
...this._queryTree,
{
operation: "loadInterfaceTypeDefFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a Label from its ID.
*/
loadLabelFromID = (id: LabelID): Label => {
return new Label({
queryTree: [
...this._queryTree,
{
operation: "loadLabelFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a ListTypeDef from its ID.
*/
loadListTypeDefFromID = (id: ListTypeDefID): ListTypeDef => {
return new ListTypeDef({
queryTree: [
...this._queryTree,
{
operation: "loadListTypeDefFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a ModuleConfig from its ID.
*/
loadModuleConfigFromID = (id: ModuleConfigID): ModuleConfig => {
return new ModuleConfig({
queryTree: [
...this._queryTree,
{
operation: "loadModuleConfigFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a Module from its ID.
*/
loadModuleFromID = (id: ModuleID): Module_ => {
return new Module_({
queryTree: [
...this._queryTree,
{
operation: "loadModuleFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a ObjectTypeDef from its ID.
*/
loadObjectTypeDefFromID = (id: ObjectTypeDefID): ObjectTypeDef => {
return new ObjectTypeDef({
queryTree: [
...this._queryTree,
{
operation: "loadObjectTypeDefFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a Port from its ID.
*/
loadPortFromID = (id: PortID): Port => {
return new Port({
queryTree: [
...this._queryTree,
{
operation: "loadPortFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a Secret from its ID.
*/
loadSecretFromID = (id: SecretID): Secret => {
return new Secret({
queryTree: [
...this._queryTree,
{
operation: "loadSecretFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a Service from its ID.
*/
loadServiceFromID = (id: ServiceID): Service => {
return new Service({
queryTree: [
...this._queryTree,
{
operation: "loadServiceFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a Socket from its ID.
*/
loadSocketFromID = (id: SocketID): Socket => {
return new Socket({
queryTree: [
...this._queryTree,
{
operation: "loadSocketFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Load a TypeDef from its ID.
*/
loadTypeDefFromID = (id: TypeDefID): TypeDef => {
return new TypeDef({
queryTree: [
...this._queryTree,
{
operation: "loadTypeDefFromID",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Create a new module.
*/
module_ = (): Module_ => {
return new Module_({
queryTree: [
...this._queryTree,
{
operation: "module",
},
],
ctx: this._ctx,
})
}
/**
* Load the static configuration for a module from the given source directory and optional subpath.
*/
moduleConfig = (
sourceDirectory: Directory,
opts?: ClientModuleConfigOpts
): ModuleConfig => {
return new ModuleConfig({
queryTree: [
...this._queryTree,
{
operation: "moduleConfig",
args: { sourceDirectory, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Creates a named sub-pipeline.
* @param name Name of the sub-pipeline.
* @param opts.description Description of the sub-pipeline.
* @param opts.labels Labels to apply to the sub-pipeline.
*/
pipeline = (name: string, opts?: ClientPipelineOpts): Client => {
return new Client({
queryTree: [
...this._queryTree,
{
operation: "pipeline",
args: { name, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Reference a secret by name.
*/
secret = (name: string): Secret => {
return new Secret({
queryTree: [
...this._queryTree,
{
operation: "secret",
args: { name },
},
],
ctx: this._ctx,
})
}
/**
* Sets a secret given a user defined name to its plaintext and returns the secret.
*
* The plaintext value is limited to a size of 128000 bytes.
* @param name The user defined name for this secret
* @param plaintext The plaintext of the secret
*/
setSecret = (name: string, plaintext: string): Secret => {
return new Secret({
queryTree: [
...this._queryTree,
{
operation: "setSecret",
args: { name, plaintext },
},
],
ctx: this._ctx,
})
}
/**
* Loads a socket by its ID.
* @deprecated Use loadSocketFromID instead.
*/
socket = (id: SocketID): Socket => {
return new Socket({
queryTree: [
...this._queryTree,
{
operation: "socket",
args: { id },
},
],
ctx: this._ctx,
})
}
/**
* Create a new TypeDef.
*/
typeDef = (): TypeDef => {
return new TypeDef({
queryTree: [
...this._queryTree,
{
operation: "typeDef",
},
],
ctx: this._ctx,
})
}
/**
* Call the provided function with current Client.
*
* This is useful for reusability and readability by not breaking the calling chain.
*/
with = (arg: (param: Client) => Client) => {
return arg(this)
}
}
/**
* A reference to a secret value, which can be handled more safely than the value itself.
*/
export class Secret extends BaseClient {
private readonly _id?: SecretID = undefined
private readonly _plaintext?: string = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: SecretID,
_plaintext?: string
) {
super(parent)
this._id = _id
this._plaintext = _plaintext
}
/**
* A unique identifier for this Secret.
*/
id = async (): Promise<SecretID> => {
if (this._id) {
return this._id
}
const response: Awaited<SecretID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
/**
* The value of this secret.
*/
plaintext = async (): Promise<string> => {
if (this._plaintext) {
return this._plaintext
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "plaintext",
},
],
await this._ctx.connection()
)
return response
}
}
/**
* A content-addressed service providing TCP connectivity.
*/
export class Service extends BaseClient {
private readonly _id?: ServiceID = undefined
private readonly _endpoint?: string = undefined
private readonly _hostname?: string = undefined
private readonly _start?: ServiceID = undefined
private readonly _stop?: ServiceID = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: ServiceID,
_endpoint?: string,
_hostname?: string,
_start?: ServiceID,
_stop?: ServiceID
) {
super(parent)
this._id = _id
this._endpoint = _endpoint
this._hostname = _hostname
this._start = _start
this._stop = _stop
}
/**
* A unique identifier for this Service.
*/
id = async (): Promise<ServiceID> => {
if (this._id) {
return this._id
}
const response: Awaited<ServiceID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
/**
* Retrieves an endpoint that clients can use to reach this container.
*
* If no port is specified, the first exposed port is used. If none exist an error is returned.
*
* If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
* @param opts.port The exposed port number for the endpoint
* @param opts.scheme Return a URL with the given scheme, eg. http for http://
*/
endpoint = async (opts?: ServiceEndpointOpts): Promise<string> => {
if (this._endpoint) {
return this._endpoint
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "endpoint",
args: { ...opts },
},
],
await this._ctx.connection()
)
return response
}
/**
* Retrieves a hostname which can be used by clients to reach this container.
*/
hostname = async (): Promise<string> => {
if (this._hostname) {
return this._hostname
}
const response: Awaited<string> = await computeQuery(
[
...this._queryTree,
{
operation: "hostname",
},
],
await this._ctx.connection()
)
return response
}
/**
* Retrieves the list of ports provided by the service.
*/
ports = async (): Promise<Port[]> => {
type ports = {
id: PortID
}
const response: Awaited<ports[]> = await computeQuery(
[
...this._queryTree,
{
operation: "ports",
},
{
operation: "id",
},
],
await this._ctx.connection()
)
return response.map(
(r) =>
new Port(
{
queryTree: [
{
operation: "loadPortFromID",
args: { id: r.id },
},
],
ctx: this._ctx,
},
r.id
)
)
}
/**
* Start the service and wait for its health checks to succeed.
*
* Services bound to a Container do not need to be manually started.
*/
start = async (): Promise<Service> => {
await computeQuery(
[
...this._queryTree,
{
operation: "start",
},
],
await this._ctx.connection()
)
return this
}
/**
* Stop the service.
*/
stop = async (): Promise<Service> => {
await computeQuery(
[
...this._queryTree,
{
operation: "stop",
},
],
await this._ctx.connection()
)
return this
}
}
/**
* A Unix or TCP/IP socket that can be mounted into a container.
*/
export class Socket extends BaseClient {
private readonly _id?: SocketID = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: SocketID
) {
super(parent)
this._id = _id
}
/**
* A unique identifier for this Socket.
*/
id = async (): Promise<SocketID> => {
if (this._id) {
return this._id
}
const response: Awaited<SocketID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
}
/**
* A definition of a parameter or return type in a Module.
*/
export class TypeDef extends BaseClient {
private readonly _id?: TypeDefID = undefined
private readonly _kind?: TypeDefKind = undefined
private readonly _optional?: boolean = undefined
/**
* Constructor is used for internal usage only, do not create object from it.
*/
constructor(
parent?: { queryTree?: QueryTree[]; ctx: Context },
_id?: TypeDefID,
_kind?: TypeDefKind,
_optional?: boolean
) {
super(parent)
this._id = _id
this._kind = _kind
this._optional = _optional
}
/**
* A unique identifier for this TypeDef.
*/
id = async (): Promise<TypeDefID> => {
if (this._id) {
return this._id
}
const response: Awaited<TypeDefID> = await computeQuery(
[
...this._queryTree,
{
operation: "id",
},
],
await this._ctx.connection()
)
return response
}
asInterface = (): InterfaceTypeDef => {
return new InterfaceTypeDef({
queryTree: [
...this._queryTree,
{
operation: "asInterface",
},
],
ctx: this._ctx,
})
}
asList = (): ListTypeDef => {
return new ListTypeDef({
queryTree: [
...this._queryTree,
{
operation: "asList",
},
],
ctx: this._ctx,
})
}
asObject = (): ObjectTypeDef => {
return new ObjectTypeDef({
queryTree: [
...this._queryTree,
{
operation: "asObject",
},
],
ctx: this._ctx,
})
}
kind = async (): Promise<TypeDefKind> => {
if (this._kind) {
return this._kind
}
const response: Awaited<TypeDefKind> = await computeQuery(
[
...this._queryTree,
{
operation: "kind",
},
],
await this._ctx.connection()
)
return response
}
optional = async (): Promise<boolean> => {
if (this._optional) {
return this._optional
}
const response: Awaited<boolean> = await computeQuery(
[
...this._queryTree,
{
operation: "optional",
},
],
await this._ctx.connection()
)
return response
}
/**
* Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
*/
withConstructor = (function_: Function_): TypeDef => {
return new TypeDef({
queryTree: [
...this._queryTree,
{
operation: "withConstructor",
args: {
function: function_,
},
},
],
ctx: this._ctx,
})
}
/**
* Adds a static field for an Object TypeDef, failing if the type is not an object.
* @param name The name of the field in the object
* @param typeDef The type of the field
* @param opts.description A doc string for the field, if any
*/
withField = (
name: string,
typeDef: TypeDef,
opts?: TypeDefWithFieldOpts
): TypeDef => {
return new TypeDef({
queryTree: [
...this._queryTree,
{
operation: "withField",
args: { name, typeDef, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.
*/
withFunction = (function_: Function_): TypeDef => {
return new TypeDef({
queryTree: [
...this._queryTree,
{
operation: "withFunction",
args: {
function: function_,
},
},
],
ctx: this._ctx,
})
}
/**
* Returns a TypeDef of kind Interface with the provided name.
*/
withInterface = (name: string, opts?: TypeDefWithInterfaceOpts): TypeDef => {
return new TypeDef({
queryTree: [
...this._queryTree,
{
operation: "withInterface",
args: { name, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Sets the kind of the type.
*/
withKind = (kind: TypeDefKind): TypeDef => {
const metadata: Metadata = {
kind: { is_enum: true },
}
return new TypeDef({
queryTree: [
...this._queryTree,
{
operation: "withKind",
args: { kind, __metadata: metadata },
},
],
ctx: this._ctx,
})
}
/**
* Returns a TypeDef of kind List with the provided type for its elements.
*/
withListOf = (elementType: TypeDef): TypeDef => {
return new TypeDef({
queryTree: [
...this._queryTree,
{
operation: "withListOf",
args: { elementType },
},
],
ctx: this._ctx,
})
}
/**
* Returns a TypeDef of kind Object with the provided name.
*
* Note that an object's fields and functions may be omitted if the intent is only to refer to an object. This is how functions are able to return their own object, or any other circular reference.
*/
withObject = (name: string, opts?: TypeDefWithObjectOpts): TypeDef => {
return new TypeDef({
queryTree: [
...this._queryTree,
{
operation: "withObject",
args: { name, ...opts },
},
],
ctx: this._ctx,
})
}
/**
* Sets whether this type can be set to null.
*/
withOptional = (optional: boolean): TypeDef => {
return new TypeDef({
queryTree: [
...this._queryTree,
{
operation: "withOptional",
args: { optional },
},
],
ctx: this._ctx,
})
}
/**
* Call the provided function with current TypeDef.
*
* This is useful for reusability and readability by not breaking the calling chain.
*/
with = (arg: (param: TypeDef) => TypeDef) => {
return arg(this)
}
}
export const dag = new Client({ ctx: defaultContext })
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,357 | CLI: support for `-o` flag | As described in [this comment](https://github.com/dagger/dagger/issues/6229#issuecomment-1863649336), we want to add a `-o` flag for smartly redirecting output in `dagger call`.
---
This flag would be applicable for any return type and result in that result being written to the caller's filesystem rather than written to stdout.
For simple cases like a `string` return type, this would have the same end effect as a shell redirection. The difference is that we would allow *some* special case handling for it too. So if `myfunc` returns a `Directory`, this would work:
```
dagger run -o ./some/output/dir myfunc
```
and result in the the directory returned by `myfunc` to be written to `./some/output/dir`.
To start, `-o` would be exclusively for writing to the cli caller's filesystem.
* I suppose you could in theory expand to other output destinations via a `scheme://` type approach if we ever wanted to, but that's just a possible future extension point, not in scope now and just a random idea.
Also important to note that this would not inherently *remove* support for the full `... export --path ./some/output/dir` style either, it would just be a supplement to it. | https://github.com/dagger/dagger/issues/6357 | https://github.com/dagger/dagger/pull/6432 | 5201d6cf969a539189ec996eaa543233e20edd21 | 829fe2ca13b97ac3a4ee98401ebea7c7d1f4a9dd | "2024-01-03T19:54:37Z" | go | "2024-01-22T17:33:09Z" | cmd/dagger/call.go | package main
import (
"fmt"
"github.com/spf13/cobra"
)
var callCmd = &FuncCommand{
Name: "call",
Short: "Call a module function",
Long: "Call a module function and print the result.\n\nOn a container, the stdout will be returned. On a directory, the list of entries, and on a file, its contents.",
OnSelectObjectLeaf: func(c *FuncCommand, name string) error {
switch name {
case Container:
// TODO: Combined `output` in the API. Querybuilder
// doesn't support querying sibling fields.
c.Select("stdout")
case Directory:
c.Select("entries")
case File:
c.Select("contents")
default:
return fmt.Errorf("return type %q requires a sub-command", name)
}
return nil
},
AfterResponse: func(_ *FuncCommand, cmd *cobra.Command, _ *modTypeDef, response any) error {
return printResponse(cmd, response)
},
}
func printResponse(cmd *cobra.Command, r any) error {
switch t := r.(type) {
case []any:
for _, v := range t {
if err := printResponse(cmd, v); err != nil {
return err
}
}
return nil
case map[string]any:
for _, v := range t {
if err := printResponse(cmd, v); err != nil {
return err
}
}
return nil
default:
cmd.Printf("%+v\n", t)
}
return nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,357 | CLI: support for `-o` flag | As described in [this comment](https://github.com/dagger/dagger/issues/6229#issuecomment-1863649336), we want to add a `-o` flag for smartly redirecting output in `dagger call`.
---
This flag would be applicable for any return type and result in that result being written to the caller's filesystem rather than written to stdout.
For simple cases like a `string` return type, this would have the same end effect as a shell redirection. The difference is that we would allow *some* special case handling for it too. So if `myfunc` returns a `Directory`, this would work:
```
dagger run -o ./some/output/dir myfunc
```
and result in the the directory returned by `myfunc` to be written to `./some/output/dir`.
To start, `-o` would be exclusively for writing to the cli caller's filesystem.
* I suppose you could in theory expand to other output destinations via a `scheme://` type approach if we ever wanted to, but that's just a possible future extension point, not in scope now and just a random idea.
Also important to note that this would not inherently *remove* support for the full `... export --path ./some/output/dir` style either, it would just be a supplement to it. | https://github.com/dagger/dagger/issues/6357 | https://github.com/dagger/dagger/pull/6432 | 5201d6cf969a539189ec996eaa543233e20edd21 | 829fe2ca13b97ac3a4ee98401ebea7c7d1f4a9dd | "2024-01-03T19:54:37Z" | go | "2024-01-22T17:33:09Z" | cmd/dagger/download.go | package main
import (
"fmt"
"github.com/spf13/cobra"
)
var exportPath string
var downloadCmd = &FuncCommand{
Name: "download",
Aliases: []string{"export", "dl"},
Short: "Download an asset from module function",
Long: "Download an asset returned by a module function and save it to the host.\n\nWorks with a Directory, File or Container.",
Init: func(cmd *cobra.Command) {
cmd.PersistentFlags().StringVarP(&exportPath, "output", "o", ".", "Path to export to")
},
OnSelectObjectLeaf: func(c *FuncCommand, name string) error {
switch name {
case Directory, File, Container:
c.Select("export")
c.Arg("path", exportPath)
if name == File {
c.Arg("allowParentDirPath", true)
}
return nil
default:
return fmt.Errorf("return type %q cannot be downloaded", name)
}
},
BeforeRequest: func(_ *FuncCommand, cmd *cobra.Command, returnType *modTypeDef) error {
switch returnType.Name() {
case Directory, File, Container:
flag := cmd.Flags().Lookup("output")
if returnType.Name() == Container && flag != nil && !flag.Changed {
return fmt.Errorf("flag --output is required for containers")
}
return nil
}
return fmt.Errorf("return type not supported: %s", printReturnType(returnType))
},
AfterResponse: func(_ *FuncCommand, cmd *cobra.Command, _ *modTypeDef, response any) error {
status, ok := response.(bool)
if !ok {
return fmt.Errorf("unexpected response %T: %+v", response, response)
}
if !status {
return fmt.Errorf("failed to export asset to %q", exportPath)
}
cmd.Printf("Asset exported to %q\n", exportPath)
return nil
},
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,357 | CLI: support for `-o` flag | As described in [this comment](https://github.com/dagger/dagger/issues/6229#issuecomment-1863649336), we want to add a `-o` flag for smartly redirecting output in `dagger call`.
---
This flag would be applicable for any return type and result in that result being written to the caller's filesystem rather than written to stdout.
For simple cases like a `string` return type, this would have the same end effect as a shell redirection. The difference is that we would allow *some* special case handling for it too. So if `myfunc` returns a `Directory`, this would work:
```
dagger run -o ./some/output/dir myfunc
```
and result in the the directory returned by `myfunc` to be written to `./some/output/dir`.
To start, `-o` would be exclusively for writing to the cli caller's filesystem.
* I suppose you could in theory expand to other output destinations via a `scheme://` type approach if we ever wanted to, but that's just a possible future extension point, not in scope now and just a random idea.
Also important to note that this would not inherently *remove* support for the full `... export --path ./some/output/dir` style either, it would just be a supplement to it. | https://github.com/dagger/dagger/issues/6357 | https://github.com/dagger/dagger/pull/6432 | 5201d6cf969a539189ec996eaa543233e20edd21 | 829fe2ca13b97ac3a4ee98401ebea7c7d1f4a9dd | "2024-01-03T19:54:37Z" | go | "2024-01-22T17:33:09Z" | cmd/dagger/functions.go | package main
import (
"context"
"errors"
"fmt"
"io"
"os"
"sort"
"strings"
"dagger.io/dagger"
"dagger.io/dagger/querybuilder"
"github.com/dagger/dagger/engine/client"
"github.com/juju/ansiterm/tabwriter"
"github.com/muesli/termenv"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/vito/progrock"
)
const (
Directory string = "Directory"
Container string = "Container"
File string = "File"
Secret string = "Secret"
Service string = "Service"
)
var funcGroup = &cobra.Group{
ID: "functions",
Title: "Functions",
}
var funcCmds = FuncCommands{
funcListCmd,
callCmd,
shellCmd,
downloadCmd,
upCmd,
}
var funcListCmd = &FuncCommand{
Name: "functions",
Short: `List available functions`,
Execute: func(fc *FuncCommand, cmd *cobra.Command) error {
tw := tabwriter.NewWriter(cmd.OutOrStdout(), 0, 0, 3, ' ', tabwriter.DiscardEmptyColumns)
var o functionProvider = fc.mod.GetMainObject()
fmt.Fprintf(tw, "%s\t%s\n",
termenv.String("Name").Bold(),
termenv.String("Description").Bold(),
)
// Walk the hypothetical function pipeline specified by the args
for _, field := range cmd.Flags().Args() {
// Lookup the next function in the specified pipeline
nextFunc, err := o.GetFunction(field)
if err != nil {
return err
}
nextType := nextFunc.ReturnType
if nextType.AsFunctionProvider() != nil {
// sipsma explains why 'nextType.AsObject' is not enough:
// > when we're returning the hierarchies of TypeDefs from the API,
// > and an object shows up as an output/input type to a function,
// > we just return a TypeDef with a name of the object rather than the full object definition.
// > You can get the full object definition only from the "top-level" returned object on the api call.
//
// > The reason is that if we repeated the full object definition every time,
// > you'd at best be using O(n^2) space in the result,
// > and at worst cause json serialization errors due to cyclic references
// > (i.e. with* functions on an object that return the object itself).
o = fc.mod.GetFunctionProvider(nextType.Name())
continue
}
// FIXME: handle arrays of objects
return fmt.Errorf("function '%s' returns non-object type %v", field, nextType.Kind)
}
// List functions on the final object
fns := o.GetFunctions()
sort.Slice(fns, func(i, j int) bool {
return fns[i].Name < fns[j].Name
})
for _, fn := range fns {
desc := strings.SplitN(fn.Description, "\n", 2)[0]
if desc == "" {
desc = "-"
}
fmt.Fprintf(tw, "%s\t%s\n",
cliName(fn.Name),
desc,
)
}
return tw.Flush()
},
}
func printReturnType(returnType *modTypeDef) (n string) {
defer func() {
if !returnType.Optional {
n += "!"
}
}()
switch returnType.Kind {
case dagger.StringKind:
return "String"
case dagger.IntegerKind:
return "Int"
case dagger.BooleanKind:
return "Boolean"
case dagger.ObjectKind:
return returnType.AsObject.Name
case dagger.InterfaceKind:
return returnType.AsInterface.Name
case dagger.ListKind:
return fmt.Sprintf("[%s]", printReturnType(returnType.AsList.ElementTypeDef))
default:
return ""
}
}
type FuncCommands []*FuncCommand
func (fcs FuncCommands) AddFlagSet(flags *pflag.FlagSet) {
for _, cmd := range fcs.All() {
cmd.PersistentFlags().AddFlagSet(flags)
}
}
func (fcs FuncCommands) AddParent(rootCmd *cobra.Command) {
rootCmd.AddGroup(funcGroup)
rootCmd.AddCommand(fcs.All()...)
}
func (fcs FuncCommands) All() []*cobra.Command {
cmds := make([]*cobra.Command, len(fcs))
for i, fc := range fcs {
cmds[i] = fc.Command()
}
return cmds
}
func setCmdOutput(cmd *cobra.Command, vtx *progrock.VertexRecorder) {
if silent {
return
}
var stdout io.Writer
var stderr io.Writer
if stdoutIsTTY {
stdout = vtx.Stdout()
} else {
stdout = os.Stdout
}
if stderrIsTTY {
stderr = vtx.Stderr()
} else {
stderr = os.Stderr
}
cmd.SetOut(stdout)
cmd.SetErr(stderr)
}
// FuncCommand is a config object used to create a dynamic set of commands
// for querying a module's functions.
type FuncCommand struct {
// The name of the command (or verb), as shown in usage.
Name string
// Aliases is an array of aliases that can be used instead of the first word in Use.
Aliases []string
// Short is the short description shown in the 'help' output.
Short string
// Long is the long message shown in the 'help <this-command>' output.
Long string
// Example is examples of how to use the command.
Example string
// Init is called when the command is created and initialized,
// before execution.
//
// It can be useful to add persistent flags for all subcommands here.
Init func(*cobra.Command)
// Execute circumvents the default behavior of traversing subcommands
// from the arguments, but still has access to the loaded objects from
// the module.
Execute func(*FuncCommand, *cobra.Command) error
// BeforeParse is called before parsing the flags for a subcommand.
//
// It can be useful to add any additional flags for a subcommand here.
BeforeParse func(*FuncCommand, *cobra.Command, *modFunction) error
// OnSelectObjectLeaf is called when a user provided command ends in a
// object and no more sub-commands are provided.
//
// If set, it should make another selection on the object that results
// return no error. Otherwise if it doesn't handle the object, it should
// return an error.
OnSelectObjectLeaf func(*FuncCommand, string) error
// BeforeRequest is called before making the request with the query that
// contains the whole chain of functions.
//
// It can be useful to validate the return type of the function or as a
// last effort to select a GraphQL sub-field.
BeforeRequest func(*FuncCommand, *cobra.Command, *modTypeDef) error
// AfterResponse is called when the query has completed and returned a result.
AfterResponse func(*FuncCommand, *cobra.Command, *modTypeDef, any) error
// cmd is the parent cobra command.
cmd *cobra.Command
// mod is the loaded module definition.
mod *moduleDef
// showHelp is set in the loader vertex to flag whether to show the help
// in the execution vertex.
showHelp bool
// showUsage flags whether to show a one-line usage message after error.
showUsage bool
q *querybuilder.Selection
c *client.Client
}
func (fc *FuncCommand) Command() *cobra.Command {
if fc.cmd == nil {
use := fmt.Sprintf("%s [flags] [command [flags]]...", fc.Name)
disableFlagsInUse := true
if fc.Execute != nil {
use = fc.Name
disableFlagsInUse = false
}
fc.cmd = &cobra.Command{
Use: use,
Aliases: fc.Aliases,
Short: fc.Short,
Long: fc.Long,
Example: fc.Example,
GroupID: funcGroup.ID,
Hidden: true, // for now, remove once we're ready for primetime
// We need to disable flag parsing because it'll act on --help
// and validate the args before we have a chance to add the
// subcommands.
DisableFlagParsing: true,
DisableFlagsInUseLine: disableFlagsInUse,
PreRunE: func(c *cobra.Command, a []string) error {
// Recover what DisableFlagParsing disabled.
// In PreRunE it's, already past the --help check and
// args validation, but not flag validation which we want.
c.DisableFlagParsing = false
// Since we disabled flag parsing, we'll get all args,
// not just flags. We want to stop parsing at the first
// possible dynamic sub-command since they've not been
// added yet.
c.Flags().SetInterspersed(false)
// Allow using flags with the name that was reported
// by the SDK. This avoids confusion as users are editing
// a module and trying to test its functions.
c.SetGlobalNormalizationFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName {
return pflag.NormalizedName(cliName(name))
})
// temporarily allow unknown flags so we can parse any global flags before starting
// the engine+TUI while not erroring out on module constructor flags (which can't be
// added until the engine has started)
c.FParseErrWhitelist.UnknownFlags = true
if err := c.ParseFlags(a); err != nil {
// This gives a chance for FuncCommand implementations to
// handle errors from parsing flags.
return c.FlagErrorFunc()(c, err)
}
c.FParseErrWhitelist.UnknownFlags = false
fc.showHelp, _ = c.Flags().GetBool("help")
return nil
},
// Between PreRunE and RunE, flags are validated.
RunE: func(c *cobra.Command, a []string) error {
return withEngineAndTUI(c.Context(), client.Params{}, func(ctx context.Context, engineClient *client.Client) (rerr error) {
fc.c = engineClient
// withEngineAndTUI changes the context.
c.SetContext(ctx)
// We need to print the errors ourselves because the root command
// will print the command path for this one (parent), not any
// sub-command.
c.SilenceErrors = true
return fc.execute(c, a)
})
},
}
if fc.Init != nil {
fc.Init(fc.cmd)
}
}
return fc.cmd
}
func (fc *FuncCommand) execute(c *cobra.Command, a []string) (rerr error) {
ctx := c.Context()
rec := progrock.FromContext(ctx)
// NB: Don't print full os.Args in Vertex name because we don't know which
// flags hold a secret value yet and don't want to risk exposing them.
// We'll print just the command path when we have the leaf command.
loader := rec.Vertex("cmd-func-loader", "load "+c.Name())
setCmdOutput(c, loader)
cmd, flags, err := fc.load(c, a, loader)
loader.Done(err)
if err != nil {
return err
}
vtx := rec.Vertex("cmd-func-exec", cmd.CommandPath(), progrock.Focused())
setCmdOutput(c, vtx)
defer func() {
if rerr != nil {
cmd.PrintErrln("Error:", rerr.Error())
if fc.showUsage {
cmd.PrintErrf("Run '%v --help' for usage.\n", cmd.CommandPath())
}
}
vtx.Done(rerr)
}()
// TODO: Move help output out of progrock?
if fc.showHelp {
// Hide aliases for sub-commands. They just allow using the SDK's
// casing for functions but there's no need to advertise.
if cmd != c {
cmd.Aliases = nil
}
return cmd.Help()
}
// There should be no args left, if there are it's an unknown command.
if err := cobra.NoArgs(cmd, flags); err != nil {
return err
}
if fc.Execute != nil {
return fc.Execute(fc, cmd)
}
// No args to the parent command, default to showing help.
if cmd == c {
return cmd.Help()
}
err = cmd.RunE(cmd, flags)
if err != nil {
return err
}
return nil
}
func (fc *FuncCommand) load(c *cobra.Command, a []string, vtx *progrock.VertexRecorder) (cmd *cobra.Command, _ []string, rerr error) {
ctx := c.Context()
dag := fc.c.Dagger()
// Print error in current vertex, before completing it.
defer func() {
if cmd == nil {
cmd = c
}
if rerr != nil {
cmd.PrintErrln("Error:", rerr.Error())
if fc.showHelp {
// Explicitly show the help here while still returning the error.
// This handles the case of `dagger call --help` run on a broken module; in that case
// we want to error out since we can't actually load the module and show all subcommands
// and flags in the help output, but we still want to show the user *something*
cmd.Help()
}
if fc.showUsage {
cmd.PrintErrf("Run '%v --help' for usage.\n", cmd.CommandPath())
}
}
}()
load := vtx.Task("loading module")
mod, err := loadMod(ctx, dag)
load.Done(err)
if err != nil {
return nil, nil, err
}
if mod == nil {
return nil, nil, fmt.Errorf("no module specified and no default module found in current directory")
}
load = vtx.Task("loading objects")
modDef, err := loadModTypeDefs(ctx, dag, mod)
load.Done(err)
if err != nil {
return nil, nil, err
}
obj := modDef.GetMainObject()
if obj == nil {
return nil, nil, fmt.Errorf("main object not found")
}
fc.mod = modDef
if fc.Execute != nil {
// if `Execute` is set, there's no need for sub-commands.
return nil, nil, nil
}
if obj.Constructor != nil {
// add constructor args as top-level flags
if err := fc.addArgsForFunction(c, a, obj.Constructor, dag); err != nil {
return nil, nil, err
}
fc.selectFunc(obj.Name, obj.Constructor, c, dag)
} else {
fc.Select(obj.Name)
}
// Add main object's functions as subcommands
fc.addSubCommands(c, dag, obj)
if fc.showHelp {
return nil, nil, nil
}
traverse := vtx.Task("traversing arguments")
cmd, flags, err := fc.traverse(c)
defer func() { traverse.Done(rerr) }()
if err != nil {
if errors.Is(err, pflag.ErrHelp) {
fc.showHelp = true
return cmd, flags, nil
}
fc.showUsage = true
return cmd, flags, err
}
return cmd, flags, nil
}
// traverse the arguments to build the command tree and return the leaf command.
func (fc *FuncCommand) traverse(c *cobra.Command) (*cobra.Command, []string, error) {
cmd, args, err := c.Find(c.Flags().Args())
if err != nil {
return cmd, args, err
}
// Leaf command
if cmd == c {
return cmd, args, nil
}
cmd.SetContext(c.Context())
cmd.InitDefaultHelpFlag()
// Load and ParseFlags
err = cmd.PreRunE(cmd, args)
if err != nil {
return cmd, args, err
}
return fc.traverse(cmd)
}
func (fc *FuncCommand) addSubCommands(cmd *cobra.Command, dag *dagger.Client, fnProvider functionProvider) {
if fnProvider != nil {
for _, fn := range fnProvider.GetFunctions() {
subCmd := fc.makeSubCmd(dag, fn)
cmd.AddCommand(subCmd)
}
}
}
func (fc *FuncCommand) makeSubCmd(dag *dagger.Client, fn *modFunction) *cobra.Command {
newCmd := &cobra.Command{
Use: cliName(fn.Name),
Short: fn.Description,
PreRunE: func(cmd *cobra.Command, args []string) (err error) {
if err := fc.addArgsForFunction(cmd, args, fn, dag); err != nil {
return err
}
fnProvider := fn.ReturnType.AsFunctionProvider()
if fnProvider == nil && fn.ReturnType.AsList != nil {
fnProvider = fn.ReturnType.AsList.ElementTypeDef.AsFunctionProvider()
}
fc.addSubCommands(cmd, dag, fnProvider)
// Show help for first command that has the --help flag.
help, _ := cmd.Flags().GetBool("help")
if help {
return pflag.ErrHelp
}
// Need to make the query selection before chaining off.
return fc.selectFunc(fn.Name, fn, cmd, dag)
},
// This is going to be executed in the "execution" vertex, when
// we have the final/leaf command.
RunE: func(cmd *cobra.Command, args []string) (err error) {
switch fn.ReturnType.Kind {
case dagger.ObjectKind, dagger.InterfaceKind:
if fc.OnSelectObjectLeaf == nil {
// there is no handling of this object and no further selections, error out
fc.showUsage = true
return fmt.Errorf("%q requires a sub-command", cmd.Name())
}
// the top-level command may handle this via OnSelectObjectLeaf
err := fc.OnSelectObjectLeaf(fc, fn.ReturnType.Name())
if err != nil {
fc.showUsage = true
return fmt.Errorf("invalid selection for command %q: %w", cmd.Name(), err)
}
case dagger.ListKind:
fnProvider := fn.ReturnType.AsList.ElementTypeDef.AsFunctionProvider()
if fnProvider != nil && len(fnProvider.GetFunctions()) > 0 {
// we don't handle lists of objects/interfaces w/ extra functions on any commands right now
fc.showUsage = true
return fmt.Errorf("%q requires a sub-command", cmd.Name())
}
}
if fc.BeforeRequest != nil {
if err = fc.BeforeRequest(fc, cmd, fn.ReturnType); err != nil {
return err
}
}
ctx := cmd.Context()
query, _ := fc.q.Build(ctx)
rec := progrock.FromContext(ctx)
rec.Debug("executing", progrock.Labelf("query", "%+v", query))
var response any
q := fc.q.Bind(&response)
if err := q.Execute(ctx, dag.GraphQLClient()); err != nil {
return fmt.Errorf("response from query: %w", err)
}
if fc.AfterResponse != nil {
return fc.AfterResponse(fc, cmd, fn.ReturnType, response)
}
if fn.ReturnType.Kind != dagger.VoidKind {
cmd.Println(response)
}
return nil
},
}
// Allow using the function name from the SDK as an alias for the command.
if fn.Name != newCmd.Name() {
newCmd.Aliases = append(newCmd.Aliases, fn.Name)
}
newCmd.Flags().SetInterspersed(false)
return newCmd
}
func (fc *FuncCommand) addArgsForFunction(cmd *cobra.Command, cmdArgs []string, fn *modFunction, dag *dagger.Client) error {
fc.mod.LoadTypeDef(fn.ReturnType)
for _, arg := range fn.Args {
fc.mod.LoadTypeDef(arg.TypeDef)
}
for _, arg := range fn.Args {
_, err := arg.AddFlag(cmd.Flags(), dag)
if err != nil {
return err
}
if !arg.TypeDef.Optional {
cmd.MarkFlagRequired(arg.FlagName())
}
}
if fc.BeforeParse != nil {
if err := fc.BeforeParse(fc, cmd, fn); err != nil {
return err
}
}
if err := cmd.ParseFlags(cmdArgs); err != nil {
// This gives a chance for FuncCommand implementations to
// handle errors from parsing flags.
return cmd.FlagErrorFunc()(cmd, err)
}
help, _ := cmd.Flags().GetBool("help")
if !help {
if err := cmd.ValidateRequiredFlags(); err != nil {
return err
}
if err := cmd.ValidateFlagGroups(); err != nil {
return err
}
}
return nil
}
// selectFunc adds the function selection to the query.
// Note that the type can change if there's an extra selection for supported types.
func (fc *FuncCommand) selectFunc(selectName string, fn *modFunction, cmd *cobra.Command, dag *dagger.Client) error {
fc.Select(selectName)
for _, arg := range fn.Args {
var val any
flag := cmd.Flags().Lookup(arg.FlagName())
if flag == nil {
return fmt.Errorf("no flag for %q", arg.FlagName())
}
// Don't send optional arguments that weren't set.
if arg.TypeDef.Optional && !flag.Changed {
continue
}
val = flag.Value
switch v := val.(type) {
case DaggerValue:
obj, err := v.Get(cmd.Context(), dag)
if err != nil {
return fmt.Errorf("failed to get value for argument %q: %w", arg.Name, err)
}
if obj == nil {
return fmt.Errorf("no value for argument: %s", arg.Name)
}
val = obj
case pflag.SliceValue:
val = v.GetSlice()
}
fc.Arg(arg.Name, val)
}
return nil
}
func (fc *FuncCommand) Select(name string) {
if fc.q == nil {
fc.q = querybuilder.Query()
}
fc.q = fc.q.Select(gqlFieldName(name))
}
func (fc *FuncCommand) Arg(name string, value any) {
fc.q = fc.q.Arg(gqlArgName(name), value)
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,357 | CLI: support for `-o` flag | As described in [this comment](https://github.com/dagger/dagger/issues/6229#issuecomment-1863649336), we want to add a `-o` flag for smartly redirecting output in `dagger call`.
---
This flag would be applicable for any return type and result in that result being written to the caller's filesystem rather than written to stdout.
For simple cases like a `string` return type, this would have the same end effect as a shell redirection. The difference is that we would allow *some* special case handling for it too. So if `myfunc` returns a `Directory`, this would work:
```
dagger run -o ./some/output/dir myfunc
```
and result in the the directory returned by `myfunc` to be written to `./some/output/dir`.
To start, `-o` would be exclusively for writing to the cli caller's filesystem.
* I suppose you could in theory expand to other output destinations via a `scheme://` type approach if we ever wanted to, but that's just a possible future extension point, not in scope now and just a random idea.
Also important to note that this would not inherently *remove* support for the full `... export --path ./some/output/dir` style either, it would just be a supplement to it. | https://github.com/dagger/dagger/issues/6357 | https://github.com/dagger/dagger/pull/6432 | 5201d6cf969a539189ec996eaa543233e20edd21 | 829fe2ca13b97ac3a4ee98401ebea7c7d1f4a9dd | "2024-01-03T19:54:37Z" | go | "2024-01-22T17:33:09Z" | core/integration/module_call_test.go | package core
import (
"fmt"
"strings"
"testing"
"dagger.io/dagger"
"github.com/stretchr/testify/require"
)
func TestModuleDaggerCallArgTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
t.Run("service args", func(t *testing.T) {
t.Parallel()
t.Run("used as service binding", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context, svc *Service) (string, error) {
return dag.Container().From("alpine:3.18").WithExec([]string{"apk", "add", "curl"}).
WithServiceBinding("daserver", svc).
WithExec([]string{"curl", "http://daserver:8000"}).
Stdout(ctx)
}
`,
})
logGen(ctx, t, modGen.Directory("."))
httpServer, _ := httpService(ctx, t, c, "im up")
endpoint, err := httpServer.Endpoint(ctx)
require.NoError(t, err)
out, err := modGen.
WithServiceBinding("testserver", httpServer).
With(daggerCall("fn", "--svc", "tcp://"+endpoint)).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "im up")
})
t.Run("used directly", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"fmt"
"strings"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context, svc *Service) (string, error) {
ports, err := svc.Ports(ctx)
if err != nil {
return "", err
}
var out []string
out = append(out, fmt.Sprintf("%d exposed ports:", len(ports)))
for _, port := range ports {
number, err := port.Port(ctx)
if err != nil {
return "", err
}
out = append(out, fmt.Sprintf("- TCP/%d", number))
}
return strings.Join(out, "\n"), nil
}
`,
})
logGen(ctx, t, modGen.Directory("."))
httpServer, _ := httpService(ctx, t, c, "im up")
endpoint, err := httpServer.Endpoint(ctx)
require.NoError(t, err)
out, err := modGen.
WithServiceBinding("testserver", httpServer).
With(daggerCall("fn", "--svc", "tcp://"+endpoint)).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "1 exposed ports:\n- TCP/8000")
})
})
t.Run("list args", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("foo.txt", dagger.ContainerWithNewFileOpts{
Contents: "bar",
}).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"strings"
)
type Minimal struct {}
func (m *Minimal) Hello(msgs []string) string {
return strings.Join(msgs, "+")
}
func (m *Minimal) Reads(ctx context.Context, files []File) (string, error) {
var contents []string
for _, f := range files {
content, err := f.Contents(ctx)
if err != nil {
return "", err
}
contents = append(contents, content)
}
return strings.Join(contents, "+"), nil
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(daggerCall("hello", "--msgs", "yo", "--msgs", "my", "--msgs", "friend")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "yo+my+friend")
out, err = modGen.With(daggerCall("reads", "--files=foo.txt", "--files=foo.txt")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "bar+bar")
})
t.Run("directory arg inputs", func(t *testing.T) {
t.Parallel()
t.Run("local dir", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("/dir/subdir/foo.txt", dagger.ContainerWithNewFileOpts{
Contents: "foo",
}).
WithNewFile("/dir/subdir/bar.txt", dagger.ContainerWithNewFileOpts{
Contents: "bar",
}).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct {}
func (m *Test) Fn(dir *Directory) *Directory {
return dir
}
`,
})
out, err := modGen.With(daggerCall("fn", "--dir", "/dir/subdir")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "bar.txt\nfoo.txt")
out, err = modGen.With(daggerCall("fn", "--dir", "file:///dir/subdir")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "bar.txt\nfoo.txt")
})
t.Run("git dir", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct {}
func (m *Test) Fn(dir *Directory, subpath Optional[string]) *Directory {
return dir.Directory(subpath.GetOr("."))
}
`,
})
for _, tc := range []struct {
baseURL string
subpath string
}{
{
baseURL: "https://github.com/dagger/dagger",
},
{
baseURL: "https://github.com/dagger/dagger",
subpath: ".changes",
},
{
baseURL: "https://github.com/dagger/dagger.git",
},
{
baseURL: "https://github.com/dagger/dagger.git",
subpath: ".changes",
},
} {
tc := tc
t.Run(fmt.Sprintf("%s:%s", tc.baseURL, tc.subpath), func(t *testing.T) {
t.Parallel()
url := tc.baseURL + "#v0.9.1"
if tc.subpath != "" {
url += ":" + tc.subpath
}
args := []string{"fn", "--dir", url}
if tc.subpath == "" {
args = append(args, "--subpath", ".changes")
}
out, err := modGen.With(daggerCall(args...)).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, "v0.9.1.md")
require.NotContains(t, out, "v0.9.2.md")
})
}
})
})
t.Run("secret args", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Insecure(ctx context.Context, token *Secret) (string, error) {
return token.Plaintext(ctx)
}
`,
}).
WithEnvVariable("TOPSECRET", "shhh").
WithNewFile("/mysupersecret", dagger.ContainerWithNewFileOpts{Contents: "file shhh"})
t.Run("explicit env", func(t *testing.T) {
t.Parallel()
t.Run("happy", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("insecure", "--token", "env:TOPSECRET")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "shhh", strings.TrimSpace(out))
})
t.Run("sad", func(t *testing.T) {
t.Parallel()
_, err := modGen.With(daggerCall("insecure", "--token", "env:NOWHERETOBEFOUND")).Stdout(ctx)
require.ErrorContains(t, err, `secret env var not found: "NOW..."`)
})
})
t.Run("implicit env", func(t *testing.T) {
t.Parallel()
t.Run("happy", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("insecure", "--token", "TOPSECRET")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "shhh", strings.TrimSpace(out))
})
t.Run("sad", func(t *testing.T) {
t.Parallel()
_, err := modGen.With(daggerCall("insecure", "--token", "NOWHERETOBEFOUND")).Stdout(ctx)
require.ErrorContains(t, err, `secret env var not found: "NOW..."`)
})
})
t.Run("file", func(t *testing.T) {
t.Parallel()
t.Run("happy", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("insecure", "--token", "file:/mysupersecret")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "file shhh", strings.TrimSpace(out))
})
t.Run("sad", func(t *testing.T) {
t.Parallel()
_, err := modGen.With(daggerCall("insecure", "--token", "file:/nowheretobefound")).Stdout(ctx)
require.ErrorContains(t, err, `failed to read secret file "/nowheretobefound": open /nowheretobefound: no such file or directory`)
})
})
t.Run("cmd", func(t *testing.T) {
t.Parallel()
t.Run("happy", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("insecure", "--token", "cmd:echo -n cmd shhh")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "cmd shhh", strings.TrimSpace(out))
})
t.Run("sad", func(t *testing.T) {
t.Parallel()
_, err := modGen.With(daggerCall("insecure", "--token", "cmd:exit 1")).Stdout(ctx)
require.ErrorContains(t, err, `failed to run secret command "exit 1": exit status 1`)
})
})
t.Run("invalid source", func(t *testing.T) {
t.Parallel()
_, err := modGen.With(daggerCall("insecure", "--token", "wtf:HUH")).Stdout(ctx)
require.ErrorContains(t, err, `unsupported secret arg source: "wtf"`)
})
})
}
func TestModuleDaggerCallReturnTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
t.Run("return list objects", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {
Bar int ` + "`" + `json:"bar"` + "`" + `
}
func (m *Minimal) Fn() []*Foo {
var foos []*Foo
for i := 0; i < 3; i++ {
foos = append(foos, &Foo{Bar: i})
}
return foos
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(daggerCall("fn", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "0\n1\n2")
})
t.Run("return container", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{Ctr: dag.Container().From("alpine:3.18").WithExec([]string{"echo", "hello", "world"})}
}
type Test struct {
Ctr *Container
}
`,
})
out, err := modGen.With(daggerCall("ctr")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hello world", strings.TrimSpace(out))
})
t.Run("return directory", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
Dir: dag.Directory().WithNewFile("foo.txt", "foo").WithNewFile("bar.txt", "bar"),
}
}
type Test struct {
Dir *Directory
}
`,
})
out, err := modGen.With(daggerCall("dir")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "bar.txt\nfoo.txt", strings.TrimSpace(out))
})
t.Run("return file", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
File: dag.Directory().WithNewFile("foo.txt", "foo").File("foo.txt"),
}
}
type Test struct {
File *File
}
`,
})
out, err := modGen.With(daggerCall("file")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "foo", strings.TrimSpace(out))
})
t.Run("sync", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{Ctr: dag.Container().From("alpine:3.18").WithExec([]string{"echo", "hello", "world"})}
}
type Test struct {
Ctr *Container
}
`,
})
// just verify it works without error for now
_, err := modGen.With(daggerCall("ctr", "sync")).Stdout(ctx)
require.NoError(t, err)
})
}
func TestModuleDaggerCallCoreChaining(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
t.Run("container", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{Ctr: dag.Container().From("alpine:3.18.5")}
}
type Test struct {
Ctr *Container
}
`,
})
t.Run("file", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("ctr", "file", "--path=/etc/alpine-release", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "3.18.5", strings.TrimSpace(out))
})
t.Run("export", func(t *testing.T) {
t.Parallel()
modGen, err := modGen.With(daggerCall("ctr", "export", "--path=./container.tar.gz")).Sync(ctx)
require.NoError(t, err)
size, err := modGen.File("./container.tar.gz").Size(ctx)
require.NoError(t, err)
require.Greater(t, size, 0)
})
})
t.Run("directory", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
Dir: dag.Directory().WithNewFile("foo.txt", "foo").WithNewFile("bar.txt", "bar"),
}
}
type Test struct {
Dir *Directory
}
`,
})
t.Run("file", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("dir", "file", "--path=foo.txt", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "foo", strings.TrimSpace(out))
})
t.Run("export", func(t *testing.T) {
t.Parallel()
modGen, err := modGen.With(daggerCall("dir", "export", "--path=./outdir")).Sync(ctx)
require.NoError(t, err)
ents, err := modGen.Directory("./outdir").Entries(ctx)
require.NoError(t, err)
require.Equal(t, []string{"bar.txt", "foo.txt"}, ents)
})
})
t.Run("return file", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
File: dag.Directory().WithNewFile("foo.txt", "foo").File("foo.txt"),
}
}
type Test struct {
File *File
}
`,
})
t.Run("size", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("file", "size")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "3", strings.TrimSpace(out))
})
t.Run("export", func(t *testing.T) {
t.Parallel()
modGen, err := modGen.With(daggerCall("file", "export", "--path=./outfile")).Sync(ctx)
require.NoError(t, err)
contents, err := modGen.File("./outfile").Contents(ctx)
require.NoError(t, err)
require.Equal(t, "foo", strings.TrimSpace(contents))
})
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,368 | Document that changing secrets doesn't invalidate the cache | ### What is the issue?
This is coming from a Discord question here: https://discord.com/channels/707636530424053791/1193141267903815700
Our official secrets docs (https://docs.dagger.io/723462/use-secrets/) do not mention anything about the fact that changing secrets doesn't invalidate the cache. I think it's important to highlight this property so users are aware of this.
| https://github.com/dagger/dagger/issues/6368 | https://github.com/dagger/dagger/pull/6472 | 71e6723bb75ebf1611d2fa7af39763119350bb1b | cd38b2f3bb2a6914705b0d7549d3fe0610cf7fd8 | "2024-01-06T15:26:48Z" | go | "2024-01-23T15:49:53Z" | docs/current_docs/cookbook.mdx | ---
slug: /cookbook
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# Cookbook
## Filesystem
### List host directory contents
The following code listing obtains a reference to the host working directory and lists the directory's contents.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/work-with-host-filesystem/list-dir/main.go
```
</TabItem>
<TabItem value="Node.js">
```typescript file=./guides/snippets/work-with-host-filesystem/list-dir/index.mts
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/work-with-host-filesystem/list-dir/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/421437-work-with-host-filesystem.mdx)
### Get host directory with filters
The following code listing obtains a reference to the host working directory containing all files except `*.txt` files.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/work-with-host-filesystem/list-dir-exclude/main.go
```
</TabItem>
<TabItem value="Node.js">
```typescript file=./guides/snippets/work-with-host-filesystem/list-dir-exclude/index.mts
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/work-with-host-filesystem/list-dir-exclude/main.py
```
</TabItem>
</Tabs>
The following code listing obtains a reference to the host working directory containing only `*.rar` files.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/work-with-host-filesystem/list-dir-include/main.go
```
</TabItem>
<TabItem value="Node.js">
```typescript file=./guides/snippets/work-with-host-filesystem/list-dir-include/index.mts
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/work-with-host-filesystem/list-dir-include/main.py
```
</TabItem>
</Tabs>
The following code listing obtains a reference to the host working directory containing all files except `*.rar` files.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/work-with-host-filesystem/list-dir-exclude-include/main.go
```
</TabItem>
<TabItem value="Node.js">
```typescript file=./guides/snippets/work-with-host-filesystem/list-dir-exclude-include/index.mts
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/work-with-host-filesystem/list-dir-exclude-include/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/421437-work-with-host-filesystem.mdx)
### Transfer and read host directory in container
The following code listing writes a host directory to a container at the `/host` container path and then reads the contents of the directory.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/work-with-host-filesystem/transfer-dir/main.go
```
</TabItem>
<TabItem value="Node.js">
```typescript file=./guides/snippets/work-with-host-filesystem/transfer-dir/index.mts
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/work-with-host-filesystem/transfer-dir/main.py
```
</TabItem>
</Tabs>
### Transfer and write to host directory from container
The following code listing writes a host directory to a container at the `/host` container path, adds a file to it, and then exports the modified directory back to the host:
:::note
Modifications made to a host directory written to a container filesystem path do not appear on the host. Data flows only one way between Dagger operations, because they are connected in a DAG. To write modifications back to the host directory, you must explicitly export the directory back to the host filesystem.
:::
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/work-with-host-filesystem/transfer-dir-export/main.go
```
</TabItem>
<TabItem value="Node.js">
```typescript file=./guides/snippets/work-with-host-filesystem/transfer-dir-export/index.mts
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/work-with-host-filesystem/transfer-dir-export/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/421437-work-with-host-filesystem.mdx)
### Add Git repository as directory to container
The following code listing adds a remote Git repository branch to a container as a directory at the `/src` container path and then executes a command in the container to list the directory contents.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/filesystem-operations/add-git-dir/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/filesystem-operations/add-git-dir/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/filesystem-operations/add-git-dir/main.py
```
</TabItem>
</Tabs>
### Add Git repository as directory to container with filters
The following code listing adds a remote Git repository branch as a directory at the `/src` container path, excluding `*.md` files.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/filesystem-operations/add-git-dir-exclude/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/filesystem-operations/add-git-dir-exclude/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/filesystem-operations/add-git-dir-exclude/main.py
```
</TabItem>
</Tabs>
The following code listing adds a remote Git repository branch as a directory at the `/src` container path, including only `*.md` files.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/filesystem-operations/add-git-dir-include/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/filesystem-operations/add-git-dir-include/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/filesystem-operations/add-git-dir-include/main.py
```
</TabItem>
</Tabs>
The following code listing adds a remote Git repository branch as a directory at the `/src` container path, including all `*.md` files except `README.md`.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/filesystem-operations/add-git-dir-exclude-include/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/filesystem-operations/add-git-dir-exclude-include/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/filesystem-operations/add-git-dir-exclude-include/main.py
```
</TabItem>
</Tabs>
## Builds
### Perform multi-stage build
The following code listing performs a multi-stage build.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/multistage-build/main.go
```
</TabItem>
<TabItem value="Node.js">
```typescript file=./guides/snippets/multistage-build/index.mts
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/multistage-build/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/544174-multistage-build.mdx)
### Perform matrix build
The following code listing builds separate images for multiple OS and CPU architecture combinations.
<Tabs groupId="language" className="embeds">
<TabItem value="Go">
```go file=./guides/snippets/multi-builds/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./guides/snippets/multi-builds/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/multi-builds/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/648384-multi-builds.mdx)
### Build multi-arch image
The following code listing builds a single image for different CPU architectures using native emulation.
<Tabs groupId="language" className="embeds">
<TabItem value="Go">
```go file=./guides/snippets/multiplatform-support/build-images-emulation/main.go
```
</TabItem>
</Tabs>
[Learn more](./guides/406009-multiplatform-support.mdx)
### Build multi-arch image with cross-compilation
The following code listing builds a single image for different CPU architectures using cross-compilation.
<Tabs groupId="language" className="embeds">
<TabItem value="Go">
```go file=./guides/snippets/multiplatform-support/build-images-cross-compilation/main.go
```
</TabItem>
</Tabs>
[Learn more](./guides/406009-multiplatform-support.mdx)
### Build image from Dockerfile
The following code listing builds an image from a Dockerfile in the current working directory on the host.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./quickstart/snippets/build-dockerfile/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./quickstart/snippets/build-dockerfile/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./quickstart/snippets/build-dockerfile/main.py
```
</TabItem>
</Tabs>
[Learn more](./quickstart/429462-build-dockerfile.mdx)
### Build image from Dockerfile using different build context
The following code listing builds an image from a Dockerfile using a build context directory in a different location than the current working directory.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/build-dockerfile/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/build-dockerfile/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/build-dockerfile/main.py
```
</TabItem>
</Tabs>
[Learn more](./quickstart/429462-build-dockerfile.mdx)
### Add OCI annotations to image
The following code listing adds [OpenContainer Initiative (OCI) annotations](https://github.com/opencontainers/image-spec/blob/v1.0/annotations.md) to an image.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/oci-annotations/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/oci-annotations/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/oci-annotations/main.py
```
</TabItem>
</Tabs>
### Define build-time variables
The following code listing defines various environment variables for build purposes.
<Tabs groupId="language" className="embeds">
<TabItem value="Go">
```go file=./guides/snippets/multi-builds/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./guides/snippets/multi-builds/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/multi-builds/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/648384-multi-builds.mdx)
### Access private Git repository
The following code listing demonstrates how to access a private Git repository using SSH.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/private-repositories/main.go
```
</TabItem>
<TabItem value="Node.js">
```typescript file=./guides/snippets/private-repositories/clone.ts
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/private-repositories/clone.py
```
</TabItem>
</Tabs>
### Invalidate cache
The following code listing demonstrates how to invalidate the Dagger pipeline operations cache and thereby force execution of subsequent pipeline steps, by introducing a volatile time variable at a specific point in the Dagger pipeline.
:::note
This is a temporary workaround until cache invalidation support is officially added to Dagger.
:::
:::note
Changes in mounted cache volumes do not invalidate the Dagger pipeline operations cache.
:::
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/cache-invalidation/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/cache-invalidation/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/cache-invalidation/main.py
```
</TabItem>
</Tabs>
## Services
### Expose service containers to host
The following code listing makes HTTP requests from the host to an HTTP service running in a Dagger pipeline.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/use-services/expose-service-containers-to-host/main.go
```
</TabItem>
<TabItem value="Node.js">
```typescript file=./guides/snippets/use-services/expose-service-containers-to-host/index.ts
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/use-services/expose-service-containers-to-host/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/757394-use-services.mdx)
### Expose host services to containers
The following code listing shows how a database client in a Dagger pipeline can access a database service running on the host.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/use-services/expose-host-services-to-container/main.go
```
</TabItem>
<TabItem value="Node.js">
```typescript file=./guides/snippets/use-services/expose-host-services-to-container/index.ts
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/use-services/expose-host-services-to-container/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/757394-use-services.mdx)
### Use transient database service for application tests
The following code listing creates a temporary MariaDB database service and binds it to an application container for unit/integration testing.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/use-services/use-db-service/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./guides/snippets/use-services/use-db-service/index.ts
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/use-services/use-db-service/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/757394-use-services.mdx)
### Start and stop services
The following code listing demonstrates explicitly starting a Docker daemon for use in a test suite.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/use-services/start-stop-services/main.go
```
</TabItem>
<TabItem value="Node.js">
```typescript file=./guides/snippets/use-services/start-stop-services/index.ts
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/use-services/start-stop-services/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/757394-use-services.mdx)
## Outputs
### Publish image to registry
The following code listing publishes a container image to a remote registry (Docker Hub). Replace the `DOCKER-HUB-USERNAME` and `DOCKER-HUB-PASSWORD` placeholders with your Docker Hub username and password respectively.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/use-secrets/sdk/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./guides/snippets/use-secrets/sdk/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/use-secrets/sdk/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/723462-use-secrets.mdx)
### Export image to host
The following code listing exports a container image from a Dagger pipeline to the host.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/load-images-local-docker-engine/export/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./guides/snippets/load-images-local-docker-engine/export/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/load-images-local-docker-engine/export/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/252029-load-images-local-docker-engine.mdx)
### Export container directory to host
The following code listing exports the contents of a container directory to the host's temporary directory.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/work-with-host-filesystem/export-dir/main.go
```
</TabItem>
</Tabs>
[Learn more](./guides/421437-work-with-host-filesystem.mdx)
### Publish image to registry with multiple tags
The following code listing tags a container image multiple times and publishes it to a remote registry (Docker Hub). Set the Docker Hub username and password as host environment variables named `DOCKERHUB_USERNAME` and `DOCKERHUB_PASSWORD` respectively.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/multiple-tags/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/multiple-tags/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/multiple-tags/main.py
```
</TabItem>
</Tabs>
## Secrets
### Expose secret via environment variable
The following code listing demonstrates how to inject an environment variable in a container as a secret.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/use-secrets/host-env/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./guides/snippets/use-secrets/host-env/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/use-secrets/host-env/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/723462-use-secrets.mdx)
### Expose secret via file
The following code listing demonstrates how to inject a file in a container as a secret.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/use-secrets/host-fs/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./guides/snippets/use-secrets/host-fs/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/use-secrets/host-fs/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/723462-use-secrets.mdx)
### Use secret in Dockerfile build
The following code listing demonstrates how to inject a secret into a Dockerfile build. The secret is automatically mounted in the build container at `/run/secrets/SECRET-ID`.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/use-secrets/dockerfile/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./guides/snippets/use-secrets/dockerfile/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/use-secrets/dockerfile/main.py
```
</TabItem>
</Tabs>
The sample Dockerfile below demonstrates the process of mounting the secret using a [`secret` filesystem mount type](https://docs.docker.com/engine/reference/builder/#run---mounttypesecret) and using it in the Dockerfile build process:
```dockerfile file=./guides/snippets/use-secrets/dockerfile/Dockerfile
```
[Learn more](./guides/723462-use-secrets.mdx)
### Load secret from Google Cloud Secret Manager
The following code listing reads a secret (a GitHub API token) from Google Cloud Secret Manager and uses it in a Dagger pipeline to interact with the GitHub API.
Set up [Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/provide-credentials-adc) and replace the `PROJECT-ID` and `SECRET-ID` placeholders with your Google Cloud project and secret identifiers respectively.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/use-secrets/external/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./guides/snippets/use-secrets/external/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/use-secrets/external/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/723462-use-secrets.mdx)
### Load secret from Hashicorp Vault
The following code listing reads a secret (a GitHub API token) from a Hashicorp Vault Key/Value v2 engine and uses it in a Dagger pipeline to interact with the GitHub API.
Set the Hashicorp Vault URI, namespace, role and secret identifiers as host environment variables named `VAULT_ADDRESS`, `VAULT_NAMESPACE`, `VAULT_ROLE_ID` and `VAULT_SECRET_ID` respectively. Replace the `MOUNT-PATH`, `SECRET-ID` and `SECRET-KEY` placeholders with your Hashicorp Vault mount point, secret identifier and key respectively.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/secrets-vault/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/secrets-vault/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/secrets-vault/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/723462-use-secrets.mdx)
### Mount directories as secrets in a container
The following code listing demonstrates how to securely mount directories as secrets in a container. The directory structure/file names will be accessible, but contents of the secrets will be scrubbed:
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/mount-directories-as-secrets/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/mount-directories-as-secrets/index.ts
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/mount-directories-as-secrets/main.py
```
</TabItem>
</Tabs>
## Error handling
### Terminate gracefully
The following code listing demonstrates how to handle errors gracefully, without crashing the program or script running Dagger pipelines.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/error-handling/aborting/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/error-handling/aborting/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/error-handling/aborting/main.py
```
</TabItem>
</Tabs>
### Handle exit code and unexpected errors
The following code listing demonstrates how to handle a non-zero exit code (an error from running a command) in a container, with several use cases:
- Difference between “test failed” and “failed to test”
- Handle a specific exit code value
- Handle a failure from a command executed in a container, without checking for the exit code
- Catching and handling a failure from a command executed in a container, without propagating it
- Get the standard output of a command, irrespective of whether or not it failed
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/error-handling/exit-code/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/error-handling/exit-code/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/error-handling/exit-code/main.py
```
</TabItem>
</Tabs>
### Continue using container after command execution fails
This code listing demonstrates how to continue using a container after a command executed within it fails. A common use case for this is to export a report that a test suite tool generates.
:::note
The caveat with this approach is that forcing a zero exit code on a failure caches the failure. This may not be desired depending on the use case.
:::
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/error-handling/postmortem/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/error-handling/postmortem/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/error-handling/postmortem/main.py
```
</TabItem>
</Tabs>
## Optimizations
### Cache dependencies
The following code listing uses a cache volume for application dependencies. This enables Dagger to reuse the contents of the cache every time the pipeline runs, and thereby speed up pipeline operations.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/cache-dependencies/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/cache-dependencies/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/cache-dependencies/main.py
```
</TabItem>
</Tabs>
[Learn more](./quickstart/635927-caching.mdx)
### Persist service state between runs
The following code listing uses a cache volume to persist a service's data across pipeline runs.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/use-services/persist-service-state/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./guides/snippets/use-services/persist-service-state/index.ts
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/use-services/persist-service-state/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/757394-use-services.mdx)
### Add multiple environment variables to a container
The following code listing demonstrates how to add multiple environment variables to a container.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/custom-callbacks/environment-variables/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./guides/snippets/custom-callbacks/environment-variables/index.mts
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/custom-callbacks/environment-variables/main.py
```
</TabItem>
</Tabs>
### Organize pipeline code into modules & classes
The following code listing demonstrates how to organize Dagger pipeline code into independent modules (or functions/packages, depending on your programming language) to improve code reusability and organization. It also demonstrates how to reuse the Dagger client and, therefore, share the Dagger session between modules.
:::note
The same Dagger client can safely be used in concurrent threads/routines. Therefore, it is recommended to reuse the Dagger client wherever possible, instead of creating a new client for each use. Initializing and using multiple Dagger clients in the same pipeline can result in unexpected behavior.
:::
<Tabs groupId="language">
<TabItem value="Go">
```go title="main.go" file=./cookbook/snippets/modules-shared-client/functions/main.go
```
```go title="alpine/alpine.go" file=./cookbook/snippets/modules-shared-client/functions/alpine/alpine.go
```
</TabItem>
<TabItem value="Node.js">
```typescript title="index.mts" file=./cookbook/snippets/modules-shared-client/functions/index.mts
```
```typescript title="alpine.mts" file=./cookbook/snippets/modules-shared-client/functions/alpine.mts
```
</TabItem>
<TabItem value="Python">
```python title="main.py" file=./cookbook/snippets/modules-shared-client/functions/main.py
```
```python title="alpine.py" file=./cookbook/snippets/modules-shared-client/functions/alpine.py
```
</TabItem>
</Tabs>
Another possible approach is to use independent classes (or interfaces, depending on the programming language) with public methods as functions. With this, it is no longer necessary to pass the client to all imported functions. The following code listing demonstrates this approach.
<Tabs groupId="language">
<TabItem value="Go">
```go title="main.go" file=./cookbook/snippets/modules-shared-client/classes/main.go
```
```go title="alpine/alpine.go" file=./cookbook/snippets/modules-shared-client/classes/alpine/alpine.go
```
</TabItem>
<TabItem value="Node.js">
```typescript title="index.mts" file=./cookbook/snippets/modules-shared-client/classes/index.mts
```
```typescript title="alpine.mts" file=./cookbook/snippets/modules-shared-client/classes/alpine.mts
```
</TabItem>
<TabItem value="Python">
```python title="main.py" file=./cookbook/snippets/modules-shared-client/classes/main.py
```
```python title="alpine.py" file=./cookbook/snippets/modules-shared-client/classes/alpine.py
```
</TabItem>
</Tabs>
### Execute pipeline operations concurrently
The following code listing demonstrates how to use native-language concurrency features ([goroutines](https://gobyexample.com/goroutines) in Go, [promises](https://basarat.gitbook.io/typescript/future-javascript/promise) in TypeScript, and [task groups](https://anyio.readthedocs.io/en/stable/) in Python) to execute pipeline operations in parallel.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/concurrency/main.go
```
</TabItem>
<TabItem value="Node.js">
```typescript file=./cookbook/snippets/concurrency/index.mts
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/concurrency/main.py
```
</TabItem>
</Tabs>
## Integrations
### Docker Engine
The following code listing shows how to connect to a Docker Engine on the host machine, by mounting the Docker UNIX socket into a container, and running the `docker` CLI.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/docker-engine-host/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/docker-engine-host/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/docker-engine-host/main.py
```
</TabItem>
</Tabs>
### Tailscale
The following code listing shows how to have a container running in a Dagger pipeline access a Tailscale network using Tailscale's [userspace networking](https://tailscale.com/kb/1112/userspace-networking/).
Set the `TAILSCALE_AUTHKEY` host environment variable to a [Tailscale authentication key](https://tailscale.com/kb/1085/auth-keys/) and the `TAILSCALE_SERVICE_URL` host environment variable to a URL accessibly only on the Tailscale network.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./cookbook/snippets/tailscale-networking/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./cookbook/snippets/tailscale-networking/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./cookbook/snippets/tailscale-networking/main.py
```
</TabItem>
</Tabs>
### AWS Cloud Development Kit
The following code listing builds, publishes and deploys a container using the Amazon Web Services (AWS) Cloud Development Kit (CDK).
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/aws-cdk-ecs/main.go
```
```go file=./guides/snippets/aws-cdk-ecs/aws.go
```
```go file=./guides/snippets/aws-cdk-ecs/registry.go
```
</TabItem>
</Tabs>
[Learn more](./guides/899944-aws-cdk-ecs.mdx)
### Google Cloud Run
The following code listing builds, publishes and deploys a container using Google Container Registry and Google Cloud Run.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./guides/snippets/github-google-cloud/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./guides/snippets/github-google-cloud/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./guides/snippets/github-google-cloud/main.py
```
</TabItem>
</Tabs>
[Learn more](./guides/620941-github-google-cloud.mdx)
### GitHub Actions
<Tabs groupId="language">
<TabItem value="Go">
The following code listing shows how to integrate Dagger with GitHub Actions.
```yaml title=".github/workflows/dagger.yml" file=./guides/snippets/ci/go/actions.yml
```
</TabItem>
<TabItem value="Node.js">
```yaml title=".github/workflows/dagger.yaml" file=./guides/snippets/ci/nodejs/actions.yml
```
</TabItem>
<TabItem value="Python">
```yaml title=".github/workflows/dagger.yaml" file=./guides/snippets/ci/python/actions.yml
```
</TabItem>
</Tabs>
[Learn more](./guides/145912-ci.mdx)
### GitLab CI
The following code listing shows how to integrate Dagger with GitLab CI.
<Tabs groupId="language">
<TabItem value="Go">
```yaml title=".gitlab-ci.yml" file=./guides/snippets/ci/go/gitlab.yml
```
</TabItem>
<TabItem value="Node.js">
```yaml title=".gitlab-ci.yml" file=./guides/snippets/ci/nodejs/gitlab.yml
```
</TabItem>
<TabItem value="Python">
```yaml title=".gitlab-ci.yml" file=./guides/snippets/ci/python/gitlab.yml
```
</TabItem>
</Tabs>
[Learn more](./guides/145912-ci.mdx)
### CircleCI
The following code listing shows how to integrate Dagger with CircleCI.
<Tabs groupId="language">
<TabItem value="Go">
```yaml title=".circleci/config.yml" file=./guides/snippets/ci/go/circle.yml
```
</TabItem>
<TabItem value="Node.js">
```yaml title=".circleci/config.yml" file=./guides/snippets/ci/nodejs/circle.yml
```
</TabItem>
<TabItem value="Python">
```yaml title=".circleci/config.yml" file=./guides/snippets/ci/python/circle.yml
```
</TabItem>
</Tabs>
[Learn more](./guides/145912-ci.mdx)
### Jenkins
The following code listing shows how to integrate Dagger with Jenkins.
<Tabs groupId="language">
<TabItem value="Go">
```groovy title="Jenkinsfile" file=./guides/snippets/ci/go/Jenkinsfile
```
</TabItem>
<TabItem value="Node.js">
```groovy title="Jenkinsfile" file=./guides/snippets/ci/nodejs/Jenkinsfile
```
</TabItem>
<TabItem value="Python">
```groovy title="Jenkinsfile" file=./guides/snippets/ci/python/Jenkinsfile
```
</TabItem>
</Tabs>
Requires `docker` client and `go` installed on your Jenkins agent, a Docker host available (can be `docker:dind`), and agents labeled in Jenkins with `dagger`.
[Learn more](./guides/145912-ci.mdx)
### Azure Pipelines
The following code listing shows how to integrate Dagger with Azure Pipelines.
<Tabs groupId="language">
<TabItem value="Go">
```yaml title="azure-pipelines.yml" file=./guides/snippets/ci/go/azure-pipelines.yml
```
</TabItem>
<TabItem value="Node.js">
```yaml title="azure-pipelines.yml" file=./guides/snippets/ci/nodejs/azure-pipelines.yml
```
</TabItem>
<TabItem value="Python">
```yaml title="azure-pipelines.yml" file=./guides/snippets/ci/python/azure-pipelines.yml
```
</TabItem>
</Tabs>
[Learn more](./guides/145912-ci.mdx)
### AWS CodePipeline
The following code listing shows how to integrate Dagger with AWS CodePipeline.
<Tabs groupId="language">
<TabItem value="Go">
```yaml title="buildspec.yml" file=./guides/snippets/ci/go/buildspec.yml
```
</TabItem>
<TabItem value="Node.js">
```yaml title="buildspec.yml" file=./guides/snippets/ci/nodejs/buildspec.yml
```
</TabItem>
<TabItem value="Python">
```yaml title="buildspec.yml" file=./guides/snippets/ci/python/buildspec.yml
```
</TabItem>
</Tabs>
[Learn more](./guides/145912-ci.mdx)
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,368 | Document that changing secrets doesn't invalidate the cache | ### What is the issue?
This is coming from a Discord question here: https://discord.com/channels/707636530424053791/1193141267903815700
Our official secrets docs (https://docs.dagger.io/723462/use-secrets/) do not mention anything about the fact that changing secrets doesn't invalidate the cache. I think it's important to highlight this property so users are aware of this.
| https://github.com/dagger/dagger/issues/6368 | https://github.com/dagger/dagger/pull/6472 | 71e6723bb75ebf1611d2fa7af39763119350bb1b | cd38b2f3bb2a6914705b0d7549d3fe0610cf7fd8 | "2024-01-06T15:26:48Z" | go | "2024-01-23T15:49:53Z" | docs/current_docs/guides/723462-use-secrets.mdx | ---
slug: /723462/use-secrets
displayed_sidebar: "current"
category: "guides"
tags: ["go", "python", "nodejs"]
authors: ["Vikram Vaswani"]
date: "2023-03-28"
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
# Use Secrets in Dagger
## Introduction
Dagger allows you to utilize confidential information, such as passwords, API keys, SSH keys and so on, when running your Dagger pipelines, without exposing those secrets in plaintext logs, writing them into the filesystem of containers you're building, or inserting them into cache.
This tutorial teaches you the basics of using secrets in Dagger.
## Requirements
This tutorial assumes that:
- You have a Go, Python or Node.js development environment. If not, install [Go](https://go.dev/doc/install), [Python](https://www.python.org/downloads/) or [Node.js](https://nodejs.org/en/download/).
- You have a Dagger SDK installed for one of the above languages. If not, follow the installation instructions for the Dagger [Go](../sdk/go/371491-install.mdx), [Python](../sdk/python/866944-install.mdx) or [Node.js](../sdk/nodejs/835948-install.mdx) SDK.
- You have Docker installed and running on the host system. If not, [install Docker](https://docs.docker.com/engine/install/).
## Create and use a secret
The Dagger API provides the following queries and fields for working with secrets:
- The `setSecret` query creates a new secret from a plaintext value.
- A `Container`'s `withMountedSecret()` field returns the container with the secret mounted at the named filesystem path.
- A `Container`'s `withSecretVariable()` field returns the container with the secret stored in the named container environment variable.
Once a secret is loaded into Dagger, it can be used in a Dagger pipeline as either a variable or a mounted file. Some Dagger SDK methods additionally accept secrets as native objects.
Let's start with a simple example of setting a secret in a Dagger pipeline and using it in a container.
The following code listing creates a Dagger secret for a GitHub personal access token and then uses the token to authorize a request to the GitHub API. To use this listing, replace the `TOKEN` placeholder with your personal GitHub access token.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./snippets/use-secrets/raw/main.go
```
In this code listing:
- The client's `SetSecret()` method accepts two parameters - a unique name for the secret, and the secret value - and returns a new `Secret` object
- The `WithSecretVariable()` method also accepts two parameters - an environment variable name and a `Secret` object. It returns a container with the secret value assigned to the specified environment variable.
- The environment variable can then be used in subsequent container operations - for example, in a command-line `curl` request, as shown above.
</TabItem>
<TabItem value="Node.js">
```javascript file=./snippets/use-secrets/raw/index.mjs
```
In this code listing:
- The client's `setSecret()` method accepts two parameters - a unique name for the secret, and the secret value - and returns a new `Secret` object
- The `withSecretVariable()` method also accepts two parameters - an environment variable name and a `Secret` object. It returns a container with the secret value assigned to the specified environment variable.
- The environment variable can then be used in subsequent container operations - for example, in a command-line `curl` request, as shown above.
</TabItem>
<TabItem value="Python">
```python file=./snippets/use-secrets/raw/main.py
```
In this code listing:
- The client's `set_secret()` method accepts two parameters - a unique name for the secret, and the secret value - and returns a new `Secret` object
- The `with_secret_variable()` method also accepts two parameters - an environment variable name and a `Secret` object. It returns a container with the secret value assigned to the specified environment variable.
- The environment variable can then be used in subsequent container operations - for example, in a command-line `curl` request, as shown above.
</TabItem>
</Tabs>
## Use secrets from the host environment
Most of the time, it's neither practical nor secure to define plaintext secrets directly in your pipeline. That's why Dagger lets you read secrets from the host, either from host environment variables or from the host filesystem, or from external providers.
Here's a revision of the previous example, where the secret is read from a host environment variable. To use this listing, create a host environment variable named `GH_SECRET` and assign it the value of your GitHub personal access token.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./snippets/use-secrets/host-env/main.go
```
This code listing assumes the existence of a host environment variable named `GH_SECRET` containing the secret value. It performs the following operations:
- It reads the value of the host environment variable using the `os.Getenv()` function.
- It creates a Dagger secret with that value using the `SetSecret()` method.
- It uses the `WithSecretVariable()` method to return a container with the secret value assigned to an environment variable in the container.
- It uses the secret in subsequent container operations, as explained previously.
</TabItem>
<TabItem value="Node.js">
```javascript file=./snippets/use-secrets/host-env/index.mjs
```
This code listing assumes the existence of a host environment variable named `GH_SECRET` containing the secret value. It performs the following operations:
- It reads the value of the host environment variable using the `process.env` object.
- It creates a Dagger secret with that value using the `setSecret()` method.
- It uses the `withSecretVariable()` method to return a container with the secret value assigned to an environment variable in the container.
- The environment variable can then be used in subsequent container operations, as explained previously.
</TabItem>
<TabItem value="Python">
```python file=./snippets/use-secrets/host-env/main.py
```
This code listing assumes the existence of a host environment variable named `GH_SECRET` containing the secret value. It performs the following operations:
- It reads the value of the host environment variable using the `os.environ` object.
- It creates a Dagger secret with that value using the `set_secret()` method.
- It uses the `with_secret_variable()` method to return a container with the secret value assigned to an environment variable in the container.
- The environment variable can then be used in subsequent container operations, as explained previously.
</TabItem>
</Tabs>
## Use secrets from the host filesystem
Dagger also lets you mount secrets as files within a container's filesystem. This is useful for tools that look for secrets in a specific filesystem location - for example, GPG keyrings, SSH keys or file-based authentication tokens.
As an example, consider the [GitHub CLI](https://cli.github.com/), which reads its authentication token from a file stored in the user's home directory at `~/.config/gh/hosts.yml`. The following code listing demonstrates how to mount this file at a specific location in a container as a secret, so that the GitHub CLI is able to find it.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./snippets/use-secrets/host-fs/main.go
```
This code listing assumes the existence of a GitHub CLI configuration file containing an authentication token at `/home/USER/.config/gh/hosts.yml`. It performs the following operations:
- It reads the host file's contents into a string and loads the string into a secret with the Dagger client's `SetSecret()` method. This method returns a new `Secret` object.
- It uses the `WithMountedSecret()` method to return a container with the secret mounted as a file at the given location.
- The GitHub CLI reads this file as needed to perform requested operations. For example, executing the `gh auth status` command in the Dagger pipeline after mounting the secret returns a message indicating that the user is logged-in, testifying to the success of the secret mount.
</TabItem>
<TabItem value="Node.js">
```javascript file=./snippets/use-secrets/host-fs/index.mjs
```
This code listing assumes the existence of a GitHub CLI configuration file containing an authentication token at `/home/USER/.config/gh/hosts.yml`. It performs the following operations:
- It reads the host file's contents into a string and loads the string into a secret with the Dagger client's `setSecret()` method. This method returns a new `Secret` object.
- It uses the `withMountedSecret()` method to return a container with the secret mounted as a file at the given location.
- The GitHub CLI reads this file as needed to perform requested operations. For example, executing the `gh auth status` command in the Dagger pipeline after mounting the secret returns a message indicating that the user is logged-in, testifying to the success of the secret mount.
</TabItem>
<TabItem value="Python">
```python file=./snippets/use-secrets/host-fs/main.py
```
This code listing assumes the existence of a GitHub CLI configuration file containing an authentication token at `/home/USER/.config/gh/hosts.yml`. It performs the following operations:
- It reads the host file's contents into a string and loads the string into a secret with the Dagger client's `set_secret()` method. This method returns a new `Secret` object.
- It uses the `with_mounted_secret()` method to return a container with the secret mounted as a file at the given location.
- The GitHub CLI reads this file as needed to perform requested operations. For example, executing the `gh auth status` command in the Dagger pipeline after mounting the secret returns a message indicating that the user is logged-in, testifying to the success of the secret mount.
</TabItem>
</Tabs>
## Use secrets from an external secret manager
It's also possible to read secrets into Dagger from external secret managers. The following code listing provides an example of using a secret from Google Cloud Secret Manager in a Dagger pipeline.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./snippets/use-secrets/external/main.go
```
This code listing requires the user to replace the `PROJECT-ID` and `SECRET-ID` placeholders with corresponding Google Cloud project and secret identifiers. It performs the following operations:
- It imports the Dagger and Google Cloud Secret Manager client libraries.
- It uses the Google Cloud Secret Manager client to access and read the specified secret's payload.
- It creates a Dagger secret with that payload using the `SetSecret()` method.
- It uses the `WithSecretVariable()` method to return a container with the secret value assigned to an environment variable in the container.
- It uses the secret to make an authenticated request to the GitHub API, as explained previously.
</TabItem>
<TabItem value="Node.js">
```javascript file=./snippets/use-secrets/external/index.mjs
```
This code listing requires the user to replace the `PROJECT-ID` and `SECRET-ID` placeholders with corresponding Google Cloud project and secret identifiers. It performs the following operations:
- It imports the Dagger and Google Cloud Secret Manager client libraries.
- It uses the Google Cloud Secret Manager client to access and read the specified secret's payload.
- It creates a Dagger secret with that payload using the `setSecret()` method.
- It uses the `withSecretVariable()` method to return a container with the secret value assigned to an environment variable in the container.
- It uses the secret to make an authenticated request to the GitHub API, as explained previously.
</TabItem>
<TabItem value="Python">
```python file=./snippets/use-secrets/external/main.py
```
This code listing requires the user to replace the `PROJECT-ID` and `SECRET-ID` placeholders with corresponding Google Cloud project and secret identifiers. It performs the following operations:
- It imports the Dagger and Google Cloud Secret Manager client libraries.
- It uses the Google Cloud Secret Manager client to access and read the specified secret's payload.
- It creates a Dagger secret with that payload using the `set_secret()` method.
- It uses the `with_secret_variable()` method to return a container with the secret value assigned to an environment variable in the container.
- It uses the secret to make an authenticated request to the GitHub API, as explained previously.
</TabItem>
</Tabs>
## Use secrets with Dagger SDK methods
Secrets can also be used natively as inputs to some Dagger SDK methods. Here's an example, which demonstrates logging in to Docker Hub from a Dagger pipeline and publishing a new image. To use this listing, replace the `DOCKER-HUB-USERNAME` and `DOCKER-HUB-PASSWORD` placeholders with your Docker Hub username and password respectively.
<Tabs groupId="language">
<TabItem value="Go">
```go file=./snippets/use-secrets/sdk/main.go
```
In this code listing:
- The client's `SetSecret()` method returns a new `Secret` representing the Docker Hub password.
- The `WithRegistryAuth()` method accepts three parameters - the Docker Hub registry address, the username and the password (as a `Secret`) - and returns a container pre-authenticated for the registry.
- The `Publish()` method publishes the container to Docker Hub.
</TabItem>
<TabItem value="Node.js">
```javascript file=./snippets/use-secrets/sdk/index.mjs
```
In this code listing:
- The client's `setSecret()` method returns a new `Secret` representing the Docker Hub password.
- The `withRegistryAuth()` method accepts three parameters - the Docker Hub registry address, the username and the password (as a `Secret`) - and returns a container pre-authenticated for the registry.
- The `publish()` method publishes the container to Docker Hub.
</TabItem>
<TabItem value="Python">
```python file=./snippets/use-secrets/sdk/main.py
```
In this code listing:
- The client's `set_secret()` method returns a new `Secret` representing the Docker Hub password.
- The `with_registry_auth()` method accepts three parameters - the Docker Hub registry address, the username and the password (as a `Secret`) - and returns a container pre-authenticated for the registry.
- The `publish()` method publishes the container to Docker Hub.
</TabItem>
</Tabs>
## Use secrets with Dockerfile builds
Secrets can also be passed to Dockerfile builds performed with Dagger. Build secrets set with Dagger are automatically mounted in the build container at the default Dockerfile location of `/run/secrets/SECRET-ID`.
Here's an example, which demonstrates setting a build secret in a Dagger pipeline and using that secret in a Dockerfile build:
<Tabs groupId="language">
<TabItem value="Go">
```go file=./snippets/use-secrets/dockerfile/main.go
```
This code listing expects a host environment variable named `GH_SECRET` containing the secret value. It performs the following operations:
- It reads the value of the host environment variable using the `os.Getenv()` function.
- It creates a Dagger secret named `gh-secret` with that value using the `SetSecret()` function.
- It uses the `DockerBuild()` function to build an image from a Dockerfile. The secret is automatically mounted in the build container at `/run/secrets/gh-secret`.
</TabItem>
<TabItem value="Node.js">
```javascript file=./snippets/use-secrets/dockerfile/index.mjs
```
This code listing expects a host environment variable named `GH_SECRET` containing the secret value. It performs the following operations:
- It reads the value of the host environment variable using the `process.env` object.
- It creates a Dagger secret named `gh-secret` with that value using the `setSecret()` function.
- It uses the `dockerBuild()` function to build an image from a Dockerfile. The secret is automatically mounted in the build container at `/run/secrets/gh-secret`.
</TabItem>
<TabItem value="Python">
```python file=./snippets/use-secrets/dockerfile/main.py
```
This code listing expects a host environment variable named `GH_SECRET` containing the secret value. It performs the following operations:
- It reads the value of the host environment variable using the `os.environ` object.
- It creates a Dagger secret named `gh-secret` with that value using the `set_secret()` function.
- It uses the `docker_build()` function to build an image from a Dockerfile. The secret is automatically mounted in the build container at `/run/secrets/gh-secret`.
</TabItem>
</Tabs>
The sample Dockerfile below demonstrates the process of mounting the secret using a [`secret` filesystem mount type](https://docs.docker.com/engine/reference/builder/#run---mounttypesecret) and using it in the Dockerfile build process:
```dockerfile file=./snippets/use-secrets/dockerfile/Dockerfile
```
## Understand how Dagger secures secrets
Dagger automatically scrubs secrets from its various logs and output streams. This ensures that sensitive data does not leak - for example, in the event of a crash. This applies to secrets stored in both environment variables and file mounts.
The following example demonstrates this feature:
<Tabs groupId="language">
<TabItem value="Go">
```go file=./snippets/use-secrets/security/main.go
```
</TabItem>
<TabItem value="Node.js">
```javascript file=./snippets/use-secrets/security/index.mjs
```
</TabItem>
<TabItem value="Python">
```python file=./snippets/use-secrets/security/main.py
```
</TabItem>
</Tabs>
This listing creates dummy secrets on the host (as an environment variable and a file), loads them into Dagger and then attempts to print them to the console. However, Dagger automatically scrubs the sensitive data before printing it, as shown in the output below:
```shell
secret env data: *** || secret file data:
***
```
:::danger
Any secret that is to be read from the container environment should always be loaded using `withSecretVariable()`. If `withEnvVariable()` is used instead, the value of the environment variable may leak via the build history of the container. Using `withSecretVariable()` guarantees that the secret will not leak in the container build history or image layers.
:::
## Conclusion
This tutorial walked you through the basics of using secrets in Dagger. It explained the various API methods available to work with secrets and provided examples of using secrets as environment variables, file mounts and native objects.
Use the [API Key Concepts](../api/975146-concepts.mdx) page and the [Go](https://pkg.go.dev/dagger.io/dagger), [Node.js](../sdk/nodejs/reference/modules.md) and [Python](https://dagger-io.readthedocs.org/) SDK References to learn more about Dagger.
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,368 | Document that changing secrets doesn't invalidate the cache | ### What is the issue?
This is coming from a Discord question here: https://discord.com/channels/707636530424053791/1193141267903815700
Our official secrets docs (https://docs.dagger.io/723462/use-secrets/) do not mention anything about the fact that changing secrets doesn't invalidate the cache. I think it's important to highlight this property so users are aware of this.
| https://github.com/dagger/dagger/issues/6368 | https://github.com/dagger/dagger/pull/6472 | 71e6723bb75ebf1611d2fa7af39763119350bb1b | cd38b2f3bb2a6914705b0d7549d3fe0610cf7fd8 | "2024-01-06T15:26:48Z" | go | "2024-01-23T15:49:53Z" | docs/current_docs/quickstart/635927-caching.mdx | ---
slug: /quickstart/635927/caching
displayed_sidebar: "quickstart"
hide_table_of_contents: true
title: "Use caching"
---
# Quickstart
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import QuickstartDoc from "@site/src/components/quickstartDoc.js"
import Embed from "@site/src/components/embed.js"
export const ids = {
Go: "1J5Fs4NoQcW",
"Node.js": "HjFX8td15TX",
Python: "TCdOYrKMfV_d"
}
<QuickstartDoc embeds={ids}>
## Use caching
One of Dagger's most powerful features is its ability to cache data across pipeline runs. This is typically most useful when dealing with package managers such as `npm`, `maven`, `pip` and similar. For these tools to cache properly, they need their own cache data (usually a directory) to be persisted between runs.
Dagger lets you define one or more such directories as cache volumes and persist their contents across runs. This enables you to reuse the contents of the cache volume(s) every time the pipeline runs, and thereby speed up pipeline operations.
:::note
Cache volumes are not meant to be shared outside of Dagger; they are for persisting specific parts of the internal state of your pipeline, for optimal use of your tool's native caching features.
:::
You may have noticed that the example pipeline executes the `npm install` command to download the application's dependencies every time the pipeline runs. Since these dependencies are usually locked to specific versions in the application's manifest, re-downloading them on every pipeline run is inefficient and time-consuming.
This step is, therefore, a good candidate for a cache volume. Let's update the pipeline accordingly.
:::tip
The `npm install` command is appropriate for a React application, but other applications are likely to use different commands. Modify your Dagger pipeline accordingly.
:::
<Tabs groupId="language" className="embeds">
<TabItem value="Go">
<Embed id="1J5Fs4NoQcW" />
This revised pipeline now uses a cache volume for the application dependencies.
- It uses the client's `CacheVolume()` method to initialize a new cache volume.
- It uses the `Container.WithMountedCache()` method to mount this cache volume at the `node_modules/` mount point in the container.
- It uses the `Container.WithExec()` method to define the `npm install` command. When executed, this command downloads and installs dependencies in the `node_modules/` directory. Since this directory is defined as a cache volume, its contents will persist even after the pipeline terminates and can be reused on the next pipeline run.
Run the pipeline by executing the command below from the application directory:
```shell
dagger run go run ci/main.go
```
</TabItem>
<TabItem value="Node.js">
<Embed id="HjFX8td15TX" />
This revised pipeline now uses a cache volume for the application dependencies.
- It uses the client's `cacheVolume()` method to initialize a new cache volume.
- It uses the `Container.withMountedCache()` method to mount this cache volume at the `node_modules/` mount point in the container.
- It uses the `Container.withExec()` method to define the `npm install` command. When executed, this command downloads and installs dependencies in the `node_modules/` directory. Since this directory is defined as a cache volume, its contents will persist even after the pipeline terminates and can be reused on the next pipeline run.
Run the pipeline by executing the command below from the application directory:
```shell
dagger run node ci/index.mjs
```
</TabItem>
<TabItem value="Python">
<Embed id="TCdOYrKMfV_d" />
This revised pipeline now uses a cache volume for the application dependencies.
- It uses the client's `cache_volume()` method to initialize a new cache volume.
- It uses the `Container.with_mounted_cache()` method to mount this cache volume at the `node_modules/` mount point in the container.
- It uses the `Container.with_exec()` method to define the `npm install` command. When executed, this command downloads and installs dependencies in the `node_modules/` directory. Since this directory is defined as a cache volume, its contents will persist even after the pipeline terminates and can be reused on the next pipeline run.
Run the pipeline by executing the command below from the application directory:
```shell
dagger run python ci/main.py
```
</TabItem>
</Tabs>
This revised pipeline produces the same result as before.
Run the pipeline a few times. Notice that on the first run, the application dependencies are downloaded as usual. However, since the dependencies are cached, subsequent pipeline runs will skip the download operation and be significantly faster (assuming that there are no other changes to the application code).
:::note
In addition to cache volumes, Dagger has a separate cache for pipeline operations. Changes in cache volumes do not invalidate the Dagger pipeline operations cache.
:::
</QuickstartDoc>
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,374 | Update buildkit past ca71a44 | Currently, we are stuck on the current version of buildkit, since https://github.com/moby/buildkit/pull/4347#issuecomment-1872217571 seems to have introduced a deadlock.
To reproduce: update buildkit in `go.mod` to `ca71a446d9f4e31ca7c4fa30fb8fb8861b8b0117`, and run a large number of integration tests. The engine will lock up after some time - after sending `SIGUIT` to the engine, you can observe the stack trace:
```
goroutine 441 [sync.Mutex.Lock, 4 minutes]:
runtime.gopark(0xc01d5ebbf0?, 0xc00aef48e1?, 0xc0?, 0xf?, 0xc017641870?)
/usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc017641790 sp=0xc017641770 pc=0x43e42e
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:404
runtime.semacquire1(0xc01d77eb74, 0x0?, 0x3, 0x1, 0x21?)
/usr/local/go/src/runtime/sema.go:160 +0x218 fp=0xc0176417f8 sp=0xc017641790 pc=0x44f918
sync.runtime_SemacquireMutex(0xffffffffffffffff?, 0x0?, 0xc00ed7c4b0?)
/usr/local/go/src/runtime/sema.go:77 +0x25 fp=0xc017641830 sp=0xc0176417f8 pc=0x46d545
sync.(*Mutex).lockSlow(0xc01d77eb70)
/usr/local/go/src/sync/mutex.go:171 +0x15d fp=0xc017641880 sp=0xc017641830 pc=0x488f1d
sync.(*Mutex).Lock(...)
/usr/local/go/src/sync/mutex.go:90
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01d77eb70, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:91 +0x5c fp=0xc017641960 sp=0xc017641880 pc=0xcb537c
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01d77eb70?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641a28 sp=0xc017641960 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01dfe5da0, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:95 +0x17e fp=0xc017641b08 sp=0xc017641a28 pc=0xcb549e
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01dfe5da0?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641bd0 sp=0xc017641b08 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).Add(0xc01d77eb70, {0x1f7e8b0?, 0xc01dfe5da0?})
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:46 +0x190 fp=0xc017641c60 sp=0xc017641bd0 pc=0xcb4d70
github.com/moby/buildkit/solver.(*state).setEdge(0xc01dfe3440, 0x2, 0xc003975a40, 0xc0165fcb40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:178 +0x370 fp=0xc017641ce8 sp=0xc017641c60 pc=0xdef3f0
github.com/moby/buildkit/solver.(*Solver).setEdge(0xc0007071a0, {0xc003975a40?, {0x1f92360?, 0xc004bd6480?}}, 0xc003975a40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:295 +0x125 fp=0xc017641d58 sp=0xc017641ce8 pc=0xdf0265
github.com/moby/buildkit/solver.(*scheduler).dispatch(0xc0002fc770, 0xc01356a140)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:177 +0xbdb fp=0xc017641f68 sp=0xc017641d58 pc=0xdfe87b
github.com/moby/buildkit/solver.(*scheduler).loop(0xc0002fc770)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:104 +0x1d4 fp=0xc017641fc8 sp=0xc017641f68 pc=0xdfdb34
github.com/moby/buildkit/solver.newScheduler.func1()
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x25 fp=0xc017641fe0 sp=0xc017641fc8 pc=0xdfd865
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc017641fe8 sp=0xc017641fe0 pc=0x4715e1
created by github.com/moby/buildkit/solver.newScheduler in goroutine 1
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x22d
```
See https://github.com/dagger/dagger/pull/6169 for more information on when this was originally discovered.
Next steps:
- Wait until upstream PRs are merged :tada: | https://github.com/dagger/dagger/issues/6374 | https://github.com/dagger/dagger/pull/6481 | 2aefe558d80c355fb6868145e79763ef73c0e6b9 | faaa0d18ec2f8f4ddb425298e672c079869017e7 | "2024-01-08T18:47:15Z" | go | "2024-01-24T17:07:57Z" | cmd/engine/main.go | package main
import (
"context"
"crypto/tls"
"crypto/x509"
goerrors "errors"
"fmt"
"log/slog"
"net"
"os"
"os/user"
"path/filepath"
"sort"
"strconv"
"strings"
"time"
"github.com/containerd/containerd/pkg/seed" //nolint:staticcheck // SA1019 deprecated
"github.com/containerd/containerd/pkg/userns"
"github.com/containerd/containerd/platforms"
"github.com/containerd/containerd/remotes/docker"
"github.com/containerd/containerd/sys"
sddaemon "github.com/coreos/go-systemd/v22/daemon"
"github.com/dagger/dagger/engine/cache"
"github.com/dagger/dagger/engine/server"
"github.com/dagger/dagger/network"
"github.com/dagger/dagger/network/netinst"
"github.com/docker/docker/pkg/reexec"
"github.com/gofrs/flock"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
"github.com/moby/buildkit/cache/remotecache"
"github.com/moby/buildkit/cache/remotecache/azblob"
"github.com/moby/buildkit/cache/remotecache/gha"
inlineremotecache "github.com/moby/buildkit/cache/remotecache/inline"
localremotecache "github.com/moby/buildkit/cache/remotecache/local"
registryremotecache "github.com/moby/buildkit/cache/remotecache/registry"
s3remotecache "github.com/moby/buildkit/cache/remotecache/s3"
"github.com/moby/buildkit/client"
"github.com/moby/buildkit/cmd/buildkitd/config"
"github.com/moby/buildkit/executor/oci"
"github.com/moby/buildkit/frontend"
dockerfile "github.com/moby/buildkit/frontend/dockerfile/builder"
"github.com/moby/buildkit/frontend/gateway"
"github.com/moby/buildkit/frontend/gateway/forwarder"
"github.com/moby/buildkit/session"
"github.com/moby/buildkit/solver"
"github.com/moby/buildkit/solver/bboltcachestorage"
"github.com/moby/buildkit/solver/llbsolver/mounts"
"github.com/moby/buildkit/util/apicaps"
"github.com/moby/buildkit/util/appcontext"
"github.com/moby/buildkit/util/appdefaults"
"github.com/moby/buildkit/util/archutil"
"github.com/moby/buildkit/util/bklog"
"github.com/moby/buildkit/util/grpcerrors"
"github.com/moby/buildkit/util/profiler"
"github.com/moby/buildkit/util/resolver"
"github.com/moby/buildkit/util/stack"
"github.com/moby/buildkit/util/tracing/detect"
_ "github.com/moby/buildkit/util/tracing/detect/jaeger"
_ "github.com/moby/buildkit/util/tracing/env"
"github.com/moby/buildkit/util/tracing/transform"
"github.com/moby/buildkit/version"
"github.com/moby/buildkit/worker"
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
sloglogrus "github.com/samber/slog-logrus/v2"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"go.opentelemetry.io/otel/propagation"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"go.opentelemetry.io/otel/trace"
tracev1 "go.opentelemetry.io/proto/otlp/collector/trace/v1"
"golang.org/x/sync/errgroup"
"google.golang.org/grpc"
)
const (
autoMode = "auto"
daggerCacheServiceURL = "https://api.dagger.cloud/magicache"
)
func init() {
apicaps.ExportedProduct = "buildkit"
stack.SetVersionInfo(version.Version, version.Revision)
//nolint:staticcheck // SA1019 deprecated
seed.WithTimeAndRand()
if reexec.Init() {
os.Exit(0)
}
// enable in memory recording for buildkitd traces
detect.Recorder = detect.NewTraceRecorder()
}
var propagators = propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})
type workerInitializerOpt struct {
config *config.Config
sessionManager *session.Manager
traceSocket string
}
type workerInitializer struct {
fn func(c *cli.Context, common workerInitializerOpt) ([]worker.Worker, error)
// less priority number, more preferred
priority int
}
var (
appFlags []cli.Flag
workerInitializers []workerInitializer
)
func registerWorkerInitializer(wi workerInitializer, flags ...cli.Flag) {
workerInitializers = append(workerInitializers, wi)
sort.Slice(workerInitializers,
func(i, j int) bool {
return workerInitializers[i].priority < workerInitializers[j].priority
})
appFlags = append(appFlags, flags...)
}
func main() { //nolint:gocyclo
cli.VersionPrinter = func(c *cli.Context) {
fmt.Println(c.App.Name, version.Package, c.App.Version, version.Revision)
}
app := cli.NewApp()
app.Name = "buildkitd"
app.Usage = "build daemon"
app.Version = version.Version
defaultConf, err := defaultConf()
if err != nil {
fmt.Fprintf(os.Stderr, "%+v\n", err)
os.Exit(1)
}
rootlessUsage := "set all the default options to be compatible with rootless containers"
if userns.RunningInUserNS() {
app.Flags = append(app.Flags, cli.BoolTFlag{
Name: "rootless",
Usage: rootlessUsage + " (default: true)",
})
} else {
app.Flags = append(app.Flags, cli.BoolFlag{
Name: "rootless",
Usage: rootlessUsage,
})
}
groupValue := func(gid *int) string {
if gid == nil {
return ""
}
return strconv.Itoa(*gid)
}
app.Flags = append(app.Flags,
cli.StringFlag{
Name: "config",
Usage: "path to config file",
Value: defaultConfigPath(),
},
cli.BoolFlag{
Name: "debug",
Usage: "enable debug output in logs",
},
cli.BoolFlag{
Name: "trace",
Usage: "enable trace output in logs (highly verbose, could affect performance)",
},
cli.StringFlag{
Name: "root",
Usage: "path to state directory",
Value: defaultConf.Root,
},
cli.StringSliceFlag{
Name: "addr",
Usage: "listening address (socket or tcp)",
Value: &cli.StringSlice{defaultConf.GRPC.Address[0]},
},
cli.StringFlag{
Name: "group",
Usage: "group (name or gid) which will own all Unix socket listening addresses",
Value: groupValue(defaultConf.GRPC.GID),
},
cli.StringFlag{
Name: "debugaddr",
Usage: "debugging address (eg. 0.0.0.0:6060)",
Value: defaultConf.GRPC.DebugAddress,
},
cli.StringFlag{
Name: "tlscert",
Usage: "certificate file to use",
Value: defaultConf.GRPC.TLS.Cert,
},
cli.StringFlag{
Name: "tlskey",
Usage: "key file to use",
Value: defaultConf.GRPC.TLS.Key,
},
cli.StringFlag{
Name: "tlscacert",
Usage: "ca certificate to verify clients",
Value: defaultConf.GRPC.TLS.CA,
},
cli.StringSliceFlag{
Name: "allow-insecure-entitlement",
Usage: "allows insecure entitlements e.g. network.host, security.insecure",
},
cli.StringFlag{
Name: "network-name",
Usage: "short name for the engine's container network; used for interface name",
Value: network.DefaultName,
},
cli.StringFlag{
Name: "network-cidr",
Usage: "address range to use for networked containers",
Value: network.DefaultCIDR,
},
)
app.Flags = append(app.Flags, appFlags...)
app.Action = func(c *cli.Context) error {
// TODO: On Windows this always returns -1. The actual "are you admin" check is very Windows-specific.
// See https://github.com/golang/go/issues/28804#issuecomment-505326268 for the "short" version.
if os.Geteuid() > 0 {
return errors.New("rootless mode requires to be executed as the mapped root in a user namespace; you may use RootlessKit for setting up the namespace")
}
ctx, cancel := context.WithCancel(appcontext.Context())
defer cancel()
bklog.G(ctx).Debug("loading engine config file")
cfg, err := config.LoadFile(c.GlobalString("config"))
if err != nil {
return err
}
bklog.G(ctx).Debug("setting up engine networking")
networkContext, cancelNetworking := context.WithCancel(context.Background())
defer cancelNetworking()
netConf, err := setupNetwork(networkContext,
c.GlobalString("network-name"),
c.GlobalString("network-cidr"),
)
if err != nil {
return err
}
bklog.G(ctx).Debug("setting engine configs from defaults and flags")
if err := setDaggerDefaults(&cfg, netConf); err != nil {
return err
}
setDefaultConfig(&cfg)
if err := applyMainFlags(c, &cfg); err != nil {
return err
}
logrus.SetFormatter(&logrus.TextFormatter{FullTimestamp: true})
// Wire slog up to send to Logrus so engine logs using slog also get sent
// to Cloud
slogOpts := sloglogrus.Option{
AddSource: true,
}
if cfg.Debug {
slogOpts.Level = slog.LevelDebug
logrus.SetLevel(logrus.DebugLevel)
}
if cfg.Trace {
logrus.SetLevel(logrus.TraceLevel)
}
slog.SetDefault(slog.New(slogOpts.NewLogrusHandler()))
if cfg.GRPC.DebugAddress != "" {
if err := setupDebugHandlers(cfg.GRPC.DebugAddress); err != nil {
return err
}
}
bklog.G(ctx).Debug("setting up engine tracing")
tp, err := detect.TracerProvider()
if err != nil {
// just log it, this can happen when there's mismatching versions of otel libraries in your
// module dependency DAG...
bklog.G(ctx).WithError(err).Error("failed to create tracer provider")
}
// FIXME: continuing to use the deprecated interceptor until/unless there's a replacement that works w/ grpc_middleware
//nolint:staticcheck // SA1019 deprecated
streamTracer := otelgrpc.StreamServerInterceptor(otelgrpc.WithTracerProvider(tp), otelgrpc.WithPropagators(propagators))
// NOTE: using context.Background because otherwise when the outer context is cancelled the server
// stops working. Server shutdown based on context cancellation is handled later in this func.
unary := grpc_middleware.ChainUnaryServer(unaryInterceptor(context.Background(), tp), grpcerrors.UnaryServerInterceptor)
stream := grpc_middleware.ChainStreamServer(streamTracer, grpcerrors.StreamServerInterceptor)
bklog.G(ctx).Debug("creating engine GRPC server")
grpcOpts := []grpc.ServerOption{grpc.UnaryInterceptor(unary), grpc.StreamInterceptor(stream)}
server := grpc.NewServer(grpcOpts...)
// relative path does not work with nightlyone/lockfile
root, err := filepath.Abs(cfg.Root)
if err != nil {
return err
}
cfg.Root = root
if err := os.MkdirAll(root, 0o700); err != nil {
return errors.Wrapf(err, "failed to create %s", root)
}
bklog.G(ctx).Debug("creating engine lockfile")
lockPath := filepath.Join(root, "buildkitd.lock")
lock := flock.New(lockPath)
locked, err := lock.TryLock()
if err != nil {
return errors.Wrapf(err, "could not lock %s", lockPath)
}
if !locked {
return errors.Errorf("could not lock %s, another instance running?", lockPath)
}
defer func() {
lock.Unlock()
os.RemoveAll(lockPath)
}()
bklog.G(ctx).Debug("creating engine controller")
controller, cacheManager, err := newController(ctx, c, &cfg)
if err != nil {
return err
}
defer controller.Close()
controller.Register(server)
go logMetrics(context.Background(), cfg.Root, controller)
if cfg.Trace {
go logTraceMetrics(context.Background())
}
ents := c.GlobalStringSlice("allow-insecure-entitlement")
if len(ents) > 0 {
cfg.Entitlements = []string{}
for _, e := range ents {
switch e {
case "security.insecure":
cfg.Entitlements = append(cfg.Entitlements, e)
case "network.host":
cfg.Entitlements = append(cfg.Entitlements, e)
default:
return errors.Errorf("invalid entitlement : %s", e)
}
}
}
bklog.G(ctx).Debug("starting optional cache mount synchronization")
err = cacheManager.StartCacheMountSynchronization(ctx)
if err != nil {
bklog.G(ctx).WithError(err).Error("failed to start cache mount synchronization")
// continue on, doesn't need to be fatal
}
// start serving on the listeners for actual clients
bklog.G(ctx).Debug("starting main engine grpc listeners")
errCh := make(chan error, 1)
if err := serveGRPC(cfg.GRPC, server, errCh); err != nil {
return err
}
select {
case serverErr := <-errCh:
err = serverErr
cancel()
case <-ctx.Done():
// context should only be cancelled when a signal is received, which
// isn't an error
if ctx.Err() != context.Canceled {
err = ctx.Err()
}
}
// TODO:(sipsma) make timeouts configurable
bklog.G(ctx).Debug("stopping cache manager")
stopCacheCtx, cancelCacheCtx := context.WithTimeout(context.Background(), 600*time.Second)
defer cancelCacheCtx()
stopCacheErr := cacheManager.Close(stopCacheCtx)
if stopCacheErr != nil {
bklog.G(ctx).WithError(stopCacheErr).Error("failed to stop cache")
}
err = goerrors.Join(err, stopCacheErr)
cancelNetworking()
bklog.G(ctx).Infof("stopping server")
if os.Getenv("NOTIFY_SOCKET") != "" {
notified, notifyErr := sddaemon.SdNotify(false, sddaemon.SdNotifyStopping)
bklog.G(ctx).Debugf("SdNotifyStopping notified=%v, err=%v", notified, notifyErr)
}
server.GracefulStop()
return err
}
app.After = func(_ *cli.Context) error {
tel.Close()
return detect.Shutdown(context.TODO())
}
profiler.Attach(app)
if err := app.Run(os.Args); err != nil {
fmt.Fprintf(os.Stderr, "buildkitd: %+v\n", err)
os.Exit(1)
}
}
func serveGRPC(cfg config.GRPCConfig, server *grpc.Server, errCh chan error) error {
addrs := cfg.Address
if len(addrs) == 0 {
return errors.New("--addr cannot be empty")
}
tlsConfig, err := serverCredentials(cfg.TLS)
if err != nil {
return err
}
eg, _ := errgroup.WithContext(context.Background())
listeners := make([]net.Listener, 0, len(addrs))
for _, addr := range addrs {
l, err := getListener(addr, *cfg.UID, *cfg.GID, tlsConfig)
if err != nil {
for _, l := range listeners {
l.Close()
}
return err
}
listeners = append(listeners, l)
}
if os.Getenv("NOTIFY_SOCKET") != "" {
notified, notifyErr := sddaemon.SdNotify(false, sddaemon.SdNotifyReady)
logrus.Debugf("SdNotifyReady notified=%v, err=%v", notified, notifyErr)
}
for _, l := range listeners {
func(l net.Listener) {
eg.Go(func() error {
defer l.Close()
logrus.Infof("running server on %s", l.Addr())
return server.Serve(l)
})
}(l)
}
go func() {
errCh <- eg.Wait()
}()
return nil
}
func defaultConfigPath() string {
if userns.RunningInUserNS() {
return filepath.Join(appdefaults.UserConfigDir(), "buildkitd.toml")
}
return filepath.Join(appdefaults.ConfigDir, "buildkitd.toml")
}
func defaultConf() (config.Config, error) {
cfg, err := config.LoadFile(defaultConfigPath())
if err != nil {
var pe *os.PathError
if !errors.As(err, &pe) {
return config.Config{}, err
}
logrus.Warnf("failed to load default config: %v", err)
}
setDefaultConfig(&cfg)
return cfg, nil
}
func setDefaultNetworkConfig(nc config.NetworkConfig) config.NetworkConfig {
if nc.Mode == "" {
nc.Mode = autoMode
}
if nc.CNIConfigPath == "" {
nc.CNIConfigPath = appdefaults.DefaultCNIConfigPath
}
if nc.CNIBinaryPath == "" {
nc.CNIBinaryPath = appdefaults.DefaultCNIBinDir
}
return nc
}
func setDefaultConfig(cfg *config.Config) {
orig := *cfg
if cfg.Root == "" {
cfg.Root = appdefaults.Root
}
if len(cfg.GRPC.Address) == 0 {
cfg.GRPC.Address = []string{appdefaults.Address}
}
if cfg.Workers.OCI.Platforms == nil {
cfg.Workers.OCI.Platforms = formatPlatforms(archutil.SupportedPlatforms(false))
}
if cfg.Workers.Containerd.Platforms == nil {
cfg.Workers.Containerd.Platforms = formatPlatforms(archutil.SupportedPlatforms(false))
}
cfg.Workers.OCI.NetworkConfig = setDefaultNetworkConfig(cfg.Workers.OCI.NetworkConfig)
cfg.Workers.Containerd.NetworkConfig = setDefaultNetworkConfig(cfg.Workers.Containerd.NetworkConfig)
if userns.RunningInUserNS() {
// if buildkitd is being executed as the mapped-root (not only EUID==0 but also $USER==root)
// in a user namespace, we need to enable the rootless mode but
// we don't want to honor $HOME for setting up default paths.
if u := os.Getenv("USER"); u != "" && u != "root" {
if orig.Root == "" {
cfg.Root = appdefaults.UserRoot()
}
if len(orig.GRPC.Address) == 0 {
cfg.GRPC.Address = []string{appdefaults.UserAddress()}
}
appdefaults.EnsureUserAddressDir()
}
}
}
func applyMainFlags(c *cli.Context, cfg *config.Config) error {
if c.IsSet("debug") {
cfg.Debug = c.Bool("debug")
}
if c.IsSet("trace") {
cfg.Trace = c.Bool("trace")
}
if c.IsSet("root") {
cfg.Root = c.String("root")
}
if c.IsSet("addr") || len(cfg.GRPC.Address) == 0 {
cfg.GRPC.Address = c.StringSlice("addr")
}
if c.IsSet("allow-insecure-entitlement") {
// override values from config
cfg.Entitlements = c.StringSlice("allow-insecure-entitlement")
}
if c.IsSet("debugaddr") {
cfg.GRPC.DebugAddress = c.String("debugaddr")
}
if cfg.GRPC.UID == nil {
uid := os.Getuid()
cfg.GRPC.UID = &uid
}
if cfg.GRPC.GID == nil {
gid := os.Getgid()
cfg.GRPC.GID = &gid
}
if group := c.String("group"); group != "" {
gid, err := grouptoGID(group)
if err != nil {
return err
}
cfg.GRPC.GID = &gid
}
if tlscert := c.String("tlscert"); tlscert != "" {
cfg.GRPC.TLS.Cert = tlscert
}
if tlskey := c.String("tlskey"); tlskey != "" {
cfg.GRPC.TLS.Key = tlskey
}
if tlsca := c.String("tlscacert"); tlsca != "" {
cfg.GRPC.TLS.CA = tlsca
}
return nil
}
// Convert a string containing either a group name or a stringified gid into a numeric id)
func grouptoGID(group string) (int, error) {
if group == "" {
return os.Getgid(), nil
}
var (
err error
id int
)
// Try and parse as a number, if the error is ErrSyntax
// (i.e. its not a number) then we carry on and try it as a
// name.
if id, err = strconv.Atoi(group); err == nil {
return id, nil
} else if err.(*strconv.NumError).Err != strconv.ErrSyntax {
return 0, err
}
ginfo, err := user.LookupGroup(group)
if err != nil {
return 0, err
}
group = ginfo.Gid
if id, err = strconv.Atoi(group); err != nil {
return 0, err
}
return id, nil
}
func getListener(addr string, uid, gid int, tlsConfig *tls.Config) (net.Listener, error) {
addrSlice := strings.SplitN(addr, "://", 2)
if len(addrSlice) < 2 {
return nil, errors.Errorf("address %s does not contain proto, you meant unix://%s ?",
addr, addr)
}
proto := addrSlice[0]
listenAddr := addrSlice[1]
switch proto {
case "unix", "npipe":
if tlsConfig != nil {
logrus.Warnf("TLS is disabled for %s", addr)
}
return sys.GetLocalListener(listenAddr, uid, gid)
case "fd":
return listenFD(listenAddr, tlsConfig)
case "tcp":
l, err := net.Listen("tcp", listenAddr)
if err != nil {
return nil, err
}
if tlsConfig == nil {
logrus.Warnf("TLS is not enabled for %s. enabling mutual TLS authentication is highly recommended", addr)
return l, nil
}
return tls.NewListener(l, tlsConfig), nil
default:
return nil, errors.Errorf("addr %s not supported", addr)
}
}
func unaryInterceptor(globalCtx context.Context, tp trace.TracerProvider) grpc.UnaryServerInterceptor {
// FIXME: continuing to use the deprecated interceptor until/unless there's a replacement that works w/ grpc_middleware
//nolint:staticcheck // SA1019 deprecated
withTrace := otelgrpc.UnaryServerInterceptor(otelgrpc.WithTracerProvider(tp), otelgrpc.WithPropagators(propagators))
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
go func() {
select {
case <-ctx.Done():
case <-globalCtx.Done():
cancel()
}
}()
if strings.HasSuffix(info.FullMethod, "opentelemetry.proto.collector.trace.v1.TraceService/Export") {
return handler(ctx, req)
}
resp, err = withTrace(ctx, req, info, handler)
if err != nil {
logrus.Errorf("%s returned error: %v", info.FullMethod, err)
if logrus.GetLevel() >= logrus.DebugLevel {
fmt.Fprintf(os.Stderr, "%+v", stack.Formatter(grpcerrors.FromGRPC(err)))
}
}
return
}
}
func serverCredentials(cfg config.TLSConfig) (*tls.Config, error) {
certFile := cfg.Cert
keyFile := cfg.Key
caFile := cfg.CA
if certFile == "" && keyFile == "" {
return nil, nil
}
err := errors.New("you must specify key and cert file if one is specified")
if certFile == "" {
return nil, err
}
if keyFile == "" {
return nil, err
}
certificate, err := tls.LoadX509KeyPair(certFile, keyFile)
if err != nil {
return nil, errors.Wrap(err, "could not load server key pair")
}
tlsConf := &tls.Config{
Certificates: []tls.Certificate{certificate},
MinVersion: tls.VersionTLS12,
}
if caFile != "" {
certPool := x509.NewCertPool()
ca, err := os.ReadFile(caFile)
if err != nil {
return nil, errors.Wrap(err, "could not read ca certificate")
}
// Append the client certificates from the CA
if ok := certPool.AppendCertsFromPEM(ca); !ok {
return nil, errors.New("failed to append ca cert")
}
tlsConf.ClientAuth = tls.RequireAndVerifyClientCert
tlsConf.ClientCAs = certPool
}
return tlsConf, nil
}
func newController(ctx context.Context, c *cli.Context, cfg *config.Config) (*server.BuildkitController, cache.Manager, error) {
sessionManager, err := session.NewManager()
if err != nil {
return nil, nil, err
}
tc, err := detect.Exporter()
if err != nil {
// just log it, this can happen when there's mismatching versions of otel libraries in your
// module dependency DAG...
bklog.G(ctx).WithError(err).Error("failed to create tracer exporter")
}
var traceSocket string
if tc != nil {
traceSocket = filepath.Join(cfg.Root, "otel-grpc.sock")
if err := runTraceController(traceSocket, tc); err != nil {
logrus.Warnf("failed set up otel-grpc controller: %v", err)
traceSocket = ""
}
}
wc, err := newWorkerController(c, workerInitializerOpt{
config: cfg,
sessionManager: sessionManager,
traceSocket: traceSocket,
})
if err != nil {
return nil, nil, err
}
w, err := wc.GetDefault()
if err != nil {
return nil, nil, err
}
frontends := map[string]frontend.Frontend{}
frontends["dockerfile.v0"] = forwarder.NewGatewayForwarder(wc, dockerfile.Build)
frontends["gateway.v0"] = gateway.NewGatewayFrontend(wc)
cacheStorage, err := bboltcachestorage.NewStore(filepath.Join(cfg.Root, "cache.db"))
if err != nil {
return nil, nil, err
}
cacheServiceURL := os.Getenv("_EXPERIMENTAL_DAGGER_CACHESERVICE_URL")
cacheServiceToken := os.Getenv("_EXPERIMENTAL_DAGGER_CACHESERVICE_TOKEN")
// add DAGGER_CLOUD_TOKEN in a backwards compat way.
// TODO: deprecate in a future release
if v, ok := os.LookupEnv("DAGGER_CLOUD_TOKEN"); ok {
cacheServiceToken = v
}
if cacheServiceURL == "" {
cacheServiceURL = daggerCacheServiceURL
}
cacheManager, err := cache.NewManager(ctx, cache.ManagerConfig{
KeyStore: cacheStorage,
ResultStore: worker.NewCacheResultStorage(wc),
Worker: w,
MountManager: mounts.NewMountManager("dagger-cache", w.CacheManager(), sessionManager),
ServiceURL: cacheServiceURL,
Token: cacheServiceToken,
EngineID: engineName,
})
if err != nil {
return nil, nil, err
}
resolverFn := resolverFunc(cfg)
remoteCacheExporterFuncs := map[string]remotecache.ResolveCacheExporterFunc{
"registry": registryremotecache.ResolveCacheExporterFunc(sessionManager, resolverFn),
"local": localremotecache.ResolveCacheExporterFunc(sessionManager),
"inline": inlineremotecache.ResolveCacheExporterFunc(),
"gha": gha.ResolveCacheExporterFunc(),
"s3": s3remotecache.ResolveCacheExporterFunc(),
"azblob": azblob.ResolveCacheExporterFunc(),
// for backwards compatibility:
"dagger": func(ctx context.Context, g session.Group, attrs map[string]string) (remotecache.Exporter, error) {
return nil, nil
},
}
remoteCacheImporterFuncs := map[string]remotecache.ResolveCacheImporterFunc{
"registry": registryremotecache.ResolveCacheImporterFunc(sessionManager, w.ContentStore(), resolverFn),
"local": localremotecache.ResolveCacheImporterFunc(sessionManager),
"gha": gha.ResolveCacheImporterFunc(),
"s3": s3remotecache.ResolveCacheImporterFunc(),
"azblob": azblob.ResolveCacheImporterFunc(),
// for backwards compatibility:
"dagger": func(ctx context.Context, g session.Group, attrs map[string]string) (remotecache.Importer, ocispecs.Descriptor, error) {
return &noopCacheImporter{}, ocispecs.Descriptor{}, nil
},
}
bklog.G(context.Background()).Debugf("engine name: %s", engineName)
ctrler, err := server.NewBuildkitController(server.BuildkitControllerOpts{
WorkerController: wc,
SessionManager: sessionManager,
CacheManager: cacheManager,
ContentStore: w.ContentStore(),
LeaseManager: w.LeaseManager(),
Entitlements: cfg.Entitlements,
EngineName: engineName,
Frontends: frontends,
TraceCollector: tc,
UpstreamCacheExporters: remoteCacheExporterFuncs,
UpstreamCacheImporters: remoteCacheImporterFuncs,
DNSConfig: getDNSConfig(cfg.DNS),
})
if err != nil {
return nil, nil, err
}
return ctrler, cacheManager, nil
}
func resolverFunc(cfg *config.Config) docker.RegistryHosts {
return resolver.NewRegistryConfig(cfg.Registries)
}
func newWorkerController(c *cli.Context, wiOpt workerInitializerOpt) (*worker.Controller, error) {
wc := &worker.Controller{}
nWorkers := 0
for _, wi := range workerInitializers {
ws, err := wi.fn(c, wiOpt)
if err != nil {
return nil, err
}
for _, w := range ws {
p := w.Platforms(false)
logrus.Infof("found worker %q, labels=%v, platforms=%v", w.ID(), w.Labels(), formatPlatforms(p))
archutil.WarnIfUnsupported(p)
if err = wc.Add(w); err != nil {
return nil, err
}
nWorkers++
}
}
if nWorkers == 0 {
return nil, errors.New("no worker found, rebuild the buildkit daemon?")
}
defaultWorker, err := wc.GetDefault()
if err != nil {
return nil, err
}
logrus.Infof("found %d workers, default=%q", nWorkers, defaultWorker.ID())
logrus.Warn("currently, only the default worker can be used.")
return wc, nil
}
func attrMap(sl []string) (map[string]string, error) {
m := map[string]string{}
for _, v := range sl {
parts := strings.SplitN(v, "=", 2)
if len(parts) != 2 {
return nil, errors.Errorf("invalid value %s", v)
}
m[parts[0]] = parts[1]
}
return m, nil
}
func formatPlatforms(p []ocispecs.Platform) []string {
str := make([]string, 0, len(p))
for _, pp := range p {
str = append(str, platforms.Format(platforms.Normalize(pp)))
}
return str
}
func parsePlatforms(platformsStr []string) ([]ocispecs.Platform, error) {
out := make([]ocispecs.Platform, 0, len(platformsStr))
for _, s := range platformsStr {
p, err := platforms.Parse(s)
if err != nil {
return nil, err
}
out = append(out, platforms.Normalize(p))
}
return out, nil
}
func getGCPolicy(cfg config.GCConfig, root string) []client.PruneInfo {
if cfg.GC != nil && !*cfg.GC {
return nil
}
if len(cfg.GCPolicy) == 0 {
cfg.GCPolicy = config.DefaultGCPolicy(cfg.GCKeepStorage)
}
out := make([]client.PruneInfo, 0, len(cfg.GCPolicy))
for _, rule := range cfg.GCPolicy {
out = append(out, client.PruneInfo{
Filter: rule.Filters,
All: rule.All,
KeepBytes: rule.KeepBytes.AsBytes(root),
KeepDuration: rule.KeepDuration.Duration,
})
}
return out
}
func getBuildkitVersion() client.BuildkitVersion {
return client.BuildkitVersion{
Package: version.Package,
Version: version.Version,
Revision: version.Revision,
}
}
func getDNSConfig(cfg *config.DNSConfig) *oci.DNSConfig {
var dns *oci.DNSConfig
if cfg != nil {
dns = &oci.DNSConfig{
Nameservers: cfg.Nameservers,
Options: cfg.Options,
SearchDomains: cfg.SearchDomains,
}
}
return dns
}
// parseBoolOrAuto returns (nil, nil) if s is "auto"
func parseBoolOrAuto(s string) (*bool, error) {
if s == "" || strings.EqualFold(s, autoMode) {
return nil, nil
}
b, err := strconv.ParseBool(s)
return &b, err
}
func runTraceController(p string, exp sdktrace.SpanExporter) error {
server := grpc.NewServer()
tracev1.RegisterTraceServiceServer(server, &traceCollector{exporter: exp})
uid := os.Getuid()
l, err := sys.GetLocalListener(p, uid, uid)
if err != nil {
return err
}
if err := os.Chmod(p, 0o666); err != nil {
l.Close()
return err
}
go server.Serve(l)
return nil
}
type traceCollector struct {
*tracev1.UnimplementedTraceServiceServer
exporter sdktrace.SpanExporter
}
func (t *traceCollector) Export(ctx context.Context, req *tracev1.ExportTraceServiceRequest) (*tracev1.ExportTraceServiceResponse, error) {
err := t.exporter.ExportSpans(ctx, transform.Spans(req.GetResourceSpans()))
if err != nil {
return nil, err
}
return &tracev1.ExportTraceServiceResponse{}, nil
}
type networkConfig struct {
NetName string
NetCIDR string
Bridge net.IP
CNIConfigPath string
}
func setupNetwork(ctx context.Context, netName, netCIDR string) (*networkConfig, error) {
bridge, err := network.BridgeFromCIDR(netCIDR)
if err != nil {
return nil, fmt.Errorf("bridge from cidr: %w", err)
}
// NB: this is needed for the Dagger shim worker at the moment for host alias
// resolution
err = netinst.InstallResolvconf(netName, bridge.String())
if err != nil {
return nil, fmt.Errorf("install resolv.conf: %w", err)
}
err = netinst.InstallDnsmasq(ctx, netName)
if err != nil {
return nil, fmt.Errorf("install dnsmasq: %w", err)
}
cniConfigPath, err := netinst.InstallCNIConfig(netName, netCIDR)
if err != nil {
return nil, fmt.Errorf("install cni: %w", err)
}
return &networkConfig{
NetName: netName,
NetCIDR: netCIDR,
Bridge: bridge,
CNIConfigPath: cniConfigPath,
}, nil
}
type noopCacheImporter struct{}
var _ remotecache.Importer = &noopCacheImporter{}
func (i *noopCacheImporter) Resolve(ctx context.Context, desc ocispecs.Descriptor, id string, w worker.Worker) (solver.CacheManager, error) {
return nil, nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,374 | Update buildkit past ca71a44 | Currently, we are stuck on the current version of buildkit, since https://github.com/moby/buildkit/pull/4347#issuecomment-1872217571 seems to have introduced a deadlock.
To reproduce: update buildkit in `go.mod` to `ca71a446d9f4e31ca7c4fa30fb8fb8861b8b0117`, and run a large number of integration tests. The engine will lock up after some time - after sending `SIGUIT` to the engine, you can observe the stack trace:
```
goroutine 441 [sync.Mutex.Lock, 4 minutes]:
runtime.gopark(0xc01d5ebbf0?, 0xc00aef48e1?, 0xc0?, 0xf?, 0xc017641870?)
/usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc017641790 sp=0xc017641770 pc=0x43e42e
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:404
runtime.semacquire1(0xc01d77eb74, 0x0?, 0x3, 0x1, 0x21?)
/usr/local/go/src/runtime/sema.go:160 +0x218 fp=0xc0176417f8 sp=0xc017641790 pc=0x44f918
sync.runtime_SemacquireMutex(0xffffffffffffffff?, 0x0?, 0xc00ed7c4b0?)
/usr/local/go/src/runtime/sema.go:77 +0x25 fp=0xc017641830 sp=0xc0176417f8 pc=0x46d545
sync.(*Mutex).lockSlow(0xc01d77eb70)
/usr/local/go/src/sync/mutex.go:171 +0x15d fp=0xc017641880 sp=0xc017641830 pc=0x488f1d
sync.(*Mutex).Lock(...)
/usr/local/go/src/sync/mutex.go:90
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01d77eb70, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:91 +0x5c fp=0xc017641960 sp=0xc017641880 pc=0xcb537c
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01d77eb70?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641a28 sp=0xc017641960 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01dfe5da0, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:95 +0x17e fp=0xc017641b08 sp=0xc017641a28 pc=0xcb549e
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01dfe5da0?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641bd0 sp=0xc017641b08 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).Add(0xc01d77eb70, {0x1f7e8b0?, 0xc01dfe5da0?})
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:46 +0x190 fp=0xc017641c60 sp=0xc017641bd0 pc=0xcb4d70
github.com/moby/buildkit/solver.(*state).setEdge(0xc01dfe3440, 0x2, 0xc003975a40, 0xc0165fcb40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:178 +0x370 fp=0xc017641ce8 sp=0xc017641c60 pc=0xdef3f0
github.com/moby/buildkit/solver.(*Solver).setEdge(0xc0007071a0, {0xc003975a40?, {0x1f92360?, 0xc004bd6480?}}, 0xc003975a40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:295 +0x125 fp=0xc017641d58 sp=0xc017641ce8 pc=0xdf0265
github.com/moby/buildkit/solver.(*scheduler).dispatch(0xc0002fc770, 0xc01356a140)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:177 +0xbdb fp=0xc017641f68 sp=0xc017641d58 pc=0xdfe87b
github.com/moby/buildkit/solver.(*scheduler).loop(0xc0002fc770)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:104 +0x1d4 fp=0xc017641fc8 sp=0xc017641f68 pc=0xdfdb34
github.com/moby/buildkit/solver.newScheduler.func1()
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x25 fp=0xc017641fe0 sp=0xc017641fc8 pc=0xdfd865
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc017641fe8 sp=0xc017641fe0 pc=0x4715e1
created by github.com/moby/buildkit/solver.newScheduler in goroutine 1
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x22d
```
See https://github.com/dagger/dagger/pull/6169 for more information on when this was originally discovered.
Next steps:
- Wait until upstream PRs are merged :tada: | https://github.com/dagger/dagger/issues/6374 | https://github.com/dagger/dagger/pull/6481 | 2aefe558d80c355fb6868145e79763ef73c0e6b9 | faaa0d18ec2f8f4ddb425298e672c079869017e7 | "2024-01-08T18:47:15Z" | go | "2024-01-24T17:07:57Z" | engine/buildkit/containerimage.go | package buildkit
import (
"context"
"encoding/json"
"fmt"
"os"
"path"
"strings"
"github.com/containerd/containerd/platforms"
"github.com/dagger/dagger/engine"
bkcache "github.com/moby/buildkit/cache"
bkclient "github.com/moby/buildkit/client"
"github.com/moby/buildkit/exporter/containerimage/exptypes"
bkgw "github.com/moby/buildkit/frontend/gateway/client"
bksolverpb "github.com/moby/buildkit/solver/pb"
solverresult "github.com/moby/buildkit/solver/result"
specs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/vito/progrock"
)
type ContainerExport struct {
Definition *bksolverpb.Definition
Config specs.ImageConfig
}
func (c *Client) PublishContainerImage(
ctx context.Context,
inputByPlatform map[string]ContainerExport,
opts map[string]string, // TODO: make this an actual type, this leaks too much untyped buildkit api
) (map[string]string, error) {
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return nil, err
}
defer cancel()
combinedResult, err := c.getContainerResult(ctx, inputByPlatform)
if err != nil {
return nil, err
}
exporter, err := c.Worker.Exporter(bkclient.ExporterImage, c.SessionManager)
if err != nil {
return nil, err
}
expInstance, err := exporter.Resolve(ctx, opts)
if err != nil {
return nil, fmt.Errorf("failed to resolve exporter: %s", err)
}
resp, descRef, err := expInstance.Export(ctx, combinedResult, c.ID())
if err != nil {
return nil, fmt.Errorf("failed to export: %s", err)
}
if descRef != nil {
descRef.Release()
}
return resp, nil
}
func (c *Client) ExportContainerImage(
ctx context.Context,
inputByPlatform map[string]ContainerExport,
destPath string,
opts map[string]string, // TODO: make this an actual type, this leaks too much untyped buildkit api
) (map[string]string, error) {
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return nil, err
}
defer cancel()
destPath = path.Clean(destPath)
if destPath == ".." || strings.HasPrefix(destPath, "../") {
return nil, fmt.Errorf("path %q escapes workdir; use an absolute path instead", destPath)
}
combinedResult, err := c.getContainerResult(ctx, inputByPlatform)
if err != nil {
return nil, err
}
exporterName := bkclient.ExporterDocker
if len(combinedResult.Refs) > 1 {
exporterName = bkclient.ExporterOCI
}
exporter, err := c.Worker.Exporter(exporterName, c.SessionManager)
if err != nil {
return nil, err
}
expInstance, err := exporter.Resolve(ctx, opts)
if err != nil {
return nil, fmt.Errorf("failed to resolve exporter: %s", err)
}
clientMetadata, err := engine.ClientMetadataFromContext(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get requester session ID from client metadata: %s", err)
}
ctx = engine.LocalExportOpts{
DestClientID: clientMetadata.ClientID,
Path: destPath,
IsFileStream: true,
}.AppendToOutgoingContext(ctx)
resp, descRef, err := expInstance.Export(ctx, combinedResult, clientMetadata.ClientID)
if err != nil {
return nil, fmt.Errorf("failed to export: %s", err)
}
if descRef != nil {
descRef.Release()
}
return resp, nil
}
func (c *Client) ContainerImageToTarball(
ctx context.Context,
engineHostPlatform specs.Platform,
fileName string,
inputByPlatform map[string]ContainerExport,
opts map[string]string,
) (*bksolverpb.Definition, error) {
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return nil, err
}
defer cancel()
combinedResult, err := c.getContainerResult(ctx, inputByPlatform)
if err != nil {
return nil, err
}
exporterName := bkclient.ExporterDocker
if len(combinedResult.Refs) > 1 {
exporterName = bkclient.ExporterOCI
}
exporter, err := c.Worker.Exporter(exporterName, c.SessionManager)
if err != nil {
return nil, err
}
expInstance, err := exporter.Resolve(ctx, opts)
if err != nil {
return nil, fmt.Errorf("failed to resolve exporter: %s", err)
}
tmpDir, err := os.MkdirTemp("", "dagger-tarball")
if err != nil {
return nil, fmt.Errorf("failed to create temp dir for tarball export: %s", err)
}
defer os.RemoveAll(tmpDir)
destPath := path.Join(tmpDir, fileName)
ctx = engine.LocalExportOpts{
DestClientID: c.ID(),
Path: destPath,
IsFileStream: true,
}.AppendToOutgoingContext(ctx)
_, descRef, err := expInstance.Export(ctx, combinedResult, c.ID())
if err != nil {
return nil, fmt.Errorf("failed to export: %s", err)
}
if descRef != nil {
defer descRef.Release()
}
ctx, recorder := progrock.WithGroup(ctx, "container image to tarball")
pbDef, _, err := c.EngineContainerLocalImport(ctx, recorder, engineHostPlatform, tmpDir, nil, []string{fileName})
if err != nil {
return nil, fmt.Errorf("failed to import container tarball from engine container filesystem: %s", err)
}
return pbDef, nil
}
func (c *Client) getContainerResult(
ctx context.Context,
inputByPlatform map[string]ContainerExport,
) (*solverresult.Result[bkcache.ImmutableRef], error) {
combinedResult := &solverresult.Result[bkcache.ImmutableRef]{}
expPlatforms := &exptypes.Platforms{
Platforms: make([]exptypes.Platform, len(inputByPlatform)),
}
// TODO: probably faster to do this in parallel for each platform
for platformString, input := range inputByPlatform {
res, err := c.Solve(ctx, bkgw.SolveRequest{
Definition: input.Definition,
Evaluate: true,
})
if err != nil {
return nil, fmt.Errorf("failed to solve for container publish: %s", err)
}
cacheRes, err := ConvertToWorkerCacheResult(ctx, res)
if err != nil {
return nil, fmt.Errorf("failed to convert result: %s", err)
}
ref, err := cacheRes.SingleRef()
if err != nil {
return nil, err
}
platform, err := platforms.Parse(platformString)
if err != nil {
return nil, err
}
cfgBytes, err := json.Marshal(specs.Image{
Platform: specs.Platform{
Architecture: platform.Architecture,
OS: platform.OS,
OSVersion: platform.OSVersion,
OSFeatures: platform.OSFeatures,
},
Config: input.Config,
})
if err != nil {
return nil, err
}
combinedResult.AddMeta(fmt.Sprintf("%s/%s", exptypes.ExporterImageConfigKey, platformString), cfgBytes)
if len(inputByPlatform) == 1 {
combinedResult.AddMeta(exptypes.ExporterImageConfigKey, cfgBytes)
combinedResult.SetRef(ref)
} else {
expPlatforms.Platforms[len(combinedResult.Refs)] = exptypes.Platform{
ID: platformString,
Platform: platform,
}
combinedResult.AddRef(platformString, ref)
}
}
if len(combinedResult.Refs) > 1 {
platformBytes, err := json.Marshal(expPlatforms)
if err != nil {
return nil, err
}
combinedResult.AddMeta(exptypes.ExporterPlatformsKey, platformBytes)
}
return combinedResult, nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,374 | Update buildkit past ca71a44 | Currently, we are stuck on the current version of buildkit, since https://github.com/moby/buildkit/pull/4347#issuecomment-1872217571 seems to have introduced a deadlock.
To reproduce: update buildkit in `go.mod` to `ca71a446d9f4e31ca7c4fa30fb8fb8861b8b0117`, and run a large number of integration tests. The engine will lock up after some time - after sending `SIGUIT` to the engine, you can observe the stack trace:
```
goroutine 441 [sync.Mutex.Lock, 4 minutes]:
runtime.gopark(0xc01d5ebbf0?, 0xc00aef48e1?, 0xc0?, 0xf?, 0xc017641870?)
/usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc017641790 sp=0xc017641770 pc=0x43e42e
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:404
runtime.semacquire1(0xc01d77eb74, 0x0?, 0x3, 0x1, 0x21?)
/usr/local/go/src/runtime/sema.go:160 +0x218 fp=0xc0176417f8 sp=0xc017641790 pc=0x44f918
sync.runtime_SemacquireMutex(0xffffffffffffffff?, 0x0?, 0xc00ed7c4b0?)
/usr/local/go/src/runtime/sema.go:77 +0x25 fp=0xc017641830 sp=0xc0176417f8 pc=0x46d545
sync.(*Mutex).lockSlow(0xc01d77eb70)
/usr/local/go/src/sync/mutex.go:171 +0x15d fp=0xc017641880 sp=0xc017641830 pc=0x488f1d
sync.(*Mutex).Lock(...)
/usr/local/go/src/sync/mutex.go:90
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01d77eb70, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:91 +0x5c fp=0xc017641960 sp=0xc017641880 pc=0xcb537c
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01d77eb70?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641a28 sp=0xc017641960 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01dfe5da0, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:95 +0x17e fp=0xc017641b08 sp=0xc017641a28 pc=0xcb549e
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01dfe5da0?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641bd0 sp=0xc017641b08 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).Add(0xc01d77eb70, {0x1f7e8b0?, 0xc01dfe5da0?})
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:46 +0x190 fp=0xc017641c60 sp=0xc017641bd0 pc=0xcb4d70
github.com/moby/buildkit/solver.(*state).setEdge(0xc01dfe3440, 0x2, 0xc003975a40, 0xc0165fcb40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:178 +0x370 fp=0xc017641ce8 sp=0xc017641c60 pc=0xdef3f0
github.com/moby/buildkit/solver.(*Solver).setEdge(0xc0007071a0, {0xc003975a40?, {0x1f92360?, 0xc004bd6480?}}, 0xc003975a40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:295 +0x125 fp=0xc017641d58 sp=0xc017641ce8 pc=0xdf0265
github.com/moby/buildkit/solver.(*scheduler).dispatch(0xc0002fc770, 0xc01356a140)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:177 +0xbdb fp=0xc017641f68 sp=0xc017641d58 pc=0xdfe87b
github.com/moby/buildkit/solver.(*scheduler).loop(0xc0002fc770)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:104 +0x1d4 fp=0xc017641fc8 sp=0xc017641f68 pc=0xdfdb34
github.com/moby/buildkit/solver.newScheduler.func1()
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x25 fp=0xc017641fe0 sp=0xc017641fc8 pc=0xdfd865
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc017641fe8 sp=0xc017641fe0 pc=0x4715e1
created by github.com/moby/buildkit/solver.newScheduler in goroutine 1
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x22d
```
See https://github.com/dagger/dagger/pull/6169 for more information on when this was originally discovered.
Next steps:
- Wait until upstream PRs are merged :tada: | https://github.com/dagger/dagger/issues/6374 | https://github.com/dagger/dagger/pull/6481 | 2aefe558d80c355fb6868145e79763ef73c0e6b9 | faaa0d18ec2f8f4ddb425298e672c079869017e7 | "2024-01-08T18:47:15Z" | go | "2024-01-24T17:07:57Z" | engine/buildkit/filesync.go | package buildkit
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"os"
"path"
"path/filepath"
"strings"
"github.com/containerd/continuity/fs"
"github.com/dagger/dagger/engine"
"github.com/dagger/dagger/engine/sources/blob"
cacheconfig "github.com/moby/buildkit/cache/config"
bkclient "github.com/moby/buildkit/client"
"github.com/moby/buildkit/client/llb"
bkgw "github.com/moby/buildkit/frontend/gateway/client"
"github.com/moby/buildkit/session/filesync"
"github.com/moby/buildkit/snapshot"
bksolverpb "github.com/moby/buildkit/solver/pb"
"github.com/moby/buildkit/util/bklog"
"github.com/moby/buildkit/util/compression"
bkworker "github.com/moby/buildkit/worker"
specs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/vito/progrock"
)
func (c *Client) LocalImport(
ctx context.Context,
recorder *progrock.Recorder,
platform specs.Platform,
srcPath string,
excludePatterns []string,
includePatterns []string,
) (*bksolverpb.Definition, specs.Descriptor, error) {
var desc specs.Descriptor
srcPath = path.Clean(srcPath)
if srcPath == ".." || strings.HasPrefix(srcPath, "../") {
return nil, desc, fmt.Errorf("path %q escapes workdir; use an absolute path instead", srcPath)
}
clientMetadata, err := engine.ClientMetadataFromContext(ctx)
if err != nil {
return nil, desc, err
}
localOpts := []llb.LocalOption{
llb.SessionID(clientMetadata.ClientID),
llb.SharedKeyHint(strings.Join([]string{clientMetadata.ClientHostname, srcPath}, " ")),
}
localName := fmt.Sprintf("upload %s from %s (client id: %s)", srcPath, clientMetadata.ClientHostname, clientMetadata.ClientID)
if len(excludePatterns) > 0 {
localName += fmt.Sprintf(" (exclude: %s)", strings.Join(excludePatterns, ", "))
localOpts = append(localOpts, llb.ExcludePatterns(excludePatterns))
}
if len(includePatterns) > 0 {
localName += fmt.Sprintf(" (include: %s)", strings.Join(includePatterns, ", "))
localOpts = append(localOpts, llb.IncludePatterns(includePatterns))
}
localOpts = append(localOpts, llb.WithCustomName(localName))
localLLB := llb.Local(srcPath, localOpts...)
// We still need to do a copy here for now because buildkit's cache calls
// Finalize on refs when getting their blobs which makes the cache ref for the
// local ref unable to be reused.
//
// TODO: we should ensure that this doesn't create a new cache entry, without
// this the entire local directory is uploaded to the cache. See also
// blobSource.CacheKey for more context
copyLLB := llb.Scratch().File(
llb.Copy(localLLB, "/", "/"),
llb.WithCustomNamef("%scopy %s", InternalPrefix, localName),
)
copyDef, err := copyLLB.Marshal(ctx, llb.Platform(platform))
if err != nil {
return nil, desc, err
}
copyPB := copyDef.ToPB()
RecordVertexes(recorder, copyPB)
res, err := c.Solve(ctx, bkgw.SolveRequest{
Definition: copyPB,
Evaluate: true,
})
if err != nil {
return nil, desc, err
}
resultProxy, err := res.SingleRef()
if err != nil {
return nil, desc, fmt.Errorf("failed to get single ref: %s", err)
}
cachedRes, err := resultProxy.Result(ctx)
if err != nil {
return nil, desc, wrapError(ctx, err, c.ID())
}
workerRef, ok := cachedRes.Sys().(*bkworker.WorkerRef)
if !ok {
return nil, desc, fmt.Errorf("invalid ref: %T", cachedRes.Sys())
}
ref := workerRef.ImmutableRef
// Force an unlazy of the copy in case it was lazy due to remote caching; we
// need it to exist locally or else blob source won't work.
// NOTE: in theory we could keep it lazy if we could get the descriptor handlers
// for the remote over to the blob source code, but the plumbing to accomplish that
// is tricky and ultimately only result in a marginal performance optimization.
err = ref.Extract(ctx, nil)
if err != nil {
return nil, desc, fmt.Errorf("failed to extract ref: %s", err)
}
remotes, err := ref.GetRemotes(ctx, true, cacheconfig.RefConfig{
Compression: compression.Config{
// TODO: double check whether using Zstd is best idea. It's the fastest, but
// if it ends up in an exported image and the user tries to load that into
// old docker versions, they will get an error unless they specify the force
// compression option during export.
Type: compression.Zstd,
},
}, false, nil)
if err != nil {
return nil, desc, fmt.Errorf("failed to get remotes: %s", err)
}
if len(remotes) != 1 {
return nil, desc, fmt.Errorf("expected 1 remote, got %d", len(remotes))
}
remote := remotes[0]
if len(remote.Descriptors) != 1 {
return nil, desc, fmt.Errorf("expected 1 descriptor, got %d", len(remote.Descriptors))
}
desc = remote.Descriptors[0]
blobDef, err := blob.LLB(desc).Marshal(ctx)
if err != nil {
return nil, desc, fmt.Errorf("failed to marshal blob source: %s", err)
}
blobPB := blobDef.ToPB()
// do a sync solve right now so we can release the cache ref for the local import
// without giving up the lease on the blob
_, err = c.Solve(ctx, bkgw.SolveRequest{
Definition: blobPB,
Evaluate: true,
})
if err != nil {
return nil, desc, fmt.Errorf("failed to solve blobsource: %w", wrapError(ctx, err, c.ID()))
}
return blobPB, desc, nil
}
// Import a directory from the engine container, as opposed to from a client
func (c *Client) EngineContainerLocalImport(
ctx context.Context,
recorder *progrock.Recorder,
platform specs.Platform,
srcPath string,
excludePatterns []string,
includePatterns []string,
) (*bksolverpb.Definition, specs.Descriptor, error) {
hostname, err := os.Hostname()
if err != nil {
return nil, specs.Descriptor{}, fmt.Errorf("failed to get hostname for engine local import: %s", err)
}
ctx = engine.ContextWithClientMetadata(ctx, &engine.ClientMetadata{
ClientID: c.ID(),
ClientHostname: hostname,
})
return c.LocalImport(ctx, recorder, platform, srcPath, excludePatterns, includePatterns)
}
func (c *Client) ReadCallerHostFile(ctx context.Context, path string) ([]byte, error) {
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return nil, err
}
defer cancel()
clientMetadata, err := engine.ClientMetadataFromContext(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get requester session ID: %s", err)
}
ctx = engine.LocalImportOpts{
OwnerClientID: clientMetadata.ClientID,
Path: path,
ReadSingleFileOnly: true,
MaxFileSize: MaxFileContentsChunkSize,
}.AppendToOutgoingContext(ctx)
clientCaller, err := c.SessionManager.Get(ctx, clientMetadata.ClientID, false)
if err != nil {
return nil, fmt.Errorf("failed to get requester session: %s", err)
}
diffCopyClient, err := filesync.NewFileSyncClient(clientCaller.Conn()).DiffCopy(ctx)
if err != nil {
return nil, fmt.Errorf("failed to create diff copy client: %s", err)
}
defer diffCopyClient.CloseSend()
msg := filesync.BytesMessage{}
err = diffCopyClient.RecvMsg(&msg)
if err != nil {
return nil, fmt.Errorf("failed to receive file bytes message: %s", err)
}
return msg.Data, nil
}
func (c *Client) LocalDirExport(
ctx context.Context,
def *bksolverpb.Definition,
destPath string,
) (rerr error) {
ctx = bklog.WithLogger(ctx, bklog.G(ctx).WithField("export_path", destPath))
bklog.G(ctx).Debug("exporting local dir")
defer func() {
lg := bklog.G(ctx)
if rerr != nil {
lg = lg.WithError(rerr)
}
lg.Debug("finished exporting local dir")
}()
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return err
}
defer cancel()
destPath = path.Clean(destPath)
if destPath == ".." || strings.HasPrefix(destPath, "../") {
return fmt.Errorf("path %q escapes workdir; use an absolute path instead", destPath)
}
res, err := c.Solve(ctx, bkgw.SolveRequest{Definition: def})
if err != nil {
return fmt.Errorf("failed to solve for local export: %s", err)
}
cacheRes, err := ConvertToWorkerCacheResult(ctx, res)
if err != nil {
return fmt.Errorf("failed to convert result: %s", err)
}
exporter, err := c.Worker.Exporter(bkclient.ExporterLocal, c.SessionManager)
if err != nil {
return err
}
expInstance, err := exporter.Resolve(ctx, nil)
if err != nil {
return fmt.Errorf("failed to resolve exporter: %s", err)
}
clientMetadata, err := engine.ClientMetadataFromContext(ctx)
if err != nil {
return fmt.Errorf("failed to get requester session ID: %s", err)
}
ctx = engine.LocalExportOpts{
DestClientID: clientMetadata.ClientID,
Path: destPath,
}.AppendToOutgoingContext(ctx)
_, descRef, err := expInstance.Export(ctx, cacheRes, clientMetadata.ClientID)
if err != nil {
return fmt.Errorf("failed to export: %s", err)
}
if descRef != nil {
descRef.Release()
}
return nil
}
func (c *Client) LocalFileExport(
ctx context.Context,
def *bksolverpb.Definition,
destPath string,
filePath string,
allowParentDirPath bool,
) (rerr error) {
ctx = bklog.WithLogger(ctx, bklog.G(ctx).
WithField("export_path", destPath).
WithField("file_path", filePath).
WithField("allow_parent_dir_path", allowParentDirPath),
)
bklog.G(ctx).Debug("exporting local file")
defer func() {
lg := bklog.G(ctx)
if rerr != nil {
lg = lg.WithError(rerr)
}
lg.Debug("finished exporting local file")
}()
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return err
}
defer cancel()
destPath = path.Clean(destPath)
if destPath == ".." || strings.HasPrefix(destPath, "../") {
return fmt.Errorf("path %q escapes workdir; use an absolute path instead", destPath)
}
res, err := c.Solve(ctx, bkgw.SolveRequest{Definition: def, Evaluate: true})
if err != nil {
return fmt.Errorf("failed to solve for local export: %s", err)
}
ref, err := res.SingleRef()
if err != nil {
return fmt.Errorf("failed to get single ref: %s", err)
}
mountable, err := ref.getMountable(ctx)
if err != nil {
return fmt.Errorf("failed to get mountable: %s", err)
}
mounter := snapshot.LocalMounter(mountable)
mountPath, err := mounter.Mount()
if err != nil {
return fmt.Errorf("failed to mount: %s", err)
}
defer mounter.Unmount()
mntFilePath, err := fs.RootPath(mountPath, filePath)
if err != nil {
return fmt.Errorf("failed to get root path: %s", err)
}
file, err := os.Open(mntFilePath)
if err != nil {
return fmt.Errorf("failed to open file: %s", err)
}
defer file.Close()
stat, err := file.Stat()
if err != nil {
return fmt.Errorf("failed to stat file: %s", err)
}
clientMetadata, err := engine.ClientMetadataFromContext(ctx)
if err != nil {
return fmt.Errorf("failed to get requester session ID: %s", err)
}
ctx = engine.LocalExportOpts{
DestClientID: clientMetadata.ClientID,
Path: destPath,
IsFileStream: true,
FileOriginalName: filepath.Base(filePath),
AllowParentDirPath: allowParentDirPath,
FileMode: stat.Mode().Perm(),
}.AppendToOutgoingContext(ctx)
clientCaller, err := c.SessionManager.Get(ctx, clientMetadata.ClientID, false)
if err != nil {
return fmt.Errorf("failed to get requester session: %s", err)
}
diffCopyClient, err := filesync.NewFileSendClient(clientCaller.Conn()).DiffCopy(ctx)
if err != nil {
return fmt.Errorf("failed to create diff copy client: %s", err)
}
defer diffCopyClient.CloseSend()
fileSizeLeft := stat.Size()
chunkSize := int64(MaxFileContentsChunkSize)
for fileSizeLeft > 0 {
buf := new(bytes.Buffer) // TODO: more efficient to use bufio.Writer, reuse buffers, sync.Pool, etc.
n, err := io.CopyN(buf, file, chunkSize)
if errors.Is(err, io.EOF) {
err = nil
}
if err != nil {
return fmt.Errorf("failed to read file: %s", err)
}
fileSizeLeft -= n
err = diffCopyClient.SendMsg(&filesync.BytesMessage{Data: buf.Bytes()})
if errors.Is(err, io.EOF) {
err := diffCopyClient.RecvMsg(struct{}{})
if err != nil {
return fmt.Errorf("diff copy client error: %s", err)
}
} else if err != nil {
return fmt.Errorf("failed to send file chunk: %s", err)
}
}
if err := diffCopyClient.CloseSend(); err != nil {
return fmt.Errorf("failed to close send: %s", err)
}
// wait for receiver to finish
var msg filesync.BytesMessage
if err := diffCopyClient.RecvMsg(&msg); err != io.EOF {
return fmt.Errorf("unexpected closing recv msg: %s", err)
}
return nil
}
// IOReaderExport exports the contents of an io.Reader to the caller's local fs as a file
// TODO: de-dupe this with the above method to extent possible
func (c *Client) IOReaderExport(ctx context.Context, r io.Reader, destPath string, destMode os.FileMode) (rerr error) {
ctx = bklog.WithLogger(ctx, bklog.G(ctx).WithField("export_path", destPath))
bklog.G(ctx).Debug("exporting bytes")
defer func() {
lg := bklog.G(ctx)
if rerr != nil {
lg = lg.WithError(rerr)
}
lg.Debug("finished exporting bytes")
}()
clientMetadata, err := engine.ClientMetadataFromContext(ctx)
if err != nil {
return fmt.Errorf("failed to get requester session ID: %s", err)
}
ctx = engine.LocalExportOpts{
DestClientID: clientMetadata.ClientID,
Path: destPath,
IsFileStream: true,
FileOriginalName: filepath.Base(destPath),
FileMode: destMode,
}.AppendToOutgoingContext(ctx)
clientCaller, err := c.SessionManager.Get(ctx, clientMetadata.ClientID, false)
if err != nil {
return fmt.Errorf("failed to get requester session: %s", err)
}
diffCopyClient, err := filesync.NewFileSendClient(clientCaller.Conn()).DiffCopy(ctx)
if err != nil {
return fmt.Errorf("failed to create diff copy client: %s", err)
}
defer diffCopyClient.CloseSend()
chunkSize := int64(MaxFileContentsChunkSize)
keepGoing := true
for keepGoing {
buf := new(bytes.Buffer) // TODO: more efficient to use bufio.Writer, reuse buffers, sync.Pool, etc.
_, err := io.CopyN(buf, r, chunkSize)
if errors.Is(err, io.EOF) {
keepGoing = false
err = nil
}
if err != nil {
return fmt.Errorf("failed to read file: %s", err)
}
err = diffCopyClient.SendMsg(&filesync.BytesMessage{Data: buf.Bytes()})
if errors.Is(err, io.EOF) {
err := diffCopyClient.RecvMsg(struct{}{})
if err != nil {
return fmt.Errorf("diff copy client error: %s", err)
}
} else if err != nil {
return fmt.Errorf("failed to send file chunk: %s", err)
}
}
if err := diffCopyClient.CloseSend(); err != nil {
return fmt.Errorf("failed to close send: %s", err)
}
// wait for receiver to finish
var msg filesync.BytesMessage
if err := diffCopyClient.RecvMsg(&msg); err != io.EOF {
return fmt.Errorf("unexpected closing recv msg: %s", err)
}
return nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,374 | Update buildkit past ca71a44 | Currently, we are stuck on the current version of buildkit, since https://github.com/moby/buildkit/pull/4347#issuecomment-1872217571 seems to have introduced a deadlock.
To reproduce: update buildkit in `go.mod` to `ca71a446d9f4e31ca7c4fa30fb8fb8861b8b0117`, and run a large number of integration tests. The engine will lock up after some time - after sending `SIGUIT` to the engine, you can observe the stack trace:
```
goroutine 441 [sync.Mutex.Lock, 4 minutes]:
runtime.gopark(0xc01d5ebbf0?, 0xc00aef48e1?, 0xc0?, 0xf?, 0xc017641870?)
/usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc017641790 sp=0xc017641770 pc=0x43e42e
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:404
runtime.semacquire1(0xc01d77eb74, 0x0?, 0x3, 0x1, 0x21?)
/usr/local/go/src/runtime/sema.go:160 +0x218 fp=0xc0176417f8 sp=0xc017641790 pc=0x44f918
sync.runtime_SemacquireMutex(0xffffffffffffffff?, 0x0?, 0xc00ed7c4b0?)
/usr/local/go/src/runtime/sema.go:77 +0x25 fp=0xc017641830 sp=0xc0176417f8 pc=0x46d545
sync.(*Mutex).lockSlow(0xc01d77eb70)
/usr/local/go/src/sync/mutex.go:171 +0x15d fp=0xc017641880 sp=0xc017641830 pc=0x488f1d
sync.(*Mutex).Lock(...)
/usr/local/go/src/sync/mutex.go:90
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01d77eb70, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:91 +0x5c fp=0xc017641960 sp=0xc017641880 pc=0xcb537c
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01d77eb70?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641a28 sp=0xc017641960 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01dfe5da0, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:95 +0x17e fp=0xc017641b08 sp=0xc017641a28 pc=0xcb549e
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01dfe5da0?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641bd0 sp=0xc017641b08 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).Add(0xc01d77eb70, {0x1f7e8b0?, 0xc01dfe5da0?})
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:46 +0x190 fp=0xc017641c60 sp=0xc017641bd0 pc=0xcb4d70
github.com/moby/buildkit/solver.(*state).setEdge(0xc01dfe3440, 0x2, 0xc003975a40, 0xc0165fcb40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:178 +0x370 fp=0xc017641ce8 sp=0xc017641c60 pc=0xdef3f0
github.com/moby/buildkit/solver.(*Solver).setEdge(0xc0007071a0, {0xc003975a40?, {0x1f92360?, 0xc004bd6480?}}, 0xc003975a40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:295 +0x125 fp=0xc017641d58 sp=0xc017641ce8 pc=0xdf0265
github.com/moby/buildkit/solver.(*scheduler).dispatch(0xc0002fc770, 0xc01356a140)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:177 +0xbdb fp=0xc017641f68 sp=0xc017641d58 pc=0xdfe87b
github.com/moby/buildkit/solver.(*scheduler).loop(0xc0002fc770)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:104 +0x1d4 fp=0xc017641fc8 sp=0xc017641f68 pc=0xdfdb34
github.com/moby/buildkit/solver.newScheduler.func1()
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x25 fp=0xc017641fe0 sp=0xc017641fc8 pc=0xdfd865
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc017641fe8 sp=0xc017641fe0 pc=0x4715e1
created by github.com/moby/buildkit/solver.newScheduler in goroutine 1
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x22d
```
See https://github.com/dagger/dagger/pull/6169 for more information on when this was originally discovered.
Next steps:
- Wait until upstream PRs are merged :tada: | https://github.com/dagger/dagger/issues/6374 | https://github.com/dagger/dagger/pull/6481 | 2aefe558d80c355fb6868145e79763ef73c0e6b9 | faaa0d18ec2f8f4ddb425298e672c079869017e7 | "2024-01-08T18:47:15Z" | go | "2024-01-24T17:07:57Z" | engine/client/buildkit.go | package client
import (
"context"
"fmt"
"net/url"
"time"
"github.com/dagger/dagger/engine"
bkclient "github.com/moby/buildkit/client"
"github.com/moby/buildkit/util/tracing/detect"
"github.com/vito/progrock"
"go.opentelemetry.io/otel"
// load connection helpers
_ "github.com/moby/buildkit/client/connhelper/dockercontainer"
_ "github.com/moby/buildkit/client/connhelper/kubepod"
_ "github.com/moby/buildkit/client/connhelper/podmancontainer"
_ "github.com/moby/buildkit/client/connhelper/ssh"
)
func newBuildkitClient(ctx context.Context, rec *progrock.VertexRecorder, remote *url.URL, userAgent string) (*bkclient.Client, *bkclient.Info, error) {
var c *bkclient.Client
var err error
switch remote.Scheme {
case DockerImageProvider:
c, err = buildkitConnectDocker(ctx, rec, remote, userAgent)
default:
task := rec.Task("starting engine")
c, err = buildkitConnectDefault(ctx, rec, remote)
task.Done(err)
}
if err != nil {
return nil, nil, err
}
info, err := c.Info(ctx)
if err != nil {
return nil, nil, err
}
if info.BuildkitVersion.Package != engine.Package {
return nil, nil, fmt.Errorf("remote is not a valid dagger server (expected %q, got %q)", engine.Package, info.BuildkitVersion.Package)
}
return c, info, nil
}
func buildkitConnectDefault(ctx context.Context, rec *progrock.VertexRecorder, remote *url.URL) (*bkclient.Client, error) {
opts := []bkclient.ClientOpt{
bkclient.WithFailFast(),
bkclient.WithTracerProvider(otel.GetTracerProvider()),
}
exp, err := detect.Exporter()
if err == nil {
if td, ok := exp.(bkclient.TracerDelegate); ok {
opts = append(opts, bkclient.WithTracerDelegate(td))
}
} else {
fmt.Fprintln(rec.Stdout(), "failed to detect opentelemetry exporter: ", err)
}
c, err := bkclient.New(ctx, remote.String(), opts...)
if err != nil {
return nil, fmt.Errorf("buildkit client: %w", err)
}
ctx, cancel := context.WithTimeout(ctx, 10*time.Minute)
defer cancel()
if err := c.Wait(ctx); err != nil {
return nil, err
}
return c, nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,374 | Update buildkit past ca71a44 | Currently, we are stuck on the current version of buildkit, since https://github.com/moby/buildkit/pull/4347#issuecomment-1872217571 seems to have introduced a deadlock.
To reproduce: update buildkit in `go.mod` to `ca71a446d9f4e31ca7c4fa30fb8fb8861b8b0117`, and run a large number of integration tests. The engine will lock up after some time - after sending `SIGUIT` to the engine, you can observe the stack trace:
```
goroutine 441 [sync.Mutex.Lock, 4 minutes]:
runtime.gopark(0xc01d5ebbf0?, 0xc00aef48e1?, 0xc0?, 0xf?, 0xc017641870?)
/usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc017641790 sp=0xc017641770 pc=0x43e42e
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:404
runtime.semacquire1(0xc01d77eb74, 0x0?, 0x3, 0x1, 0x21?)
/usr/local/go/src/runtime/sema.go:160 +0x218 fp=0xc0176417f8 sp=0xc017641790 pc=0x44f918
sync.runtime_SemacquireMutex(0xffffffffffffffff?, 0x0?, 0xc00ed7c4b0?)
/usr/local/go/src/runtime/sema.go:77 +0x25 fp=0xc017641830 sp=0xc0176417f8 pc=0x46d545
sync.(*Mutex).lockSlow(0xc01d77eb70)
/usr/local/go/src/sync/mutex.go:171 +0x15d fp=0xc017641880 sp=0xc017641830 pc=0x488f1d
sync.(*Mutex).Lock(...)
/usr/local/go/src/sync/mutex.go:90
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01d77eb70, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:91 +0x5c fp=0xc017641960 sp=0xc017641880 pc=0xcb537c
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01d77eb70?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641a28 sp=0xc017641960 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01dfe5da0, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:95 +0x17e fp=0xc017641b08 sp=0xc017641a28 pc=0xcb549e
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01dfe5da0?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641bd0 sp=0xc017641b08 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).Add(0xc01d77eb70, {0x1f7e8b0?, 0xc01dfe5da0?})
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:46 +0x190 fp=0xc017641c60 sp=0xc017641bd0 pc=0xcb4d70
github.com/moby/buildkit/solver.(*state).setEdge(0xc01dfe3440, 0x2, 0xc003975a40, 0xc0165fcb40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:178 +0x370 fp=0xc017641ce8 sp=0xc017641c60 pc=0xdef3f0
github.com/moby/buildkit/solver.(*Solver).setEdge(0xc0007071a0, {0xc003975a40?, {0x1f92360?, 0xc004bd6480?}}, 0xc003975a40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:295 +0x125 fp=0xc017641d58 sp=0xc017641ce8 pc=0xdf0265
github.com/moby/buildkit/solver.(*scheduler).dispatch(0xc0002fc770, 0xc01356a140)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:177 +0xbdb fp=0xc017641f68 sp=0xc017641d58 pc=0xdfe87b
github.com/moby/buildkit/solver.(*scheduler).loop(0xc0002fc770)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:104 +0x1d4 fp=0xc017641fc8 sp=0xc017641f68 pc=0xdfdb34
github.com/moby/buildkit/solver.newScheduler.func1()
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x25 fp=0xc017641fe0 sp=0xc017641fc8 pc=0xdfd865
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc017641fe8 sp=0xc017641fe0 pc=0x4715e1
created by github.com/moby/buildkit/solver.newScheduler in goroutine 1
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x22d
```
See https://github.com/dagger/dagger/pull/6169 for more information on when this was originally discovered.
Next steps:
- Wait until upstream PRs are merged :tada: | https://github.com/dagger/dagger/issues/6374 | https://github.com/dagger/dagger/pull/6481 | 2aefe558d80c355fb6868145e79763ef73c0e6b9 | faaa0d18ec2f8f4ddb425298e672c079869017e7 | "2024-01-08T18:47:15Z" | go | "2024-01-24T17:07:57Z" | go.mod | module github.com/dagger/dagger
go 1.21
replace dagger.io/dagger => ./sdk/go
require (
dagger.io/dagger v0.9.7
github.com/99designs/gqlgen v0.17.41
github.com/Khan/genqlient v0.6.0
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2
github.com/adrg/xdg v0.4.0
github.com/blang/semver v3.5.1+incompatible
github.com/cenkalti/backoff/v4 v4.2.1
github.com/charmbracelet/bubbles v0.17.1
github.com/charmbracelet/bubbletea v0.25.0
github.com/charmbracelet/lipgloss v0.9.1
github.com/containerd/containerd v1.7.11
github.com/containerd/continuity v0.4.3
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6
github.com/containerd/stargz-snapshotter v0.15.1
github.com/containernetworking/cni v1.1.2
github.com/coreos/go-systemd/v22 v22.5.0
github.com/creack/pty v1.1.18
github.com/dave/jennifer v1.7.0
github.com/docker/cli v25.0.0-rc.3+incompatible
github.com/docker/distribution v2.8.2+incompatible
github.com/docker/docker v25.0.0-rc.3+incompatible
github.com/dschmidt/go-layerfs v0.1.0
github.com/go-git/go-git/v5 v5.11.0
github.com/gofrs/flock v0.8.1
github.com/gogo/protobuf v1.3.2
github.com/google/go-containerregistry v0.15.2
github.com/google/go-github/v50 v50.2.0
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/google/uuid v1.5.0
github.com/gorilla/websocket v1.5.0
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/iancoleman/strcase v0.3.0
github.com/jackpal/gateway v1.0.7
github.com/juju/ansiterm v1.0.0
github.com/klauspost/compress v1.17.3
github.com/mackerelio/go-osstat v0.2.4
github.com/mattn/go-isatty v0.0.20
github.com/mitchellh/go-spdx v0.1.0
github.com/moby/buildkit v0.13.0-beta1.0.20231107172747-c4f191410a41 // https://github.com/moby/buildkit/commit/c4f191410a411d7b7cb31426e2bd17fae305acf1
github.com/moby/locker v1.0.1
github.com/moby/patternmatcher v0.6.0
github.com/moby/sys/mount v0.3.3
github.com/muesli/termenv v0.15.2
github.com/nxadm/tail v1.4.8
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.0-rc5
github.com/opencontainers/runc v1.1.11
github.com/opencontainers/runtime-spec v1.1.0
github.com/pelletier/go-toml v1.9.5
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/pkg/errors v0.9.1
github.com/prometheus/procfs v0.12.0
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e
github.com/rs/cors v1.10.0
github.com/rs/zerolog v1.30.0
github.com/samber/slog-logrus/v2 v2.2.0
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29
github.com/sirupsen/logrus v1.9.3
github.com/sourcegraph/conc v0.3.0
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
github.com/tidwall/gjson v1.17.0
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea
github.com/urfave/cli v1.22.14
github.com/vektah/gqlparser/v2 v2.5.10
github.com/vito/midterm v0.1.4
github.com/vito/progrock v0.10.2-0.20240112170756-062394b3e4ae
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63
github.com/zeebo/xxh3 v1.0.2
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/exporters/jaeger v1.17.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
go.opentelemetry.io/otel/sdk v1.21.0
go.opentelemetry.io/otel/trace v1.21.0
go.opentelemetry.io/proto/otlp v1.0.0
golang.org/x/crypto v0.17.0
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/mod v0.14.0
golang.org/x/net v0.19.0
golang.org/x/oauth2 v0.15.0
golang.org/x/sync v0.5.0
golang.org/x/sys v0.15.0
golang.org/x/term v0.15.0
golang.org/x/text v0.14.0
golang.org/x/tools v0.15.0
google.golang.org/grpc v1.60.1
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools/v3 v3.5.1
oss.terrastruct.com/d2 v0.6.1
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2
)
require (
cdr.dev/slog v1.4.2 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.11.4 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/PuerkitoBio/goquery v1.8.1 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/alecthomas/chroma v0.10.0 // indirect
github.com/alecthomas/chroma/v2 v2.11.1 // indirect
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 // indirect
github.com/aws/aws-sdk-go-v2 v1.17.8 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
github.com/aws/aws-sdk-go-v2/config v1.18.21 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.20 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.2 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.62 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.32 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.26 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.33 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.24 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.27 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.26 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.1 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.31.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.12.8 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.8 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.18.9 // indirect
github.com/aws/smithy-go v1.13.5 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/charmbracelet/harmonica v0.2.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/containerd/fifo v1.1.0 // indirect
github.com/containerd/go-cni v1.1.9 // indirect
github.com/containerd/go-runc v1.1.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/nydus-snapshotter v0.13.1 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/containerd/ttrpc v1.2.2 // indirect
github.com/containerd/typeurl/v2 v2.1.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/docker/docker-credential-helpers v0.8.0 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect
github.com/hanwen/go-fuse/v2 v2.4.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.3 // indirect
github.com/in-toto/in-toto-golang v0.5.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jonboulle/clockwork v0.4.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/lunixbochs/vtclean v1.0.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mazznoer/csscolorparser v0.1.3 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/sys/mountinfo v0.6.2 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/signal v0.7.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/opencontainers/selinux v1.11.0 // indirect
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/profile v1.5.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/samber/lo v1.38.1 // indirect
github.com/samber/slog-common v0.14.0 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.4.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/shibumi/go-pathspec v1.3.0 // indirect
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/sosodev/duration v1.1.0 // indirect
github.com/spdx/tools-golang v0.5.1 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 // indirect
github.com/tonistiigi/go-archvariant v1.0.0 // indirect
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/weaveworks/promrus v1.2.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/yuin/goldmark v1.6.0 // indirect
github.com/zmb3/spotify/v2 v2.3.1 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/image v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gonum.org/v1/plot v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,374 | Update buildkit past ca71a44 | Currently, we are stuck on the current version of buildkit, since https://github.com/moby/buildkit/pull/4347#issuecomment-1872217571 seems to have introduced a deadlock.
To reproduce: update buildkit in `go.mod` to `ca71a446d9f4e31ca7c4fa30fb8fb8861b8b0117`, and run a large number of integration tests. The engine will lock up after some time - after sending `SIGUIT` to the engine, you can observe the stack trace:
```
goroutine 441 [sync.Mutex.Lock, 4 minutes]:
runtime.gopark(0xc01d5ebbf0?, 0xc00aef48e1?, 0xc0?, 0xf?, 0xc017641870?)
/usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc017641790 sp=0xc017641770 pc=0x43e42e
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:404
runtime.semacquire1(0xc01d77eb74, 0x0?, 0x3, 0x1, 0x21?)
/usr/local/go/src/runtime/sema.go:160 +0x218 fp=0xc0176417f8 sp=0xc017641790 pc=0x44f918
sync.runtime_SemacquireMutex(0xffffffffffffffff?, 0x0?, 0xc00ed7c4b0?)
/usr/local/go/src/runtime/sema.go:77 +0x25 fp=0xc017641830 sp=0xc0176417f8 pc=0x46d545
sync.(*Mutex).lockSlow(0xc01d77eb70)
/usr/local/go/src/sync/mutex.go:171 +0x15d fp=0xc017641880 sp=0xc017641830 pc=0x488f1d
sync.(*Mutex).Lock(...)
/usr/local/go/src/sync/mutex.go:90
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01d77eb70, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:91 +0x5c fp=0xc017641960 sp=0xc017641880 pc=0xcb537c
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01d77eb70?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641a28 sp=0xc017641960 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01dfe5da0, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:95 +0x17e fp=0xc017641b08 sp=0xc017641a28 pc=0xcb549e
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01dfe5da0?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641bd0 sp=0xc017641b08 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).Add(0xc01d77eb70, {0x1f7e8b0?, 0xc01dfe5da0?})
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:46 +0x190 fp=0xc017641c60 sp=0xc017641bd0 pc=0xcb4d70
github.com/moby/buildkit/solver.(*state).setEdge(0xc01dfe3440, 0x2, 0xc003975a40, 0xc0165fcb40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:178 +0x370 fp=0xc017641ce8 sp=0xc017641c60 pc=0xdef3f0
github.com/moby/buildkit/solver.(*Solver).setEdge(0xc0007071a0, {0xc003975a40?, {0x1f92360?, 0xc004bd6480?}}, 0xc003975a40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:295 +0x125 fp=0xc017641d58 sp=0xc017641ce8 pc=0xdf0265
github.com/moby/buildkit/solver.(*scheduler).dispatch(0xc0002fc770, 0xc01356a140)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:177 +0xbdb fp=0xc017641f68 sp=0xc017641d58 pc=0xdfe87b
github.com/moby/buildkit/solver.(*scheduler).loop(0xc0002fc770)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:104 +0x1d4 fp=0xc017641fc8 sp=0xc017641f68 pc=0xdfdb34
github.com/moby/buildkit/solver.newScheduler.func1()
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x25 fp=0xc017641fe0 sp=0xc017641fc8 pc=0xdfd865
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc017641fe8 sp=0xc017641fe0 pc=0x4715e1
created by github.com/moby/buildkit/solver.newScheduler in goroutine 1
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x22d
```
See https://github.com/dagger/dagger/pull/6169 for more information on when this was originally discovered.
Next steps:
- Wait until upstream PRs are merged :tada: | https://github.com/dagger/dagger/issues/6374 | https://github.com/dagger/dagger/pull/6481 | 2aefe558d80c355fb6868145e79763ef73c0e6b9 | faaa0d18ec2f8f4ddb425298e672c079869017e7 | "2024-01-08T18:47:15Z" | go | "2024-01-24T17:07:57Z" | go.sum | bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
bazil.org/fuse v0.0.0-20180421153158-65cc252bf669/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
cdr.dev/slog v1.4.2 h1:fIfiqASYQFJBZiASwL825atyzeA96NsqSxx2aL61P8I=
cdr.dev/slog v1.4.2/go.mod h1:0EkH+GkFNxizNR+GAXUEdUHanxUH5t9zqPILmPM/Vn8=
cloud.google.com/go v0.25.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.37.2/go.mod h1:H8IAquKe2L30IxoupDgqTaQvKSwF/c8prYHynGIWQbA=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw=
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY=
cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM=
cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY=
cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ=
cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI=
cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4=
cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA=
cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A=
cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc=
cloud.google.com/go v0.110.9 h1:e7ITSqGFFk4rbz/JFIqZh3G4VEHguhAL4BQcFlWtU68=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow=
cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM=
cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M=
cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s=
cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU=
cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U=
cloud.google.com/go/compute v1.23.2 h1:nWEMDhgbBkBJjfpVySqU4jgWdc22PLR0o4vEexZHers=
cloud.google.com/go/compute v1.23.2/go.mod h1:JJ0atRC0J/oWYiiVBmsSsrRnh92DhZPG4hFDcR04Rns=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY=
cloud.google.com/go/logging v1.8.1 h1:26skQWPeYhvIasWKm48+Eq7oUqdcdbwsCVwz5Ys0FvU=
cloud.google.com/go/logging v1.8.1/go.mod h1:TJjR+SimHwuC8MZ9cjByQulAMgni+RkXeI3wwctHJEI=
cloud.google.com/go/longrunning v0.5.3 h1:maKa7O9YTzmVzwdlRKr981U1Ys2auup6rpeMt8y3+RU=
cloud.google.com/go/longrunning v0.5.3/go.mod h1:y/0ga59EYu58J6SHmmQOvekvND2qODbu8ywBBW7EK7Y=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
code.gitea.io/sdk/gitea v0.12.0/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY=
contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA=
contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0=
contrib.go.opencensus.io/exporter/stackdriver v0.12.1/go.mod h1:iwB6wGarfphGGe/e5CWqyUk/cLzKnWsOKPVW3no6OTw=
contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE=
contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA=
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
git.sr.ht/~sbinet/gg v0.5.0 h1:6V43j30HM623V329xA9Ntq+WJrMjDxRjuAB1LFWF5m8=
git.sr.ht/~sbinet/gg v0.5.0/go.mod h1:G2C0eRESqlKhS7ErsNey6HHrqU1PwsnCQlekFi9Q2Oo=
github.com/99designs/gqlgen v0.17.41 h1:C1/zYMhGVP5TWNCNpmZ9Mb6CqT1Vr5SHEWoTOEJ3v3I=
github.com/99designs/gqlgen v0.17.41/go.mod h1:GQ6SyMhwFbgHR0a8r2Wn8fYgEwPxxmndLFPhU63+cJE=
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/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/AkihiroSuda/containerd-fuse-overlayfs v1.0.0/go.mod h1:0mMDvQFeLbbn1Wy8P2j3hwFhqBq+FKn8OZPno8WLmp8=
github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU=
github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4=
github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc=
github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v19.1.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v29.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v38.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 h1:Ut0ZGdOwJDw0npYEg+TLlPls3Pq6JiZaP2/aGKir7Zw=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1 h1:QSdcrd/UFJv6Bp/CfoVf2SrENpFn9P6Yh8yb+xNhYMM=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1/go.mod h1:eZ4g6GUvXiGulfIbbhh1Xr4XwUYaYaWMqzGD/284wCA=
github.com/Azure/azure-service-bus-go v0.9.1/go.mod h1:yzBx6/BUGfjfeqbRZny9AQIbIe3AcV9WZbAdpkoXOa0=
github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v10.15.5+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v12.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v14.1.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0=
github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630=
github.com/Azure/go-autorest/autorest v0.10.2/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630=
github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc=
github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM=
github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw=
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g=
github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM=
github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc=
github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA=
github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8=
github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI=
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0 h1:XMEdVDFxgulDDl0lQmAZS6j8gRQ/0pJ+ZpXH2FHVtDc=
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/Djarvur/go-err113 v0.1.0/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20191009163259-e802c2cb94ae/go.mod h1:mjwGPas4yKduTyubHvD1Atl9r1rUq8DfVy+gkVvZ+oo=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14=
github.com/Khan/genqlient v0.6.0 h1:Bwb1170ekuNIVIwTJEqvO8y7RxBxXu639VJOkKSrwAk=
github.com/Khan/genqlient v0.6.0/go.mod h1:rvChwWVTqXhiapdhLDV4bp9tz/Xvtewwkon4DpWWCRM=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Masterminds/semver/v3 v3.1.0 h1:Y2lUDsFKVRSYGojLJ1yLxSXdMmMYTYls0rCvoqmMUQk=
github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.4.15-0.20200908182639-5b44b70ab3ab/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.4.15/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
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/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ=
github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8=
github.com/Microsoft/hcsshim v0.8.10/go.mod h1:g5uw8EV2mAlzqe94tfNBNdr89fnbD/n3HV0OhsddkmM=
github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8=
github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w=
github.com/Microsoft/hcsshim/test v0.0.0-20200826032352-301c83a30e7c/go.mod h1:30A5igQ91GEmhYJF8TaRP79pMBOYynRsyOByfVV0dU4=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM=
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg=
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E=
github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo=
github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8=
github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo=
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw=
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM=
github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink=
github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek=
github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s=
github.com/alecthomas/chroma/v2 v2.11.1 h1:m9uUtgcdAwgfFNxuqj7AIG75jD2YmL61BBIJWtdzJPs=
github.com/alecthomas/chroma/v2 v2.11.1/go.mod h1:4TQu7gdfuPjSh76j78ietmqh9LiurGF0EpseFXdKMBw=
github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE=
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 h1:aM1rlcoLz8y5B2r4tTLMiVTrMtpfY0O8EScKJxaSaEc=
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apex/log v1.1.4/go.mod h1:AlpoD9aScyQfJDVHmLMEcx4oU6LqzkWp4Mg9GdAcEvQ=
github.com/apex/log v1.3.0/go.mod h1:jd8Vpsr46WAe3EZSQ/IUMs2qQD/GOycT5rPWCO1yGcs=
github.com/apex/logs v0.0.4/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo=
github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE=
github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs=
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.15.90/go.mod h1:es1KtYUFs7le0xQ3rOihkuoVD90z7D0fR2Qm4S00/gU=
github.com/aws/aws-sdk-go v1.16.26/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.19.18/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.19.45/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.20.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.25.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go-v2 v1.17.8 h1:GMupCNNI7FARX27L7GjCJM8NgivWbRgpjNI/hOQjFS8=
github.com/aws/aws-sdk-go-v2 v1.17.8/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 h1:dK82zF6kkPeCo8J1e+tGx4JdvDIQzj7ygIoLg8WMuGs=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno=
github.com/aws/aws-sdk-go-v2/config v1.18.21 h1:ENTXWKwE8b9YXgQCsruGLhvA9bhg+RqAsL9XEMEsa2c=
github.com/aws/aws-sdk-go-v2/config v1.18.21/go.mod h1:+jPQiVPz1diRnjj6VGqWcLK6EzNmQ42l7J3OqGTLsSY=
github.com/aws/aws-sdk-go-v2/credentials v1.13.20 h1:oZCEFcrMppP/CNiS8myzv9JgOzq2s0d3v3MXYil/mxQ=
github.com/aws/aws-sdk-go-v2/credentials v1.13.20/go.mod h1:xtZnXErtbZ8YGXC3+8WfajpMBn5Ga/3ojZdxHq6iI8o=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.2 h1:jOzQAesnBFDmz93feqKnsTHsXrlwWORNZMFHMV+WLFU=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.2/go.mod h1:cDh1p6XkSGSwSRIArWRc6+UqAQ7x4alQ0QfpVR6f+co=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.62 h1:LhVbe/UDWvBT/jp5LYAweFVH8s+DNtT07Qp2riWEovU=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.62/go.mod h1:4xCuu1TSwhW5UH6WOdtS4/x/9UfMr2XplzKc86Ffj78=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.32 h1:dpbVNUjczQ8Ae3QKHbpHBpfvaVkRdesxpTOe9pTouhU=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.32/go.mod h1:RudqOgadTWdcS3t/erPQo24pcVEoYyqj/kKW5Vya21I=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.26 h1:QH2kOS3Ht7x+u0gHCh06CXL/h6G8LQJFpZfFBYBNboo=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.26/go.mod h1:vq86l7956VgFr0/FWQ2BWnK07QC3WYsepKzy33qqY5U=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.33 h1:HbH1VjUgrCdLJ+4lnnuLI4iVNRvBbBELGaJ5f69ClA8=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.33/go.mod h1:zG2FcwjQarWaqXSCGpgcr3RSjZ6dHGguZSppUL0XR7Q=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.24 h1:zsg+5ouVLLbePknVZlUMm1ptwyQLkjjLMWnN+kVs5dA=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.24/go.mod h1:+fFaIjycTmpV6hjmPTbyU9Kp5MI/lA+bbibcAtmlhYA=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 h1:y2+VQzC6Zh2ojtV2LoC0MNwHWc6qXv/j2vrQtlftkdA=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11/go.mod h1:iV4q2hsqtNECrfmlXyord9u4zyuFEJX9eLgLpSPzWA8=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.27 h1:qIw7Hg5eJEc1uSxg3hRwAthPAO7NeOd4dPxhaTi0yB0=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.27/go.mod h1:Zz0kvhcSlu3NX4XJkaGgdjaa+u7a9LYuy8JKxA5v3RM=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.26 h1:uUt4XctZLhl9wBE1L8lobU3bVN8SNUP7T+olb0bWBO4=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.26/go.mod h1:Bd4C/4PkVGubtNe5iMXu5BNnaBi/9t/UsFspPt4ram8=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.1 h1:lRWp3bNu5wy0X3a8GS42JvZFlv++AKsMdzEnoiVJrkg=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.1/go.mod h1:VXBHSxdN46bsJrkniN68psSwbyBKsazQfU2yX/iSDso=
github.com/aws/aws-sdk-go-v2/service/s3 v1.31.3 h1:MG+2UlhyBL3oCOoHbUQh+Sqr3elN0I5PBe0MtVh0xMg=
github.com/aws/aws-sdk-go-v2/service/s3 v1.31.3/go.mod h1:aSl9/LJltSz1cVusiR/Mu8tvI4Sv/5w/WWrJmmkNii0=
github.com/aws/aws-sdk-go-v2/service/sso v1.12.8 h1:5cb3D6xb006bPTqEfCNaEA6PPEfBXxxy4NNeX/44kGk=
github.com/aws/aws-sdk-go-v2/service/sso v1.12.8/go.mod h1:GNIveDnP+aE3jujyUSH5aZ/rktsTM5EvtKnCqBZawdw=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.8 h1:NZaj0ngZMzsubWZbrEFSB4rgSQRbFq38Sd6KBxHuOIU=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.8/go.mod h1:44qFP1g7pfd+U+sQHLPalAPKnyfTZjJsYR4xIwsJy5o=
github.com/aws/aws-sdk-go-v2/service/sts v1.18.9 h1:Qf1aWwnsNkyAoqDqmdM3nHwN78XQjec27LjM6b9vyfI=
github.com/aws/aws-sdk-go-v2/service/sts v1.18.9/go.mod h1:yyW88BEPXA2fGFyI2KCcZC3dNpiT0CZAHaF+i656/tQ=
github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8=
github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI=
github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/bombsimon/wsl/v2 v2.0.0/go.mod h1:mf25kr/SqFEPhhcxW1+7pxzGlW+hIl/hYTKY95VwV8U=
github.com/bombsimon/wsl/v2 v2.2.0/go.mod h1:Azh8c3XGEJl9LyX0/sFC+CKMc7Ssgua0g+6abzXN4Pg=
github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk=
github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50=
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw=
github.com/campoy/embedmd v1.0.0 h1:V4kI2qTJJLf4J29RzI/MAt2c3Bl4dQSYPuflzwFH2hY=
github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8=
github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e/go.mod h1:9IOqJGCPMSc6E5ydlp5NIonxObaeu/Iub/X03EKPVYo=
github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e/go.mod h1:oDpT4efm8tSYHXV5tHSdRvBet/b/QzxZ+XyyPehvm3A=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/charmbracelet/bubbles v0.17.1 h1:0SIyjOnkrsfDo88YvPgAWvZMwXe26TP6drRvmkjyUu4=
github.com/charmbracelet/bubbles v0.17.1/go.mod h1:9HxZWlkCqz2PRwsCbYl7a3KXvGzFaDHpYbSYMJ+nE3o=
github.com/charmbracelet/bubbletea v0.25.0 h1:bAfwk7jRz7FKFl9RzlIULPkStffg5k6pNt5dywy4TcM=
github.com/charmbracelet/bubbletea v0.25.0/go.mod h1:EN3QDR1T5ZdWmdfDzYcqOCAps45+QIJbLOBxmVNWNNg=
github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ=
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
github.com/charmbracelet/lipgloss v0.9.1 h1:PNyd3jvaJbg4jRHKWXnCj1akQm4rh8dbEzN1p/u1KWg=
github.com/charmbracelet/lipgloss v0.9.1/go.mod h1:1mPmG4cxScwUQALAAnacHaigiiHB9Pmr+v1VEawJl6I=
github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg=
github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k=
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM=
github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo=
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/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE=
github.com/containerd/console v1.0.0/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE=
github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk=
github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.4.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.4.1-0.20201117152358-0edc412565dc/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.7.11 h1:lfGKw3eU35sjV0aG2eYZTiwFEY1pCzxdzicHP3SZILw=
github.com/containerd/containerd v1.7.11/go.mod h1:5UluHxHTX2rdvYuZ5OJTC5m/KJNs0Zs9wVoJm9zf5ZE=
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo=
github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8=
github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0=
github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY=
github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o=
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6 h1:MWwG/UOQv6J2hvRgKGduhJn5yKZPl4ly+PWMhfPnMzU=
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6/go.mod h1:gfcR4++fMRl37UvYy4Kw6JrQIra1bFFQVVtWEp1oon4=
github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU=
github.com/containerd/go-cni v1.1.9 h1:ORi7P1dYzCwVM6XPN4n3CbkuOx/NZ2DOqy+SHRdo9rU=
github.com/containerd/go-cni v1.1.9/go.mod h1:XYrZJ1d5W6E2VOvjffL3IZq0Dz6bsVlERHbekNK90PM=
github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0=
github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g=
github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok=
github.com/containerd/go-runc v1.1.0 h1:OX4f+/i2y5sUT7LhmcJH7GYrjjhHa1QI4e8yO0gGleA=
github.com/containerd/go-runc v1.1.0/go.mod h1:xJv2hFF7GvHtTJd9JqTS2UVxMkULUYw4JN5XAUZqH5U=
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/nydus-snapshotter v0.13.1 h1:5XNkCZ9ivLXCcyx3Jbbfh/fntkcls69uBg0x9VE8zlk=
github.com/containerd/nydus-snapshotter v0.13.1/go.mod h1:XWAz9ytsjBuKPVXDKP3xoMlcSKNsGnjXlEup6DuzUIo=
github.com/containerd/stargz-snapshotter v0.0.0-20201027054423-3a04e4c2c116/go.mod h1:o59b3PCKVAf9jjiKtCc/9hLAd+5p/rfhBfm6aBcTEr4=
github.com/containerd/stargz-snapshotter v0.15.1 h1:fpsP4kf/Z4n2EYnU0WT8ZCE3eiKDwikDhL6VwxIlgeA=
github.com/containerd/stargz-snapshotter v0.15.1/go.mod h1:74D+J1m1RMXytLmWxegXWhtOSRHPWZKpKc2NdK3S+us=
github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU=
github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk=
github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o=
github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y=
github.com/containerd/ttrpc v1.2.2 h1:9vqZr0pxwOF5koz6N0N3kJ0zDHokrcPxIR/ZR2YFtOs=
github.com/containerd/ttrpc v1.2.2/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak=
github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg=
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/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY=
github.com/containernetworking/cni v1.1.2 h1:wtRGZVv7olUHMOqouPpn3cXJWpJgM6+EUl31EQbXALQ=
github.com/containernetworking/cni v1.1.2/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/go-systemd/v22 v22.4.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4=
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
github.com/dave/jennifer v1.7.0 h1:uRbSBH9UTS64yXbh4FrMHfgfY762RD+C7bUPKODpSJE=
github.com/dave/jennifer v1.7.0/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc=
github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/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/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0=
github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY=
github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g=
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
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/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c=
github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko=
github.com/docker/cli v0.0.0-20190925022749-754388324470/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v20.10.0-beta1.0.20201029214301-1d20b15adc38+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v25.0.0-rc.3+incompatible h1:pk9OUWCVWtxZC5n9n4heCBSJq2IT6nixGUFDznbMtwo=
github.com/docker/cli v25.0.0-rc.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY=
github.com/docker/distribution v2.6.0-rc.1.0.20180327202408-83389a148052+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v0.0.0-20200511152416-a93e9eb0e95c/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v1.4.2-0.20180531152204-71cd53e4a197/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v17.12.0-ce-rc1.0.20200730172259-9f28837c1d93+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v20.10.0-beta1.0.20201110211921-af34b94a78a1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v25.0.0-rc.3+incompatible h1:f2YaukI/rOEueLwmDGAVcES5E8Y+BT/e7pQWLu/WZSk=
github.com/docker/docker v25.0.0-rc.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y=
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8=
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA=
github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI=
github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=
github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw=
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/libnetwork v0.8.0-dev.2.0.20200917202933-d0951081b35f/go.mod h1:93m0aTqz6z+g32wla4l4WxTrdtvBRmVzYRkYvasA5Z8=
github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk=
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d h1:wi6jN5LVt/ljaBG4ue79Ekzb12QfJ52L9Q98tl8SWhw=
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4=
github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y=
github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM=
github.com/dschmidt/go-layerfs v0.1.0 h1:jE6aHDfjNzS/31DS48th6EkmELwTa1Uf+aO4jRkBs3U=
github.com/dschmidt/go-layerfs v0.1.0/go.mod h1:m62aff0hn23Q/tQBRiNSeLD7EUuimDvsuCvCpzBr3Gw=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU=
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA=
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776 h1:VRIbnDWRmAh5yBdz+J6yFMF5vso1It6vn+WmM/5l7MA=
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776/go.mod h1:9wvnDu3YOfxzWM9Cst40msBF1C2UdQgDv962oTxSuMs=
github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4=
github.com/go-critic/go-critic v0.4.1/go.mod h1:7/14rZGnZbY6E38VEGk2kVhoq6itzc1E68facVDK23g=
github.com/go-critic/go-critic v0.4.3/go.mod h1:j4O3D4RoIwRqlZw5jJpx0BNfXWWbpcJoKu5cYSe4YmQ=
github.com/go-fonts/liberation v0.3.1 h1:9RPT2NhUpxQ7ukUvz3jeUckmN42T9D9TpjtQcqK/ceM=
github.com/go-fonts/liberation v0.3.1/go.mod h1:jdJ+cqF+F4SUL2V+qxBth8fvBpBDS7yloUL5Fi8GTGY=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=
github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4=
github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9 h1:NxXI5pTAtpEaU49bpLpQoDsu1zrteW/vxzTz8Cd2UAs=
github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9/go.mod h1:gWuR/CrFDDeVRFQwHPvsv9soJVB/iqymhuZQuJ3a9OM=
github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-pdf/fpdf v0.8.0 h1:IJKpdaagnWUeSkUFUjTcSzTppFxmv8ucGQyNPQWxYOQ=
github.com/go-pdf/fpdf v0.8.0/go.mod h1:gfqhcNwXrsd3XYKte9a7vM3smvU/jB4ZRDrmWSxpfdc=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4=
github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ=
github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg=
github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw=
github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU=
github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk=
github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI=
github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks=
github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc=
github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8=
github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/flock v0.7.3/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU=
github.com/gogo/googleapis v1.3.2/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=
github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc=
github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs=
github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/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.1/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.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
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.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4=
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk=
github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0=
github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8=
github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o=
github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU=
github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU=
github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU=
github.com/golangci/golangci-lint v1.23.7/go.mod h1:g/38bxfhp4rI7zeWSxcdIeHTQGS58TCak8FYcyCmavQ=
github.com/golangci/golangci-lint v1.27.0/go.mod h1:+eZALfxIuthdrHPtfM7w/R3POJLjHDfJJw8XZl9xOng=
github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU=
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg=
github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o=
github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA=
github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA=
github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI=
github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4=
github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4=
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ=
github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/crfs v0.0.0-20191108021818-71d77da419c9/go.mod h1:etGhoOqfwPkooV6aqoX3eBGQOJblqdoc9XvWOeuxpPw=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/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.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/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.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
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-containerregistry v0.0.0-20191010200024-a3d713f9b7f8/go.mod h1:KyKXa9ciM8+lgMXwOVsXi7UxGrsf9mM61Mzs+xKUrKE=
github.com/google/go-containerregistry v0.1.2/go.mod h1:GPivBPgdAyd2SU+vf6EpsgOtWDuPqjW0hJZt4rNdTZ4=
github.com/google/go-containerregistry v0.15.2 h1:MMkSh+tjSdnmJZO7ljvEqV1DjfekB6VUEAZgy3a+TQE=
github.com/google/go-containerregistry v0.15.2/go.mod h1:wWK+LnOv4jXMM23IT/F1wdYftGWGr47Is8CG+pmHK1Q=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM=
github.com/google/go-github/v50 v50.2.0 h1:j2FyongEHlO9nxXLc+LP3wuBSVU9mVxfpdYUexMpIfk=
github.com/google/go-github/v50 v50.2.0/go.mod h1:VBY8FB6yPIjrtKhozXv4FQupxKLS6H4m6xFZlT43q8Q=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/go-replayers/grpcreplay v0.1.0/go.mod h1:8Ig2Idjpr6gifRd6pNVggX6TC1Zw6Jx74AKp7QNH2QE=
github.com/google/go-replayers/httpreplay v0.1.0/go.mod h1:YKZViNhiGgqdBlUbI2MwGpq4pXxNmhJLPHQ7cv2b5no=
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg=
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a h1:fEBsGL/sjAuJrgah5XqmmYsTLzJp/TO9Lhy39gkverk=
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/rpmpack v0.0.0-20191226140753-aa36bfddb3a0/go.mod h1:RaTPr0KUf2K7fnZYLNDrr8rxAamWs3iNywJLtQ2AzBg=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1/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.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/wire v0.3.0/go.mod h1:i1DMg/Lu8Sz5yYl25iOdmc5CT5qusaa+zmRWs16741s=
github.com/google/wire v0.4.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU=
github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM=
github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM=
github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c=
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
github.com/gookit/color v1.2.4/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg=
github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/goreleaser/goreleaser v0.136.0/go.mod h1:wiKrPUeSNh6Wu8nUHxZydSOVQ/OZvOaO7DTtFqie904=
github.com/goreleaser/nfpm v1.2.1/go.mod h1:TtWrABZozuLOttX2uDlYyECfQX7x5XYkVxhjYcR6G9w=
github.com/goreleaser/nfpm v1.3.0/go.mod h1:w0p7Kc9TAUgWMyrub63ex3M2Mgw88M4GZXoTq5UCb40=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.2/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y=
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw=
github.com/hanwen/go-fuse v1.0.0/go.mod h1:unqXarDXqzAk0rt98O2tVndEPIpUgLD9+rwFisZH3Ok=
github.com/hanwen/go-fuse/v2 v2.0.3/go.mod h1:0EQM6aH2ctVpvZ6a+onrQ/vaykxh2GH7hy3e13vzTUY=
github.com/hanwen/go-fuse/v2 v2.4.0 h1:12OhD7CkXXQdvxG2osIdBQLdXh+nmLXY9unkUIe/xaU=
github.com/hanwen/go-fuse/v2 v2.4.0/go.mod h1:xKwi1cF7nXAOBCXujD5ie0ZKsxc8GGSA1rlMJc+8IJs=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM=
github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/go-retryablehttp v0.6.4/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA=
github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru/v2 v2.0.3 h1:kmRrRLlInXvng0SmLxmQpQkpbYAvcXm7NPDrgxJa9mE=
github.com/hashicorp/golang-lru/v2 v2.0.3/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hashicorp/uuid v0.0.0-20160311170451-ebb0a03e909c/go.mod h1:fHzc09UnyJyqyW+bFuq864eh+wC7dj65aXmXLRe5to0=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/in-toto/in-toto-golang v0.5.0 h1:hb8bgwr0M2hGdDsLjkJ3ZqJ8JFLL/tgYdAxF/XEFBbY=
github.com/in-toto/in-toto-golang v0.5.0/go.mod h1:/Rq0IZHLV7Ku5gielPT4wPHJfH1GdHMCq8+WPxw8/BE=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg=
github.com/jackpal/gateway v1.0.7 h1:7tIFeCGmpyrMx9qvT0EgYUi7cxVW48a0mMvnIL17bPM=
github.com/jackpal/gateway v1.0.7/go.mod h1:aRcO0UFKt+MgIZmRmvOmnejdDT4Y1DNiNOsSd1AcIbA=
github.com/jaguilar/vt100 v0.0.0-20150826170717-2703a27b14ea/go.mod h1:QMdK4dGB3YhEW2BmA1wgGpPYI3HZy/5gD705PXKUVSg=
github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s=
github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0=
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0=
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/juju/ansiterm v1.0.0 h1:gmMvnZRq7JZJx6jkfSq9/+2LMrVEwGwt7UR6G+lmDEg=
github.com/juju/ansiterm v1.0.0/go.mod h1:PyXUpnI3olx3bsPcHt98FGPX/KCFZ1Fi+hw1XLI6384=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA=
github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/lunixbochs/vtclean v1.0.0 h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+LVb8=
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs=
github.com/mackerelio/go-osstat v0.2.4/go.mod h1:Zy+qzGdZs3A9cuIqmgbJvwbmLQH9dJvtio5ZjJTbdlQ=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU=
github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.10/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo=
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY=
github.com/mazznoer/csscolorparser v0.1.3 h1:vug4zh6loQxAUxfU1DZEu70gTPufDPspamZlHAkKcxE=
github.com/mazznoer/csscolorparser v0.1.3/go.mod h1:Aj22+L/rYN/Y6bj3bYqO3N6g1dtdHtGfQ32xZ5PJQic=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk=
github.com/mitchellh/go-spdx v0.1.0 h1:50JnVzkL3kWreQ5Qb4Pi3Qx9e+bbYrt8QglJDpfeBEs=
github.com/mitchellh/go-spdx v0.1.0/go.mod h1:FFi4Cg1fBuN/JCtPtP8PEDmcBjvO3gijQVl28YjIBVQ=
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ=
github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=
github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A=
github.com/moby/buildkit v0.8.1/go.mod h1:/kyU1hKy/aYCuP39GZA9MaKioovHku57N6cqlKZIaiQ=
github.com/moby/buildkit v0.13.0-beta1.0.20231107172747-c4f191410a41 h1:QNbbQOQLlEH2nUUKl18FUmHFTybJXsfVyepdHwOsQOg=
github.com/moby/buildkit v0.13.0-beta1.0.20231107172747-c4f191410a41/go.mod h1:VE6gCOYRW2hbxnxtt7udKkYMF73YdvkgIrGhkB0EiDA=
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
github.com/moby/sys/mount v0.1.0/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74=
github.com/moby/sys/mount v0.1.1/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74=
github.com/moby/sys/mount v0.3.3 h1:fX1SVkXFJ47XWDoeFW4Sq7PdQJnV2QIDZAqjNqgEjUs=
github.com/moby/sys/mount v0.3.3/go.mod h1:PBaEorSNTLG5t/+4EgukEQVlAvVEc6ZjTySwKdqp5K0=
github.com/moby/sys/mountinfo v0.1.0/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o=
github.com/moby/sys/mountinfo v0.1.3/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o=
github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A=
github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78=
github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
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/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2/go.mod h1:TjQg8pa4iejrUrjiz0MCtMV38jdMNW4doKSiBrEvCQQ=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c=
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc=
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
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/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
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/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc10/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc92/go.mod h1:X1zlU4p7wOlX4+WRCz+hvlRv8phdL7UqbYD+vQwNMmE=
github.com/opencontainers/runc v1.1.11 h1:9LjxyVlE0BPMRP2wuQDRlHV4941Jp9rc3F0+YKimopA=
github.com/opencontainers/runc v1.1.11/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8=
github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
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-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE=
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02/go.mod h1:JNdpVEzCpXBgIiv4ds+TzhN1hrtxq6ClLrTlT9OQRSc=
github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9/go.mod h1:PLldrQSroqzH70Xl+1DQcGnefIbqsKR7UDaiux3zV+w=
github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170 h1:DiLBVp4DAcZlBVBEtJpNWZpZVq0AEeCY7Hqk8URVs4o=
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170/go.mod h1:uQd4a7Rh3ZsVg5j0lNyAfyxIeGde9yrlhjF78GzeW0c=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/profile v1.5.0 h1:042Buzk+NhDI+DeSAA62RwJL8VAuZUMQZUjCsRz1Mug=
github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18=
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ=
github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=
github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY=
github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
github.com/prometheus/exporter-toolkit v0.8.2/go.mod h1:00shzmJL7KxcsabLWcONwpyNEuWhREOnFqZW7vadFS0=
github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e h1:51xcRlSMBU5rhM9KahnJGfEsBPVPz3182TgFRowA8yY=
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e/go.mod h1:tcaRap0jS3eifrEEllL6ZMd9dg8IlDpi2S1oARrQ+NI=
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
github.com/quasilyte/go-ruleguard v0.1.2-0.20200318202121-b00d7a75d3d8/go.mod h1:CGFX09Ci3pq9QZdj86B+VGIdNj4VyCo2iPOGS9esB/k=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rs/cors v1.10.0 h1:62NOS1h+r8p1mW6FM0FSB0exioXLhd/sh15KpjWBZ+8=
github.com/rs/cors v1.10.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c=
github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w=
github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryancurrah/gomodguard v1.0.4/go.mod h1:9T/Cfuxs5StfsocWr4WzDL36HqnX0fVb9d5fSEaLhoE=
github.com/ryancurrah/gomodguard v1.1.0/go.mod h1:4O8tr7hBODaGE6VIhfJDHcwzh5GUccKSJBU0UMXJFVM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/samber/slog-common v0.14.0 h1:g4TGALXmqogbJu3epRhjIWUJKSpgqB9VyN2OEnS8Wyg=
github.com/samber/slog-common v0.14.0/go.mod h1:Qjrfhwk79XiCIhBj8+jTq1Cr0u9rlWbjawh3dWXzaHk=
github.com/samber/slog-logrus/v2 v2.2.0 h1:Noku55MKf/x57c2j5/LsLzw75biW86Q29bOkZpnLAgY=
github.com/samber/slog-logrus/v2 v2.2.0/go.mod h1:C0egl62QrwHPY9RcsEXa3E7FHb6/xM9uaVSuc7piJXU=
github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b/go.mod h1:am+Fp8Bt506lA3Rk3QCmSqmYmLMnPDhdDUcosQCAx+I=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624Y=
github.com/sebdah/goldie/v2 v2.5.3/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI=
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
github.com/secure-systems-lab/go-securesystemslib v0.4.0/go.mod h1:FGBZgq2tXWICsxWQW1msNf49F0Pf2Op5Htayx335Qbs=
github.com/securego/gosec v0.0.0-20200103095621-79fbf3af8d83/go.mod h1:vvbZ2Ae7AzSq3/kywjUDxSNq2SJ27RxCz2un0H3ePqE=
github.com/securego/gosec v0.0.0-20200401082031-e946c8c39989/go.mod h1:i9l/TNj+yDFh9SZXUTvspXTjbFXgZGP/UvhU1S65A4A=
github.com/securego/gosec/v2 v2.3.0/go.mod h1:UzeVyUXbxukhLeHKV3VVqo7HdoQR9MrRfFmZYotn8ME=
github.com/sercand/kuberesolver v2.4.0+incompatible/go.mod h1:lWF3GL0xptCB/vCiJPl/ZshwPsX/n4Y7u0CW9E7aQIQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc=
github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI=
github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE=
github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ=
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 h1:B1PEwpArrNp4dkQrfxh/abbBAOZBVp0ds+fBEOUOqOc=
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29/go.mod h1:AuYgA5Kyo4c7HfUmvRGs/6rGlMMV/6B1bVnB9JxJEEg=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
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/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ=
github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/sosodev/duration v1.1.0 h1:kQcaiGbJaIsRqgQy7VGlZrVw1giWO+lDoX3MCPnpVO4=
github.com/sosodev/duration v1.1.0/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE=
github.com/sourcegraph/go-diff v0.5.3/go.mod h1:v9JDtjCE4HHHCZGId75rg8gkKKa98RVjBcBGsVmMmak=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb/go.mod h1:uKWaldnbMnjsSAXRurWqqrdyZen1R7kxl8TkmWk2OyM=
github.com/spdx/tools-golang v0.5.1 h1:fJg3SVOGG+eIva9ZUBm/hvyA7PIPVFjRxUKe6fdAgwE=
github.com/spdx/tools-golang v0.5.1/go.mod h1:/DRDQuBfB37HctM29YtrX1v+bXiVmT2OpQDalRmX9aU=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
github.com/tetafro/godot v0.3.7/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
github.com/tetafro/godot v0.4.2/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM=
github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0=
github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0=
github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao=
github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig=
github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig=
github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85/go.mod h1:a7cilN64dG941IOXfhJhlH0qB92hxJ9A1ewrdUmJ6xo=
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302 h1:ZT8ibgassurSISJ1Pj26NsM3vY2jxFZn63Nd/TpHmRw=
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302/go.mod h1:9kMVqMyQ/Sx2df5LtnGG+nbrmiZzCS7V6gjW3oGHsvI=
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 h1:8eY6m1mjgyB8XySUR7WvebTM8D/Vs86jLJzD/Tw7zkc=
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7/go.mod h1:qqvyZqkfwkoJuPU/bw61bItaoO0SJ8YSW0vSVRRvsRg=
github.com/tonistiigi/go-archvariant v1.0.0 h1:5LC1eDWiBNflnTF1prCiX09yfNHIxDC/aukdhCdTyb0=
github.com/tonistiigi/go-archvariant v1.0.0/go.mod h1:TxFmO5VS6vMq2kvs3ht04iPXtu2rUT/erOnGFYfk5Ho=
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/v/cCndK0AMpt1wiVFb/YYmqB3/QG0=
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk=
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 h1:Y/M5lygoNPKwVNLMPXgVfsRT40CSFKXCxuU8LoHySjs=
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc=
github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-client-go v2.28.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA=
github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA=
github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk=
github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA=
github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s=
github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4=
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts=
github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk=
github.com/vdemeester/k8s-pkg-credentialprovider v1.17.4/go.mod h1:inCTmtUdr5KJbreVojo06krnTgaeAz/Z7lynpPk/Q2c=
github.com/vektah/gqlparser/v2 v2.5.10 h1:6zSM4azXC9u4Nxy5YmdmGu4uKamfwsdKTwp5zsEealU=
github.com/vektah/gqlparser/v2 v2.5.10/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vito/midterm v0.1.4 h1:SALq5mQ+AgzeZxjL4loB6Uk5TZc9JMyX2ELA/NVH65c=
github.com/vito/midterm v0.1.4/go.mod h1:Mm3u6lrpzo2EFSJbwksKOdottTJzYePK8c1KJy4aRbk=
github.com/vito/progrock v0.10.2-0.20240112170756-062394b3e4ae h1:l5+peCyvBr937ywBwKfsPiCm9hFJwTKlShUNLwWr6BQ=
github.com/vito/progrock v0.10.2-0.20240112170756-062394b3e4ae/go.mod h1:Q8hxIUXZW8vkezLwH4TnRmXv+XdRb4KfLtS9t5RtH9g=
github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU=
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63 h1:qZcnPZbiX8gGs3VmipVc3ft29vPYBZzlox/04Von6+k=
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63/go.mod h1:KoQ+3z63GUJzQ7AhU0AWQNU+LPda2EwL/cx1PlbDzVQ=
github.com/weaveworks/promrus v1.2.0 h1:jOLf6pe6/vss4qGHjXmGz4oDJQA+AOCqEL3FvvZGz7M=
github.com/weaveworks/promrus v1.2.0/go.mod h1:SaE82+OJ91yqjrE1rsvBWVzNZKcHYFtMUyS1+Ogs/KA=
github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xanzy/go-gitlab v0.32.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/goldmark v1.6.0 h1:boZcn2GTjpsynOsC0iJHnBWa4Bi0qzfJjthwauItG68=
github.com/yuin/goldmark v1.6.0/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs=
github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA=
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg=
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
github.com/zmb3/spotify/v2 v2.3.1 h1:aEyIPotROM3JJjHMCImFROgnPIUpzVo8wymYSaPSd9w=
github.com/zmb3/spotify/v2 v2.3.1/go.mod h1:+LVh9CafHu7SedyqYmEf12Rd01dIVlEL845yNhksW0E=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A=
go.opencensus.io v0.19.2/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0 h1:2ea0IkZBsWH+HA2GkD+7+hRw2u97jzdFyRtXuO14a1s=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0/go.mod h1:4m3RnBBb+7dB9d21y510oO1pdB1V4J6smNf14WXcBFQ=
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/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc=
go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo=
go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4=
go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU=
go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4=
go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM=
go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8=
go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E=
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.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
gocloud.dev v0.19.0/go.mod h1:SmKwiR8YwIMMJvQBKLsC3fHNyMwXLw3PMDO+VVteJMI=
golang.org/x/build v0.0.0-20190314133821-5284462c4bec/go.mod h1:atTaCNAy0f16Ah5aV1gMSwgiKVHwu/JncqDpuRr7lS4=
golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4=
golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20170114055629-f2499483f923/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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/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-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ=
golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM=
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190620070143-6f217b454f45/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191115151921-52ab43148777/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-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200917073148-efd3b9a0ff20/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/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-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/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-20220610221304-9f5ed59c137d/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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/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.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113232020-e2727e816f5a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200102140908-9497f49d5709/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200204192400-7124308813f3/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200331202046-9d5940d49312/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8=
golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0=
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ=
gonum.org/v1/plot v0.14.0 h1:+LBDVFYwFe4LHhdP8coW6296MBEY4nQ+Y4vuUpJopcE=
gonum.org/v1/plot v0.14.0/go.mod h1:MLdR9424SJed+5VqC6MsouEpig9pZX2VZ57H9ko2bXU=
google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181220000619-583d854617af/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.2.0/go.mod h1:IfRCZScioGtypHNTlz3gFk67J8uePVW7uDTBzXuIkhU=
google.golang.org/api v0.3.0/go.mod h1:IuvZyQh8jgscv8qWfQ4ABd8m7hEudgBFM/EdhA3BnXw=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4=
google.golang.org/api v0.6.1-0.20190607001116-5213b8090861/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo=
google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4=
google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw=
google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU=
google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k=
google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI=
google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I=
google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo=
google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g=
google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA=
google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8=
google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs=
google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA=
google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw=
google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg=
google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.3.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/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A=
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24=
google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w=
google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 h1:I6WNifs6pF9tNdSob2W24JtyxIYjzFB9qDlpUC76q+U=
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405/go.mod h1:3WDQMjmJk36UQhjQ89emUzb1mdaHcPeeAh4SCBKznB4=
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo=
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.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.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU=
google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20180904230853-4e7be11eab3f/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
k8s.io/api v0.17.4/go.mod h1:5qxx6vjmwUVG2nHQTKGlLts8Tbok8PzHl4vHtVFuZCA=
k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw=
k8s.io/apimachinery v0.0.0-20180904193909-def12e63c512/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=
k8s.io/apimachinery v0.17.4/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0g=
k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA=
k8s.io/apiserver v0.17.4/go.mod h1:5ZDQ6Xr5MNBxyi3iUZXS84QOhZl+W7Oq2us/29c0j9I=
k8s.io/client-go v0.0.0-20180910083459-2cefa64ff137/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s=
k8s.io/client-go v0.17.4/go.mod h1:ouF6o5pz3is8qU0/qYL2RnoxOPqgfuidYLowytyLJmc=
k8s.io/client-go v0.19.0/go.mod h1:H9E/VT95blcFQnlyShFgnFT9ZnJOAceiUHM3MlRC+mU=
k8s.io/cloud-provider v0.17.4/go.mod h1:XEjKDzfD+b9MTLXQFlDGkk6Ho8SGMpaU8Uugx/KNK9U=
k8s.io/code-generator v0.17.2/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s=
k8s.io/component-base v0.17.4/go.mod h1:5BRqHMbbQPm2kKu35v3G+CpVq4K0RJKC7TRioF0I9lE=
k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM=
k8s.io/csi-translation-lib v0.17.4/go.mod h1:CsxmjwxEI0tTNMzffIAcgR9lX4wOh6AKHdxQrT7L0oo=
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc=
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o=
k8s.io/kubernetes v1.11.10/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/legacy-cloud-providers v0.17.4/go.mod h1:FikRNoD64ECjkxO36gkDgJeiQWwyZTuBkhu+yxOc1Js=
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
kernel.org/pub/linux/libs/security/libcap/cap v1.2.67 h1:sPQ9qlSNR26fToTKbxe/HDWJlXvBLqGmt84LGCQkOy0=
kernel.org/pub/linux/libs/security/libcap/cap v1.2.67/go.mod h1:GkntoBuwffz19qtdFVB+k2NtWNN+yCKnC/Ykv/hMiTU=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.67 h1:NxbXJ7pDVq0FKBsqjieT92QDXI2XaqH2HAi4QcCOHt8=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.67/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24=
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw=
mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7/go.mod h1:HGC5lll35J70Y5v7vCGb9oLhHoScFwkHDJm/05RdSTc=
oss.terrastruct.com/d2 v0.6.1 h1:TEk7pl5yS1cnUxHOsIQ7bZCs+iRGsb5FaofaianfZk8=
oss.terrastruct.com/d2 v0.6.1/go.mod h1:ZyzsiefzsZ3w/BDnfF/hcDx9LKBlgieuolX8pXi7oJY=
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2 h1:n6y6RoZCgZDchN4gLGlzNRO1Jdf9xOGGqohDBph5BG8=
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2/go.mod h1:eMWv0sOtD9T2RUl90DLWfuShZCYp4NrsqNpI8eqO6U4=
pack.ag/amqp v0.11.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
sourcegraph.com/sqs/pbtypes v1.0.0/go.mod h1:3AciMUv4qUuRHRHhOG4TZOB+72GdPVz5k+c648qsFS4=
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,374 | Update buildkit past ca71a44 | Currently, we are stuck on the current version of buildkit, since https://github.com/moby/buildkit/pull/4347#issuecomment-1872217571 seems to have introduced a deadlock.
To reproduce: update buildkit in `go.mod` to `ca71a446d9f4e31ca7c4fa30fb8fb8861b8b0117`, and run a large number of integration tests. The engine will lock up after some time - after sending `SIGUIT` to the engine, you can observe the stack trace:
```
goroutine 441 [sync.Mutex.Lock, 4 minutes]:
runtime.gopark(0xc01d5ebbf0?, 0xc00aef48e1?, 0xc0?, 0xf?, 0xc017641870?)
/usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc017641790 sp=0xc017641770 pc=0x43e42e
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:404
runtime.semacquire1(0xc01d77eb74, 0x0?, 0x3, 0x1, 0x21?)
/usr/local/go/src/runtime/sema.go:160 +0x218 fp=0xc0176417f8 sp=0xc017641790 pc=0x44f918
sync.runtime_SemacquireMutex(0xffffffffffffffff?, 0x0?, 0xc00ed7c4b0?)
/usr/local/go/src/runtime/sema.go:77 +0x25 fp=0xc017641830 sp=0xc0176417f8 pc=0x46d545
sync.(*Mutex).lockSlow(0xc01d77eb70)
/usr/local/go/src/sync/mutex.go:171 +0x15d fp=0xc017641880 sp=0xc017641830 pc=0x488f1d
sync.(*Mutex).Lock(...)
/usr/local/go/src/sync/mutex.go:90
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01d77eb70, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:91 +0x5c fp=0xc017641960 sp=0xc017641880 pc=0xcb537c
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01d77eb70?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641a28 sp=0xc017641960 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01dfe5da0, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:95 +0x17e fp=0xc017641b08 sp=0xc017641a28 pc=0xcb549e
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01dfe5da0?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641bd0 sp=0xc017641b08 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).Add(0xc01d77eb70, {0x1f7e8b0?, 0xc01dfe5da0?})
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:46 +0x190 fp=0xc017641c60 sp=0xc017641bd0 pc=0xcb4d70
github.com/moby/buildkit/solver.(*state).setEdge(0xc01dfe3440, 0x2, 0xc003975a40, 0xc0165fcb40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:178 +0x370 fp=0xc017641ce8 sp=0xc017641c60 pc=0xdef3f0
github.com/moby/buildkit/solver.(*Solver).setEdge(0xc0007071a0, {0xc003975a40?, {0x1f92360?, 0xc004bd6480?}}, 0xc003975a40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:295 +0x125 fp=0xc017641d58 sp=0xc017641ce8 pc=0xdf0265
github.com/moby/buildkit/solver.(*scheduler).dispatch(0xc0002fc770, 0xc01356a140)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:177 +0xbdb fp=0xc017641f68 sp=0xc017641d58 pc=0xdfe87b
github.com/moby/buildkit/solver.(*scheduler).loop(0xc0002fc770)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:104 +0x1d4 fp=0xc017641fc8 sp=0xc017641f68 pc=0xdfdb34
github.com/moby/buildkit/solver.newScheduler.func1()
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x25 fp=0xc017641fe0 sp=0xc017641fc8 pc=0xdfd865
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc017641fe8 sp=0xc017641fe0 pc=0x4715e1
created by github.com/moby/buildkit/solver.newScheduler in goroutine 1
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x22d
```
See https://github.com/dagger/dagger/pull/6169 for more information on when this was originally discovered.
Next steps:
- Wait until upstream PRs are merged :tada: | https://github.com/dagger/dagger/issues/6374 | https://github.com/dagger/dagger/pull/6481 | 2aefe558d80c355fb6868145e79763ef73c0e6b9 | faaa0d18ec2f8f4ddb425298e672c079869017e7 | "2024-01-08T18:47:15Z" | go | "2024-01-24T17:07:57Z" | internal/mage/go.mod | module github.com/dagger/dagger/internal/mage
go 1.21.3
require (
dagger.io/dagger v0.9.7
github.com/dagger/dagger v0.9.7
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/hexops/gotextdiff v1.0.3
github.com/magefile/mage v1.15.0
github.com/moby/buildkit v0.13.0-beta1.0.20231107172747-c4f191410a41
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/mod v0.14.0
golang.org/x/sync v0.5.0
)
require (
github.com/99designs/gqlgen v0.17.41 // indirect
github.com/Khan/genqlient v0.6.0 // indirect
github.com/adrg/xdg v0.4.0 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sosodev/duration v1.1.0 // indirect
github.com/vektah/gqlparser/v2 v2.5.10 // indirect
golang.org/x/sys v0.15.0 // indirect
)
replace github.com/dagger/dagger => ../../
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,374 | Update buildkit past ca71a44 | Currently, we are stuck on the current version of buildkit, since https://github.com/moby/buildkit/pull/4347#issuecomment-1872217571 seems to have introduced a deadlock.
To reproduce: update buildkit in `go.mod` to `ca71a446d9f4e31ca7c4fa30fb8fb8861b8b0117`, and run a large number of integration tests. The engine will lock up after some time - after sending `SIGUIT` to the engine, you can observe the stack trace:
```
goroutine 441 [sync.Mutex.Lock, 4 minutes]:
runtime.gopark(0xc01d5ebbf0?, 0xc00aef48e1?, 0xc0?, 0xf?, 0xc017641870?)
/usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc017641790 sp=0xc017641770 pc=0x43e42e
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:404
runtime.semacquire1(0xc01d77eb74, 0x0?, 0x3, 0x1, 0x21?)
/usr/local/go/src/runtime/sema.go:160 +0x218 fp=0xc0176417f8 sp=0xc017641790 pc=0x44f918
sync.runtime_SemacquireMutex(0xffffffffffffffff?, 0x0?, 0xc00ed7c4b0?)
/usr/local/go/src/runtime/sema.go:77 +0x25 fp=0xc017641830 sp=0xc0176417f8 pc=0x46d545
sync.(*Mutex).lockSlow(0xc01d77eb70)
/usr/local/go/src/sync/mutex.go:171 +0x15d fp=0xc017641880 sp=0xc017641830 pc=0x488f1d
sync.(*Mutex).Lock(...)
/usr/local/go/src/sync/mutex.go:90
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01d77eb70, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:91 +0x5c fp=0xc017641960 sp=0xc017641880 pc=0xcb537c
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01d77eb70?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641a28 sp=0xc017641960 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).writeRawProgress(0xc01dfe5da0, 0xc004bd6e00)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:95 +0x17e fp=0xc017641b08 sp=0xc017641a28 pc=0xcb549e
github.com/moby/buildkit/util/progress.(*MultiWriter).WriteRawProgress(0xc01dfe5da0?, 0xc004bd6e00?)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:87 +0xac fp=0xc017641bd0 sp=0xc017641b08 pc=0xcb516c
github.com/moby/buildkit/util/progress.(*MultiWriter).Add(0xc01d77eb70, {0x1f7e8b0?, 0xc01dfe5da0?})
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/util/progress/multiwriter.go:46 +0x190 fp=0xc017641c60 sp=0xc017641bd0 pc=0xcb4d70
github.com/moby/buildkit/solver.(*state).setEdge(0xc01dfe3440, 0x2, 0xc003975a40, 0xc0165fcb40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:178 +0x370 fp=0xc017641ce8 sp=0xc017641c60 pc=0xdef3f0
github.com/moby/buildkit/solver.(*Solver).setEdge(0xc0007071a0, {0xc003975a40?, {0x1f92360?, 0xc004bd6480?}}, 0xc003975a40)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/jobs.go:295 +0x125 fp=0xc017641d58 sp=0xc017641ce8 pc=0xdf0265
github.com/moby/buildkit/solver.(*scheduler).dispatch(0xc0002fc770, 0xc01356a140)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:177 +0xbdb fp=0xc017641f68 sp=0xc017641d58 pc=0xdfe87b
github.com/moby/buildkit/solver.(*scheduler).loop(0xc0002fc770)
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:104 +0x1d4 fp=0xc017641fc8 sp=0xc017641f68 pc=0xdfdb34
github.com/moby/buildkit/solver.newScheduler.func1()
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x25 fp=0xc017641fe0 sp=0xc017641fc8 pc=0xdfd865
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc017641fe8 sp=0xc017641fe0 pc=0x4715e1
created by github.com/moby/buildkit/solver.newScheduler in goroutine 1
/go/pkg/mod/github.com/moby/buildkit@v0.13.0-beta1.0.20231107172820-ca71a446d9f4/solver/scheduler.go:35 +0x22d
```
See https://github.com/dagger/dagger/pull/6169 for more information on when this was originally discovered.
Next steps:
- Wait until upstream PRs are merged :tada: | https://github.com/dagger/dagger/issues/6374 | https://github.com/dagger/dagger/pull/6481 | 2aefe558d80c355fb6868145e79763ef73c0e6b9 | faaa0d18ec2f8f4ddb425298e672c079869017e7 | "2024-01-08T18:47:15Z" | go | "2024-01-24T17:07:57Z" | internal/mage/go.sum | dagger.io/dagger v0.9.7 h1:qPZRJvQWiSCr8OONEMQht62pWQ2lD68YMZpb3gFkBsE=
dagger.io/dagger v0.9.7/go.mod h1:ic2UD6gS5iBp2e6VWPxyb7h6VpAyhFN6U7/TDlriox8=
github.com/99designs/gqlgen v0.17.41 h1:C1/zYMhGVP5TWNCNpmZ9Mb6CqT1Vr5SHEWoTOEJ3v3I=
github.com/99designs/gqlgen v0.17.41/go.mod h1:GQ6SyMhwFbgHR0a8r2Wn8fYgEwPxxmndLFPhU63+cJE=
github.com/Khan/genqlient v0.6.0 h1:Bwb1170ekuNIVIwTJEqvO8y7RxBxXu639VJOkKSrwAk=
github.com/Khan/genqlient v0.6.0/go.mod h1:rvChwWVTqXhiapdhLDV4bp9tz/Xvtewwkon4DpWWCRM=
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
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/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg=
github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/moby/buildkit v0.13.0-beta1.0.20231107172747-c4f191410a41 h1:QNbbQOQLlEH2nUUKl18FUmHFTybJXsfVyepdHwOsQOg=
github.com/moby/buildkit v0.13.0-beta1.0.20231107172747-c4f191410a41/go.mod h1:VE6gCOYRW2hbxnxtt7udKkYMF73YdvkgIrGhkB0EiDA=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/sosodev/duration v1.1.0 h1:kQcaiGbJaIsRqgQy7VGlZrVw1giWO+lDoX3MCPnpVO4=
github.com/sosodev/duration v1.1.0/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/vektah/gqlparser/v2 v2.5.10 h1:6zSM4azXC9u4Nxy5YmdmGu4uKamfwsdKTwp5zsEealU=
github.com/vektah/gqlparser/v2 v2.5.10/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,359 | CLI: update handling of various core types | As described in [this comment](https://github.com/dagger/dagger/issues/6229#issuecomment-1863649336) (and that issue generally), we need to make some adjustments to the CLIs behavior when `dagger call` ends in various core types.
There's a handful of related adjustments needed here. Creating as a checklist for now to save issue spam; can break down into more issues if useful though. I'm including my initial suggestions on how to handle these, but to be clear these are not finalized decisions and the final call can be made as part of implementing this
- [ ] Handle arbitrary user objects
- Print fields (as in `TypeDef` fields, so just trivially resolvable values) as a json object
- [x] Handle container
- call `sync` only, rely on progress output for anything else
- [x] Handle directory
- call `sync` only, rely on progress output for anything else
- [x] Handle file
- call `sync` only, rely on progress output for anything else
- [ ] Handle IDs returned by `sync` (i.e. the case where the user explicitly chains `sync`)
- just rely on progress output, don't show the id
| https://github.com/dagger/dagger/issues/6359 | https://github.com/dagger/dagger/pull/6482 | 2999573c5a34e85b8baac8c0150881d9c08a86b8 | d91ac42c196873830c2e0876b251f3bf4d62ea49 | "2024-01-03T20:19:06Z" | go | "2024-01-26T18:48:04Z" | cmd/dagger/call.go | package main
import (
"fmt"
"io"
"os"
"path/filepath"
"github.com/spf13/cobra"
)
var outputPath string
var outputExport bool
var callCmd = &FuncCommand{
Name: "call",
Short: "Call a module function",
Long: "Call a module function and print the result.\n\nOn a container, the stdout will be returned. On a directory, the list of entries, and on a file, its contents.",
Init: func(cmd *cobra.Command) {
cmd.PersistentFlags().StringVarP(&outputPath, "output", "o", "", "Path in the host to save the result to")
},
OnSelectObjectLeaf: func(c *FuncCommand, name string) error {
switch name {
case Container:
if outputPath != "" {
c.Select("export")
c.Arg("path", outputPath)
outputExport = true
return nil
}
// TODO: Combined `output` in the API. Querybuilder
// doesn't support querying sibling fields.
c.Select("stdout")
case Directory:
if outputPath != "" {
c.Select("export")
c.Arg("path", outputPath)
outputExport = true
return nil
}
c.Select("entries")
case File:
if outputPath != "" {
c.Select("export")
c.Arg("path", outputPath)
c.Arg("allowParentDirPath", true)
outputExport = true
return nil
}
c.Select("contents")
case Terminal:
c.Select("websocketEndpoint")
default:
return fmt.Errorf("return type %q requires a sub-command", name)
}
return nil
},
BeforeRequest: func(_ *FuncCommand, _ *cobra.Command, modType *modTypeDef) error {
if modType.Name() != Terminal {
return nil
}
// Even though these flags are global, we only check them just before query
// execution because you may want to debug an error during loading or for
// --help.
if silent || !(progress == "auto" && autoTTY || progress == "tty") {
return fmt.Errorf("running shell without the TUI is not supported")
}
if debug {
return fmt.Errorf("running shell with --debug is not supported")
}
return nil
},
AfterResponse: func(c *FuncCommand, cmd *cobra.Command, modType *modTypeDef, response any) error {
switch modType.Name() {
case Terminal:
termEndpoint, ok := response.(string)
if !ok {
return fmt.Errorf("unexpected response %T: %+v", response, response)
}
return attachToShell(cmd.Context(), c.c, termEndpoint)
default:
writer := cmd.OutOrStdout()
if outputPath != "" {
if outputExport {
logOutputSuccess(cmd, outputPath)
return nil
}
file, err := openOutputFile(outputPath)
if err != nil {
return fmt.Errorf("couldn't write output to file: %w", err)
}
defer func() {
file.Close()
logOutputSuccess(cmd, outputPath)
}()
writer = io.MultiWriter(writer, file)
}
return printFunctionResult(writer, response)
}
},
}
// openOutputFile opens a file for writing, creating the parent directories if needed.
func openOutputFile(path string) (*os.File, error) {
if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
return nil, err
}
return os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o644)
}
// logOutputSuccess prints to stderr the the output path to the user.
func logOutputSuccess(cmd *cobra.Command, path string) {
path, err := filepath.Abs(path)
if err != nil {
// don't fail because at this point the output has been saved successfully
cmd.PrintErrf("WARNING: failed to get absolute path: %s\n", err)
path = outputPath
}
cmd.PrintErrf("Saved output to %q.\n", path)
}
func printFunctionResult(w io.Writer, r any) error {
switch t := r.(type) {
case []any:
for _, v := range t {
if err := printFunctionResult(w, v); err != nil {
return err
}
}
return nil
case map[string]any:
for _, v := range t {
if err := printFunctionResult(w, v); err != nil {
return err
}
}
return nil
default:
fmt.Fprintf(w, "%+v\n", t)
}
return nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,359 | CLI: update handling of various core types | As described in [this comment](https://github.com/dagger/dagger/issues/6229#issuecomment-1863649336) (and that issue generally), we need to make some adjustments to the CLIs behavior when `dagger call` ends in various core types.
There's a handful of related adjustments needed here. Creating as a checklist for now to save issue spam; can break down into more issues if useful though. I'm including my initial suggestions on how to handle these, but to be clear these are not finalized decisions and the final call can be made as part of implementing this
- [ ] Handle arbitrary user objects
- Print fields (as in `TypeDef` fields, so just trivially resolvable values) as a json object
- [x] Handle container
- call `sync` only, rely on progress output for anything else
- [x] Handle directory
- call `sync` only, rely on progress output for anything else
- [x] Handle file
- call `sync` only, rely on progress output for anything else
- [ ] Handle IDs returned by `sync` (i.e. the case where the user explicitly chains `sync`)
- just rely on progress output, don't show the id
| https://github.com/dagger/dagger/issues/6359 | https://github.com/dagger/dagger/pull/6482 | 2999573c5a34e85b8baac8c0150881d9c08a86b8 | d91ac42c196873830c2e0876b251f3bf4d62ea49 | "2024-01-03T20:19:06Z" | go | "2024-01-26T18:48:04Z" | core/integration/module_call_test.go | package core
import (
"fmt"
"strings"
"testing"
"dagger.io/dagger"
"github.com/stretchr/testify/require"
)
func TestModuleDaggerCallArgTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
t.Run("service args", func(t *testing.T) {
t.Parallel()
t.Run("used as service binding", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context, svc *Service) (string, error) {
return dag.Container().From("alpine:3.18").WithExec([]string{"apk", "add", "curl"}).
WithServiceBinding("daserver", svc).
WithExec([]string{"curl", "http://daserver:8000"}).
Stdout(ctx)
}
`,
})
logGen(ctx, t, modGen.Directory("."))
httpServer, _ := httpService(ctx, t, c, "im up")
endpoint, err := httpServer.Endpoint(ctx)
require.NoError(t, err)
out, err := modGen.
WithServiceBinding("testserver", httpServer).
With(daggerCall("fn", "--svc", "tcp://"+endpoint)).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "im up")
})
t.Run("used directly", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"fmt"
"strings"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context, svc *Service) (string, error) {
ports, err := svc.Ports(ctx)
if err != nil {
return "", err
}
var out []string
out = append(out, fmt.Sprintf("%d exposed ports:", len(ports)))
for _, port := range ports {
number, err := port.Port(ctx)
if err != nil {
return "", err
}
out = append(out, fmt.Sprintf("- TCP/%d", number))
}
return strings.Join(out, "\n"), nil
}
`,
})
logGen(ctx, t, modGen.Directory("."))
httpServer, _ := httpService(ctx, t, c, "im up")
endpoint, err := httpServer.Endpoint(ctx)
require.NoError(t, err)
out, err := modGen.
WithServiceBinding("testserver", httpServer).
With(daggerCall("fn", "--svc", "tcp://"+endpoint)).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "1 exposed ports:\n- TCP/8000")
})
})
t.Run("list args", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("foo.txt", dagger.ContainerWithNewFileOpts{
Contents: "bar",
}).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"strings"
)
type Minimal struct {}
func (m *Minimal) Hello(msgs []string) string {
return strings.Join(msgs, "+")
}
func (m *Minimal) Reads(ctx context.Context, files []File) (string, error) {
var contents []string
for _, f := range files {
content, err := f.Contents(ctx)
if err != nil {
return "", err
}
contents = append(contents, content)
}
return strings.Join(contents, "+"), nil
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(daggerCall("hello", "--msgs", "yo", "--msgs", "my", "--msgs", "friend")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "yo+my+friend")
out, err = modGen.With(daggerCall("reads", "--files=foo.txt", "--files=foo.txt")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "bar+bar")
})
t.Run("directory arg inputs", func(t *testing.T) {
t.Parallel()
t.Run("local dir", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("/dir/subdir/foo.txt", dagger.ContainerWithNewFileOpts{
Contents: "foo",
}).
WithNewFile("/dir/subdir/bar.txt", dagger.ContainerWithNewFileOpts{
Contents: "bar",
}).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct {}
func (m *Test) Fn(dir *Directory) *Directory {
return dir
}
`,
})
out, err := modGen.With(daggerCall("fn", "--dir", "/dir/subdir")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "bar.txt\nfoo.txt")
out, err = modGen.With(daggerCall("fn", "--dir", "file:///dir/subdir")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "bar.txt\nfoo.txt")
})
t.Run("git dir", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct {}
func (m *Test) Fn(dir *Directory, subpath Optional[string]) *Directory {
return dir.Directory(subpath.GetOr("."))
}
`,
})
for _, tc := range []struct {
baseURL string
subpath string
}{
{
baseURL: "https://github.com/dagger/dagger",
},
{
baseURL: "https://github.com/dagger/dagger",
subpath: ".changes",
},
{
baseURL: "https://github.com/dagger/dagger.git",
},
{
baseURL: "https://github.com/dagger/dagger.git",
subpath: ".changes",
},
} {
tc := tc
t.Run(fmt.Sprintf("%s:%s", tc.baseURL, tc.subpath), func(t *testing.T) {
t.Parallel()
url := tc.baseURL + "#v0.9.1"
if tc.subpath != "" {
url += ":" + tc.subpath
}
args := []string{"fn", "--dir", url}
if tc.subpath == "" {
args = append(args, "--subpath", ".changes")
}
out, err := modGen.With(daggerCall(args...)).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, "v0.9.1.md")
require.NotContains(t, out, "v0.9.2.md")
})
}
})
})
t.Run("secret args", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Insecure(ctx context.Context, token *Secret) (string, error) {
return token.Plaintext(ctx)
}
`,
}).
WithEnvVariable("TOPSECRET", "shhh").
WithNewFile("/mysupersecret", dagger.ContainerWithNewFileOpts{Contents: "file shhh"})
t.Run("explicit env", func(t *testing.T) {
t.Parallel()
t.Run("happy", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("insecure", "--token", "env:TOPSECRET")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "shhh", strings.TrimSpace(out))
})
t.Run("sad", func(t *testing.T) {
t.Parallel()
_, err := modGen.With(daggerCall("insecure", "--token", "env:NOWHERETOBEFOUND")).Stdout(ctx)
require.ErrorContains(t, err, `secret env var not found: "NOW..."`)
})
})
t.Run("implicit env", func(t *testing.T) {
t.Parallel()
t.Run("happy", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("insecure", "--token", "TOPSECRET")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "shhh", strings.TrimSpace(out))
})
t.Run("sad", func(t *testing.T) {
t.Parallel()
_, err := modGen.With(daggerCall("insecure", "--token", "NOWHERETOBEFOUND")).Stdout(ctx)
require.ErrorContains(t, err, `secret env var not found: "NOW..."`)
})
})
t.Run("file", func(t *testing.T) {
t.Parallel()
t.Run("happy", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("insecure", "--token", "file:/mysupersecret")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "file shhh", strings.TrimSpace(out))
})
t.Run("sad", func(t *testing.T) {
t.Parallel()
_, err := modGen.With(daggerCall("insecure", "--token", "file:/nowheretobefound")).Stdout(ctx)
require.ErrorContains(t, err, `failed to read secret file "/nowheretobefound": open /nowheretobefound: no such file or directory`)
})
})
t.Run("cmd", func(t *testing.T) {
t.Parallel()
t.Run("happy", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("insecure", "--token", "cmd:echo -n cmd shhh")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "cmd shhh", strings.TrimSpace(out))
})
t.Run("sad", func(t *testing.T) {
t.Parallel()
_, err := modGen.With(daggerCall("insecure", "--token", "cmd:exit 1")).Stdout(ctx)
require.ErrorContains(t, err, `failed to run secret command "exit 1": exit status 1`)
})
})
t.Run("invalid source", func(t *testing.T) {
t.Parallel()
_, err := modGen.With(daggerCall("insecure", "--token", "wtf:HUH")).Stdout(ctx)
require.ErrorContains(t, err, `unsupported secret arg source: "wtf"`)
})
})
}
func TestModuleDaggerCallReturnTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
t.Run("return list objects", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {
Bar int ` + "`" + `json:"bar"` + "`" + `
}
func (m *Minimal) Fn() []*Foo {
var foos []*Foo
for i := 0; i < 3; i++ {
foos = append(foos, &Foo{Bar: i})
}
return foos
}
`,
})
logGen(ctx, t, modGen.Directory("."))
expected := "0\n1\n2"
t.Run("print", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("fn", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, expected, strings.TrimSpace(out))
})
t.Run("output", func(t *testing.T) {
t.Parallel()
out, err := modGen.
With(daggerCall("fn", "bar", "-o", "./outfile")).
File("./outfile").
Contents(ctx)
require.NoError(t, err)
require.Equal(t, expected, strings.TrimSpace(out))
})
})
t.Run("return container", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{Ctr: dag.Container().From("alpine:3.18").WithExec([]string{"echo", "hello", "world"})}
}
type Test struct {
Ctr *Container
}
`,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("print", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("ctr")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hello world", strings.TrimSpace(out))
})
t.Run("output", func(t *testing.T) {
t.Parallel()
modGen, err := modGen.With(daggerCall("ctr", "-o", "./container.tar")).Sync(ctx)
require.NoError(t, err)
size, err := modGen.File("./container.tar").Size(ctx)
require.NoError(t, err)
require.Greater(t, size, 0)
_, err = modGen.WithExec([]string{"tar", "tf", "./container.tar", "oci-layout"}).Sync(ctx)
require.NoError(t, err)
})
})
t.Run("return directory", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
Dir: dag.Directory().WithNewFile("foo.txt", "foo").WithNewFile("bar.txt", "bar"),
}
}
type Test struct {
Dir *Directory
}
`,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("print", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("dir")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "bar.txt\nfoo.txt", strings.TrimSpace(out))
})
t.Run("output", func(t *testing.T) {
t.Parallel()
modGen, err := modGen.With(daggerCall("dir", "-o", "./outdir")).Sync(ctx)
require.NoError(t, err)
entries, err := modGen.Directory("./outdir").Entries(ctx)
require.NoError(t, err)
require.Equal(t, "bar.txt\nfoo.txt", strings.Join(entries, "\n"))
foo, err := modGen.Directory("./outdir").File("foo.txt").Contents(ctx)
require.NoError(t, err)
require.Equal(t, "foo", strings.TrimSpace(foo))
bar, err := modGen.Directory("./outdir").File("bar.txt").Contents(ctx)
require.NoError(t, err)
require.Equal(t, "bar", strings.TrimSpace(bar))
})
})
t.Run("return file", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
File: dag.Directory().WithNewFile("foo.txt", "foo").File("foo.txt"),
}
}
type Test struct {
File *File
}
`,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("print", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("file")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "foo", strings.TrimSpace(out))
})
t.Run("output", func(t *testing.T) {
t.Parallel()
out, err := modGen.
With(daggerCall("file", "-o", "./outfile")).
File("./outfile").
Contents(ctx)
require.NoError(t, err)
require.Equal(t, "foo", strings.TrimSpace(out))
})
})
t.Run("sync", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{Ctr: dag.Container().From("alpine:3.18").WithExec([]string{"echo", "hello", "world"})}
}
type Test struct {
Ctr *Container
}
`,
})
// just verify it works without error for now
_, err := modGen.With(daggerCall("ctr", "sync")).Stdout(ctx)
require.NoError(t, err)
})
}
func TestModuleDaggerCallCoreChaining(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
t.Run("container", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{Ctr: dag.Container().From("alpine:3.18.5")}
}
type Test struct {
Ctr *Container
}
`,
})
t.Run("file", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("ctr", "file", "--path=/etc/alpine-release", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "3.18.5", strings.TrimSpace(out))
})
t.Run("export", func(t *testing.T) {
t.Parallel()
modGen, err := modGen.With(daggerCall("ctr", "export", "--path=./container.tar.gz")).Sync(ctx)
require.NoError(t, err)
size, err := modGen.File("./container.tar.gz").Size(ctx)
require.NoError(t, err)
require.Greater(t, size, 0)
})
})
t.Run("directory", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
Dir: dag.Directory().WithNewFile("foo.txt", "foo").WithNewFile("bar.txt", "bar"),
}
}
type Test struct {
Dir *Directory
}
`,
})
t.Run("file", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("dir", "file", "--path=foo.txt", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "foo", strings.TrimSpace(out))
})
t.Run("export", func(t *testing.T) {
t.Parallel()
modGen, err := modGen.With(daggerCall("dir", "export", "--path=./outdir")).Sync(ctx)
require.NoError(t, err)
ents, err := modGen.Directory("./outdir").Entries(ctx)
require.NoError(t, err)
require.Equal(t, []string{"bar.txt", "foo.txt"}, ents)
})
})
t.Run("return file", func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
File: dag.Directory().WithNewFile("foo.txt", "foo").File("foo.txt"),
}
}
type Test struct {
File *File
}
`,
})
t.Run("size", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerCall("file", "size")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "3", strings.TrimSpace(out))
})
t.Run("export", func(t *testing.T) {
t.Parallel()
modGen, err := modGen.With(daggerCall("file", "export", "--path=./outfile")).Sync(ctx)
require.NoError(t, err)
contents, err := modGen.File("./outfile").Contents(ctx)
require.NoError(t, err)
require.Equal(t, "foo", strings.TrimSpace(contents))
})
})
}
func TestModuleDaggerCallSaveOutput(t *testing.T) {
// NB: Normal usage is tested in TestModuleDaggerCallReturnTypes.
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct {
}
func (t *Test) Hello() string {
return "hello"
}
func (t *Test) File() *File {
return dag.Directory().WithNewFile("foo.txt", "foo").File("foo.txt")
}
`,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("truncate file", func(t *testing.T) {
t.Parallel()
out, err := modGen.
WithNewFile("foo.txt", dagger.ContainerWithNewFileOpts{
Contents: "foobar",
}).
With(daggerCall("hello", "-o", "foo.txt")).
File("foo.txt").
Contents(ctx)
require.NoError(t, err)
require.Equal(t, "hello", strings.TrimSpace(out))
})
t.Run("not a file", func(t *testing.T) {
t.Parallel()
_, err := modGen.With(daggerCall("hello", "-o", ".")).Sync(ctx)
require.ErrorContains(t, err, "is a directory")
})
t.Run("allow dir for file", func(t *testing.T) {
t.Parallel()
out, err := modGen.
With(daggerCall("file", "-o", ".")).
File("foo.txt").
Contents(ctx)
require.NoError(t, err)
require.Equal(t, "foo", strings.TrimSpace(out))
})
t.Run("create parent dirs", func(t *testing.T) {
t.Parallel()
ctr, err := modGen.With(daggerCall("hello", "-o", "foo/bar.txt")).Sync(ctx)
require.NoError(t, err)
t.Run("print success", func(t *testing.T) {
t.Parallel()
// should print success to stderr so it doesn't interfere with piping output
out, err := ctr.Stderr(ctx)
require.NoError(t, err)
require.Contains(t, out, `Saved output to "/work/foo/bar.txt"`)
})
t.Run("check directory permissions", func(t *testing.T) {
t.Parallel()
out, err := ctr.WithExec([]string{"stat", "-c", "%a", "foo"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "755", strings.TrimSpace(out))
})
t.Run("check file permissions", func(t *testing.T) {
t.Parallel()
out, err := ctr.WithExec([]string{"stat", "-c", "%a", "foo/bar.txt"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "644", strings.TrimSpace(out))
})
})
t.Run("check umask", func(t *testing.T) {
t.Parallel()
ctr, err := modGen.
WithNewFile("/entrypoint.sh", dagger.ContainerWithNewFileOpts{
Contents: `#!/bin/sh
umask 027
exec "$@"
`,
Permissions: 0o750,
}).
WithEntrypoint([]string{"/entrypoint.sh"}).
With(daggerCall("hello", "-o", "/tmp/foo/bar.txt")).
Sync(ctx)
require.NoError(t, err)
t.Run("directory", func(t *testing.T) {
t.Parallel()
out, err := ctr.WithExec([]string{"stat", "-c", "%a", "/tmp/foo"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "750", strings.TrimSpace(out))
})
t.Run("file", func(t *testing.T) {
t.Parallel()
out, err := ctr.WithExec([]string{"stat", "-c", "%a", "/tmp/foo/bar.txt"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "640", strings.TrimSpace(out))
})
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,359 | CLI: update handling of various core types | As described in [this comment](https://github.com/dagger/dagger/issues/6229#issuecomment-1863649336) (and that issue generally), we need to make some adjustments to the CLIs behavior when `dagger call` ends in various core types.
There's a handful of related adjustments needed here. Creating as a checklist for now to save issue spam; can break down into more issues if useful though. I'm including my initial suggestions on how to handle these, but to be clear these are not finalized decisions and the final call can be made as part of implementing this
- [ ] Handle arbitrary user objects
- Print fields (as in `TypeDef` fields, so just trivially resolvable values) as a json object
- [x] Handle container
- call `sync` only, rely on progress output for anything else
- [x] Handle directory
- call `sync` only, rely on progress output for anything else
- [x] Handle file
- call `sync` only, rely on progress output for anything else
- [ ] Handle IDs returned by `sync` (i.e. the case where the user explicitly chains `sync`)
- just rely on progress output, don't show the id
| https://github.com/dagger/dagger/issues/6359 | https://github.com/dagger/dagger/pull/6482 | 2999573c5a34e85b8baac8c0150881d9c08a86b8 | d91ac42c196873830c2e0876b251f3bf4d62ea49 | "2024-01-03T20:19:06Z" | go | "2024-01-26T18:48:04Z" | core/integration/module_test.go | package core
import (
"context"
_ "embed"
"encoding/json"
"fmt"
"go/format"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"time"
"github.com/dagger/dagger/dagql/idproto"
"github.com/iancoleman/strcase"
"github.com/moby/buildkit/identity"
"github.com/stretchr/testify/require"
"github.com/tidwall/gjson"
"golang.org/x/sync/errgroup"
"dagger.io/dagger"
"github.com/dagger/dagger/cmd/codegen/introspection"
"github.com/dagger/dagger/core/modules"
)
func TestModuleGoInit(t *testing.T) {
t.Run("from scratch", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=bare", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("reserved go.mod name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=go", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{go{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"go":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("uses expected Go module name, camel-cases Dagger module name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=My-Module", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{myModule{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"myModule":{"containerEcho":{"stdout":"hello\n"}}}`, out)
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
t.Run("creates go.mod beneath an existing go.mod if root points beneath it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/go.mod", dagger.ContainerWithNewFileOpts{
Contents: "module example.com/test\n",
}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/ci").
With(daggerExec("mod", "init", "--name=beneathGoMod", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{beneathGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"beneathGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("names Go module after Dagger module", func(t *testing.T) {
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
})
t.Run("respects existing go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
With(daggerExec("mod", "init", "--name=hasGoMod", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("preserves module name", func(t *testing.T) {
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module example.com/test")
})
})
t.Run("respects parent go.mod if root points to it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/child").
With(daggerExec("mod", "init", "--name=child", "--sdk=go", "--root=..")).
WithNewFile("/work/child/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
import "os"
type Child struct{}
func (m *Child) Root() *Directory {
wd, err := os.Getwd()
if err != nil {
panic(err)
}
return dag.Host().Directory(wd+"/..")
}
`,
})
generated := modGen.
// explicitly sync to see whether it makes a go.mod
With(daggerExec("mod", "sync")).
Directory(".")
logGen(ctx, t, generated)
out, err := modGen.
With(daggerQuery(`{child{root{entries}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"child":{"root":{"entries":["child","foo.go","go.mod","go.sum"]}}}`, out)
childEntries, err := generated.Entries(ctx)
require.NoError(t, err)
require.NotContains(t, childEntries, "go.mod")
t.Run("preserves parent module name", func(t *testing.T) {
generated, err := modGen.File("/work/go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module example.com/test")
})
})
t.Run("respects existing go.mod even if root points to parent that has go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/child").
WithExec([]string{"go", "mod", "init", "my-mod"}).
With(daggerExec("mod", "init", "--name=child", "--sdk=go", "--root=..")).
WithNewFile("/work/child/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
import "os"
type Child struct{}
func (m *Child) Root() *Directory {
wd, err := os.Getwd()
if err != nil {
panic(err)
}
return dag.Host().Directory(wd+"/..")
}
`,
})
generated := modGen.
// explicitly sync to see whether it makes a go.mod
With(daggerExec("mod", "sync")).
Directory(".")
logGen(ctx, t, generated)
out, err := modGen.
With(daggerQuery(`{child{root{entries}}}`)).
Stdout(ctx)
require.NoError(t, err)
// no go.sum
require.JSONEq(t, `{"child":{"root":{"entries":["child","foo.go","go.mod"]}}}`, out)
childEntries, err := generated.Entries(ctx)
require.NoError(t, err)
require.Contains(t, childEntries, "go.mod")
require.Contains(t, childEntries, "go.sum")
})
t.Run("respects existing main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasMainGo struct {}
func (m *HasMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("mod", "init", "--name=hasMainGo", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{hasMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("respects existing main.go even if it uses types not generated yet", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasDaggerTypes struct {}
func (m *HasDaggerTypes) Hello() *Container {
return dag.Container().
From("` + alpineImage + `").
WithExec([]string{"echo", "Hello, world!"})
}
`,
}).
With(daggerExec("mod", "init", "--name=hasDaggerTypes", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{hasDaggerTypes{hello{stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasDaggerTypes":{"hello":{"stdout":"Hello, world!\n"}}}`, out)
})
t.Run("respects existing package without creating main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/notmain.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type HasNotMainGo struct {}
func (m *HasNotMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("mod", "init", "--name=hasNotMainGo", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{hasNotMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasNotMainGo":{"hello":"Hello, world!"}}`, out)
})
}
func TestModulePythonInit(t *testing.T) {
t.Run("from scratch", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=bare", "--sdk=python"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("with different root", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/child").
With(daggerExec("mod", "init", "--name=bare", "--sdk=python", "--root=.."))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("respects existing pyproject.toml", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("pyproject.toml", dagger.ContainerWithNewFileOpts{
Contents: `[project]
name = "has-pyproject"
version = "0.0.0"
`,
}).
With(daggerExec("mod", "init", "--name=hasPyproject", "--sdk=python"))
out, err := modGen.
With(daggerQuery(`{hasPyproject{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasPyproject":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("preserves module name", func(t *testing.T) {
generated, err := modGen.File("pyproject.toml").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, `name = "has-pyproject"`)
})
})
t.Run("respects existing main.py", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/src/main/__init__.py", dagger.ContainerWithNewFileOpts{
Contents: "from . import notmain\n",
}).
WithNewFile("/work/src/main/notmain.py", dagger.ContainerWithNewFileOpts{
Contents: `from dagger import function
@function
def hello() -> str:
return "Hello, world!"
`,
}).
With(daggerExec("mod", "init", "--name=hasMainPy", "--sdk=python"))
out, err := modGen.
With(daggerQuery(`{hasMainPy{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasMainPy":{"hello":"Hello, world!"}}`, out)
})
t.Run("uses expected field casing", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=hello-world", "--sdk=python")).
With(sdkSource("python", `from dagger import field, function, object_type
@object_type
class HelloWorld:
my_name: str = field(default="World")
@function
def message(self) -> str:
return f"Hello, {self.my_name}!"
`,
))
out, err := modGen.
With(daggerQuery(`{helloWorld(myName: "Monde"){message}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"helloWorld":{"message":"Hello, Monde!"}}`, out)
})
}
func TestModuleInitLICENSE(t *testing.T) {
t.Run("bootstraps Apache-2.0 LICENSE file if none found", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=licensed-to-ill", "--sdk=go"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("creates LICENSE file in the directory specified by -m", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "-m", "./mymod", "--name=licensed-to-ill", "--sdk=go"))
content, err := modGen.File("mymod/LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("does not bootstrap LICENSE file if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("mod", "init", "--name=licensed-to-ill", "--sdk=go"))
_, err := modGen.File("LICENSE").Contents(ctx)
require.Error(t, err)
})
t.Run("bootstraps a LICENSE file when requested, even if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("mod", "init", "--name=licensed-to-ill", "--sdk=go", "--license=MIT"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "MIT License")
})
}
func TestModuleGit(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
gitignores []string
}
for _, tc := range []testCase{
{
sdk: "go",
gitignores: []string{
"/dagger.gen.go\n",
"/querybuilder/\n",
},
},
{
sdk: "python",
gitignores: []string{
"/sdk\n",
},
},
{
sdk: "typescript",
gitignores: []string{
"/sdk\n",
"/node_modules\n",
},
},
} {
tc := tc
t.Run(fmt.Sprintf("module %s git", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
With(daggerExec("mod", "init", "--name=bare", "--sdk="+tc.sdk))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("configures .gitignore", func(t *testing.T) {
ignore, err := modGen.File(".gitignore").Contents(ctx)
require.NoError(t, err)
for _, gitignore := range tc.gitignores {
require.Contains(t, ignore, gitignore)
}
})
})
}
}
func TestModuleGoGitRemovesIgnored(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
committedModGen := goGitBase(t, c).
With(daggerExec("mod", "init", "--name=bare", "--sdk=go")).
WithExec([]string{"rm", ".gitignore"}).
// simulate old path scheme to show we ignore it too to help transition
WithExec([]string{"mkdir", "./internal"}).
WithExec([]string{"cp", "-a", "./querybuilder", "./internal/querybuilder"}).
WithExec([]string{"git", "add", "."}).
WithExec([]string{"git", "commit", "-m", "init with generated files"})
changedAfterSync, err := committedModGen.
With(daggerExec("mod", "sync")).
WithExec([]string{"git", "diff"}). // for debugging
WithExec([]string{"git", "status", "--short"}).
Stdout(ctx)
require.NoError(t, err)
t.Logf("changed after sync:\n%s", changedAfterSync)
require.Contains(t, changedAfterSync, "D dagger.gen.go\n")
require.Contains(t, changedAfterSync, "D querybuilder/marshal.go\n")
require.Contains(t, changedAfterSync, "D querybuilder/querybuilder.go\n")
require.Contains(t, changedAfterSync, "D internal/querybuilder/marshal.go\n")
require.Contains(t, changedAfterSync, "D internal/querybuilder/querybuilder.go\n")
}
func TestModulePythonGitRemovesIgnored(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
committedModGen := goGitBase(t, c).
With(daggerExec("mod", "init", "--name=bare", "--sdk=python")).
WithExec([]string{"rm", ".gitignore"}).
WithExec([]string{"git", "add", "."}).
WithExec([]string{"git", "commit", "-m", "init with generated files"})
changedAfterSync, err := committedModGen.
With(daggerExec("mod", "sync")).
WithExec([]string{"git", "diff"}). // for debugging
WithExec([]string{"git", "status", "--short"}).
Stdout(ctx)
require.NoError(t, err)
t.Logf("changed after sync:\n%s", changedAfterSync)
require.Contains(t, changedAfterSync, "D sdk/pyproject.toml\n")
require.Contains(t, changedAfterSync, "D sdk/src/dagger/__init__.py\n")
}
func TestModuleTypescriptGitRemovesIgnored(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
committedModGen := goGitBase(t, c).
With(daggerExec("mod", "init", "--name=bare", "--sdk=typescript")).
WithExec([]string{"rm", ".gitignore"}).
WithExec([]string{"git", "add", "."}).
WithExec([]string{"git", "commit", "-m", "init with generated files"})
changedAfterSync, err := committedModGen.
With(daggerExec("mod", "sync")).
WithExec([]string{"git", "diff"}). // for debugging
WithExec([]string{"git", "status", "--short"}).
Stdout(ctx)
require.NoError(t, err)
t.Logf("changed after sync:\n%s", changedAfterSync)
require.Contains(t, changedAfterSync, "D sdk/index.ts\n")
require.Contains(t, changedAfterSync, "D sdk/entrypoint/entrypoint.ts\n")
}
//go:embed testdata/modules/go/minimal/main.go
var goSignatures string
func TestModuleGoSignatures(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("func Hello() string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello"}}`, out)
})
t.Run("func Echo(string) string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echo(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echo":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointer(*string) string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointerPointer(**string) string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoPointerPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointerPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoOptional(string) string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoOptional(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalPointer(string) string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalPointer}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalSlice([]string) string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalSlice(msg: ["hello", "there"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"hello+there...hello+there...hello+there..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalSlice}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"foobar...foobar...foobar..."}}`, out)
})
t.Run("func Echoes([]string) []string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoes(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoes":["hello...hello...hello..."]}}`, out)
})
t.Run("func EchoesVariadic(...string) string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoesVariadic(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoesVariadic":"hello...hello...hello..."}}`, out)
})
t.Run("func HelloContext(context.Context) string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{helloContext}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloContext":"hello context"}}`, out)
})
t.Run("func EchoContext(context.Context, string) string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoContext(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoContext":"ctx.hello...ctx.hello...ctx.hello..."}}`, out)
})
t.Run("func HelloStringError() (string, error)", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{helloStringError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloStringError":"hello i worked"}}`, out)
})
t.Run("func HelloVoid()", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{helloVoid}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoid":null}}`, out)
})
t.Run("func HelloVoidError() error", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{helloVoidError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoidError":null}}`, out)
})
t.Run("func EchoOpts(string, string, int) error", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInline(struct{string, string, int}) error", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlinePointer(*struct{string, string, int}) error", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineCtx(ctx, struct{string, string, int}) error", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineTags(struct{string, string, int}) error", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsPragmas(string, string, int) error", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoOptsPragmas(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsPragmas":"hi...hi...hi..."}}`, out)
})
}
//go:embed testdata/modules/typescript/minimal/index.ts
var tsSignatures string
func TestModuleTypescriptSignatures(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=typescript")).
WithNewFile("src/index.ts", dagger.ContainerWithNewFileOpts{
Contents: tsSignatures,
})
t.Run("hello(): string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello"}}`, out)
})
t.Run("echoes(msgs: string[]): string[]", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoes(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoes":["hello...hello...hello..."]}}`, out)
})
t.Run("echoOptional(msg = 'default'): string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoOptional(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"default...default...default..."}}`, out)
})
t.Run("echoesVariadic(...msgs: string[]): string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoesVariadic(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoesVariadic":"hello...hello...hello..."}}`, out)
})
t.Run("echo(msg: string): string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echo(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echo":"hello...hello...hello..."}}`, out)
})
t.Run("echoOptionalSlice(msg = ['foobar']): string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalSlice(msg: ["hello", "there"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"hello+there...hello+there...hello+there..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalSlice}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"foobar...foobar...foobar..."}}`, out)
})
t.Run("helloVoid(): void", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{helloVoid}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoid":null}}`, out)
})
t.Run("echoOpts(msg: string, suffix: string = '', times: number = 1): string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi!hi!"}}`, out)
t.Run("execute with unordered args", func(t *testing.T) {
out, err = modGen.With(daggerQuery(`{minimal{echoOpts(times: 2, msg: "order", suffix: "?")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"order?order?"}}`, out)
})
})
t.Run("echoMaybe(msg: string, isQuestion = false): string", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(`{minimal{echoMaybe(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoMaybe":"hi...hi...hi..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoMaybe(msg: "hi", isQuestion: true)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoMaybe":"hi?...hi?...hi?..."}}`, out)
t.Run("execute with unordered args", func(t *testing.T) {
out, err = modGen.With(daggerQuery(`{minimal{echoMaybe(isQuestion: false, msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoMaybe":"hi...hi...hi..."}}`, out)
})
})
}
func TestModuleGoSignaturesBuiltinTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Minimal struct {}
func (m *Minimal) Read(ctx context.Context, dir Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadPointer(ctx context.Context, dir *Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadSlice(ctx context.Context, dir []Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadVariadic(ctx context.Context, dir ...Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadOptional(ctx context.Context, dir Optional[Directory]) (string, error) {
d, ok := dir.Get()
if ok {
return d.File("foo").Contents(ctx)
}
return "", nil
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(daggerQuery(`{directory{withNewFile(path: "foo", contents: "bar"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
dirID := gjson.Get(out, "directory.withNewFile.id").String()
t.Run("func Read(ctx, Directory) (string, error)", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{read(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"read":"bar"}}`, out)
})
t.Run("func ReadPointer(ctx, *Directory) (string, error)", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readPointer(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readPointer":"bar"}}`, out)
})
t.Run("func ReadSlice(ctx, []Directory) (string, error)", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readSlice(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readSlice":"bar"}}`, out)
})
t.Run("func ReadVariadic(ctx, ...Directory) (string, error)", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readVariadic(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readVariadic":"bar"}}`, out)
})
t.Run("func ReadOptional(ctx, Optional[Directory]) (string, error)", func(t *testing.T) {
t.Parallel()
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readOptional(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":"bar"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{readOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":""}}`, out)
})
}
func TestModuleGoSignaturesUnexported(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) string {
return name
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(inspectModule).Stdout(ctx)
require.NoError(t, err)
objs := gjson.Get(out, "host.directory.asModule.objects")
require.Equal(t, 1, len(objs.Array()))
minimal := objs.Get(`0.asObject`)
require.Equal(t, "Minimal", minimal.Get("name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err = modGen.With(inspectModule).Stdout(ctx)
require.NoError(t, err)
objs = gjson.Get(out, "host.directory.asModule.objects")
require.Equal(t, 2, len(objs.Array()))
minimal = objs.Get(`0.asObject`)
require.Equal(t, "Minimal", minimal.Get("name").String())
foo := objs.Get(`1.asObject`)
require.Equal(t, "MinimalFoo", foo.Get("name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {
Bar bar
}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
logGen(ctx, t, modGen.Directory("."))
_, err = modGen.With(inspectModule).Stderr(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "cannot code-generate unexported type bar")
}
func TestModuleGoSignaturesMixMatch(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
func (m *Minimal) Hello(name string, opts struct{}, opts2 struct{}) string {
return name
}
`,
})
logGen(ctx, t, modGen.Directory("."))
_, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "nested structs are not supported")
}
func TestModuleGoSignaturesNameConflict(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {
Foo Foo
Bar Bar
Baz Baz
}
type Foo struct {}
type Bar struct {}
type Baz struct {}
func (m *Foo) Hello(name string) string {
return name
}
func (f *Bar) Hello(name string, name2 string) string {
return name + name2
}
func (b *Baz) Hello() (string, error) {
return "", nil
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(inspectModule).Stdout(ctx)
require.NoError(t, err)
objs := gjson.Get(out, "host.directory.asModule.objects")
require.Equal(t, 4, len(objs.Array()))
obj := objs.Get(`0.asObject`)
require.Equal(t, "Minimal", obj.Get("name").String())
obj = objs.Get(`1.asObject`)
require.Equal(t, "MinimalFoo", obj.Get("name").String())
obj = objs.Get(`2.asObject`)
require.Equal(t, "MinimalBar", obj.Get("name").String())
obj = objs.Get(`3.asObject`)
require.Equal(t, "MinimalBaz", obj.Get("name").String())
}
var inspectModule = daggerQuery(`
query {
host {
directory(path: ".") {
asModule {
description
objects {
asObject {
name
description
functions {
name
description
args {
name
description
defaultValue
}
}
fields {
name
description
}
}
}
}
}
}
}
`)
func TestModuleGoDocs(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(inspectModule).Stdout(ctx)
require.NoError(t, err)
obj := gjson.Get(out, "host.directory.asModule.objects.0.asObject")
require.Equal(t, "Minimal", obj.Get("name").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Empty(t, hello.Get("description").String())
require.Empty(t, hello.Get("args").Array())
// test the args-based form
echoOpts := obj.Get(`functions.#(name="echoOpts")`)
require.Equal(t, "echoOpts", echoOpts.Get("name").String())
require.Equal(t, "EchoOpts does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the inline struct form
echoOpts = obj.Get(`functions.#(name="echoOptsInline")`)
require.Equal(t, "echoOptsInline", echoOpts.Get("name").String())
require.Equal(t, "EchoOptsInline does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the arg-based form (with pragmas)
echoOpts = obj.Get(`functions.#(name="echoOptsPragmas")`)
require.Equal(t, "echoOptsPragmas", echoOpts.Get("name").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "", echoOpts.Get("args.0.defaultValue").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "\"...\"", echoOpts.Get("args.1.defaultValue").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "3", echoOpts.Get("args.2.defaultValue").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
}
func TestModuleGoDocsEdgeCases(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
// Minimal is a thing
type Minimal struct {
// X is this
X, Y string // Y is not this
// +private
Z string
}
// some docs
func (m *Minimal) Hello(foo string, bar string,
// hello
baz string, qux string, x string, // lol
) string {
return foo + bar
}
func (m *Minimal) HelloMore(
// foo here
foo,
// bar here
bar string,
) string {
return foo + bar
}
func (m *Minimal) HelloMoreInline(opts struct{
// foo here
foo, bar string
}) string {
return opts.foo + opts.bar
}
func (m *Minimal) HelloAgain( // docs for helloagain
foo string,
bar string, // docs for bar
baz string,
) string {
return foo + bar
}
func (m *Minimal) HelloFinal(
foo string) string { // woops
return foo
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(inspectModule).Stdout(ctx)
require.NoError(t, err)
obj := gjson.Get(out, "host.directory.asModule.objects.0.asObject")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Equal(t, "Minimal is a thing", obj.Get("description").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 5)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "hello", hello.Get("args.2.description").String())
require.Equal(t, "qux", hello.Get("args.3.name").String())
require.Equal(t, "", hello.Get("args.3.description").String())
require.Equal(t, "x", hello.Get("args.4.name").String())
require.Equal(t, "lol", hello.Get("args.4.description").String())
hello = obj.Get(`functions.#(name="helloMore")`)
require.Equal(t, "helloMore", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "bar here", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloMoreInline")`)
require.Equal(t, "helloMoreInline", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloAgain")`)
require.Equal(t, "helloAgain", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 3)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "docs for bar", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "", hello.Get("args.2.description").String())
hello = obj.Get(`functions.#(name="helloFinal")`)
require.Equal(t, "helloFinal", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 1)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Len(t, obj.Get(`fields`).Array(), 2)
prop := obj.Get(`fields.#(name="x")`)
require.Equal(t, "x", prop.Get("name").String())
require.Equal(t, "X is this", prop.Get("description").String())
prop = obj.Get(`fields.#(name="y")`)
require.Equal(t, "y", prop.Get("name").String())
require.Equal(t, "", prop.Get("description").String())
}
func TestModuleGoWeirdFields(t *testing.T) {
// these are all cases that used to panic due to the disparity in the type spec and the ast
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Z string
type Minimal struct {
// field with single (normal) name
W string
// field with multiple names
X, Y string
// field with no names
Z
}
func New() Minimal {
return Minimal{
W: "-",
X: "-",
Y: "-",
Z: Z("-"),
}
}
// struct with no fields
type Bar struct{}
func (m *Minimal) Say(
// field with single (normal) name
a string,
// field with multiple names
b, c string,
// field with no names (not included, mixed names not allowed)
// string
) string {
return a + " " + b + " " + c
}
func (m *Minimal) Hello(
// field with no names
string,
) string {
return "hello"
}
func (m *Minimal) SayOpts(opts struct{
// field with single (normal) name
A string
// field with multiple names
B, C string
// field with no names (not included because of above)
// string
}) string {
return opts.A + " " + opts.B + " " + opts.C
}
func (m *Minimal) HelloOpts(opts struct{
// field with no names
string
}) string {
return "hello"
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(daggerQuery(`{minimal{w, x, y, z}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"w": "-", "x": "-", "y": "-", "z": "-"}}`, out)
for _, name := range []string{"say", "sayOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(a: "hello", b: "world", c: "!")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello world !"}}`, name), out)
}
for _, name := range []string{"hello", "helloOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(string: "")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello"}}`, name), out)
}
}
func TestModuleGoOptionalMustBeNil(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
func (m *Minimal) Foo(x *Optional[*string]) string {
if v, _ := x.Get(); v != nil {
panic("uh oh")
}
return ""
}
func (m *Minimal) Bar(opts struct {
x *Optional[*string]
}) string {
if v, _ := opts.x.Get(); v != nil {
panic("uh oh")
}
return ""
}
func (m *Minimal) Baz(
// +optional
x *string,
) string {
if x != nil {
panic("uh oh")
}
return ""
}
func (m *Minimal) Qux(opts struct {
// +optional
x *string
}) string {
if opts.x != nil {
panic("uh oh")
}
return ""
}
`,
})
logGen(ctx, t, modGen.Directory("."))
for _, name := range []string{"foo", "bar", "baz", "qux"} {
out, err := modGen.With(daggerQuery(`{minimal{%s}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": ""}}`, name), out)
}
}
func TestModuleGoFieldMustBeNil(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "fmt"
type Minimal struct {
Src *Directory
Name *string
}
func New() *Minimal {
return &Minimal{}
}
func (m *Minimal) IsEmpty() bool {
if m.Name != nil {
panic(fmt.Sprintf("name should be nil but is %v", m.Name))
}
if m.Src != nil {
panic(fmt.Sprintf("src should be nil but is %v", m.Src))
}
return true
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{isEmpty}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"isEmpty": true}}`, out)
}
func TestModuleDescription(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
for _, tc := range []struct {
sdk string
source string
}{
{
sdk: "python",
source: `"""Minimal module, short description
Long description, with full sentences.
"""
from dagger import field, function, object_type
@object_type
class Minimal:
"""Minimal object, short description"""
foo: str = field(default="foo")
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(inspectModule).Stdout(ctx)
require.NoError(t, err)
mod := gjson.Get(out, "host.directory.asModule")
require.Equal(t,
"Minimal module, short description\n\nLong description, with full sentences.",
mod.Get("description").String(),
)
require.Equal(t,
"Minimal object, short description",
mod.Get("objects.0.asObject.description").String(),
)
})
}
}
func TestModulePrivateField(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
for _, tc := range []struct {
sdk string
source string
}{
{
sdk: "go",
source: `package main
type Minimal struct {
Foo string
Bar string // +private
}
func (m *Minimal) Set(foo string, bar string) *Minimal {
m.Foo = foo
m.Bar = bar
return m
}
func (m *Minimal) Hello() string {
return m.Foo + m.Bar
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Minimal:
foo: str = field(default="")
bar: str = ""
@function
def set(self, foo: str, bar: str) -> "Minimal":
self.foo = foo
self.bar = bar
return self
@function
def hello(self) -> str:
return self.foo + self.bar
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object
class Minimal {
@field
foo: string
bar?: string
constructor(foo?: string, bar?: string) {
this.foo = foo
this.bar = bar
}
@func
set(foo: string, bar: string): Minimal {
this.foo = foo
this.bar = bar
return this
}
@func
hello(): string {
return this.foo + this.bar
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(inspectModule).Stdout(ctx)
require.NoError(t, err)
obj := gjson.Get(out, "host.directory.asModule.objects.0.asObject")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Len(t, obj.Get(`fields`).Array(), 1)
prop := obj.Get(`fields.#(name="foo")`)
require.Equal(t, "foo", prop.Get("name").String())
out, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){hello}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"hello": "abcxyz"}}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){foo}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"foo": "abc"}}}`, out)
_, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){bar}}}`)).Stdout(ctx)
require.ErrorContains(t, err, `Minimal has no such field: "bar"`)
})
}
}
// this is no longer allowed, but verify the SDK errors out
func TestModuleGoExtendCore(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=container", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
func (c *Container) Echo(ctx context.Context, msg string) (string, error) {
return c.WithExec([]string{"echo", msg}).Stdout(ctx)
}
`,
}).
With(daggerQuery(`{container{from(address:"` + alpineImage + `"){echo(msg:"echo!"){stdout}}}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "cannot define methods on objects from outside this module")
}
func TestModuleCustomTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Test struct{}
func (m *Test) Repeater(msg string, times int) *Repeater {
return &Repeater{
Message: msg,
Times: times,
}
}
type Repeater struct {
Message string
Times int
}
func (t *Repeater) Render() string {
return strings.Repeat(t.Message, t.Times)
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Repeater:
message: str = field(default="")
times: int = field(default=0)
@function
def render(self) -> str:
return self.message * self.times
@function
def repeater(msg: str, times: int) -> Repeater:
return Repeater(message=msg, times=times)
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object
class Repeater {
@field
message: string
@field
times: number
constructor(message: string, times: number) {
this.message = message
this.times = times
}
@func
render(): string {
return this.message.repeat(this.times)
}
}
@object
class Test {
@func
repeater(msg: string, times: number): Repeater {
return new Repeater(msg, times)
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("custom %s types", tc.sdk), func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{test{repeater(msg:"echo!", times: 3){render}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"repeater":{"render":"echo!echo!echo!"}}}`, out)
})
}
}
func TestModuleReturnTypeDetection(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
}
func (m *Foo) MyFunction() X {
return X{Message: "foo"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
@function
def my_function() -> X:
return X(message="foo")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object
class X {
@field
message: string
constructor(message: string) {
this.message = message;
}
}
@object
class Foo {
@func
myFunction(): X {
return new X("foo");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{foo{myFunction{message}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo"}}}`, out)
})
}
}
func TestModuleReturnObject(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
When string ` + "`json:\"Timestamp\"`" + `
To string ` + "`json:\"recipient\"`" + `
From string
}
func (m *Foo) MyFunction() X {
return X{Message: "foo", When: "now", To: "user", From: "admin"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
when: str = field(default="", name="Timestamp")
to: str = field(default="", name="recipient")
from_: str = field(default="", name="from")
@object_type
class Foo:
@function
def my_function(self) -> X:
return X(message="foo", when="now", to="user", from_="admin")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object
class X {
@field
message: string
@field
timestamp: string
@field
recipient: string
@field
from: string
constructor(message: string, timestamp: string, recipient: string, from: string) {
this.message = message;
this.timestamp = timestamp;
this.recipient = recipient;
this.from = from;
}
}
@object
class Foo {
@func
myFunction(): X {
return new X("foo", "now", "user", "admin");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{foo{myFunction{message, recipient, from, timestamp}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo", "recipient":"user", "from":"admin", "timestamp":"now"}}}`, out)
})
}
}
func TestModuleReturnNestedObject(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type Foo struct {
MsgContainer Bar
}
type Bar struct {
Msg string
}
func (m *Playground) MyFunction() Foo {
return Foo{MsgContainer: Bar{Msg: "hello world"}}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Bar:
msg: str = field()
@object_type
class Foo:
msg_container: Bar = field()
@object_type
class Playground:
@function
def my_function(self) -> Foo:
return Foo(msg_container=Bar(msg="hello world"))
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object
class Bar {
@field
msg: string;
constructor(msg: string) {
this.msg = msg;
}
}
@object
class Foo {
@field
msgContainer: Bar;
constructor(msgContainer: Bar) {
this.msgContainer = msgContainer;
}
}
@object
class Playground {
@func
myFunction(): Foo {
return new Foo(new Bar("hello world"));
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{playground{myFunction{msgContainer{msg}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myFunction":{"msgContainer":{"msg": "hello world"}}}}`, out)
})
}
}
func TestModuleReturnCompositeCore(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
func (m *Playground) MySlice() []*Container {
return []*Container{dag.Container().From("alpine:latest").WithExec([]string{"echo", "hello world"})}
}
type Foo struct {
Con *Container
// verify fields can remain nil w/out error too
UnsetFile *File
}
func (m *Playground) MyStruct() *Foo {
return &Foo{Con: dag.Container().From("alpine:latest").WithExec([]string{"echo", "hello world"})}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class Foo:
con: dagger.Container = field()
unset_file: dagger.File | None = field(default=None)
@object_type
class Playground:
@function
def my_slice(self) -> list[dagger.Container]:
return [dag.container().from_("alpine:latest").with_exec(["echo", "hello world"])]
@function
def my_struct(self) -> Foo:
return Foo(con=dag.container().from_("alpine:latest").with_exec(["echo", "hello world"]))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, File, object, func, field } from "@dagger.io/dagger"
@object
class Foo {
@field
con: Container
@field
unsetFile?: File
constructor(con: Container, usetFile?: File) {
this.con = con
this.usetFile = usetFile
}
}
@object
class Playground {
@func
mySlice(): Container[] {
return [
dag.container().from("alpine:latest").withExec(["echo", "hello world"])
]
}
@func
myStruct(): Foo {
return new Foo(
dag.container().from("alpine:latest").withExec(["echo", "hello world"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{playground{mySlice{stdout}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"mySlice":[{"stdout":"hello world\n"}]}}`, out)
out, err = modGen.With(daggerQuery(`{playground{myStruct{con{stdout}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myStruct":{"con":{"stdout":"hello world\n"}}}}`, out)
})
}
}
func TestModuleReturnComplexThing(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type ScanResult struct {
Containers []*Container ` + "`json:\"targets\"`" + `
Report ScanReport
}
type ScanReport struct {
Contents string ` + "`json:\"contents\"`" + `
Authors []string ` + "`json:\"Authors\"`" + `
}
func (m *Playground) Scan() ScanResult {
return ScanResult{
Containers: []*Container{
dag.Container().From("alpine:latest").WithExec([]string{"echo", "hello world"}),
},
Report: ScanReport{
Contents: "hello world",
Authors: []string{"foo", "bar"},
},
}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class ScanReport:
contents: str = field()
authors: list[str] = field()
@object_type
class ScanResult:
containers: list[dagger.Container] = field(name="targets")
report: ScanReport = field()
@object_type
class Playground:
@function
def scan(self) -> ScanResult:
return ScanResult(
containers=[
dag.container().from_("alpine:latest").with_exec(["echo", "hello world"]),
],
report=ScanReport(
contents="hello world",
authors=["foo", "bar"],
),
)
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object
class ScanReport {
@field
contents: string
@field
authors: string[]
constructor(contents: string, authors: string[]) {
this.contents = contents
this.authors = authors
}
}
@object
class ScanResult {
@field
targets: Container[]
@field
report: ScanReport
constructor(containers: Container[], report: ScanReport) {
this.targets = containers
this.report = report
}
}
@object
class Playground {
@func
async scan(): Promise<ScanResult> {
return new ScanResult(
[
dag.container().from("alpine:latest").withExec(["echo", "hello world"])
],
new ScanReport("hello world", ["foo", "bar"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{playground{scan{targets{stdout},report{contents,authors}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"scan":{"targets":[{"stdout":"hello world\n"}],"report":{"contents":"hello world","authors":["foo","bar"]}}}}`, out)
})
}
}
func TestModulePythonReturnSelf(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=foo", "--sdk=python")).
WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `from typing import Self
from dagger import field, function, object_type
@object_type
class Foo:
message: str = field(default="")
@function
def bar(self) -> Self:
self.message = "foobar"
return self
`,
})
out, err := modGen.With(daggerQuery(`{foo{bar{message}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"bar":{"message":"foobar"}}}`, out)
}
func TestModuleGlobalVarDAG(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
type Foo struct {}
var someDefault = dag.Container().From("alpine:latest")
func (m *Foo) Fn(ctx context.Context) (string, error) {
return someDefault.WithExec([]string{"echo", "foo"}).Stdout(ctx)
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function, object_type
SOME_DEFAULT = dag.container().from_("alpine:latest")
@object_type
class Foo:
@function
async def fn(self) -> str:
return await SOME_DEFAULT.with_exec(["echo", "foo"]).stdout()
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from "@dagger.io/dagger"
var someDefault = dag.container().from("alpine:latest")
@object
class Foo {
@func
async fn(): Promise<string> {
return someDefault.withExec(["echo", "foo"]).stdout()
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{foo{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"fn":"foo\n"}}`, out)
})
}
}
func TestModuleIDableType(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {
Data string
}
func (m *Foo) Set(data string) *Foo {
m.Data = data
return m
}
func (m *Foo) Get() string {
return m.Data
}
`,
},
{
sdk: "python",
source: `from typing import Self
from dagger import field, function, object_type
@object_type
class Foo:
data: str = ""
@function
def set(self, data: str) -> Self:
self.data = data
return self
@function
def get(self) -> str:
return self.data
`,
},
{
sdk: "typescript",
source: `
import { object, func } from "@dagger.io/dagger"
@object
class Foo {
data: string = ""
@func
set(data: string): Foo {
this.data = data
return this
}
@func
get(): string {
return this.data
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
// sanity check
out, err := modGen.With(daggerQuery(`{foo{set(data: "abc"){get}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"set":{"get": "abc"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{set(data: "abc"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.set.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.set(data: "abc"): Foo!`)
out, err = modGen.With(daggerQuery(`{loadFooFromID(id: "%s"){get}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"loadFooFromID":{"get": "abc"}}`, out)
})
}
}
func TestModuleArgOwnType(t *testing.T) {
// Verify use of a module's own object as an argument type.
// The server needs to specifically decode the input type from an ID into
// the raw JSON, since the module doesn't understand it's own types as IDs
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Foo struct{}
type Message struct {
Content string
}
func (m *Foo) SayHello(name string) Message {
return Message{Content: "hello " + name}
}
func (m *Foo) Upper(msg Message) Message {
msg.Content = strings.ToUpper(msg.Content)
return msg
}
func (m *Foo) Uppers(msg []Message) []Message {
for i := range msg {
msg[i].Content = strings.ToUpper(msg[i].Content)
}
return msg
}`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Message:
content: str = field()
@object_type
class Foo:
@function
def say_hello(self, name: str) -> Message:
return Message(content=f"hello {name}")
@function
def upper(self, msg: Message) -> Message:
msg.content = msg.content.upper()
return msg
@function
def uppers(self, msg: list[Message]) -> list[Message]:
for m in msg:
m.content = m.content.upper()
return msg
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object
class Message {
@field
content: string
constructor(content: string) {
this.content = content
}
}
@object
class Foo {
@func
sayHello(name: string): Message {
return new Message("hello " + name)
}
@func
upper(msg: Message): Message {
msg.content = msg.content.toUpperCase()
return msg
}
@func
uppers(msg: Message[]): Message[] {
for (let i = 0; i < msg.length; i++) {
msg[i].content = msg[i].content.toUpperCase()
}
return msg
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{foo{sayHello(name: "world"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.sayHello.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.sayHello(name: "world"): FooMessage!`)
out, err = modGen.With(daggerQuery(`{foo{upper(msg:"%s"){content}}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"upper":{"content": "HELLO WORLD"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{uppers(msg:["%s", "%s"]){content}}}`, id, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"uppers":[{"content": "HELLO WORLD"}, {"content": "HELLO WORLD"}]}}`, out)
})
}
}
func TestModuleConflictingSameNameDeps(t *testing.T) {
// A -> B -> Dint
// A -> C -> Dstr
// where Dint and Dstr are modules with the same name and same object names but conflicting types
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dstr").
With(daggerExec("mod", "init", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo string
}
func (m *D) Fn(foo string) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dint").
With(daggerExec("mod", "init", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo int
}
func (m *D) Fn(foo int) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithWorkdir("/work/c").
With(daggerExec("mod", "init", "--name=c", "--sdk=go", "--root=..")).
With(daggerExec("mod", "install", "../dstr")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type C struct{}
func (m *C) Fn(ctx context.Context, foo string) (string, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work/b").
With(daggerExec("mod", "init", "--name=b", "--sdk=go", "--root=..")).
With(daggerExec("mod", "install", "../dint")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type B struct{}
func (m *B) Fn(ctx context.Context, foo int) (int, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work/a").
With(daggerExec("mod", "init", "--name=a", "--sdk=go", "--root=..")).
With(daggerExec("mod", "install", "../b")).
With(daggerExec("mod", "install", "../c")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"strconv"
)
type A struct{}
func (m *A) Fn(ctx context.Context) (string, error) {
fooStr, err := dag.C().Fn(ctx, "foo")
if err != nil {
return "", err
}
fooInt, err := dag.B().Fn(ctx, 123)
if err != nil {
return "", err
}
return fooStr + strconv.Itoa(fooInt), nil
}
`,
})
out, err := ctr.With(daggerQuery(`{a{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"a":{"fn": "foo123"}}`, out)
// verify that no types from (transitive) deps show up
types := currentSchema(ctx, t, ctr).Types
require.NotNil(t, types.Get("A"))
require.Nil(t, types.Get("B"))
require.Nil(t, types.Get("C"))
require.Nil(t, types.Get("D"))
}
func TestModuleSelfAPICall(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"github.com/Khan/genqlient/graphql"
)
type Test struct{}
func (m *Test) FnA(ctx context.Context) (string, error) {
resp := &graphql.Response{}
err := dag.c.MakeRequest(ctx, &graphql.Request{
Query: "{test{fnB}}",
}, resp)
if err != nil {
return "", err
}
return resp.Data.(map[string]any)["test"].(map[string]any)["fnB"].(string), nil
}
func (m *Test) FnB() string {
return "hi from b"
}
`,
}).
With(daggerQuery(`{test{fnA}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fnA": "hi from b"}}`, out)
}
func TestModuleGoWithOtherModuleTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("mod", "init", "--name=dep", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Dep struct{}
type Obj struct {
Foo string
}
func (m *Dep) Fn() Obj {
return Obj{Foo: "foo"}
}
`,
}).
WithWorkdir("/work/test").
With(daggerExec("mod", "init", "--name=test", "--sdk=go", "--root=..")).
With(daggerExec("mod", "install", "../dep"))
t.Run("return as other module object", func(t *testing.T) {
t.Parallel()
t.Run("direct", func(t *testing.T) {
t.Parallel()
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() (*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
t.Run("list", func(t *testing.T) {
t.Parallel()
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() ([]*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
})
t.Run("arg as other module object", func(t *testing.T) {
t.Parallel()
t.Run("direct", func(t *testing.T) {
t.Parallel()
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj *DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
t.Run("list", func(t *testing.T) {
t.Parallel()
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj []*DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
})
t.Run("field as other module object", func(t *testing.T) {
t.Parallel()
t.Run("direct", func(t *testing.T) {
t.Parallel()
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo *DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
t.Run("list", func(t *testing.T) {
t.Parallel()
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo []*DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
})
}
func TestModulePythonWithOtherModuleTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("mod", "init", "--name=dep", "--sdk=python")).
WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `from dagger import field, function, object_type
@object_type
class Foo:
...
@object_type
class Obj:
foo: str = field()
@object_type
class Dep:
@function
def fn(self) -> Obj:
return Obj(foo="foo")
`,
}).
WithWorkdir("/work/test").
With(daggerExec("mod", "init", "--name=test", "--sdk=python", "--root=..")).
With(daggerExec("mod", "install", "../dep"))
t.Run("return as other module object", func(t *testing.T) {
t.Parallel()
t.Run("direct", func(t *testing.T) {
t.Parallel()
_, err := ctr.
WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `import dagger
@dagger.object_type
class Test:
@dagger.function
def fn(self) -> dagger.DepObj:
...
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.Regexp(t, fmt.Sprintf(
`object\s+%q\s+function\s+%q\s+cannot\s+return\s+external\s+type\s+from\s+dependency\s+module\s+%q`,
"Test", "fn", "dep",
), err.Error())
})
t.Run("list", func(t *testing.T) {
t.Parallel()
_, err := ctr.
WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `import dagger
@dagger.object_type
class Test:
@dagger.function
def fn(self) -> list[dagger.DepObj]:
...
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.Regexp(t, fmt.Sprintf(
`object\s+%q\s+function\s+%q\s+cannot\s+return\s+external\s+type\s+from\s+dependency\s+module\s+%q`,
"Test", "fn", "dep",
), err.Error())
})
})
t.Run("arg as other module object", func(t *testing.T) {
t.Parallel()
t.Run("direct", func(t *testing.T) {
t.Parallel()
_, err := ctr.WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `import dagger
@dagger.object_type
class Test:
@dagger.function
def fn(self, obj: dagger.DepObj):
...
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.Regexp(t, fmt.Sprintf(
`object\s+%q\s+function\s+%q\s+arg\s+%q\s+cannot\s+reference\s+external\s+type\s+from\s+dependency\s+module\s+%q`,
"Test", "fn", "obj", "dep",
), err.Error())
})
t.Run("list", func(t *testing.T) {
t.Parallel()
_, err := ctr.WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `import dagger
@dagger.object_type
class Test:
@dagger.function
def fn(self, obj: list[dagger.DepObj]):
...
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.Regexp(t, fmt.Sprintf(
`object\s+%q\s+function\s+%q\s+arg\s+%q\s+cannot\s+reference\s+external\s+type\s+from\s+dependency\s+module\s+%q`,
"Test", "fn", "obj", "dep",
), err.Error())
})
})
t.Run("field as other module object", func(t *testing.T) {
t.Parallel()
t.Run("direct", func(t *testing.T) {
t.Parallel()
_, err := ctr.
WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `import dagger
@dagger.object_type
class Obj:
foo: dagger.DepObj = dagger.field()
@dagger.object_type
class Test:
@dagger.function
def fn(self) -> Obj:
...
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.Regexp(t, fmt.Sprintf(
`object\s+%q\s+field\s+%q\s+cannot\s+reference\s+external\s+type\s+from\s+dependency\s+module\s+%q`,
"Obj", "foo", "dep",
), err.Error())
})
t.Run("list", func(t *testing.T) {
t.Parallel()
_, err := ctr.
WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `import dagger
@dagger.object_type
class Obj:
foo: list[dagger.DepObj] = dagger.field()
@dagger.object_type
class Test:
@dagger.function
def fn(self) -> list[Obj]:
...
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.Regexp(t, fmt.Sprintf(
`object\s+%q\s+field\s+%q\s+cannot\s+reference\s+external\s+type\s+from\s+dependency\s+module\s+%q`,
"Obj", "foo", "dep",
), err.Error())
})
})
}
var useInner = `package main
type Dep struct{}
func (m *Dep) Hello() string {
return "hello"
}
`
var useGoOuter = `package main
import "context"
type Use struct{}
func (m *Use) UseHello(ctx context.Context) (string, error) {
return dag.Dep().Hello(ctx)
}
`
var usePythonOuter = `from dagger import dag, function
@function
def use_hello() -> str:
return dag.dep().hello()
`
var useTSOuter = `
import { dag, object, func } from '@dagger.io/dagger'
@object
class Use {
@func
async useHello(): Promise<string> {
return dag.dep().hello()
}
}
`
func TestModuleUseLocal(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("mod", "init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("mod", "install", "./dep"))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// cannot use transitive dependency directly
_, err = modGen.With(daggerQuery(`{dep{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, `Query has no such field: "dep"`)
})
}
}
func TestModuleCodegenOnDepChange(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
changed string
expected string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
expected: "Hellov2",
changed: strings.ReplaceAll(useGoOuter, `Hello(ctx)`, `Hellov2(ctx)`),
},
{
sdk: "python",
source: usePythonOuter,
expected: "hellov2",
changed: strings.ReplaceAll(usePythonOuter, `.hello()`, `.hellov2()`),
},
{
sdk: "typescript",
source: useTSOuter,
expected: "hellov2",
changed: strings.ReplaceAll(useTSOuter, `.hello()`, `.hellov2()`),
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("mod", "init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("mod", "install", "./dep"))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// make back-incompatible change to dep
newInner := strings.ReplaceAll(useInner, `Hello()`, `Hellov2()`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("mod", "sync"))
codegenContents, err := modGen.File(sdkCodegenFile(t, tc.sdk)).Contents(ctx)
require.NoError(t, err)
require.Contains(t, codegenContents, tc.expected)
modGen = modGen.With(sdkSource(tc.sdk, tc.changed))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
})
}
}
func TestModuleSyncDeps(t *testing.T) {
// verify that changes to deps result in a sync to the depender module
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("mod", "init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("mod", "install", "./dep"))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
modGen = modGen.With(daggerQuery(`{use{useHello}}`))
out, err := modGen.Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
newInner := strings.ReplaceAll(useInner, `"hello"`, `"goodbye"`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("mod", "sync"))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"goodbye"}}`, out)
})
}
}
func TestModuleUseLocalMulti(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
import "fmt"
type Use struct {}
func (m *Use) Names(ctx context.Context) ([]string, error) {
fooName, err := dag.Foo().Name(ctx)
if err != nil {
return nil, fmt.Errorf("foo.name: %w", err)
}
barName, err := dag.Bar().Name(ctx)
if err != nil {
return nil, fmt.Errorf("bar.name: %w", err)
}
return []string{fooName, barName}, nil
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function
@function
async def names() -> list[str]:
return [
await dag.foo().name(),
await dag.bar().name(),
]
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from '@dagger.io/dagger'
@object
class Use {
@func
async names(): Promise<string[]> {
return [await dag.foo().name(), await dag.bar().name()]
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/foo").
WithNewFile("/work/foo/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Foo struct {}
func (m *Foo) Name() string { return "foo" }
`,
}).
With(daggerExec("mod", "init", "--name=foo", "--sdk=go")).
WithWorkdir("/work/bar").
WithNewFile("/work/bar/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Bar struct {}
func (m *Bar) Name() string { return "bar" }
`,
}).
With(daggerExec("mod", "init", "--name=bar", "--sdk=go")).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=use", "--sdk="+tc.sdk)).
With(daggerExec("mod", "install", "./foo")).
With(daggerExec("mod", "install", "./bar")).
With(sdkSource(tc.sdk, tc.source)).
WithEnvVariable("BUST", identity.NewID()) // NB(vito): hmm...
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{use{names}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"names":["foo", "bar"]}}`, out)
})
}
}
func TestModuleConstructor(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
t.Run("basic", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(
ctx context.Context,
foo string,
bar Optional[int],
baz []string,
dir *Directory,
) *Test {
return &Test{
Foo: foo,
Bar: bar.GetOr(42),
Baz: baz,
Dir: dir,
}
}
type Test struct {
Foo string
Bar int
Baz []string
Dir *Directory
NeverSetDir *Directory
}
func (m *Test) GimmeFoo() string {
return m.Foo
}
func (m *Test) GimmeBar() int {
return m.Bar
}
func (m *Test) GimmeBaz() []string {
return m.Baz
}
func (m *Test) GimmeDirEnts(ctx context.Context) ([]string, error) {
return m.Dir.Entries(ctx)
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import field, function, object_type
@object_type
class Test:
foo: str = field()
dir: dagger.Directory = field()
bar: int = field(default=42)
baz: list[str] = field(default=list)
never_set_dir: dagger.Directory | None = field(default=None)
@function
def gimme_foo(self) -> str:
return self.foo
@function
def gimme_bar(self) -> int:
return self.bar
@function
def gimme_baz(self) -> list[str]:
return self.baz
@function
async def gimme_dir_ents(self) -> list[str]:
return await self.dir.entries()
`,
},
{
sdk: "typescript",
source: `
import { Directory, object, func, field } from '@dagger.io/dagger';
@object
class Test {
@field
foo: string
@field
dir: Directory
@field
bar: number
@field
baz: string[]
@field
neverSetDir?: Directory
constructor(foo: string, dir: Directory, bar = 42, baz: string[] = []) {
this.foo = foo;
this.dir = dir;
this.bar = bar;
this.baz = baz;
}
@func
gimmeFoo(): string {
return this.foo;
}
@func
gimmeBar(): number {
return this.bar;
}
@func
gimmeBaz(): string[] {
return this.baz;
}
@func
async gimmeDirEnts(): Promise<string[]> {
return this.dir.entries();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("mod", "init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-dir-ents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, strings.TrimSpace(out), "dagger.json")
})
}
})
t.Run("fields only", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(ctx context.Context) (Test, error) {
v, err := dag.Container().From("alpine:3.18.4").File("/etc/alpine-release").Contents(ctx)
if err != nil {
return Test{}, err
}
return Test{
AlpineVersion: v,
}, nil
}
type Test struct {
AlpineVersion string
}
`,
},
{
sdk: "python",
source: `from dagger import dag, field, function, object_type
@object_type
class Test:
alpine_version: str = field()
@classmethod
async def create(cls) -> "Test":
return cls(alpine_version=await (
dag.container()
.from_("alpine:3.18.4")
.file("/etc/alpine-release")
.contents()
))
`,
},
{
sdk: "typescript",
source: `
import { dag, object, field } from "@dagger.io/dagger"
@object
class Test {
@field
alpineVersion: string
// NOTE: this is standard to do async operations in the constructor.
// This is only for testing purpose but it shouldn't be done in real usage.
constructor() {
return (async () => {
this.alpineVersion = await dag.container().from("alpine:3.18.4").file("/etc/alpine-release").contents()
return this; // Return the newly-created instance
})();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("mod", "init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := ctr.With(daggerCall("alpine-version")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "3.18.4")
})
}
})
t.Run("return error", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"fmt"
)
func New() (*Test, error) {
return nil, fmt.Errorf("too bad")
}
type Test struct {
Foo string
}
`,
},
{
sdk: "python",
source: `from dagger import object_type, field
@object_type
class Test:
foo: str = field()
def __init__(self):
raise ValueError("too bad")
`,
},
{
sdk: "typescript",
source: `
import { object, field } from "@dagger.io/dagger"
@object
class Test {
@field
foo: string
constructor() {
throw new Error("too bad")
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("mod", "init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
_, err := ctr.With(daggerCall("foo")).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "too bad")
})
}
})
t.Run("python: with default factory", func(t *testing.T) {
t.Parallel()
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("mod", "init", "--name=test", "--sdk=python")).
With(sdkSource("python", fmt.Sprintf(`import dagger
from dagger import dag, object_type, field
@object_type
class Test:
foo: dagger.File = field(default=lambda: (
dag.directory()
.with_new_file("foo.txt", contents="%s")
.file("foo.txt")
))
bar: list[str] = field(default=list)
`, content),
))
out, err := ctr.With(daggerCall("foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), content)
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "python"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
t.Run("typescript: with default factory", func(t *testing.T) {
t.Parallel()
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("mod", "init", "--name=test", "--sdk=typescript")).
With(sdkSource("typescript", fmt.Sprintf(`
import { dag, File, object, field } from "@dagger.io/dagger"
@object
class Test {
@field
foo: File = dag.directory().withNewFile("foo.txt", "%s").file("foo.txt")
@field
bar: string[] = []
// Allow foo to be set through the constructor
constructor(foo?: File) {
if (foo) {
this.foo = foo
}
}
}
`, content),
))
out, err := ctr.With(daggerCall("foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), content)
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "typescript"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
}
func TestModuleWrapping(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Wrapper struct{}
func (m *Wrapper) Container() *WrappedContainer {
return &WrappedContainer{
dag.Container().From("alpine"),
}
}
type WrappedContainer struct {
Unwrap *Container` + "`" + `json:"unwrap"` + "`" + `
}
func (c *WrappedContainer) Echo(msg string) *WrappedContainer {
return &WrappedContainer{
c.Unwrap.WithExec([]string{"echo", "-n", msg}),
}
}
`,
},
{
sdk: "python",
source: `from typing import Self
import dagger
from dagger import dag, field, function, object_type
@object_type
class WrappedContainer:
unwrap: dagger.Container = field()
@function
def echo(self, msg: str) -> Self:
return WrappedContainer(unwrap=self.unwrap.with_exec(["echo", "-n", msg]))
@object_type
class Wrapper:
@function
def container(self) -> WrappedContainer:
return WrappedContainer(unwrap=dag.container().from_("alpine"))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object
class WrappedContainer {
@field
unwrap: Container
constructor(unwrap: Container) {
this.unwrap = unwrap
}
@func
echo(msg: string): WrappedContainer {
return new WrappedContainer(this.unwrap.withExec(["echo", "-n", msg]))
}
}
@object
class Wrapper {
@func
container(): WrappedContainer {
return new WrappedContainer(dag.container().from("alpine"))
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=wrapper", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
id := identity.NewID()
out, err := modGen.With(daggerQuery(
fmt.Sprintf(`{wrapper{container{echo(msg:%q){unwrap{stdout}}}}}`, id),
)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t,
fmt.Sprintf(`{"wrapper":{"container":{"echo":{"unwrap":{"stdout":%q}}}}}`, id),
out)
})
}
}
func TestModuleConfigAPI(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
moduleDir := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/subdir").
With(daggerExec("mod", "init", "--name=test", "--sdk=go", "--root=..")).
Directory("/work")
cfg := c.ModuleConfig(moduleDir, dagger.ModuleConfigOpts{Subpath: "subdir"})
name, err := cfg.Name(ctx)
require.NoError(t, err)
require.Equal(t, "test", name)
sdk, err := cfg.SDK(ctx)
require.NoError(t, err)
require.Equal(t, "go", sdk)
root, err := cfg.Root(ctx)
require.NoError(t, err)
require.Equal(t, "..", root)
}
func TestModuleTypescriptInit(t *testing.T) {
t.Run("from scratch", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=bare", "--sdk=typescript"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("with different root", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/child").
With(daggerExec("mod", "init", "--name=bare", "--sdk=typescript", "--root=.."))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("camel-cases Dagger module name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=My-Module", "--sdk=typescript"))
out, err := modGen.
With(daggerQuery(`{myModule{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"myModule":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("respect existing package.json", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/package.json", dagger.ContainerWithNewFileOpts{
Contents: `{
"name": "my-module",
"version": "1.0.0",
"description": "My module",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "John doe",
"license": "MIT"
}`,
}).
With(daggerExec("mod", "init", "--name=hasPkgJson", "--sdk=typescript"))
out, err := modGen.
With(daggerQuery(`{hasPkgJson{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasPkgJson":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("Add dagger dependencies to the existing package.json", func(t *testing.T) {
pkgJSON, err := modGen.File("/work/package.json").Contents(ctx)
require.NoError(t, err)
require.Contains(t, pkgJSON, `"@dagger.io/dagger":`)
require.Contains(t, pkgJSON, `"name": "my-module"`)
})
})
t.Run("respect existing tsconfig.json", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/tsconfig.json", dagger.ContainerWithNewFileOpts{
Contents: `{
"compilerOptions": {
"target": "ES2022",
"moduleResolution": "Node",
"experimentalDecorators": true
}
}`,
}).
With(daggerExec("mod", "init", "--name=hasTsConfig", "--sdk=typescript"))
out, err := modGen.
With(daggerQuery(`{hasTsConfig{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasTsConfig":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("Add dagger paths to the existing tsconfig.json", func(t *testing.T) {
tsConfig, err := modGen.File("/work/tsconfig.json").Contents(ctx)
require.NoError(t, err)
require.Contains(t, tsConfig, `"@dagger.io/dagger":`)
})
})
t.Run("respect existing src/index.ts", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithDirectory("/work/src", c.Directory()).
WithNewFile("/work/src/index.ts", dagger.ContainerWithNewFileOpts{
Contents: `
import { dag, Container, object, func } from "@dagger.io/dagger"
@object
// eslint-disable-next-line @typescript-eslint/no-unused-vars
class ExistingSource {
/**
* example usage: "dagger call container-echo --string-arg yo"
*/
@func
helloWorld(stringArg: string): Container {
return dag.container().from("alpine:latest").withExec(["echo", stringArg])
}
}
`,
}).
With(daggerExec("mod", "init", "--name=existingSource", "--sdk=typescript"))
out, err := modGen.
With(daggerQuery(`{existingSource{helloWorld(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"existingSource":{"helloWorld":{"stdout":"hello\n"}}}`, out)
})
}
func TestModuleLotsOfFunctions(t *testing.T) {
t.Parallel()
const funcCount = 100
t.Run("go sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
package main
type PotatoSack struct {}
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
func (m *PotatoSack) Potato%d() string {
return "potato #%d"
}
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("mod", "init", "--name=potatoSack", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("python sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `from dagger import function
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@function
def potato_%d() -> str:
return "potato #%d"
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("./src/main.py", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("mod", "init", "--name=potatoSack", "--sdk=python"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("typescript sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
import { object, func } from "@dagger.io/dagger"
@object
class PotatoSack {
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@func
potato_%d(): string {
return "potato #%d"
}
`, i, i)
}
mainSrc += "\n}"
modGen := c.
Container().
From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(sdkSource("typescript", mainSrc)).
With(daggerExec("mod", "init", "--name=potatoSack", "--sdk=typescript"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
}
func TestModuleLotsOfDeps(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
modCount := 0
getModMainSrc := func(name string, depNames []string) string {
t.Helper()
mainSrc := fmt.Sprintf(`package main
import "context"
type %s struct {}
func (m *%s) Fn(ctx context.Context) (string, error) {
s := "%s"
var depS string
_ = depS
var err error
_ = err
`, strcase.ToCamel(name), strcase.ToCamel(name), name)
for _, depName := range depNames {
mainSrc += fmt.Sprintf(`
depS, err = dag.%s().Fn(ctx)
if err != nil {
return "", err
}
s += depS
`, strcase.ToCamel(depName))
}
mainSrc += "return s, nil\n}\n"
fmted, err := format.Source([]byte(mainSrc))
require.NoError(t, err)
return string(fmted)
}
// need to construct dagger.json directly in order to avoid excessive
// `dagger mod use` calls while constructing the huge DAG of deps
getModDaggerConfig := func(name string, depNames []string) string {
t.Helper()
var depVals []string
for _, depName := range depNames {
depVals = append(depVals, "../"+depName)
}
cfg := modules.Config{
Name: name,
Root: "..",
SDK: "go",
Dependencies: depVals,
}
bs, err := json.Marshal(cfg)
require.NoError(t, err)
return string(bs)
}
addModulesWithDeps := func(newMods int, depNames []string) []string {
t.Helper()
var newModNames []string
for i := 0; i < newMods; i++ {
name := fmt.Sprintf("mod%d", modCount)
modCount++
newModNames = append(newModNames, name)
modGen = modGen.
WithWorkdir("/work/"+name).
WithNewFile("./main.go", dagger.ContainerWithNewFileOpts{
Contents: getModMainSrc(name, depNames),
}).
WithNewFile("./dagger.json", dagger.ContainerWithNewFileOpts{
Contents: getModDaggerConfig(name, depNames),
})
}
return newModNames
}
// Create a base module, then add 6 layers of deps, where each layer has one more module
// than the previous layer and each module within the layer has a dep on each module
// from the previous layer. Finally add a single module at the top that depends on all
// modules from the last layer and call that.
// Basically, this creates a quadratically growing DAG of modules and verifies we
// handle it efficiently enough to be callable.
curDeps := addModulesWithDeps(1, nil)
for i := 0; i < 6; i++ {
curDeps = addModulesWithDeps(len(curDeps)+1, curDeps)
}
addModulesWithDeps(1, curDeps)
_, err := modGen.With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
}
func TestModuleNamespacing(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
moduleSrcPath, err := filepath.Abs("./testdata/modules/go/namespacing")
require.NoError(t, err)
ctr := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithMountedDirectory("/work", c.Host().Directory(moduleSrcPath)).
WithWorkdir("/work")
out, err := ctr.
With(daggerQuery(`{test{fn(s:"yo")}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fn":["*main.Sub1Obj made 1:yo", "*main.Sub2Obj made 2:yo"]}}`, out)
}
func TestModuleRoots(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
moduleSrcPath, err := filepath.Abs("./testdata/modules/go/roots")
require.NoError(t, err)
entries, err := os.ReadDir(moduleSrcPath)
require.NoError(t, err)
ctr := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithMountedDirectory("/work", c.Host().Directory(moduleSrcPath))
for _, entry := range entries {
entry := entry
t.Run(entry.Name(), func(t *testing.T) {
t.Parallel()
ctr := ctr.WithWorkdir("/work/" + entry.Name())
out, err := ctr.
With(daggerQuery(fmt.Sprintf(`{%s{hello}}`, strcase.ToLowerCamel(entry.Name())))).
Stdout(ctx)
if strings.HasPrefix(entry.Name(), "good-") {
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"%s":{"hello": "hello"}}`, strcase.ToLowerCamel(entry.Name())), out)
} else if strings.HasPrefix(entry.Name(), "bad-") {
require.Error(t, err)
require.Regexp(t, "is not under( module)? root", err.Error())
}
})
}
}
func TestModuleLoops(t *testing.T) {
// verify circular module dependencies result in an error
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/depA").
With(daggerExec("mod", "init", "--name=depA", "--sdk=go", "--root=..")).
WithWorkdir("/work/depB").
With(daggerExec("mod", "init", "--name=depB", "--sdk=go", "--root=..")).
With(daggerExec("mod", "install", "../depA")).
WithWorkdir("/work/depC").
With(daggerExec("mod", "init", "--name=depC", "--sdk=go", "--root=..")).
With(daggerExec("mod", "install", "../depB")).
WithWorkdir("/work/depA").
With(daggerExec("mod", "install", "../depC")).
Sync(ctx)
require.ErrorContains(t, err, "module depA has a circular dependency")
}
//go:embed testdata/modules/go/id/arg/main.go
var badIDArgGoSrc string
//go:embed testdata/modules/python/id/arg/main.py
var badIDArgPySrc string
//go:embed testdata/modules/typescript/id/arg/index.ts
var badIDArgTSSrc string
//go:embed testdata/modules/go/id/field/main.go
var badIDFieldGoSrc string
//go:embed testdata/modules/typescript/id/field/index.ts
var badIDFieldTSSrc string
//go:embed testdata/modules/go/id/fn/main.go
var badIDFnGoSrc string
//go:embed testdata/modules/python/id/fn/main.py
var badIDFnPySrc string
//go:embed testdata/modules/typescript/id/fn/index.ts
var badIDFnTSSrc string
func TestModuleReservedWords(t *testing.T) {
// verify disallowed names are rejected
t.Parallel()
c, ctx := connect(t)
type testCase struct {
sdk string
source string
}
t.Run("id", func(t *testing.T) {
t.Parallel()
t.Run("arg", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDArgGoSrc,
},
{
sdk: "python",
source: badIDArgPySrc,
},
{
sdk: "typescript",
source: badIDArgTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{fn(id:"no")}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define argument with reserved name \"id\"")
})
}
})
t.Run("field", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFieldGoSrc,
},
{
sdk: "typescript",
source: badIDFieldTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{fn{id}}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define field with reserved name \"id\"")
})
}
})
t.Run("fn", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFnGoSrc,
},
{
sdk: "python",
source: badIDFnPySrc,
},
{
sdk: "typescript",
source: badIDFnTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{id}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define function with reserved name \"id\"")
})
}
})
})
}
//go:embed testdata/modules/typescript/syntax/index.ts
var tsSyntax string
func TestModuleTypescriptSyntaxSupport(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=syntax", "--sdk=typescript")).
WithNewFile("src/index.ts", dagger.ContainerWithNewFileOpts{
Contents: tsSyntax,
})
t.Run("singleQuoteDefaultArgHello(msg: string = 'world'): string", func(t *testing.T) {
t.Parallel()
defaultOut, err := modGen.With(daggerQuery(`{syntax{singleQuoteDefaultArgHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"syntax":{"singleQuoteDefaultArgHello":"hello world"}}`, defaultOut)
out, err := modGen.With(daggerQuery(`{syntax{singleQuoteDefaultArgHello(msg: "dagger")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"syntax":{"singleQuoteDefaultArgHello":"hello dagger"}}`, out)
})
t.Run("doubleQuotesDefaultArgHello(msg: string = \"world\"): string", func(t *testing.T) {
t.Parallel()
defaultOut, err := modGen.With(daggerQuery(`{syntax{doubleQuotesDefaultArgHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"syntax":{"doubleQuotesDefaultArgHello":"hello world"}}`, defaultOut)
out, err := modGen.With(daggerQuery(`{syntax{doubleQuotesDefaultArgHello(msg: "dagger")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"syntax":{"doubleQuotesDefaultArgHello":"hello dagger"}}`, out)
})
}
func TestModuleExecError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=playground", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
import (
"context"
"errors"
)
type Playground struct{}
func (p *Playground) DoThing(ctx context.Context) error {
_, err := dag.Container().From("alpine").WithExec([]string{"sh", "-c", "exit 5"}).Sync(ctx)
var e *ExecError
if errors.As(err, &e) {
if e.ExitCode == 5 {
return nil
}
}
panic("yikes")
}
`})
logGen(ctx, t, modGen.Directory("."))
_, err := modGen.
With(daggerQuery(`{playground{doThing}}`)).
Stdout(ctx)
require.NoError(t, err)
}
func daggerExec(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerQuery(query string, args ...any) dagger.WithContainerFunc {
query = fmt.Sprintf(query, args...)
return func(c *dagger.Container) *dagger.Container {
return c.WithExec([]string{"dagger", "--debug", "query"}, dagger.ContainerWithExecOpts{
Stdin: query,
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerCall(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug", "call"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerFunctions(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug", "functions"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
// command for a dagger cli call direct on the host
func hostDaggerCommand(ctx context.Context, t testing.TB, workdir string, args ...string) *exec.Cmd {
t.Helper()
cmd := exec.CommandContext(ctx, daggerCliPath(t), args...)
cmd.Dir = workdir
return cmd
}
// runs a dagger cli command directly on the host, rather than in an exec
func hostDaggerExec(ctx context.Context, t testing.TB, workdir string, args ...string) ([]byte, error) {
t.Helper()
cmd := hostDaggerCommand(ctx, t, workdir, args...)
output, err := cmd.CombinedOutput()
if err != nil {
err = fmt.Errorf("%s: %w", string(output), err)
}
return output, err
}
func sdkSource(sdk, contents string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
var sourcePath string
switch sdk {
case "go":
sourcePath = "main.go"
case "python":
sourcePath = "src/main.py"
case "typescript":
sourcePath = "src/index.ts"
default:
return c
}
return c.WithNewFile(sourcePath, dagger.ContainerWithNewFileOpts{
Contents: contents,
})
}
}
func sdkCodegenFile(t *testing.T, sdk string) string {
t.Helper()
switch sdk {
case "go":
return "dagger.gen.go"
case "python":
return "sdk/src/dagger/client/gen.py"
case "typescript":
return "sdk/api/client.gen.ts"
default:
return ""
}
}
func currentSchema(ctx context.Context, t *testing.T, ctr *dagger.Container) *introspection.Schema {
t.Helper()
out, err := ctr.With(daggerQuery(introspection.Query)).Stdout(ctx)
require.NoError(t, err)
var schemaResp introspection.Response
err = json.Unmarshal([]byte(out), &schemaResp)
require.NoError(t, err)
return schemaResp.Schema
}
func goGitBase(t *testing.T, c *dagger.Client) *dagger.Container {
t.Helper()
return c.Container().From(golangImage).
WithExec([]string{"apk", "add", "git"}).
WithExec([]string{"git", "config", "--global", "user.email", "dagger@example.com"}).
WithExec([]string{"git", "config", "--global", "user.name", "Dagger Tests"}).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"})
}
func logGen(ctx context.Context, t *testing.T, modSrc *dagger.Directory) {
t.Helper()
generated, err := modSrc.File("dagger.gen.go").Contents(ctx)
require.NoError(t, err)
t.Cleanup(func() {
t.Name()
fileName := filepath.Join(
os.TempDir(),
t.Name(),
fmt.Sprintf("dagger.gen.%d.go", time.Now().Unix()),
)
if err := os.MkdirAll(filepath.Dir(fileName), 0o755); err != nil {
t.Logf("failed to create temp dir for generated code: %v", err)
return
}
if err := os.WriteFile(fileName, []byte(generated), 0644); err != nil {
t.Logf("failed to write generated code to %s: %v", fileName, err)
} else {
t.Logf("wrote generated code to %s", fileName)
}
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,501 | 🐞 Logs are duplicated when a vertex is used multiple times | ### What is the issue?
This issue is only on `main`; the current release, v0.9.7, is not affected.
If you run a pipeline with a vertex that is used multiple times in the same session, the log output will be duplicated, possibly with each extra use (i.e. cache hit).
### Dagger version
main
### Steps to reproduce
Once #6456 is merged, run a function that calls another function twice; you should see duplicate logs in its `codegen` vertex.
### Log output
`main`:
![image](https://uploads.linear.app/0b2a9228-3827-45ff-bb20-ccd34f57f694/3f8aa9f9-2a55-464f-88fa-b720b81b0243/5b2f333b-937b-4f83-9c32-498524dd1c66?signature=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXRoIjoiLzBiMmE5MjI4LTM4MjctNDVmZi1iYjIwLWNjZDM0ZjU3ZjY5NC8zZjhhYTlmOS0yYTU1LTQ2NGYtODhmYS1iNzIwYjgxYjAyNDMvNWIyZjMzM2ItOTM3Yi00ZjgzLTljMzItNDk4NTI0ZGQxYzY2IiwiaWF0IjoxNzA2MjM3NTE0LCJleHAiOjMzMjc2Nzk3NTE0fQ.7DzuNYrqSTg645n0iILYM_7rx7FVC_CjoPN0saIQre8)
`v0.9.7`:
![image](https://uploads.linear.app/0b2a9228-3827-45ff-bb20-ccd34f57f694/1286bdec-e70a-46a3-858a-356ebfa69020/513d034f-3b15-4555-b767-23dde6f09f06?signature=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXRoIjoiLzBiMmE5MjI4LTM4MjctNDVmZi1iYjIwLWNjZDM0ZjU3ZjY5NC8xMjg2YmRlYy1lNzBhLTQ2YTMtODU4YS0zNTZlYmZhNjkwMjAvNTEzZDAzNGYtM2IxNS00NTU1LWI3NjctMjNkZGU2ZjA5ZjA2IiwiaWF0IjoxNzA2MjM3NTE0LCJleHAiOjMzMjc2Nzk3NTE0fQ.-jrW8WycCYXyQsjxVMjHHXYdQ8HD_wD-\_cKwYIPgWXc) | https://github.com/dagger/dagger/issues/6501 | https://github.com/dagger/dagger/pull/6505 | 53179a064559cf376fa2ad7596e32bd4e4934c74 | 30b22dd06e4366aed01f8f86d0a1729835b12aec | "2024-01-26T02:30:45Z" | go | "2024-01-29T11:51:30Z" | engine/buildkit/client.go | package buildkit
import (
"context"
"encoding/json"
"errors"
"fmt"
"net"
"strings"
"sync"
"time"
"github.com/dagger/dagger/auth"
"github.com/dagger/dagger/engine"
"github.com/dagger/dagger/engine/session"
bkcache "github.com/moby/buildkit/cache"
bkcacheconfig "github.com/moby/buildkit/cache/config"
"github.com/moby/buildkit/cache/remotecache"
bkclient "github.com/moby/buildkit/client"
"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/executor/oci"
bkfrontend "github.com/moby/buildkit/frontend"
bkgw "github.com/moby/buildkit/frontend/gateway/client"
bkcontainer "github.com/moby/buildkit/frontend/gateway/container"
"github.com/moby/buildkit/identity"
bksession "github.com/moby/buildkit/session"
bksecrets "github.com/moby/buildkit/session/secrets"
bksolver "github.com/moby/buildkit/solver"
"github.com/moby/buildkit/solver/llbsolver"
bksolverpb "github.com/moby/buildkit/solver/pb"
solverresult "github.com/moby/buildkit/solver/result"
"github.com/moby/buildkit/util/bklog"
"github.com/moby/buildkit/util/entitlements"
bkworker "github.com/moby/buildkit/worker"
"github.com/opencontainers/go-digest"
"golang.org/x/sync/errgroup"
"google.golang.org/grpc/metadata"
)
const (
// from buildkit, cannot change
entitlementsJobKey = "llb.entitlements"
)
type Opts struct {
Worker bkworker.Worker
SessionManager *bksession.Manager
LLBSolver *llbsolver.Solver
GenericSolver *bksolver.Solver
SecretStore bksecrets.SecretStore
AuthProvider *auth.RegistryAuthProvider
PrivilegedExecEnabled bool
UpstreamCacheImports []bkgw.CacheOptionsEntry
// MainClientCaller is the caller who initialized the server associated with this
// client. It is special in that when it shuts down, the client will be closed and
// that registry auth and sockets are currently only ever sourced from this caller,
// not any nested clients (may change in future).
MainClientCaller bksession.Caller
DNSConfig *oci.DNSConfig
}
type ResolveCacheExporterFunc func(ctx context.Context, g bksession.Group) (remotecache.Exporter, error)
// Client is dagger's internal interface to buildkit APIs
type Client struct {
Opts
session *bksession.Session
job *bksolver.Job
llbBridge bkfrontend.FrontendLLBBridge
clientMu sync.RWMutex
clientIDToSecretToken map[string]string
refs map[*ref]struct{}
refsMu sync.Mutex
containers map[bkgw.Container]struct{}
containersMu sync.Mutex
dialer *net.Dialer
closeCtx context.Context
cancel context.CancelFunc
closeMu sync.RWMutex
}
func NewClient(ctx context.Context, opts Opts) (*Client, error) {
closeCtx, cancel := context.WithCancel(context.Background())
client := &Client{
Opts: opts,
clientIDToSecretToken: make(map[string]string),
refs: make(map[*ref]struct{}),
containers: make(map[bkgw.Container]struct{}),
closeCtx: closeCtx,
cancel: cancel,
}
session, err := client.newSession(ctx)
if err != nil {
return nil, err
}
client.session = session
job, err := client.GenericSolver.NewJob(client.ID())
if err != nil {
return nil, err
}
client.job = job
client.job.SessionID = client.ID()
entitlementSet := entitlements.Set{}
if opts.PrivilegedExecEnabled {
entitlementSet[entitlements.EntitlementSecurityInsecure] = struct{}{}
}
client.job.SetValue(entitlementsJobKey, entitlementSet)
client.llbBridge = client.LLBSolver.Bridge(client.job)
client.llbBridge = recordingGateway{client.llbBridge}
client.dialer = &net.Dialer{}
if opts.DNSConfig != nil {
client.dialer.Resolver = &net.Resolver{
PreferGo: true,
Dial: func(ctx context.Context, network, address string) (net.Conn, error) {
if len(opts.DNSConfig.Nameservers) == 0 {
return nil, errors.New("no nameservers configured")
}
var errs []error
for _, ns := range opts.DNSConfig.Nameservers {
conn, err := client.dialer.DialContext(ctx, network, net.JoinHostPort(ns, "53"))
if err != nil {
errs = append(errs, err)
continue
}
return conn, nil
}
return nil, errors.Join(errs...)
},
}
}
return client, nil
}
func (c *Client) ID() string {
return c.session.ID()
}
func (c *Client) Close() error {
c.closeMu.Lock()
defer c.closeMu.Unlock()
select {
case <-c.closeCtx.Done():
// already closed
return nil
default:
}
c.cancel()
c.job.Discard()
c.job.CloseProgress()
c.refsMu.Lock()
for rf := range c.refs {
if rf != nil {
rf.resultProxy.Release(context.Background())
}
}
c.refs = nil
c.refsMu.Unlock()
c.containersMu.Lock()
var containerReleaseGroup errgroup.Group
for ctr := range c.containers {
if ctr := ctr; ctr != nil {
containerReleaseGroup.Go(func() error {
// in theory this shouldn't block very long and just kill the container,
// but add a safeguard just in case
releaseCtx, cancelRelease := context.WithTimeout(context.Background(), 30*time.Second)
defer cancelRelease()
return ctr.Release(releaseCtx)
})
}
}
err := containerReleaseGroup.Wait()
if err != nil {
bklog.G(context.Background()).WithError(err).Error("failed to release containers")
}
c.containers = nil
c.containersMu.Unlock()
return nil
}
func (c *Client) withClientCloseCancel(ctx context.Context) (context.Context, context.CancelFunc, error) {
c.closeMu.RLock()
defer c.closeMu.RUnlock()
select {
case <-c.closeCtx.Done():
return nil, nil, errors.New("client closed")
default:
}
ctx, cancel := context.WithCancel(ctx)
go func() {
select {
case <-c.closeCtx.Done():
cancel()
case <-ctx.Done():
}
}()
return ctx, cancel, nil
}
func (c *Client) Solve(ctx context.Context, req bkgw.SolveRequest) (_ *Result, rerr error) {
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return nil, err
}
defer cancel()
ctx = withOutgoingContext(ctx)
// include upstream cache imports, if any
req.CacheImports = c.UpstreamCacheImports
// include exec metadata that isn't included in the cache key
if req.Definition != nil && req.Definition.Def != nil {
clientMetadata, err := engine.ClientMetadataFromContext(ctx)
if err != nil {
return nil, err
}
dag, err := DefToDAG(req.Definition)
if err != nil {
return nil, err
}
if err := dag.Walk(func(dag *OpDAG) error {
execOp, ok := dag.AsExec()
if !ok {
return nil
}
if execOp.Meta == nil {
execOp.Meta = &bksolverpb.Meta{}
}
if execOp.Meta.ProxyEnv == nil {
execOp.Meta.ProxyEnv = &bksolverpb.ProxyEnv{}
}
execMeta := ContainerExecUncachedMetadata{
ParentClientIDs: clientMetadata.ClientIDs(),
ServerID: clientMetadata.ServerID,
}
var err error
execOp.Meta.ProxyEnv.FtpProxy, err = execMeta.ToPBFtpProxyVal()
if err != nil {
return err
}
return nil
}); err != nil {
return nil, err
}
newDef, err := dag.Marshal()
if err != nil {
return nil, err
}
req.Definition = newDef
}
llbRes, err := c.llbBridge.Solve(ctx, req, c.ID())
if err != nil {
return nil, wrapError(ctx, err, c.ID())
}
res, err := solverresult.ConvertResult(llbRes, func(rp bksolver.ResultProxy) (*ref, error) {
return newRef(rp, c), nil
})
if err != nil {
llbRes.EachRef(func(rp bksolver.ResultProxy) error {
return rp.Release(context.Background())
})
return nil, err
}
c.refsMu.Lock()
defer c.refsMu.Unlock()
if res.Ref != nil {
c.refs[res.Ref] = struct{}{}
}
for _, rf := range res.Refs {
c.refs[rf] = struct{}{}
}
return res, nil
}
func (c *Client) ResolveImageConfig(ctx context.Context, ref string, opt llb.ResolveImageConfigOpt) (string, digest.Digest, []byte, error) {
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return "", "", nil, err
}
defer cancel()
ctx = withOutgoingContext(ctx)
return c.llbBridge.ResolveImageConfig(ctx, ref, opt)
}
func (c *Client) NewContainer(ctx context.Context, req bkgw.NewContainerRequest) (bkgw.Container, error) {
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return nil, err
}
defer cancel()
ctx = withOutgoingContext(ctx)
ctrReq := bkcontainer.NewContainerRequest{
ContainerID: identity.NewID(),
NetMode: req.NetMode,
Hostname: req.Hostname,
Mounts: make([]bkcontainer.Mount, len(req.Mounts)),
}
extraHosts, err := bkcontainer.ParseExtraHosts(req.ExtraHosts)
if err != nil {
return nil, err
}
ctrReq.ExtraHosts = extraHosts
// get the input mounts in parallel in case they need to be evaluated, which can be expensive
eg, egctx := errgroup.WithContext(ctx)
for i, m := range req.Mounts {
i, m := i, m
eg.Go(func() error {
var workerRef *bkworker.WorkerRef
if m.Ref != nil {
ref, ok := m.Ref.(*ref)
if !ok {
return fmt.Errorf("dagger: unexpected ref type: %T", m.Ref)
}
if ref != nil { // TODO(vito): apparently this is possible. scratch?
res, err := ref.resultProxy.Result(egctx)
if err != nil {
return fmt.Errorf("result: %w", err)
}
workerRef, ok = res.Sys().(*bkworker.WorkerRef)
if !ok {
return fmt.Errorf("invalid res: %T", res.Sys())
}
}
}
ctrReq.Mounts[i] = bkcontainer.Mount{
WorkerRef: workerRef,
Mount: &bksolverpb.Mount{
Dest: m.Dest,
Selector: m.Selector,
Readonly: m.Readonly,
MountType: m.MountType,
CacheOpt: m.CacheOpt,
SecretOpt: m.SecretOpt,
SSHOpt: m.SSHOpt,
},
}
return nil
})
}
err = eg.Wait()
if err != nil {
return nil, fmt.Errorf("wait: %w", err)
}
// using context.Background so it continues running until exit or when c.Close() is called
ctr, err := bkcontainer.NewContainer(
context.Background(),
c.Worker,
c.SessionManager,
bksession.NewGroup(c.ID()),
ctrReq,
)
if err != nil {
return nil, err
}
c.containersMu.Lock()
defer c.containersMu.Unlock()
if c.containers == nil {
if err := ctr.Release(context.Background()); err != nil {
return nil, fmt.Errorf("release after close: %w", err)
}
return nil, errors.New("client closed")
}
c.containers[ctr] = struct{}{}
return ctr, nil
}
func (c *Client) WriteStatusesTo(ctx context.Context, ch chan *bkclient.SolveStatus) error {
return c.job.Status(ctx, ch)
}
func (c *Client) RegisterClient(clientID, clientHostname, secretToken string) error {
c.clientMu.Lock()
defer c.clientMu.Unlock()
existingToken, ok := c.clientIDToSecretToken[clientID]
if ok {
if existingToken != secretToken {
return fmt.Errorf("client ID %q already registered with different secret token", clientID)
}
return nil
}
c.clientIDToSecretToken[clientID] = secretToken
// NOTE: we purposely don't delete the secret token, it should never be reused and will be released
// from memory once the dagger server instance corresponding to this buildkit client shuts down.
// Deleting it would make it easier to create race conditions around using the client's session
// before it is fully closed.
return nil
}
func (c *Client) VerifyClient(clientID, secretToken string) error {
c.clientMu.RLock()
defer c.clientMu.RUnlock()
existingToken, ok := c.clientIDToSecretToken[clientID]
if !ok {
return fmt.Errorf("client ID %q not registered", clientID)
}
if existingToken != secretToken {
return fmt.Errorf("client ID %q registered with different secret token", clientID)
}
return nil
}
// CombinedResult returns a buildkit result with all the refs solved by this client so far.
// This is useful for constructing a result for upstream remote caching.
func (c *Client) CombinedResult(ctx context.Context) (*Result, error) {
c.refsMu.Lock()
mergeInputs := make([]llb.State, 0, len(c.refs))
for r := range c.refs {
state, err := r.ToState()
if err != nil {
c.refsMu.Unlock()
return nil, err
}
mergeInputs = append(mergeInputs, state)
}
c.refsMu.Unlock()
llbdef, err := llb.Merge(mergeInputs, llb.WithCustomName("combined session result")).Marshal(ctx)
if err != nil {
return nil, err
}
return c.Solve(ctx, bkgw.SolveRequest{
Definition: llbdef.ToPB(),
})
}
func (c *Client) UpstreamCacheExport(ctx context.Context, cacheExportFuncs []ResolveCacheExporterFunc) error {
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return err
}
defer cancel()
if len(cacheExportFuncs) == 0 {
return nil
}
bklog.G(ctx).Debugf("exporting %d caches", len(cacheExportFuncs))
combinedResult, err := c.CombinedResult(ctx)
if err != nil {
return err
}
cacheRes, err := ConvertToWorkerCacheResult(ctx, combinedResult)
if err != nil {
return fmt.Errorf("failed to convert result: %s", err)
}
bklog.G(ctx).Debugf("converting to solverRes")
solverRes, err := solverresult.ConvertResult(combinedResult, func(rf *ref) (bksolver.CachedResult, error) {
return rf.resultProxy.Result(ctx)
})
if err != nil {
return fmt.Errorf("failed to convert result: %s", err)
}
sessionGroup := bksession.NewGroup(c.ID())
eg, ctx := errgroup.WithContext(ctx)
// TODO: send progrock statuses for cache export progress
for _, exporterFunc := range cacheExportFuncs {
exporterFunc := exporterFunc
eg.Go(func() error {
bklog.G(ctx).Debugf("getting exporter")
exporter, err := exporterFunc(ctx, sessionGroup)
if err != nil {
return err
}
bklog.G(ctx).Debugf("exporting cache with %T", exporter)
compressionCfg := exporter.Config().Compression
err = solverresult.EachRef(solverRes, cacheRes, func(res bksolver.CachedResult, ref bkcache.ImmutableRef) error {
bklog.G(ctx).Debugf("exporting cache for %s", ref.ID())
ctx := withDescHandlerCacheOpts(ctx, ref)
bklog.G(ctx).Debugf("calling exporter")
_, err = res.CacheKeys()[0].Exporter.ExportTo(ctx, exporter, bksolver.CacheExportOpt{
ResolveRemotes: func(ctx context.Context, res bksolver.Result) ([]*bksolver.Remote, error) {
ref, ok := res.Sys().(*bkworker.WorkerRef)
if !ok {
return nil, fmt.Errorf("invalid result: %T", res.Sys())
}
bklog.G(ctx).Debugf("getting remotes for %s", ref.ID())
defer bklog.G(ctx).Debugf("got remotes for %s", ref.ID())
return ref.GetRemotes(ctx, true, bkcacheconfig.RefConfig{Compression: compressionCfg}, false, sessionGroup)
},
Mode: bksolver.CacheExportModeMax,
Session: sessionGroup,
CompressionOpt: &compressionCfg,
})
return err
})
if err != nil {
return err
}
bklog.G(ctx).Debugf("finalizing exporter")
defer bklog.G(ctx).Debugf("finalized exporter")
_, err = exporter.Finalize(ctx)
return err
})
}
bklog.G(ctx).Debugf("waiting for cache export")
defer bklog.G(ctx).Debugf("waited for cache export")
return eg.Wait()
}
func withDescHandlerCacheOpts(ctx context.Context, ref bkcache.ImmutableRef) context.Context {
return bksolver.WithCacheOptGetter(ctx, func(_ bool, keys ...interface{}) map[interface{}]interface{} {
vals := make(map[interface{}]interface{})
for _, k := range keys {
if key, ok := k.(bkcache.DescHandlerKey); ok {
if handler := ref.DescHandler(digest.Digest(key)); handler != nil {
vals[k] = handler
}
}
}
return vals
})
}
func (c *Client) ListenHostToContainer(
ctx context.Context,
hostListenAddr, proto, upstream string,
) (*session.ListenResponse, func() error, error) {
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return nil, nil, err
}
clientMetadata, err := engine.ClientMetadataFromContext(ctx)
if err != nil {
cancel()
return nil, nil, fmt.Errorf("failed to get requester session ID: %s", err)
}
clientCaller, err := c.SessionManager.Get(ctx, clientMetadata.ClientID, false)
if err != nil {
cancel()
return nil, nil, fmt.Errorf("failed to get requester session: %s", err)
}
conn := clientCaller.Conn()
tunnelClient := session.NewTunnelListenerClient(conn)
listener, err := tunnelClient.Listen(ctx)
if err != nil {
cancel()
return nil, nil, fmt.Errorf("failed to listen: %s", err)
}
err = listener.Send(&session.ListenRequest{
Addr: hostListenAddr,
Protocol: proto,
})
if err != nil {
cancel()
return nil, nil, fmt.Errorf("failed to send listen request: %s", err)
}
listenRes, err := listener.Recv()
if err != nil {
cancel()
return nil, nil, fmt.Errorf("failed to receive listen response: %s", err)
}
conns := map[string]net.Conn{}
connsL := &sync.Mutex{}
sendL := &sync.Mutex{}
wg := new(sync.WaitGroup)
wg.Add(1)
go func() {
defer wg.Done()
for {
res, err := listener.Recv()
if err != nil {
bklog.G(ctx).Warnf("listener recv err: %s", err)
return
}
connID := res.GetConnId()
if connID == "" {
continue
}
connsL.Lock()
conn, found := conns[connID]
connsL.Unlock()
if !found {
conn, err := c.dialer.Dial(proto, upstream)
if err != nil {
bklog.G(ctx).Warnf("failed to dial %s %s: %s", proto, upstream, err)
return
}
connsL.Lock()
conns[connID] = conn
connsL.Unlock()
wg.Add(1)
go func() {
defer wg.Done()
data := make([]byte, 32*1024)
for {
n, err := conn.Read(data)
if err != nil {
return
}
sendL.Lock()
err = listener.Send(&session.ListenRequest{
ConnId: connID,
Data: data[:n],
})
sendL.Unlock()
if err != nil {
return
}
}
}()
}
if res.Data != nil {
_, err = conn.Write(res.Data)
if err != nil {
return
}
}
}
}()
return listenRes, func() error {
defer cancel()
sendL.Lock()
err := listener.CloseSend()
sendL.Unlock()
if err == nil {
wg.Wait()
}
return err
}, nil
}
func withOutgoingContext(ctx context.Context) context.Context {
md, ok := metadata.FromIncomingContext(ctx)
if ok {
ctx = metadata.NewOutgoingContext(ctx, md)
}
return ctx
}
// Metadata passed to an exec that doesn't count towards the cache key.
// This should be used with great caution; only for metadata that is
// safe to be de-duplicated across execs.
//
// Currently, this uses the FTPProxy LLB option to pass without becoming
// part of the cache key. This is a hack that, while ugly to look at,
// is simple and robust. Alternatives would be to use secrets or sockets,
// but they are more complicated, or to create a custom buildkit
// worker/executor, which is MUCH more complicated.
//
// If a need to add ftp proxy support arises, then we can just also embed
// the "real" ftp proxy setting in here too and have the shim handle
// leaving only that set in the actual env var.
type ContainerExecUncachedMetadata struct {
ParentClientIDs []string `json:"parentClientIDs,omitempty"`
ServerID string `json:"serverID,omitempty"`
}
func (md ContainerExecUncachedMetadata) ToPBFtpProxyVal() (string, error) {
b, err := json.Marshal(md)
if err != nil {
return "", err
}
return string(b), nil
}
func (md *ContainerExecUncachedMetadata) FromEnv(envKV string) (bool, error) {
_, val, ok := strings.Cut(envKV, "ftp_proxy=")
if !ok {
return false, nil
}
err := json.Unmarshal([]byte(val), md)
if err != nil {
return false, err
}
return true, nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,510 | 🐞 `with_user` breaks `with_exec`'s `stdin` | ### What is the issue?
`with_exec`'s `stdin` parameter enables writing content to the command's standard input before it closes. However, if you switch to another user, it breaks without any notification, preventing the command from executing.
### Dagger version
dagger v0.9.7 (registry.dagger.io/engine) darwin/arm64
### Steps to reproduce
This works:
```python
import anyio
import dagger
from dagger import dag
async def main():
async with dagger.connection():
out = (
await dag.container()
.from_("alpine:latest")
.with_exec(
["sh"],
stdin="""
echo "Hello World!"
for i in $(seq 1 10); do
echo "$i"
sleep 1
done
""",
)
.stdout()
)
print(out)
anyio.run(main)
```
Outputs:
```
Hello World!
1
2
3
4
5
6
7
8
9
10
⠼ Disconnecting⏎
```
This fails:
```python
import anyio
import dagger
from dagger import dag
async def main():
async with dagger.connection():
out = (
await dag.container()
.from_("alpine:latest")
.with_exec(["adduser", "-D", "bob"])
.with_user("bob")
.with_exec(
["sh"],
stdin="""
echo "Hello World!"
for i in $(seq 1 10); do
echo "$i"
sleep 1
done
""",
)
.stdout()
)
print(out)
anyio.run(main)
```
Outputs:
```
⠇ Disconnecting⏎
```
### Log output
_No response_ | https://github.com/dagger/dagger/issues/6510 | https://github.com/dagger/dagger/pull/6511 | 30b22dd06e4366aed01f8f86d0a1729835b12aec | 6a31727f759d9137f5940458a06e196ab99b0717 | "2024-01-26T20:02:16Z" | go | "2024-01-29T12:22:43Z" | core/container.go | package core
import (
"context"
"encoding/json"
"fmt"
"io/fs"
"os"
"path"
"path/filepath"
"sort"
"strconv"
"strings"
"sync"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/pkg/transfer/archive"
"github.com/containerd/containerd/platforms"
"github.com/vektah/gqlparser/v2/ast"
"github.com/dagger/dagger/dagql"
"github.com/dagger/dagger/dagql/idproto"
"github.com/docker/distribution/reference"
"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/exporter/containerimage/exptypes"
"github.com/moby/buildkit/frontend/dockerui"
bkgw "github.com/moby/buildkit/frontend/gateway/client"
"github.com/moby/buildkit/identity"
"github.com/moby/buildkit/solver/pb"
"github.com/moby/buildkit/util/leaseutil"
"github.com/opencontainers/go-digest"
specs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
"github.com/vito/progrock"
"github.com/dagger/dagger/core/pipeline"
"github.com/dagger/dagger/engine/buildkit"
)
var ErrContainerNoExec = errors.New("no command has been executed")
// Container is a content-addressed container.
type Container struct {
Query *Query
// The container's root filesystem.
FS *pb.Definition `json:"fs"`
// Image configuration (env, workdir, etc)
Config specs.ImageConfig `json:"cfg"`
// List of GPU devices that will be exposed to the container
EnabledGPUs []string `json:"enabledGPUs,omitempty"`
// Mount points configured for the container.
Mounts ContainerMounts `json:"mounts,omitempty"`
// Meta is the /dagger filesystem. It will be null if nothing has run yet.
Meta *pb.Definition `json:"meta,omitempty"`
// The platform of the container's rootfs.
Platform Platform `json:"platform,omitempty"`
// Secrets to expose to the container.
Secrets []ContainerSecret `json:"secret_env,omitempty"`
// Sockets to expose to the container.
Sockets []ContainerSocket `json:"sockets,omitempty"`
// Image reference
ImageRef string `json:"image_ref,omitempty"`
// Ports to expose from the container.
Ports []Port `json:"ports,omitempty"`
// Services to start before running the container.
Services ServiceBindings `json:"services,omitempty"`
// Focused indicates whether subsequent operations will be
// focused, i.e. shown more prominently in the UI.
Focused bool `json:"focused"`
// The args to invoke when using the "shell" api on this container.
DefaultShell []string `json:"defaultShell,omitempty"`
}
func (*Container) Type() *ast.Type {
return &ast.Type{
NamedType: "Container",
NonNull: true,
}
}
func (*Container) TypeDescription() string {
return "An OCI-compatible container, also known as a Docker container."
}
var _ HasPBDefinitions = (*Container)(nil)
func (container *Container) PBDefinitions(ctx context.Context) ([]*pb.Definition, error) {
var defs []*pb.Definition
if container.FS != nil {
defs = append(defs, container.FS)
}
for _, mnt := range container.Mounts {
if mnt.Source != nil {
defs = append(defs, mnt.Source)
}
}
for _, bnd := range container.Services {
ctr := bnd.Service.Container
if ctr == nil {
continue
}
ctrDefs, err := ctr.PBDefinitions(ctx)
if err != nil {
return nil, err
}
defs = append(defs, ctrDefs...)
}
return defs, nil
}
func NewContainer(root *Query, platform Platform) (*Container, error) {
if root == nil {
panic("query must be non-nil")
}
return &Container{
Query: root,
Platform: platform,
}, nil
}
// Clone returns a deep copy of the container suitable for modifying in a
// WithXXX method.
func (container *Container) Clone() *Container {
cp := *container
cp.Config.ExposedPorts = cloneMap(cp.Config.ExposedPorts)
cp.Config.Env = cloneSlice(cp.Config.Env)
cp.Config.Entrypoint = cloneSlice(cp.Config.Entrypoint)
cp.Config.Cmd = cloneSlice(cp.Config.Cmd)
cp.Config.Volumes = cloneMap(cp.Config.Volumes)
cp.Config.Labels = cloneMap(cp.Config.Labels)
cp.Mounts = cloneSlice(cp.Mounts)
cp.Secrets = cloneSlice(cp.Secrets)
cp.Sockets = cloneSlice(cp.Sockets)
cp.Ports = cloneSlice(cp.Ports)
cp.Services = cloneSlice(cp.Services)
return &cp
}
var _ pipeline.Pipelineable = (*Container)(nil)
// PipelinePath returns the container's pipeline path.
func (container *Container) PipelinePath() pipeline.Path {
return container.Query.Pipeline
}
// Ownership contains a UID/GID pair resolved from a user/group name or ID pair
// provided via the API. It primarily exists to distinguish an unspecified
// ownership from UID/GID 0 (root) ownership.
type Ownership struct {
UID int `json:"uid"`
GID int `json:"gid"`
}
func (owner Ownership) Opt() llb.ChownOption {
return llb.WithUIDGID(owner.UID, owner.GID)
}
// ContainerSecret configures a secret to expose, either as an environment
// variable or mounted to a file path.
type ContainerSecret struct {
Secret *Secret `json:"secret"`
EnvName string `json:"env,omitempty"`
MountPath string `json:"path,omitempty"`
Owner *Ownership `json:"owner,omitempty"`
Mode fs.FileMode `json:"mode,omitempty"`
}
// ContainerSocket configures a socket to expose, currently as a Unix socket,
// but potentially as a TCP or UDP address in the future.
type ContainerSocket struct {
Source *Socket `json:"socket"`
ContainerPath string `json:"container_path,omitempty"`
Owner *Ownership `json:"owner,omitempty"`
}
// FSState returns the container's root filesystem mount state. If there is
// none (as with an empty container ID), it returns scratch.
func (container *Container) FSState() (llb.State, error) {
if container.FS == nil {
return llb.Scratch(), nil
}
return defToState(container.FS)
}
// MetaState returns the container's metadata mount state. If the container has
// yet to run, it returns nil.
func (container *Container) MetaState() (*llb.State, error) {
if container.Meta == nil {
return nil, nil
}
metaSt, err := defToState(container.Meta)
if err != nil {
return nil, err
}
return &metaSt, nil
}
// ContainerMount is a mount point configured in a container.
type ContainerMount struct {
// The source of the mount.
Source *pb.Definition `json:"source,omitempty"`
// A path beneath the source to scope the mount to.
SourcePath string `json:"source_path,omitempty"`
// The path of the mount within the container.
Target string `json:"target"`
// Persist changes to the mount under this cache ID.
CacheVolumeID string `json:"cache_volume_id,omitempty"`
// How to share the cache across concurrent runs.
CacheSharingMode CacheSharingMode `json:"cache_sharing,omitempty"`
// Configure the mount as a tmpfs.
Tmpfs bool `json:"tmpfs,omitempty"`
// Configure the mount as read-only.
Readonly bool `json:"readonly,omitempty"`
}
// SourceState returns the state of the source of the mount.
func (mnt ContainerMount) SourceState() (llb.State, error) {
if mnt.Source == nil {
return llb.Scratch(), nil
}
return defToState(mnt.Source)
}
type ContainerMounts []ContainerMount
func (mnts ContainerMounts) With(newMnt ContainerMount) ContainerMounts {
mntsCp := make(ContainerMounts, 0, len(mnts))
// NB: this / might need to change on Windows, but I'm not even sure how
// mounts work on Windows, so...
parent := newMnt.Target + "/"
for _, mnt := range mnts {
if mnt.Target == newMnt.Target || strings.HasPrefix(mnt.Target, parent) {
continue
}
mntsCp = append(mntsCp, mnt)
}
mntsCp = append(mntsCp, newMnt)
return mntsCp
}
func (container *Container) From(ctx context.Context, addr string) (*Container, error) {
bk := container.Query.Buildkit
container = container.Clone()
platform := container.Platform
// `From` creates 2 vertices: fetching the image config and actually pulling the image.
// We create a sub-pipeline to encapsulate both.
ctx, subRecorder := progrock.WithGroup(ctx, fmt.Sprintf("from %s", addr), progrock.Weak())
refName, err := reference.ParseNormalizedNamed(addr)
if err != nil {
return nil, err
}
ref := reference.TagNameOnly(refName).String()
_, digest, cfgBytes, err := bk.ResolveImageConfig(ctx, ref, llb.ResolveImageConfigOpt{
Platform: ptr(platform.Spec()),
ResolveMode: llb.ResolveModeDefault.String(),
})
if err != nil {
return nil, err
}
digested, err := reference.WithDigest(refName, digest)
if err != nil {
return nil, err
}
var imgSpec specs.Image
if err := json.Unmarshal(cfgBytes, &imgSpec); err != nil {
return nil, err
}
fsSt := llb.Image(
digested.String(),
llb.WithCustomNamef("pull %s", ref),
)
def, err := fsSt.Marshal(ctx, llb.Platform(platform.Spec()))
if err != nil {
return nil, err
}
container.FS = def.ToPB()
// associate vertexes to the 'from' sub-pipeline
buildkit.RecordVertexes(subRecorder, container.FS)
container.Config = mergeImageConfig(container.Config, imgSpec.Config)
container.ImageRef = digested.String()
return container, nil
}
const defaultDockerfileName = "Dockerfile"
func (container *Container) Build(
ctx context.Context,
contextDir *Directory,
dockerfile string,
buildArgs []BuildArg,
target string,
secrets []*Secret,
) (*Container, error) {
container = container.Clone()
container.Services.Merge(contextDir.Services)
for _, secret := range secrets {
container.Secrets = append(container.Secrets, ContainerSecret{
Secret: secret,
MountPath: fmt.Sprintf("/run/secrets/%s", secret.Name),
})
}
// set image ref to empty string
container.ImageRef = ""
svcs := container.Query.Services
bk := container.Query.Buildkit
// add a weak group for the docker build vertices
ctx, subRecorder := progrock.WithGroup(ctx, "docker build", progrock.Weak())
detach, _, err := svcs.StartBindings(ctx, container.Services)
if err != nil {
return nil, err
}
defer detach()
platform := container.Platform
opts := map[string]string{
"platform": platform.Format(),
"contextsubdir": contextDir.Dir,
}
if dockerfile != "" {
opts["filename"] = path.Join(contextDir.Dir, dockerfile)
} else {
opts["filename"] = path.Join(contextDir.Dir, defaultDockerfileName)
}
if target != "" {
opts["target"] = target
}
for _, buildArg := range buildArgs {
opts["build-arg:"+buildArg.Name] = buildArg.Value
}
inputs := map[string]*pb.Definition{
dockerui.DefaultLocalNameContext: contextDir.LLB,
dockerui.DefaultLocalNameDockerfile: contextDir.LLB,
}
res, err := bk.Solve(ctx, bkgw.SolveRequest{
Frontend: "dockerfile.v0",
FrontendOpt: opts,
FrontendInputs: inputs,
})
if err != nil {
return nil, err
}
bkref, err := res.SingleRef()
if err != nil {
return nil, err
}
var st llb.State
if bkref == nil {
st = llb.Scratch()
} else {
st, err = bkref.ToState()
if err != nil {
return nil, err
}
}
def, err := st.Marshal(ctx, llb.Platform(platform.Spec()))
if err != nil {
return nil, err
}
// associate vertexes to the 'docker build' sub-pipeline
buildkit.RecordVertexes(subRecorder, def.ToPB())
container.FS = def.ToPB()
container.FS.Source = nil
cfgBytes, found := res.Metadata[exptypes.ExporterImageConfigKey]
if found {
var imgSpec specs.Image
if err := json.Unmarshal(cfgBytes, &imgSpec); err != nil {
return nil, err
}
container.Config = mergeImageConfig(container.Config, imgSpec.Config)
}
return container, nil
}
func (container *Container) RootFS(ctx context.Context) (*Directory, error) {
return &Directory{
Query: container.Query,
LLB: container.FS,
Dir: "/",
Platform: container.Platform,
Services: container.Services,
}, nil
}
func (container *Container) WithRootFS(ctx context.Context, dir *Directory) (*Container, error) {
container = container.Clone()
dirSt, err := dir.StateWithSourcePath()
if err != nil {
return nil, err
}
def, err := dirSt.Marshal(ctx, llb.Platform(dir.Platform.Spec()))
if err != nil {
return nil, err
}
container.FS = def.ToPB()
container.Services.Merge(dir.Services)
// set image ref to empty string
container.ImageRef = ""
return container, nil
}
func (container *Container) WithDirectory(ctx context.Context, subdir string, src *Directory, filter CopyFilter, owner string) (*Container, error) {
container = container.Clone()
return container.writeToPath(ctx, subdir, func(dir *Directory) (*Directory, error) {
ownership, err := container.ownership(ctx, owner)
if err != nil {
return nil, err
}
return dir.WithDirectory(ctx, ".", src, filter, ownership)
})
}
func (container *Container) WithFile(ctx context.Context, destPath string, src *File, permissions *int, owner string) (*Container, error) {
container = container.Clone()
return container.writeToPath(ctx, path.Dir(destPath), func(dir *Directory) (*Directory, error) {
ownership, err := container.ownership(ctx, owner)
if err != nil {
return nil, err
}
return dir.WithFile(ctx, path.Base(destPath), src, permissions, ownership)
})
}
func (container *Container) WithNewFile(ctx context.Context, dest string, content []byte, permissions fs.FileMode, owner string) (*Container, error) {
container = container.Clone()
dir, file := filepath.Split(dest)
return container.writeToPath(ctx, dir, func(dir *Directory) (*Directory, error) {
ownership, err := container.ownership(ctx, owner)
if err != nil {
return nil, err
}
return dir.WithNewFile(ctx, file, content, permissions, ownership)
})
}
func (container *Container) WithMountedDirectory(ctx context.Context, target string, dir *Directory, owner string, readonly bool) (*Container, error) {
container = container.Clone()
return container.withMounted(ctx, target, dir.LLB, dir.Dir, dir.Services, owner, readonly)
}
func (container *Container) WithMountedFile(ctx context.Context, target string, file *File, owner string, readonly bool) (*Container, error) {
container = container.Clone()
return container.withMounted(ctx, target, file.LLB, file.File, file.Services, owner, readonly)
}
var SeenCacheKeys = new(sync.Map)
func (container *Container) WithMountedCache(ctx context.Context, target string, cache *CacheVolume, source *Directory, sharingMode CacheSharingMode, owner string) (*Container, error) {
container = container.Clone()
target = absPath(container.Config.WorkingDir, target)
if sharingMode == "" {
sharingMode = CacheSharingModeShared
}
mount := ContainerMount{
Target: target,
CacheVolumeID: cache.Sum(),
CacheSharingMode: sharingMode,
}
if source != nil {
mount.Source = source.LLB
mount.SourcePath = source.Dir
}
if owner != "" {
var err error
mount.Source, mount.SourcePath, err = container.chown(
ctx,
mount.Source,
mount.SourcePath,
owner,
llb.Platform(container.Platform.Spec()),
)
if err != nil {
return nil, err
}
}
container.Mounts = container.Mounts.With(mount)
// set image ref to empty string
container.ImageRef = ""
SeenCacheKeys.Store(cache.Keys[0], struct{}{})
return container, nil
}
func (container *Container) WithMountedTemp(ctx context.Context, target string) (*Container, error) {
container = container.Clone()
target = absPath(container.Config.WorkingDir, target)
container.Mounts = container.Mounts.With(ContainerMount{
Target: target,
Tmpfs: true,
})
// set image ref to empty string
container.ImageRef = ""
return container, nil
}
func (container *Container) WithMountedSecret(ctx context.Context, target string, source *Secret, owner string, mode fs.FileMode) (*Container, error) {
container = container.Clone()
target = absPath(container.Config.WorkingDir, target)
ownership, err := container.ownership(ctx, owner)
if err != nil {
return nil, err
}
container.Secrets = append(container.Secrets, ContainerSecret{
Secret: source,
MountPath: target,
Owner: ownership,
Mode: mode,
})
// set image ref to empty string
container.ImageRef = ""
return container, nil
}
func (container *Container) WithoutMount(ctx context.Context, target string) (*Container, error) {
container = container.Clone()
target = absPath(container.Config.WorkingDir, target)
var found bool
var foundIdx int
for i := len(container.Mounts) - 1; i >= 0; i-- {
if container.Mounts[i].Target == target {
found = true
foundIdx = i
break
}
}
if found {
container.Mounts = append(container.Mounts[:foundIdx], container.Mounts[foundIdx+1:]...)
}
// set image ref to empty string
container.ImageRef = ""
return container, nil
}
func (container *Container) MountTargets(ctx context.Context) ([]string, error) {
mounts := []string{}
for _, mnt := range container.Mounts {
mounts = append(mounts, mnt.Target)
}
return mounts, nil
}
func (container *Container) WithUnixSocket(ctx context.Context, target string, source *Socket, owner string) (*Container, error) {
container = container.Clone()
target = absPath(container.Config.WorkingDir, target)
ownership, err := container.ownership(ctx, owner)
if err != nil {
return nil, err
}
newSocket := ContainerSocket{
Source: source,
ContainerPath: target,
Owner: ownership,
}
var replaced bool
for i, sock := range container.Sockets {
if sock.ContainerPath == target {
container.Sockets[i] = newSocket
replaced = true
break
}
}
if !replaced {
container.Sockets = append(container.Sockets, newSocket)
}
// set image ref to empty string
container.ImageRef = ""
return container, nil
}
func (container *Container) WithoutUnixSocket(ctx context.Context, target string) (*Container, error) {
container = container.Clone()
target = absPath(container.Config.WorkingDir, target)
for i, sock := range container.Sockets {
if sock.ContainerPath == target {
container.Sockets = append(container.Sockets[:i], container.Sockets[i+1:]...)
break
}
}
// set image ref to empty string
container.ImageRef = ""
return container, nil
}
func (container *Container) WithSecretVariable(ctx context.Context, name string, secret *Secret) (*Container, error) {
container = container.Clone()
container.Secrets = append(container.Secrets, ContainerSecret{
Secret: secret,
EnvName: name,
})
// set image ref to empty string
container.ImageRef = ""
return container, nil
}
func (container *Container) Directory(ctx context.Context, dirPath string) (*Directory, error) {
dir, _, err := locatePath(ctx, container, dirPath, NewDirectory)
if err != nil {
return nil, err
}
svcs := container.Query.Services
bk := container.Query.Buildkit
// check that the directory actually exists so the user gets an error earlier
// rather than when the dir is used
info, err := dir.Stat(ctx, bk, svcs, ".")
if err != nil {
return nil, err
}
if !info.IsDir() {
return nil, fmt.Errorf("path %s is a file, not a directory", dirPath)
}
return dir, nil
}
func (container *Container) File(ctx context.Context, filePath string) (*File, error) {
file, _, err := locatePath(ctx, container, filePath, NewFile)
if err != nil {
return nil, err
}
// check that the file actually exists so the user gets an error earlier
// rather than when the file is used
info, err := file.Stat(ctx)
if err != nil {
return nil, err
}
if info.IsDir() {
return nil, fmt.Errorf("path %s is a directory, not a file", filePath)
}
return file, nil
}
func locatePath[T *File | *Directory](
ctx context.Context,
container *Container,
containerPath string,
init func(*Query, *pb.Definition, string, Platform, ServiceBindings) T,
) (T, *ContainerMount, error) {
containerPath = absPath(container.Config.WorkingDir, containerPath)
// NB(vito): iterate in reverse order so we'll find deeper mounts first
for i := len(container.Mounts) - 1; i >= 0; i-- {
mnt := container.Mounts[i]
if containerPath == mnt.Target || strings.HasPrefix(containerPath, mnt.Target+"/") {
if mnt.Tmpfs {
return nil, nil, fmt.Errorf("%s: cannot retrieve path from tmpfs", containerPath)
}
if mnt.CacheVolumeID != "" {
return nil, nil, fmt.Errorf("%s: cannot retrieve path from cache", containerPath)
}
sub := mnt.SourcePath
if containerPath != mnt.Target {
// make relative portion relative to the source path
dirSub := strings.TrimPrefix(containerPath, mnt.Target+"/")
if dirSub != "" {
sub = path.Join(sub, dirSub)
}
}
return init(
container.Query,
mnt.Source,
sub,
container.Platform,
container.Services,
), &mnt, nil
}
}
// Not found in a mount
return init(
container.Query,
container.FS,
containerPath,
container.Platform,
container.Services,
), nil, nil
}
func (container *Container) withMounted(
ctx context.Context,
target string,
srcDef *pb.Definition,
srcPath string,
svcs ServiceBindings,
owner string,
readonly bool,
) (*Container, error) {
target = absPath(container.Config.WorkingDir, target)
var err error
if owner != "" {
srcDef, srcPath, err = container.chown(ctx, srcDef, srcPath, owner, llb.Platform(container.Platform.Spec()))
if err != nil {
return nil, err
}
}
container.Mounts = container.Mounts.With(ContainerMount{
Source: srcDef,
SourcePath: srcPath,
Target: target,
Readonly: readonly,
})
container.Services.Merge(svcs)
// set image ref to empty string
container.ImageRef = ""
return container, nil
}
func (container *Container) chown(
ctx context.Context,
srcDef *pb.Definition,
srcPath string,
owner string,
opts ...llb.ConstraintsOpt,
) (*pb.Definition, string, error) {
ownership, err := container.ownership(ctx, owner)
if err != nil {
return nil, "", err
}
if ownership == nil {
return srcDef, srcPath, nil
}
var srcSt llb.State
if srcDef == nil {
// e.g. empty cache mount
srcSt = llb.Scratch().File(
llb.Mkdir("/chown", 0o755, ownership.Opt()),
)
srcPath = "/chown"
} else {
srcSt, err = defToState(srcDef)
if err != nil {
return nil, "", err
}
def, err := srcSt.Marshal(ctx, opts...)
if err != nil {
return nil, "", err
}
ref, err := bkRef(ctx, container.Query.Buildkit, def.ToPB())
if err != nil {
return nil, "", err
}
stat, err := ref.StatFile(ctx, bkgw.StatRequest{
Path: srcPath,
})
if err != nil {
return nil, "", err
}
if stat.IsDir() {
chowned := "/chown"
// NB(vito): need to create intermediate directory with correct ownership
// to handle the directory case, otherwise the mount will be owned by
// root
srcSt = llb.Scratch().File(
llb.Mkdir(chowned, os.FileMode(stat.Mode), ownership.Opt()).
Copy(srcSt, srcPath, chowned, &llb.CopyInfo{
CopyDirContentsOnly: true,
}, ownership.Opt()),
)
srcPath = chowned
} else {
srcSt = llb.Scratch().File(
llb.Copy(srcSt, srcPath, ".", ownership.Opt()),
)
srcPath = filepath.Base(srcPath)
}
}
def, err := srcSt.Marshal(ctx, opts...)
if err != nil {
return nil, "", err
}
return def.ToPB(), srcPath, nil
}
func (container *Container) writeToPath(ctx context.Context, subdir string, fn func(dir *Directory) (*Directory, error)) (*Container, error) {
dir, mount, err := locatePath(ctx, container, subdir, NewDirectory)
if err != nil {
return nil, err
}
dir, err = fn(dir)
if err != nil {
return nil, err
}
// If not in a mount, replace rootfs
if mount == nil {
root, err := dir.Root()
if err != nil {
return nil, err
}
return container.WithRootFS(ctx, root)
}
return container.withMounted(ctx, mount.Target, dir.LLB, mount.SourcePath, nil, "", false)
}
func (container *Container) ImageConfig(ctx context.Context) (specs.ImageConfig, error) {
return container.Config, nil
}
func (container *Container) UpdateImageConfig(ctx context.Context, updateFn func(specs.ImageConfig) specs.ImageConfig) (*Container, error) {
container = container.Clone()
container.Config = updateFn(container.Config)
return container, nil
}
func (container *Container) WithPipeline(ctx context.Context, name, description string, labels []pipeline.Label) (*Container, error) {
container = container.Clone()
container.Query = container.Query.WithPipeline(name, description, labels)
return container, nil
}
type ContainerGPUOpts struct {
Devices []string
}
func (container *Container) WithGPU(ctx context.Context, gpuOpts ContainerGPUOpts) (*Container, error) {
container = container.Clone()
container.EnabledGPUs = gpuOpts.Devices
return container, nil
}
func (container *Container) WithExec(ctx context.Context, opts ContainerExecOpts) (*Container, error) { //nolint:gocyclo
container = container.Clone()
cfg := container.Config
mounts := container.Mounts
platform := container.Platform
if platform.OS == "" {
platform = container.Query.Platform
}
args, err := container.command(opts)
if err != nil {
return nil, err
}
var namef string
if container.Focused {
namef = buildkit.FocusPrefix + "exec %s"
} else {
namef = "exec %s"
}
runOpts := []llb.RunOption{
llb.Args(args),
llb.WithCustomNamef(namef, strings.Join(args, " ")),
}
// this allows executed containers to communicate back to this API
if opts.ExperimentalPrivilegedNesting {
runOpts = append(runOpts, llb.AddEnv("_DAGGER_ENABLE_NESTING", ""))
}
if opts.ModuleCallerDigest != "" {
runOpts = append(runOpts, llb.AddEnv("_DAGGER_MODULE_CALLER_DIGEST", opts.ModuleCallerDigest.String()))
}
if opts.NestedInSameSession {
runOpts = append(runOpts, llb.AddEnv("_DAGGER_ENABLE_NESTING_IN_SAME_SESSION", ""))
}
metaSt, metaSourcePath := metaMount(opts.Stdin)
// create /dagger mount point for the shim to write to
runOpts = append(runOpts,
llb.AddMount(buildkit.MetaMountDestPath, metaSt, llb.SourcePath(metaSourcePath)))
if opts.RedirectStdout != "" {
runOpts = append(runOpts, llb.AddEnv("_DAGGER_REDIRECT_STDOUT", opts.RedirectStdout))
}
if opts.RedirectStderr != "" {
runOpts = append(runOpts, llb.AddEnv("_DAGGER_REDIRECT_STDERR", opts.RedirectStderr))
}
for _, bnd := range container.Services {
for _, alias := range bnd.Aliases {
runOpts = append(runOpts,
llb.AddEnv("_DAGGER_HOSTNAME_ALIAS_"+alias, bnd.Hostname))
}
}
if cfg.User != "" {
runOpts = append(runOpts, llb.User(cfg.User))
}
if cfg.WorkingDir != "" {
runOpts = append(runOpts, llb.Dir(cfg.WorkingDir))
}
for _, env := range cfg.Env {
name, val, ok := strings.Cut(env, "=")
if !ok {
// it's OK to not be OK
// we'll just set an empty env
_ = ok
}
// don't pass these through to the container when manually set, they are internal only
if name == "_DAGGER_ENABLE_NESTING" && !opts.ExperimentalPrivilegedNesting {
continue
}
if name == "_DAGGER_MODULE_CALLER_DIGEST" && opts.ModuleCallerDigest == "" {
continue
}
if name == "_DAGGER_ENABLE_NESTING_IN_SAME_SESSION" && !opts.NestedInSameSession {
continue
}
runOpts = append(runOpts, llb.AddEnv(name, val))
}
// if GPU parameters are set for this container pass them over:
if len(container.EnabledGPUs) > 0 {
if gpuSupportEnabled := os.Getenv("_EXPERIMENTAL_DAGGER_GPU_SUPPORT"); gpuSupportEnabled == "" {
return nil, fmt.Errorf("GPU support is not enabled, set _EXPERIMENTAL_DAGGER_GPU_SUPPORT")
}
runOpts = append(runOpts, llb.AddEnv("_EXPERIMENTAL_DAGGER_GPU_PARAMS", strings.Join(container.EnabledGPUs, ",")))
}
secretsToScrub := SecretToScrubInfo{}
for i, secret := range container.Secrets {
secretOpts := []llb.SecretOption{llb.SecretID(secret.Secret.Name)}
var secretDest string
switch {
case secret.EnvName != "":
secretDest = secret.EnvName
secretOpts = append(secretOpts, llb.SecretAsEnv(true))
secretsToScrub.Envs = append(secretsToScrub.Envs, secret.EnvName)
case secret.MountPath != "":
secretDest = secret.MountPath
secretsToScrub.Files = append(secretsToScrub.Files, secret.MountPath)
if secret.Owner != nil {
secretOpts = append(secretOpts, llb.SecretFileOpt(
secret.Owner.UID,
secret.Owner.GID,
int(secret.Mode),
))
}
default:
return nil, fmt.Errorf("malformed secret config at index %d", i)
}
runOpts = append(runOpts, llb.AddSecret(secretDest, secretOpts...))
}
if len(secretsToScrub.Envs) != 0 || len(secretsToScrub.Files) != 0 {
// we sort to avoid non-deterministic order that would break caching
sort.Strings(secretsToScrub.Envs)
sort.Strings(secretsToScrub.Files)
secretsToScrubJSON, err := json.Marshal(secretsToScrub)
if err != nil {
return nil, fmt.Errorf("scrub secrets json: %w", err)
}
runOpts = append(runOpts, llb.AddEnv("_DAGGER_SCRUB_SECRETS", string(secretsToScrubJSON)))
}
for _, ctrSocket := range container.Sockets {
if ctrSocket.ContainerPath == "" {
return nil, fmt.Errorf("unsupported socket: only unix paths are implemented")
}
socketOpts := []llb.SSHOption{
llb.SSHID(ctrSocket.Source.SSHID()),
llb.SSHSocketTarget(ctrSocket.ContainerPath),
}
if ctrSocket.Owner != nil {
socketOpts = append(socketOpts,
llb.SSHSocketOpt(
ctrSocket.ContainerPath,
ctrSocket.Owner.UID,
ctrSocket.Owner.GID,
0o600, // preserve default
))
}
runOpts = append(runOpts, llb.AddSSHSocket(socketOpts...))
}
for _, mnt := range mounts {
srcSt, err := mnt.SourceState()
if err != nil {
return nil, fmt.Errorf("mount %s: %w", mnt.Target, err)
}
mountOpts := []llb.MountOption{}
if mnt.SourcePath != "" {
mountOpts = append(mountOpts, llb.SourcePath(mnt.SourcePath))
}
if mnt.CacheVolumeID != "" {
var sharingMode llb.CacheMountSharingMode
switch mnt.CacheSharingMode {
case CacheSharingModeShared:
sharingMode = llb.CacheMountShared
case CacheSharingModePrivate:
sharingMode = llb.CacheMountPrivate
case CacheSharingModeLocked:
sharingMode = llb.CacheMountLocked
default:
return nil, errors.Errorf("invalid cache mount sharing mode %q", mnt.CacheSharingMode)
}
mountOpts = append(mountOpts, llb.AsPersistentCacheDir(mnt.CacheVolumeID, sharingMode))
}
if mnt.Tmpfs {
mountOpts = append(mountOpts, llb.Tmpfs())
}
if mnt.Readonly {
mountOpts = append(mountOpts, llb.Readonly)
}
runOpts = append(runOpts, llb.AddMount(mnt.Target, srcSt, mountOpts...))
}
if opts.InsecureRootCapabilities {
runOpts = append(runOpts, llb.Security(llb.SecurityModeInsecure))
}
fsSt, err := container.FSState()
if err != nil {
return nil, fmt.Errorf("fs state: %w", err)
}
execSt := fsSt.Run(runOpts...)
execDef, err := execSt.Root().Marshal(ctx, llb.Platform(platform.Spec()))
if err != nil {
return nil, fmt.Errorf("marshal root: %w", err)
}
container.FS = execDef.ToPB()
metaDef, err := execSt.GetMount(buildkit.MetaMountDestPath).Marshal(ctx, llb.Platform(platform.Spec()))
if err != nil {
return nil, fmt.Errorf("get meta mount: %w", err)
}
container.Meta = metaDef.ToPB()
for i, mnt := range mounts {
if mnt.Tmpfs || mnt.CacheVolumeID != "" {
continue
}
mountSt := execSt.GetMount(mnt.Target)
// propagate any changes to regular mounts to subsequent containers
execMountDef, err := mountSt.Marshal(ctx, llb.Platform(platform.Spec()))
if err != nil {
return nil, fmt.Errorf("propagate %s: %w", mnt.Target, err)
}
mounts[i].Source = execMountDef.ToPB()
}
container.Mounts = mounts
// set image ref to empty string
container.ImageRef = ""
return container, nil
}
func (container Container) Evaluate(ctx context.Context) (*buildkit.Result, error) {
if container.FS == nil {
return nil, nil
}
root := container.Query
detach, _, err := root.Services.StartBindings(ctx, container.Services)
if err != nil {
return nil, err
}
defer detach()
st, err := container.FSState()
if err != nil {
return nil, err
}
def, err := st.Marshal(ctx, llb.Platform(container.Platform.Spec()))
if err != nil {
return nil, err
}
return root.Buildkit.Solve(ctx, bkgw.SolveRequest{
Evaluate: true,
Definition: def.ToPB(),
})
}
func (container *Container) MetaFileContents(ctx context.Context, filePath string) (string, error) {
if container.Meta == nil {
ctr, err := container.WithExec(ctx, ContainerExecOpts{})
if err != nil {
return "", err
}
return ctr.MetaFileContents(ctx, filePath)
}
file := NewFile(
container.Query,
container.Meta,
path.Join(buildkit.MetaSourcePath, filePath),
container.Platform,
container.Services,
)
content, err := file.Contents(ctx)
if err != nil {
return "", err
}
return string(content), nil
}
func (container *Container) Publish(
ctx context.Context,
ref string,
platformVariants []*Container,
forcedCompression ImageLayerCompression,
mediaTypes ImageMediaTypes,
) (string, error) {
if mediaTypes == "" {
// Modern registry implementations support oci types and docker daemons
// have been capable of pulling them since 2018:
// https://github.com/moby/moby/pull/37359
// So they are a safe default.
mediaTypes = OCIMediaTypes
}
inputByPlatform := map[string]buildkit.ContainerExport{}
services := ServiceBindings{}
for _, variant := range append([]*Container{container}, platformVariants...) {
if variant.FS == nil {
continue
}
st, err := variant.FSState()
if err != nil {
return "", err
}
def, err := st.Marshal(ctx, llb.Platform(variant.Platform.Spec()))
if err != nil {
return "", err
}
platformString := variant.Platform.Format()
if _, ok := inputByPlatform[platformString]; ok {
return "", fmt.Errorf("duplicate platform %q", platformString)
}
inputByPlatform[platformString] = buildkit.ContainerExport{
Definition: def.ToPB(),
Config: variant.Config,
}
services.Merge(variant.Services)
}
if len(inputByPlatform) == 0 {
// Could also just ignore and do nothing, airing on side of error until proven otherwise.
return "", errors.New("no containers to export")
}
opts := map[string]string{
string(exptypes.OptKeyName): ref,
string(exptypes.OptKeyPush): strconv.FormatBool(true),
string(exptypes.OptKeyOCITypes): strconv.FormatBool(mediaTypes == OCIMediaTypes),
}
if forcedCompression != "" {
opts[string(exptypes.OptKeyLayerCompression)] = strings.ToLower(string(forcedCompression))
opts[string(exptypes.OptKeyForceCompression)] = strconv.FormatBool(true)
}
svcs := container.Query.Services
bk := container.Query.Buildkit
detach, _, err := svcs.StartBindings(ctx, services)
if err != nil {
return "", err
}
defer detach()
resp, err := bk.PublishContainerImage(ctx, inputByPlatform, opts)
if err != nil {
return "", err
}
refName, err := reference.ParseNormalizedNamed(ref)
if err != nil {
return "", err
}
imageDigest, found := resp[exptypes.ExporterImageDigestKey]
if found {
dig, err := digest.Parse(imageDigest)
if err != nil {
return "", fmt.Errorf("parse digest: %w", err)
}
withDig, err := reference.WithDigest(refName, dig)
if err != nil {
return "", fmt.Errorf("with digest: %w", err)
}
return withDig.String(), nil
}
return ref, nil
}
func (container *Container) Export(
ctx context.Context,
dest string,
platformVariants []*Container,
forcedCompression ImageLayerCompression,
mediaTypes ImageMediaTypes,
) error {
svcs := container.Query.Services
bk := container.Query.Buildkit
if mediaTypes == "" {
// Modern registry implementations support oci types and docker daemons
// have been capable of pulling them since 2018:
// https://github.com/moby/moby/pull/37359
// So they are a safe default.
mediaTypes = OCIMediaTypes
}
inputByPlatform := map[string]buildkit.ContainerExport{}
services := ServiceBindings{}
for _, variant := range append([]*Container{container}, platformVariants...) {
if variant.FS == nil {
continue
}
st, err := variant.FSState()
if err != nil {
return err
}
def, err := st.Marshal(ctx, llb.Platform(variant.Platform.Spec()))
if err != nil {
return err
}
platformString := variant.Platform.Format()
if _, ok := inputByPlatform[platformString]; ok {
return fmt.Errorf("duplicate platform %q", platformString)
}
inputByPlatform[platformString] = buildkit.ContainerExport{
Definition: def.ToPB(),
Config: variant.Config,
}
services.Merge(variant.Services)
}
if len(inputByPlatform) == 0 {
// Could also just ignore and do nothing, airing on side of error until proven otherwise.
return errors.New("no containers to export")
}
opts := map[string]string{
"tar": strconv.FormatBool(true),
string(exptypes.OptKeyOCITypes): strconv.FormatBool(mediaTypes == OCIMediaTypes),
}
if forcedCompression != "" {
opts[string(exptypes.OptKeyLayerCompression)] = strings.ToLower(string(forcedCompression))
opts[string(exptypes.OptKeyForceCompression)] = strconv.FormatBool(true)
}
detach, _, err := svcs.StartBindings(ctx, services)
if err != nil {
return err
}
defer detach()
_, err = bk.ExportContainerImage(ctx, inputByPlatform, dest, opts)
return err
}
func (container *Container) AsTarball(
ctx context.Context,
platformVariants []*Container,
forcedCompression ImageLayerCompression,
mediaTypes ImageMediaTypes,
) (*File, error) {
bk := container.Query.Buildkit
svcs := container.Query.Services
engineHostPlatform := container.Query.Platform
if mediaTypes == "" {
mediaTypes = OCIMediaTypes
}
inputByPlatform := map[string]buildkit.ContainerExport{}
services := ServiceBindings{}
for _, variant := range append([]*Container{container}, platformVariants...) {
if variant.FS == nil {
continue
}
st, err := variant.FSState()
if err != nil {
return nil, err
}
def, err := st.Marshal(ctx, llb.Platform(variant.Platform.Spec()))
if err != nil {
return nil, err
}
platformString := platforms.Format(variant.Platform.Spec())
if _, ok := inputByPlatform[platformString]; ok {
return nil, fmt.Errorf("duplicate platform %q", platformString)
}
inputByPlatform[platformString] = buildkit.ContainerExport{
Definition: def.ToPB(),
Config: variant.Config,
}
services.Merge(variant.Services)
}
if len(inputByPlatform) == 0 {
return nil, errors.New("no containers to export")
}
opts := map[string]string{
"tar": strconv.FormatBool(true),
string(exptypes.OptKeyOCITypes): strconv.FormatBool(mediaTypes == OCIMediaTypes),
}
if forcedCompression != "" {
opts[string(exptypes.OptKeyLayerCompression)] = strings.ToLower(string(forcedCompression))
opts[string(exptypes.OptKeyForceCompression)] = strconv.FormatBool(true)
}
detach, _, err := svcs.StartBindings(ctx, services)
if err != nil {
return nil, err
}
defer detach()
fileName := identity.NewID() + ".tar"
pbDef, err := bk.ContainerImageToTarball(ctx, engineHostPlatform.Spec(), fileName, inputByPlatform, opts)
if err != nil {
return nil, fmt.Errorf("container image to tarball file conversion failed: %w", err)
}
return NewFile(container.Query, pbDef, fileName, engineHostPlatform, nil), nil
}
func (container *Container) Import(
ctx context.Context,
source *File,
tag string,
) (*Container, error) {
bk := container.Query.Buildkit
store := container.Query.OCIStore
lm := container.Query.LeaseManager
container = container.Clone()
var release func(context.Context) error
loadManifest := func(ctx context.Context) (*specs.Descriptor, error) {
src, err := source.Open(ctx)
if err != nil {
return nil, err
}
defer src.Close()
// override outer ctx with release ctx and set release
ctx, release, err = leaseutil.WithLease(ctx, lm, leaseutil.MakeTemporary)
if err != nil {
return nil, err
}
stream := archive.NewImageImportStream(src, "")
desc, err := stream.Import(ctx, store)
if err != nil {
return nil, fmt.Errorf("image archive import: %w", err)
}
return resolveIndex(ctx, store, desc, container.Platform.Spec(), tag)
}
manifestDesc, err := loadManifest(ctx)
if err != nil {
return nil, fmt.Errorf("recover: %w", err)
}
// NB: the repository portion of this ref doesn't actually matter, but it's
// pleasant to see something recognizable.
dummyRepo := "dagger/import"
st := llb.OCILayout(
fmt.Sprintf("%s@%s", dummyRepo, manifestDesc.Digest),
llb.OCIStore("", buildkit.OCIStoreName),
llb.Platform(container.Platform.Spec()),
)
execDef, err := st.Marshal(ctx, llb.Platform(container.Platform.Spec()))
if err != nil {
return nil, fmt.Errorf("marshal root: %w", err)
}
container.FS = execDef.ToPB()
if release != nil {
// eagerly evaluate the OCI reference so Buildkit sets up a long-term lease
_, err = bk.Solve(ctx, bkgw.SolveRequest{
Definition: container.FS,
Evaluate: true,
})
if err != nil {
return nil, fmt.Errorf("solve: %w", err)
}
if err := release(ctx); err != nil {
return nil, fmt.Errorf("release: %w", err)
}
}
manifestBlob, err := content.ReadBlob(ctx, store, *manifestDesc)
if err != nil {
return nil, fmt.Errorf("image archive read manifest blob: %w", err)
}
var man specs.Manifest
err = json.Unmarshal(manifestBlob, &man)
if err != nil {
return nil, fmt.Errorf("image archive unmarshal manifest: %w", err)
}
configBlob, err := content.ReadBlob(ctx, store, man.Config)
if err != nil {
return nil, fmt.Errorf("image archive read image config blob %s: %w", man.Config.Digest, err)
}
var imgSpec specs.Image
err = json.Unmarshal(configBlob, &imgSpec)
if err != nil {
return nil, fmt.Errorf("load image config: %w", err)
}
container.Config = imgSpec.Config
return container, nil
}
func (container *Container) WithExposedPort(port Port) (*Container, error) {
container = container.Clone()
// replace existing port to avoid duplicates
gotOne := false
for i, p := range container.Ports {
if p.Port == port.Port && p.Protocol == port.Protocol {
container.Ports[i] = port
gotOne = true
break
}
}
if !gotOne {
container.Ports = append(container.Ports, port)
}
if container.Config.ExposedPorts == nil {
container.Config.ExposedPorts = map[string]struct{}{}
}
ociPort := fmt.Sprintf("%d/%s", port.Port, port.Protocol.Network())
container.Config.ExposedPorts[ociPort] = struct{}{}
return container, nil
}
func (container *Container) WithoutExposedPort(port int, protocol NetworkProtocol) (*Container, error) {
container = container.Clone()
filtered := []Port{}
filteredOCI := map[string]struct{}{}
for _, p := range container.Ports {
if p.Port != port || p.Protocol != protocol {
filtered = append(filtered, p)
ociPort := fmt.Sprintf("%d/%s", p.Port, p.Protocol.Network())
filteredOCI[ociPort] = struct{}{}
}
}
container.Ports = filtered
container.Config.ExposedPorts = filteredOCI
return container, nil
}
func (container *Container) WithServiceBinding(ctx context.Context, id *idproto.ID, svc *Service, alias string) (*Container, error) {
container = container.Clone()
host, err := svc.Hostname(ctx, id)
if err != nil {
return nil, err
}
var aliases AliasSet
if alias != "" {
aliases = AliasSet{alias}
}
container.Services.Merge(ServiceBindings{
{
ID: id,
Service: svc,
Hostname: host,
Aliases: aliases,
},
})
return container, nil
}
func (container *Container) ImageRefOrErr(ctx context.Context) (string, error) {
imgRef := container.ImageRef
if imgRef != "" {
return imgRef, nil
}
return "", errors.Errorf("Image reference can only be retrieved immediately after the 'Container.From' call. Error in fetching imageRef as the container image is changed")
}
func (container *Container) Service(ctx context.Context) (*Service, error) {
if container.Meta == nil {
var err error
container, err = container.WithExec(ctx, ContainerExecOpts{})
if err != nil {
return nil, err
}
}
return container.Query.NewContainerService(container), nil
}
func (container *Container) ownership(ctx context.Context, owner string) (*Ownership, error) {
if owner == "" {
// do not change ownership
return nil, nil
}
fsSt, err := container.FSState()
if err != nil {
return nil, err
}
return resolveUIDGID(ctx, fsSt, container.Query.Buildkit, container.Platform, owner)
}
func (container *Container) command(opts ContainerExecOpts) ([]string, error) {
cfg := container.Config
args := opts.Args
if len(args) == 0 {
// we use the default args if no new default args are passed
args = cfg.Cmd
}
if len(cfg.Entrypoint) > 0 && !opts.SkipEntrypoint {
args = append(cfg.Entrypoint, args...)
}
if len(args) == 0 {
return nil, errors.New("no command has been set")
}
return args, nil
}
func metaMount(stdin string) (llb.State, string) {
// because the shim might run as non-root, we need to make a world-writable
// directory first and then make it the base of the /dagger mount point.
//
// TODO(vito): have the shim exec as the other user instead?
meta := llb.Mkdir(buildkit.MetaSourcePath, 0o777)
if stdin != "" {
meta = meta.Mkfile(path.Join(buildkit.MetaSourcePath, "stdin"), 0o600, []byte(stdin))
}
return llb.Scratch().File(
meta,
llb.WithCustomName(buildkit.InternalPrefix+"creating dagger metadata"),
),
buildkit.MetaSourcePath
}
type ContainerExecOpts struct {
// Command to run instead of the container's default command
Args []string
// If the container has an entrypoint, ignore it for this exec rather than
// calling it with args.
SkipEntrypoint bool `default:"false"`
// Content to write to the command's standard input before closing
Stdin string `default:""`
// Redirect the command's standard output to a file in the container
RedirectStdout string `default:""`
// Redirect the command's standard error to a file in the container
RedirectStderr string `default:""`
// Provide dagger access to the executed command
// Do not use this option unless you trust the command being executed.
// The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM
ExperimentalPrivilegedNesting bool `default:"false"`
// Grant the process all root capabilities
InsecureRootCapabilities bool `default:"false"`
// (Internal-only) If this exec is for a module function, this digest will be set in the
// grpc context metadata for any api requests back to the engine. It's used by the API
// server to determine which schema to serve and other module context metadata.
ModuleCallerDigest digest.Digest `name:"-"`
// (Internal-only) Used for module function execs to trigger the nested api client to
// be connected back to the same session.
NestedInSameSession bool `name:"-"`
}
type BuildArg struct {
Name string `field:"true" doc:"The build argument name."`
Value string `field:"true" doc:"The build argument value."`
}
func (BuildArg) TypeName() string {
return "BuildArg"
}
func (BuildArg) TypeDescription() string {
return "Key value object that represents a build argument."
}
// OCI manifest annotation that specifies an image's tag
const ociTagAnnotation = "org.opencontainers.image.ref.name"
func resolveIndex(ctx context.Context, store content.Store, desc specs.Descriptor, platform specs.Platform, tag string) (*specs.Descriptor, error) {
if desc.MediaType != specs.MediaTypeImageIndex {
return nil, fmt.Errorf("expected index, got %s", desc.MediaType)
}
indexBlob, err := content.ReadBlob(ctx, store, desc)
if err != nil {
return nil, fmt.Errorf("read index blob: %w", err)
}
var idx specs.Index
err = json.Unmarshal(indexBlob, &idx)
if err != nil {
return nil, fmt.Errorf("unmarshal index: %w", err)
}
matcher := platforms.Only(platform)
for _, m := range idx.Manifests {
if m.Platform != nil {
if !matcher.Match(*m.Platform) {
// incompatible
continue
}
}
if tag != "" {
if m.Annotations == nil {
continue
}
manifestTag, found := m.Annotations[ociTagAnnotation]
if !found || manifestTag != tag {
continue
}
}
switch m.MediaType {
case specs.MediaTypeImageManifest, // OCI
images.MediaTypeDockerSchema2Manifest: // Docker
return &m, nil
case specs.MediaTypeImageIndex, // OCI
images.MediaTypeDockerSchema2ManifestList: // Docker
return resolveIndex(ctx, store, m, platform, tag)
default:
return nil, fmt.Errorf("expected manifest or index, got %s", m.MediaType)
}
}
return nil, fmt.Errorf("no manifest for platform %s and tag %s", platforms.Format(platform), tag)
}
type ImageLayerCompression string
var ImageLayerCompressions = dagql.NewEnum[ImageLayerCompression]()
var (
CompressionGzip = ImageLayerCompressions.Register("Gzip")
CompressionZstd = ImageLayerCompressions.Register("Zstd")
CompressionEStarGZ = ImageLayerCompressions.Register("EStarGZ")
CompressionUncompressed = ImageLayerCompressions.Register("Uncompressed")
)
func (proto ImageLayerCompression) Type() *ast.Type {
return &ast.Type{
NamedType: "ImageLayerCompression",
NonNull: true,
}
}
func (proto ImageLayerCompression) TypeDescription() string {
return "Compression algorithm to use for image layers."
}
func (proto ImageLayerCompression) Decoder() dagql.InputDecoder {
return ImageLayerCompressions
}
func (proto ImageLayerCompression) ToLiteral() *idproto.Literal {
return ImageLayerCompressions.Literal(proto)
}
type ImageMediaTypes string
var ImageMediaTypesEnum = dagql.NewEnum[ImageMediaTypes]()
var (
OCIMediaTypes = ImageMediaTypesEnum.Register("OCIMediaTypes")
DockerMediaTypes = ImageMediaTypesEnum.Register("DockerMediaTypes")
)
func (proto ImageMediaTypes) Type() *ast.Type {
return &ast.Type{
NamedType: "ImageMediaTypes",
NonNull: true,
}
}
func (proto ImageMediaTypes) TypeDescription() string {
return "Mediatypes to use in published or exported image metadata."
}
func (proto ImageMediaTypes) Decoder() dagql.InputDecoder {
return ImageMediaTypesEnum
}
func (proto ImageMediaTypes) ToLiteral() *idproto.Literal {
return ImageMediaTypesEnum.Literal(proto)
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,510 | 🐞 `with_user` breaks `with_exec`'s `stdin` | ### What is the issue?
`with_exec`'s `stdin` parameter enables writing content to the command's standard input before it closes. However, if you switch to another user, it breaks without any notification, preventing the command from executing.
### Dagger version
dagger v0.9.7 (registry.dagger.io/engine) darwin/arm64
### Steps to reproduce
This works:
```python
import anyio
import dagger
from dagger import dag
async def main():
async with dagger.connection():
out = (
await dag.container()
.from_("alpine:latest")
.with_exec(
["sh"],
stdin="""
echo "Hello World!"
for i in $(seq 1 10); do
echo "$i"
sleep 1
done
""",
)
.stdout()
)
print(out)
anyio.run(main)
```
Outputs:
```
Hello World!
1
2
3
4
5
6
7
8
9
10
⠼ Disconnecting⏎
```
This fails:
```python
import anyio
import dagger
from dagger import dag
async def main():
async with dagger.connection():
out = (
await dag.container()
.from_("alpine:latest")
.with_exec(["adduser", "-D", "bob"])
.with_user("bob")
.with_exec(
["sh"],
stdin="""
echo "Hello World!"
for i in $(seq 1 10); do
echo "$i"
sleep 1
done
""",
)
.stdout()
)
print(out)
anyio.run(main)
```
Outputs:
```
⠇ Disconnecting⏎
```
### Log output
_No response_ | https://github.com/dagger/dagger/issues/6510 | https://github.com/dagger/dagger/pull/6511 | 30b22dd06e4366aed01f8f86d0a1729835b12aec | 6a31727f759d9137f5940458a06e196ab99b0717 | "2024-01-26T20:02:16Z" | go | "2024-01-29T12:22:43Z" | core/integration/container_test.go | package core
import (
"bytes"
_ "embed"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"os"
"path"
"path/filepath"
"strconv"
"strings"
"testing"
"github.com/containerd/containerd/platforms"
"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/remote"
"github.com/moby/buildkit/identity"
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"dagger.io/dagger"
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/core/schema"
"github.com/dagger/dagger/engine/buildkit"
"github.com/dagger/dagger/internal/testutil"
)
func TestContainerScratch(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
ID string
Rootfs struct {
Entries []string
}
}
}{}
err := testutil.Query(
`{
container {
id
rootfs {
entries
}
}
}`, &res, nil)
require.NoError(t, err)
require.Empty(t, res.Container.Rootfs.Entries)
}
func TestContainerFrom(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
From struct {
File struct {
Contents string
}
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
file(path: "/etc/alpine-release") {
contents
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, res.Container.From.File.Contents, "3.18.2\n")
}
func TestContainerBuild(t *testing.T) {
c, ctx := connect(t)
contextDir := c.Directory().
WithNewFile("main.go",
`package main
import "fmt"
import "os"
func main() {
for _, env := range os.Environ() {
fmt.Println(env)
}
}`)
t.Run("default Dockerfile location", func(t *testing.T) {
src := contextDir.
WithNewFile("Dockerfile",
`FROM golang:1.18.2-alpine
WORKDIR /src
COPY main.go .
RUN go mod init hello
RUN go build -o /usr/bin/goenv main.go
ENV FOO=bar
CMD goenv
`)
env, err := c.Container().Build(src).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, env, "FOO=bar\n")
})
t.Run("custom Dockerfile location", func(t *testing.T) {
src := contextDir.
WithNewFile("subdir/Dockerfile.whee",
`FROM golang:1.18.2-alpine
WORKDIR /src
COPY main.go .
RUN go mod init hello
RUN go build -o /usr/bin/goenv main.go
ENV FOO=bar
CMD goenv
`)
env, err := c.Container().Build(src, dagger.ContainerBuildOpts{
Dockerfile: "subdir/Dockerfile.whee",
}).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, env, "FOO=bar\n")
})
t.Run("subdirectory with default Dockerfile location", func(t *testing.T) {
src := contextDir.
WithNewFile("Dockerfile",
`FROM golang:1.18.2-alpine
WORKDIR /src
COPY main.go .
RUN go mod init hello
RUN go build -o /usr/bin/goenv main.go
ENV FOO=bar
CMD goenv
`)
sub := c.Directory().WithDirectory("subcontext", src).Directory("subcontext")
env, err := c.Container().Build(sub).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, env, "FOO=bar\n")
})
t.Run("subdirectory with custom Dockerfile location", func(t *testing.T) {
src := contextDir.
WithNewFile("subdir/Dockerfile.whee",
`FROM golang:1.18.2-alpine
WORKDIR /src
COPY main.go .
RUN go mod init hello
RUN go build -o /usr/bin/goenv main.go
ENV FOO=bar
CMD goenv
`)
sub := c.Directory().WithDirectory("subcontext", src).Directory("subcontext")
env, err := c.Container().Build(sub, dagger.ContainerBuildOpts{
Dockerfile: "subdir/Dockerfile.whee",
}).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, env, "FOO=bar\n")
})
t.Run("with build args", func(t *testing.T) {
src := contextDir.
WithNewFile("Dockerfile",
`FROM golang:1.18.2-alpine
ARG FOOARG=bar
WORKDIR /src
COPY main.go .
RUN go mod init hello
RUN go build -o /usr/bin/goenv main.go
ENV FOO=$FOOARG
CMD goenv
`)
env, err := c.Container().Build(src).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, env, "FOO=bar\n")
env, err = c.Container().Build(src, dagger.ContainerBuildOpts{BuildArgs: []dagger.BuildArg{{Name: "FOOARG", Value: "barbar"}}}).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, env, "FOO=barbar\n")
})
t.Run("with target", func(t *testing.T) {
src := contextDir.
WithNewFile("Dockerfile",
`FROM golang:1.18.2-alpine AS base
CMD echo "base"
FROM base AS stage1
CMD echo "stage1"
FROM base AS stage2
CMD echo "stage2"
`)
output, err := c.Container().Build(src).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, output, "stage2\n")
output, err = c.Container().Build(src, dagger.ContainerBuildOpts{Target: "stage1"}).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, output, "stage1\n")
require.NotContains(t, output, "stage2\n")
})
t.Run("with build secrets", func(t *testing.T) {
sec := c.SetSecret("my-secret", "barbar")
src := contextDir.
WithNewFile("Dockerfile",
`FROM golang:1.18.2-alpine
WORKDIR /src
RUN --mount=type=secret,id=my-secret test "$(cat /run/secrets/my-secret)" = "barbar"
RUN --mount=type=secret,id=my-secret cp /run/secrets/my-secret /secret
CMD cat /secret
`)
stdout, err := c.Container().Build(src, dagger.ContainerBuildOpts{
Secrets: []*dagger.Secret{sec},
}).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, stdout, "***")
})
t.Run("just build, don't execute", func(t *testing.T) {
src := contextDir.
WithNewFile("Dockerfile", "FROM "+alpineImage+"\nCMD false")
_, err := c.Container().Build(src).Sync(ctx)
require.NoError(t, err)
// unless there's a WithExec
_, err = c.Container().Build(src).WithExec(nil).Sync(ctx)
require.NotEmpty(t, err)
})
t.Run("just build, short-circuit", func(t *testing.T) {
src := contextDir.
WithNewFile("Dockerfile", "FROM "+alpineImage+"\nRUN false")
_, err := c.Container().Build(src).Sync(ctx)
require.NotEmpty(t, err)
})
}
func TestContainerWithRootFS(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
alpine316 := c.Container().From(alpineImage)
alpine316ReleaseStr, err := alpine316.File("/etc/alpine-release").Contents(ctx)
require.NoError(t, err)
alpine316ReleaseStr = strings.TrimSpace(alpine316ReleaseStr)
dir := alpine316.Rootfs()
_, err = c.Container().WithEnvVariable("ALPINE_RELEASE", alpine316ReleaseStr).WithRootfs(dir).WithExec([]string{
"/bin/sh",
"-c",
"test -f /etc/alpine-release && test \"$(head -n 1 /etc/alpine-release)\" = \"$ALPINE_RELEASE\"",
}).Sync(ctx)
require.NoError(t, err)
alpine315 := c.Container().From(alpineImage)
varVal := "testing123"
alpine315WithVar := alpine315.WithEnvVariable("DAGGER_TEST", varVal)
varValResp, err := alpine315WithVar.EnvVariable(ctx, "DAGGER_TEST")
require.NoError(t, err)
require.Equal(t, varVal, varValResp)
alpine315ReplacedFS := alpine315WithVar.WithRootfs(dir)
varValResp, err = alpine315ReplacedFS.EnvVariable(ctx, "DAGGER_TEST")
require.NoError(t, err)
require.Equal(t, varVal, varValResp)
releaseStr, err := alpine315ReplacedFS.File("/etc/alpine-release").Contents(ctx)
require.NoError(t, err)
require.Equal(t, "3.18.2\n", releaseStr)
}
//go:embed testdata/hello.go
var helloSrc string
func TestContainerWithRootFSSubdir(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
hello := c.Directory().WithNewFile("main.go", helloSrc).File("main.go")
ctr := c.Container().
From(golangImage).
WithMountedFile("/src/main.go", hello).
WithEnvVariable("CGO_ENABLED", "0").
WithExec([]string{"go", "build", "-o", "/out/hello", "/src/main.go"})
out, err := c.Container().
WithRootfs(ctr.Directory("/out")).
WithExec([]string{"/hello"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "Hello, world!\n", out)
}
func TestContainerExecSync(t *testing.T) {
t.Parallel()
// A successful sync doesn't prove anything. As soon as you call other
// leaves to check things, they could be the ones triggering execution.
// Still, sync can be useful for short-circuiting.
err := testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
withExec(args: ["false"]) {
sync
}
}
}
}`, nil, nil)
require.Contains(t, err.Error(), `process "false" did not complete successfully`)
}
func TestContainerExecStdoutStderr(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
From struct {
WithExec struct {
Stdout string
Stderr string
}
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
withExec(args: ["sh", "-c", "echo hello; echo goodbye >/dev/stderr"]) {
stdout
stderr
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, res.Container.From.WithExec.Stdout, "hello\n")
require.Equal(t, res.Container.From.WithExec.Stderr, "goodbye\n")
}
func TestContainerExecStdin(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
From struct {
WithExec struct {
Stdout string
}
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
withExec(args: ["cat"], stdin: "hello") {
stdout
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, res.Container.From.WithExec.Stdout, "hello")
}
func TestContainerExecRedirectStdoutStderr(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
From struct {
WithExec struct {
Out, Err struct {
Contents string
}
}
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
withExec(
args: ["sh", "-c", "echo hello; echo goodbye >/dev/stderr"],
redirectStdout: "out",
redirectStderr: "err"
) {
out: file(path: "out") {
contents
}
err: file(path: "err") {
contents
}
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, res.Container.From.WithExec.Out.Contents, "hello\n")
require.Equal(t, res.Container.From.WithExec.Err.Contents, "goodbye\n")
c, ctx := connect(t)
execWithMount := c.Container().From(alpineImage).
WithMountedDirectory("/mnt", c.Directory()).
WithExec([]string{"sh", "-c", "echo hello; echo goodbye >/dev/stderr"}, dagger.ContainerWithExecOpts{
RedirectStdout: "/mnt/out",
RedirectStderr: "/mnt/err",
})
stdout, err := execWithMount.File("/mnt/out").Contents(ctx)
require.NoError(t, err)
require.Equal(t, "hello\n", stdout)
stderr, err := execWithMount.File("/mnt/err").Contents(ctx)
require.NoError(t, err)
require.Equal(t, "goodbye\n", stderr)
_, err = execWithMount.Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hello\n", stdout)
_, err = execWithMount.Stderr(ctx)
require.NoError(t, err)
require.Equal(t, "goodbye\n", stderr)
}
func TestContainerExecWithWorkdir(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
From struct {
WithWorkdir struct {
WithExec struct {
Stdout string
}
}
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
withWorkdir(path: "/usr") {
withExec(args: ["pwd"]) {
stdout
}
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, res.Container.From.WithWorkdir.WithExec.Stdout, "/usr\n")
}
func TestContainerExecWithoutWorkdir(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
res, err := c.Container().
From(alpineImage).
WithWorkdir("/usr").
WithoutWorkdir().
WithExec([]string{"pwd"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "/\n", res)
}
func TestContainerExecWithUser(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
From struct {
User string
WithUser struct {
User string
WithExec struct {
Stdout string
}
}
}
}
}{}
t.Run("user name", func(t *testing.T) {
err := testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
user
withUser(name: "daemon") {
user
withExec(args: ["whoami"]) {
stdout
}
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, "", res.Container.From.User)
require.Equal(t, "daemon", res.Container.From.WithUser.User)
require.Equal(t, "daemon\n", res.Container.From.WithUser.WithExec.Stdout)
})
t.Run("user and group name", func(t *testing.T) {
err := testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
user
withUser(name: "daemon:floppy") {
user
withExec(args: ["sh", "-c", "whoami; groups"]) {
stdout
}
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, "", res.Container.From.User)
require.Equal(t, "daemon:floppy", res.Container.From.WithUser.User)
require.Equal(t, "daemon\nfloppy\n", res.Container.From.WithUser.WithExec.Stdout)
})
t.Run("user ID", func(t *testing.T) {
err := testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
user
withUser(name: "2") {
user
withExec(args: ["whoami"]) {
stdout
}
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, "", res.Container.From.User)
require.Equal(t, "2", res.Container.From.WithUser.User)
require.Equal(t, "daemon\n", res.Container.From.WithUser.WithExec.Stdout)
})
t.Run("user and group ID", func(t *testing.T) {
err := testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
user
withUser(name: "2:11") {
user
withExec(args: ["sh", "-c", "whoami; groups"]) {
stdout
}
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, "", res.Container.From.User)
require.Equal(t, "2:11", res.Container.From.WithUser.User)
require.Equal(t, "daemon\nfloppy\n", res.Container.From.WithUser.WithExec.Stdout)
})
}
func TestContainerExecWithoutUser(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
res, err := c.Container().
From(alpineImage).
WithUser("daemon").
WithoutUser().
WithExec([]string{"whoami"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "root\n", res)
}
func TestContainerExecWithEntrypoint(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
base := c.Container().From(alpineImage)
withEntry := base.WithEntrypoint([]string{"sh"})
t.Run("before", func(t *testing.T) {
t.Parallel()
before, err := base.Entrypoint(ctx)
require.NoError(t, err)
require.Empty(t, before)
})
t.Run("after", func(t *testing.T) {
t.Parallel()
after, err := withEntry.Entrypoint(ctx)
require.NoError(t, err)
require.Equal(t, []string{"sh"}, after)
})
t.Run("used", func(t *testing.T) {
t.Parallel()
used, err := withEntry.WithExec([]string{"-c", "echo $HOME"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "/root\n", used)
})
t.Run("prepended to exec", func(t *testing.T) {
t.Parallel()
_, err := withEntry.WithExec([]string{"sh", "-c", "echo $HOME"}).Sync(ctx)
require.Error(t, err)
require.ErrorContains(t, err, "can't open 'sh'")
})
t.Run("skipped", func(t *testing.T) {
t.Parallel()
skipped, err := withEntry.WithExec([]string{"sh", "-c", "echo $HOME"}, dagger.ContainerWithExecOpts{
SkipEntrypoint: true,
}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "/root\n", skipped)
})
t.Run("unset default args", func(t *testing.T) {
t.Parallel()
removed, err := base.
WithDefaultArgs([]string{"foobar"}).
WithEntrypoint([]string{"echo"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "\n", removed)
})
t.Run("kept default args", func(t *testing.T) {
t.Parallel()
kept, err := base.
WithDefaultArgs([]string{"foobar"}).
WithEntrypoint([]string{"echo"}, dagger.ContainerWithEntrypointOpts{
KeepDefaultArgs: true,
}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "foobar\n", kept)
})
t.Run("cleared", func(t *testing.T) {
t.Parallel()
withoutEntry := withEntry.WithEntrypoint(nil)
removed, err := withoutEntry.Entrypoint(ctx)
require.NoError(t, err)
require.Empty(t, removed)
})
}
func TestContainerExecWithoutEntrypoint(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
t.Run("cleared entrypoint", func(t *testing.T) {
res, err := c.Container().
From(alpineImage).
// if not unset this would return an error
WithEntrypoint([]string{"foo"}).
WithoutEntrypoint().
WithExec([]string{"echo", "-n", "foobar"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "foobar", res)
})
t.Run("cleared entrypoint with default args", func(t *testing.T) {
res, err := c.Container().
From(alpineImage).
WithEntrypoint([]string{"foo"}).
WithDefaultArgs([]string{"echo", "-n", "foobar"}).
WithoutEntrypoint().
Stdout(ctx)
require.ErrorContains(t, err, "no command has been set")
require.Empty(t, res)
})
t.Run("cleared entrypoint without default args", func(t *testing.T) {
res, err := c.Container().
From(alpineImage).
WithEntrypoint([]string{"foo"}).
WithDefaultArgs([]string{"echo", "-n", "foobar"}).
WithoutEntrypoint(dagger.ContainerWithoutEntrypointOpts{
KeepDefaultArgs: true,
}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "foobar", res)
})
}
func TestContainerWithDefaultArgs(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
From struct {
Entrypoint []string
DefaultArgs []string
WithExec struct {
Stdout string
}
WithDefaultArgs struct {
Entrypoint []string
DefaultArgs []string
}
WithEntrypoint struct {
Entrypoint []string
DefaultArgs []string
WithExec struct {
Stdout string
}
WithDefaultArgs struct {
Entrypoint []string
DefaultArgs []string
WithExec struct {
Stdout string
}
}
}
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
entrypoint
defaultArgs
withDefaultArgs(args: []) {
entrypoint
defaultArgs
}
withEntrypoint(args: ["sh", "-c"]) {
entrypoint
defaultArgs
withExec(args: ["echo $HOME"]) {
stdout
}
withDefaultArgs(args: ["id"]) {
entrypoint
defaultArgs
withExec(args: []) {
stdout
}
}
}
}
}
}`, &res, nil)
t.Run("default alpine (no entrypoint)", func(t *testing.T) {
require.NoError(t, err)
require.Empty(t, res.Container.From.Entrypoint)
require.Equal(t, []string{"/bin/sh"}, res.Container.From.DefaultArgs)
})
t.Run("with nil default args", func(t *testing.T) {
require.Empty(t, res.Container.From.WithDefaultArgs.Entrypoint)
require.Empty(t, res.Container.From.WithDefaultArgs.DefaultArgs)
})
t.Run("with entrypoint set", func(t *testing.T) {
require.Equal(t, []string{"sh", "-c"}, res.Container.From.WithEntrypoint.Entrypoint)
require.Empty(t, res.Container.From.WithEntrypoint.DefaultArgs)
})
t.Run("with exec args", func(t *testing.T) {
require.Equal(t, "/root\n", res.Container.From.WithEntrypoint.WithExec.Stdout)
})
t.Run("with default args set", func(t *testing.T) {
require.Equal(t, []string{"sh", "-c"}, res.Container.From.WithEntrypoint.WithDefaultArgs.Entrypoint)
require.Equal(t, []string{"id"}, res.Container.From.WithEntrypoint.WithDefaultArgs.DefaultArgs)
require.Equal(t, "uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)\n", res.Container.From.WithEntrypoint.WithDefaultArgs.WithExec.Stdout)
})
}
func TestContainerExecWithoutDefaultArgs(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
res, err := c.Container().
From(alpineImage).
WithEntrypoint([]string{"echo", "-n"}).
WithDefaultArgs([]string{"foo"}).
WithoutDefaultArgs().
WithExec([]string{}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "", res)
}
func TestContainerExecWithEnvVariable(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
From struct {
WithEnvVariable struct {
WithExec struct {
Stdout string
}
}
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
withEnvVariable(name: "FOO", value: "bar") {
withExec(args: ["env"]) {
stdout
}
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Contains(t, res.Container.From.WithEnvVariable.WithExec.Stdout, "FOO=bar\n")
}
func TestContainerVariables(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
From struct {
EnvVariables []schema.EnvVariable
WithExec struct {
Stdout string
}
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "golang:1.18.2-alpine") {
envVariables {
name
value
}
withExec(args: ["env"]) {
stdout
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, []schema.EnvVariable{
{Name: "PATH", Value: "/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},
{Name: "GOLANG_VERSION", Value: "1.18.2"},
{Name: "GOPATH", Value: "/go"},
}, res.Container.From.EnvVariables)
require.Contains(t, res.Container.From.WithExec.Stdout, "GOPATH=/go\n")
}
func TestContainerVariable(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
From struct {
EnvVariable *string
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "golang:1.18.2-alpine") {
envVariable(name: "GOLANG_VERSION")
}
}
}`, &res, nil)
require.NoError(t, err)
require.NotNil(t, res.Container.From.EnvVariable)
require.Equal(t, "1.18.2", *res.Container.From.EnvVariable)
err = testutil.Query(
`{
container {
from(address: "golang:1.18.2-alpine") {
envVariable(name: "UNKNOWN")
}
}
}`, &res, nil)
require.NoError(t, err)
require.Nil(t, res.Container.From.EnvVariable)
}
func TestContainerWithoutVariable(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
From struct {
WithoutEnvVariable struct {
EnvVariables []schema.EnvVariable
WithExec struct {
Stdout string
}
}
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "golang:1.18.2-alpine") {
withoutEnvVariable(name: "GOLANG_VERSION") {
envVariables {
name
value
}
withExec(args: ["env"]) {
stdout
}
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, res.Container.From.WithoutEnvVariable.EnvVariables, []schema.EnvVariable{
{Name: "PATH", Value: "/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},
{Name: "GOPATH", Value: "/go"},
})
require.NotContains(t, res.Container.From.WithoutEnvVariable.WithExec.Stdout, "GOLANG_VERSION")
}
func TestContainerEnvVariablesReplace(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
From struct {
WithEnvVariable struct {
EnvVariables []schema.EnvVariable
WithExec struct {
Stdout string
}
}
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "golang:1.18.2-alpine") {
withEnvVariable(name: "GOPATH", value: "/gone") {
envVariables {
name
value
}
withExec(args: ["env"]) {
stdout
}
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, res.Container.From.WithEnvVariable.EnvVariables, []schema.EnvVariable{
{Name: "PATH", Value: "/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},
{Name: "GOLANG_VERSION", Value: "1.18.2"},
{Name: "GOPATH", Value: "/gone"},
})
require.Contains(t, res.Container.From.WithEnvVariable.WithExec.Stdout, "GOPATH=/gone\n")
}
func TestContainerWithEnvVariableExpand(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
t.Run("add env var without expansion", func(t *testing.T) {
out, err := c.Container().
From(alpineImage).
WithEnvVariable("FOO", "foo:$PATH").
WithExec([]string{"printenv", "FOO"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "foo:$PATH\n", out)
})
t.Run("add env var with expansion", func(t *testing.T) {
out, err := c.Container().
From(alpineImage).
WithEnvVariable("USER_PATH", "/opt").
WithEnvVariable(
"PATH",
"${USER_PATH}/bin:$PATH",
dagger.ContainerWithEnvVariableOpts{
Expand: true,
},
).
WithExec([]string{"printenv", "PATH"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t,
"/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n",
out,
)
})
}
func TestContainerLabel(t *testing.T) {
c, ctx := connect(t)
t.Run("container with new label", func(t *testing.T) {
label, err := c.Container().From(alpineImage).WithLabel("FOO", "BAR").Label(ctx, "FOO")
require.NoError(t, err)
require.Contains(t, label, "BAR")
})
// implementing this test as GraphQL query until
// https://github.com/dagger/dagger/issues/4398 gets resolved
t.Run("container labels", func(t *testing.T) {
res := struct {
Container struct {
From struct {
Labels []schema.Label
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "nginx") {
labels {
name
value
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, []schema.Label{
{Name: "maintainer", Value: "NGINX Docker Maintainers <docker-maint@nginx.com>"},
}, res.Container.From.Labels)
})
t.Run("container without label", func(t *testing.T) {
label, err := c.Container().From("nginx").WithoutLabel("maintainer").Label(ctx, "maintainer")
require.NoError(t, err)
require.Empty(t, label)
})
t.Run("container replace label", func(t *testing.T) {
label, err := c.Container().From("nginx").WithLabel("maintainer", "bar").Label(ctx, "maintainer")
require.NoError(t, err)
require.Contains(t, label, "bar")
})
t.Run("container with new label - nil panics", func(t *testing.T) {
label, err := c.Container().WithLabel("FOO", "BAR").Label(ctx, "FOO")
require.NoError(t, err)
require.Contains(t, label, "BAR")
})
t.Run("container label - nil panics", func(t *testing.T) {
label, err := c.Container().Label(ctx, "FOO")
require.NoError(t, err)
require.Empty(t, label)
})
t.Run("container without label - nil panics", func(t *testing.T) {
label, err := c.Container().WithoutLabel("maintainer").Label(ctx, "maintainer")
require.NoError(t, err)
require.Empty(t, label)
})
// implementing this test as GraphQL query until
// https://github.com/dagger/dagger/issues/4398 gets resolved
t.Run("container labels - nil panics", func(t *testing.T) {
res := struct {
Container struct {
From struct {
Labels []schema.Label
}
}
}{}
err := testutil.Query(
`{
container {
labels {
name
value
}
}
}`, &res, nil)
require.NoError(t, err)
require.Empty(t, res.Container.From.Labels)
})
}
func TestContainerWorkdir(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
From struct {
Workdir string
WithExec struct {
Stdout string
}
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "golang:1.18.2-alpine") {
workdir
withExec(args: ["pwd"]) {
stdout
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, res.Container.From.Workdir, "/go")
require.Equal(t, res.Container.From.WithExec.Stdout, "/go\n")
}
func TestContainerWithWorkdir(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
From struct {
WithWorkdir struct {
Workdir string
WithExec struct {
Stdout string
}
}
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "golang:1.18.2-alpine") {
withWorkdir(path: "/usr") {
workdir
withExec(args: ["pwd"]) {
stdout
}
}
}
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, res.Container.From.WithWorkdir.Workdir, "/usr")
require.Equal(t, res.Container.From.WithWorkdir.WithExec.Stdout, "/usr\n")
}
func TestContainerWithMountedDirectory(t *testing.T) {
t.Parallel()
dirRes := struct {
Directory struct {
WithNewFile struct {
WithNewFile struct {
ID string
}
}
}
}{}
err := testutil.Query(
`{
directory {
withNewFile(path: "some-file", contents: "some-content") {
withNewFile(path: "some-dir/sub-file", contents: "sub-content") {
id
}
}
}
}`, &dirRes, nil)
require.NoError(t, err)
id := dirRes.Directory.WithNewFile.WithNewFile.ID
execRes := struct {
Container struct {
From struct {
WithMountedDirectory struct {
WithExec struct {
Stdout string
WithExec struct {
Stdout string
}
}
}
}
}
}{}
err = testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withMountedDirectory(path: "/mnt", source: $id) {
withExec(args: ["cat", "/mnt/some-file"]) {
stdout
withExec(args: ["cat", "/mnt/some-dir/sub-file"]) {
stdout
}
}
}
}
}
}`, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"id": id,
}})
require.NoError(t, err)
require.Equal(t, "some-content", execRes.Container.From.WithMountedDirectory.WithExec.Stdout)
require.Equal(t, "sub-content", execRes.Container.From.WithMountedDirectory.WithExec.WithExec.Stdout)
}
func TestContainerWithMountedDirectorySourcePath(t *testing.T) {
t.Parallel()
dirRes := struct {
Directory struct {
WithNewFile struct {
WithNewFile struct {
Directory struct {
ID string
}
}
}
}
}{}
err := testutil.Query(
`{
directory {
withNewFile(path: "some-file", contents: "some-content") {
withNewFile(path: "some-dir/sub-file", contents: "sub-content") {
directory(path: "some-dir") {
id
}
}
}
}
}`, &dirRes, nil)
require.NoError(t, err)
id := dirRes.Directory.WithNewFile.WithNewFile.Directory.ID
execRes := struct {
Container struct {
From struct {
WithMountedDirectory struct {
WithExec struct {
WithExec struct {
Stdout string
}
}
}
}
}
}{}
err = testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withMountedDirectory(path: "/mnt", source: $id) {
withExec(args: ["sh", "-c", "echo >> /mnt/sub-file; echo -n more-content >> /mnt/sub-file"]) {
withExec(args: ["cat", "/mnt/sub-file"]) {
stdout
}
}
}
}
}
}`, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"id": id,
}})
require.NoError(t, err)
require.Equal(t, "sub-content\nmore-content", execRes.Container.From.WithMountedDirectory.WithExec.WithExec.Stdout)
}
func TestContainerWithMountedDirectoryPropagation(t *testing.T) {
t.Parallel()
dirRes := struct {
Directory struct {
WithNewFile struct {
ID core.DirectoryID
}
}
}{}
err := testutil.Query(
`{
directory {
withNewFile(path: "some-file", contents: "some-content") {
id
}
}
}`, &dirRes, nil, dagger.WithLogOutput(os.Stdout))
require.NoError(t, err)
id := dirRes.Directory.WithNewFile.ID
execRes := struct {
Container struct {
From struct {
WithMountedDirectory struct {
WithExec struct {
Stdout string
WithExec struct {
WithExec struct {
Stdout string
WithMountedDirectory struct {
WithExec struct {
Stdout string
WithExec struct {
Stdout string
}
}
}
}
}
}
}
}
}
}{}
err = testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withMountedDirectory(path: "/mnt", source: $id) {
withExec(args: ["cat", "/mnt/some-file"]) {
# original content
stdout
withExec(args: ["sh", "-c", "echo >> /mnt/some-file; echo -n more-content >> /mnt/some-file"]) {
withExec(args: ["cat", "/mnt/some-file"]) {
# modified content should propagate
stdout
withMountedDirectory(path: "/mnt", source: $id) {
withExec(args: ["cat", "/mnt/some-file"]) {
# should be back to the original content
stdout
withExec(args: ["cat", "/mnt/some-file"]) {
# original content override should propagate
stdout
}
}
}
}
}
}
}
}
}
}`, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"id": id,
}}, dagger.WithLogOutput(os.Stdout))
require.NoError(t, err)
require.Equal(t,
"some-content",
execRes.Container.From.WithMountedDirectory.WithExec.Stdout)
require.Equal(t,
"some-content\nmore-content",
execRes.Container.From.WithMountedDirectory.WithExec.WithExec.WithExec.Stdout)
require.Equal(t,
"some-content",
execRes.Container.From.WithMountedDirectory.WithExec.WithExec.WithExec.WithMountedDirectory.WithExec.Stdout)
require.Equal(t,
"some-content",
execRes.Container.From.WithMountedDirectory.WithExec.WithExec.WithExec.WithMountedDirectory.WithExec.WithExec.Stdout)
}
func TestContainerWithMountedFile(t *testing.T) {
t.Parallel()
dirRes := struct {
Directory struct {
WithNewFile struct {
File struct {
ID core.FileID
}
}
}
}{}
err := testutil.Query(
`{
directory {
withNewFile(path: "some-dir/sub-file", contents: "sub-content") {
file(path: "some-dir/sub-file") {
id
}
}
}
}`, &dirRes, nil)
require.NoError(t, err)
id := dirRes.Directory.WithNewFile.File.ID
execRes := struct {
Container struct {
From struct {
WithMountedFile struct {
WithExec struct {
Stdout string
}
}
}
}
}{}
err = testutil.Query(
`query Test($id: FileID!) {
container {
from(address: "`+alpineImage+`") {
withMountedFile(path: "/mnt/file", source: $id) {
withExec(args: ["cat", "/mnt/file"]) {
stdout
}
}
}
}
}`, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"id": id,
}})
require.NoError(t, err)
require.Equal(t, "sub-content", execRes.Container.From.WithMountedFile.WithExec.Stdout)
}
func TestContainerWithMountedCache(t *testing.T) {
t.Parallel()
cacheID := newCache(t)
execRes := struct {
Container struct {
From struct {
WithEnvVariable struct {
WithMountedCache struct {
WithExec struct {
Stdout string
}
}
}
}
}
}{}
query := `query Test($cache: CacheVolumeID!, $rand: String!) {
container {
from(address: "` + alpineImage + `") {
withEnvVariable(name: "RAND", value: $rand) {
withMountedCache(path: "/mnt/cache", cache: $cache) {
withExec(args: ["sh", "-c", "echo $RAND >> /mnt/cache/file; cat /mnt/cache/file"]) {
stdout
}
}
}
}
}
}`
rand1 := identity.NewID()
err := testutil.Query(query, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"cache": cacheID,
"rand": rand1,
}})
require.NoError(t, err)
require.Equal(t, rand1+"\n", execRes.Container.From.WithEnvVariable.WithMountedCache.WithExec.Stdout)
rand2 := identity.NewID()
err = testutil.Query(query, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"cache": cacheID,
"rand": rand2,
}})
require.NoError(t, err)
require.Equal(t, rand1+"\n"+rand2+"\n", execRes.Container.From.WithEnvVariable.WithMountedCache.WithExec.Stdout)
}
func TestContainerWithMountedCacheFromDirectory(t *testing.T) {
t.Parallel()
dirRes := struct {
Directory struct {
WithNewFile struct {
Directory struct {
ID core.DirectoryID
}
}
}
}{}
err := testutil.Query(
`{
directory {
withNewFile(path: "some-dir/sub-file", contents: "initial-content\n") {
directory(path: "some-dir") {
id
}
}
}
}`, &dirRes, nil)
require.NoError(t, err)
initialID := dirRes.Directory.WithNewFile.Directory.ID
cacheID := newCache(t)
execRes := struct {
Container struct {
From struct {
WithEnvVariable struct {
WithMountedCache struct {
WithExec struct {
Stdout string
}
}
}
}
}
}{}
query := `query Test($cache: CacheVolumeID!, $rand: String!, $init: DirectoryID!) {
container {
from(address: "` + alpineImage + `") {
withEnvVariable(name: "RAND", value: $rand) {
withMountedCache(path: "/mnt/cache", cache: $cache, source: $init) {
withExec(args: ["sh", "-c", "echo $RAND >> /mnt/cache/sub-file; cat /mnt/cache/sub-file"]) {
stdout
}
}
}
}
}
}`
rand1 := identity.NewID()
err = testutil.Query(query, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"init": initialID,
"rand": rand1,
"cache": cacheID,
}})
require.NoError(t, err)
require.Equal(t, "initial-content\n"+rand1+"\n", execRes.Container.From.WithEnvVariable.WithMountedCache.WithExec.Stdout)
rand2 := identity.NewID()
err = testutil.Query(query, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"init": initialID,
"rand": rand2,
"cache": cacheID,
}})
require.NoError(t, err)
require.Equal(t, "initial-content\n"+rand1+"\n"+rand2+"\n", execRes.Container.From.WithEnvVariable.WithMountedCache.WithExec.Stdout)
}
func TestContainerWithMountedTemp(t *testing.T) {
t.Parallel()
execRes := struct {
Container struct {
From struct {
WithMountedTemp struct {
WithExec struct {
Stdout string
}
}
}
}
}{}
err := testutil.Query(`{
container {
from(address: "`+alpineImage+`") {
withMountedTemp(path: "/mnt/tmp") {
withExec(args: ["grep", "/mnt/tmp", "/proc/mounts"]) {
stdout
}
}
}
}
}`, &execRes, nil)
require.NoError(t, err)
require.Contains(t, execRes.Container.From.WithMountedTemp.WithExec.Stdout, "tmpfs /mnt/tmp tmpfs")
}
func TestContainerWithDirectory(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
dir := c.Directory().
WithNewFile("some-file", "some-content").
WithNewFile("some-dir/sub-file", "sub-content").
Directory("some-dir")
ctr := c.Container().
From(alpineImage).
WithWorkdir("/workdir").
WithDirectory("with-dir", dir)
contents, err := ctr.WithExec([]string{"cat", "with-dir/sub-file"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "sub-content", contents)
contents, err = ctr.WithExec([]string{"cat", "/workdir/with-dir/sub-file"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "sub-content", contents)
// Test with a mount
mount := c.Directory().
WithNewFile("mounted-file", "mounted-content")
ctr = c.Container().
From(alpineImage).
WithWorkdir("/workdir").
WithMountedDirectory("mnt/mount", mount).
WithDirectory("mnt/mount/dst/with-dir", dir)
contents, err = ctr.WithExec([]string{"cat", "mnt/mount/mounted-file"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "mounted-content", contents)
contents, err = ctr.WithExec([]string{"cat", "mnt/mount/dst/with-dir/sub-file"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "sub-content", contents)
// Test with a relative mount
mnt := c.Directory().WithNewDirectory("/a/b/c")
ctr = c.Container().
From(alpineImage).
WithMountedDirectory("/mnt", mnt)
dir = c.Directory().
WithNewDirectory("/foo").
WithNewFile("/foo/some-file", "some-content")
ctr = ctr.WithDirectory("/mnt/a/b/foo", dir)
contents, err = ctr.WithExec([]string{"cat", "/mnt/a/b/foo/foo/some-file"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "some-content", contents)
}
func TestContainerWithFile(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
file := c.Directory().
WithNewFile("some-file", "some-content").
File("some-file")
ctr := c.Container().
From(alpineImage).
WithWorkdir("/workdir").
WithFile("target-file", file)
contents, err := ctr.WithExec([]string{"cat", "target-file"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "some-content", contents)
contents, err = ctr.WithExec([]string{"cat", "/workdir/target-file"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "some-content", contents)
}
func TestContainerWithNewFile(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().
From(alpineImage).
WithWorkdir("/workdir").
WithNewFile("some-file", dagger.ContainerWithNewFileOpts{
Contents: "some-content",
})
contents, err := ctr.WithExec([]string{"cat", "some-file"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "some-content", contents)
contents, err = ctr.WithExec([]string{"cat", "/workdir/some-file"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "some-content", contents)
}
func TestContainerMountsWithoutMount(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
scratchID, err := c.Directory().ID(ctx)
require.NoError(t, err)
dirRes := struct {
Directory struct {
WithNewFile struct {
WithNewFile struct {
ID string
}
}
}
}{}
err = testutil.Query(
`{
directory {
withNewFile(path: "some-file", contents: "some-content") {
withNewFile(path: "some-dir/sub-file", contents: "sub-content") {
id
}
}
}
}`, &dirRes, nil)
require.NoError(t, err)
id := dirRes.Directory.WithNewFile.WithNewFile.ID
execRes := struct {
Container struct {
From struct {
WithDirectory struct {
WithMountedTemp struct {
Mounts []string
WithMountedDirectory struct {
Mounts []string
WithExec struct {
Stdout string
WithoutMount struct {
Mounts []string
WithExec struct {
Stdout string
}
}
}
}
}
}
}
}
}{}
err = testutil.Query(
`query Test($id: DirectoryID!, $scratch: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withDirectory(path: "/mnt/dir", directory: $scratch) {
withMountedTemp(path: "/mnt/tmp") {
mounts
withMountedDirectory(path: "/mnt/dir", source: $id) {
mounts
withExec(args: ["ls", "/mnt/dir"]) {
stdout
withoutMount(path: "/mnt/dir") {
mounts
withExec(args: ["ls", "/mnt/dir"]) {
stdout
}
}
}
}
}
}
}
}
}`, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"id": id,
"scratch": scratchID,
}})
require.NoError(t, err)
require.Equal(t, []string{"/mnt/tmp"}, execRes.Container.From.WithDirectory.WithMountedTemp.Mounts)
require.Equal(t, []string{"/mnt/tmp", "/mnt/dir"}, execRes.Container.From.WithDirectory.WithMountedTemp.WithMountedDirectory.Mounts)
require.Equal(t, "some-dir\nsome-file\n", execRes.Container.From.WithDirectory.WithMountedTemp.WithMountedDirectory.WithExec.Stdout)
require.Equal(t, "", execRes.Container.From.WithDirectory.WithMountedTemp.WithMountedDirectory.WithExec.WithoutMount.WithExec.Stdout)
require.Equal(t, []string{"/mnt/tmp"}, execRes.Container.From.WithDirectory.WithMountedTemp.WithMountedDirectory.WithExec.WithoutMount.Mounts)
}
func TestContainerReplacedMounts(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
lower := c.Directory().WithNewFile("some-file", "lower-content")
upper := c.Directory().WithNewFile("some-file", "upper-content")
ctr := c.Container().
From(alpineImage).
WithMountedDirectory("/mnt/dir", lower)
t.Run("initial content is lower", func(t *testing.T) {
mnts, err := ctr.Mounts(ctx)
require.NoError(t, err)
require.Equal(t, []string{"/mnt/dir"}, mnts)
out, err := ctr.WithExec([]string{"cat", "/mnt/dir/some-file"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "lower-content", out)
})
replaced := ctr.WithMountedDirectory("/mnt/dir", upper)
t.Run("mounts of same path are replaced", func(t *testing.T) {
mnts, err := replaced.Mounts(ctx)
require.NoError(t, err)
require.Equal(t, []string{"/mnt/dir"}, mnts)
out, err := replaced.WithExec([]string{"cat", "/mnt/dir/some-file"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "upper-content", out)
})
t.Run("removing a replaced mount does not reveal previous mount", func(t *testing.T) {
removed := replaced.WithoutMount("/mnt/dir")
mnts, err := removed.Mounts(ctx)
require.NoError(t, err)
require.Empty(t, mnts)
})
clobberedDir := c.Directory().WithNewFile("some-file", "clobbered-content")
clobbered := replaced.WithMountedDirectory("/mnt", clobberedDir)
t.Run("replacing parent of a mount clobbers child", func(t *testing.T) {
mnts, err := clobbered.Mounts(ctx)
require.NoError(t, err)
require.Equal(t, []string{"/mnt"}, mnts)
out, err := clobbered.WithExec([]string{"cat", "/mnt/some-file"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "clobbered-content", out)
})
clobberedSubDir := c.Directory().WithNewFile("some-file", "clobbered-sub-content")
clobberedSub := clobbered.WithMountedDirectory("/mnt/dir", clobberedSubDir)
t.Run("restoring mount under clobbered mount", func(t *testing.T) {
mnts, err := clobberedSub.Mounts(ctx)
require.NoError(t, err)
require.Equal(t, []string{"/mnt", "/mnt/dir"}, mnts)
out, err := clobberedSub.WithExec([]string{"cat", "/mnt/dir/some-file"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "clobbered-sub-content", out)
})
}
func TestContainerDirectory(t *testing.T) {
t.Parallel()
dirRes := struct {
Directory struct {
WithNewFile struct {
WithNewFile struct {
ID core.DirectoryID
}
}
}
}{}
err := testutil.Query(
`{
directory {
withNewFile(path: "some-file", contents: "some-content") {
withNewFile(path: "some-dir/sub-file", contents: "sub-content") {
id
}
}
}
}`, &dirRes, nil)
require.NoError(t, err)
id := dirRes.Directory.WithNewFile.WithNewFile.ID
writeRes := struct {
Container struct {
From struct {
WithMountedDirectory struct {
WithMountedDirectory struct {
WithExec struct {
Directory struct {
ID core.DirectoryID
}
}
}
}
}
}
}{}
err = testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withMountedDirectory(path: "/mnt/dir", source: $id) {
withMountedDirectory(path: "/mnt/dir/overlap", source: $id) {
withExec(args: ["sh", "-c", "echo hello >> /mnt/dir/overlap/another-file"]) {
directory(path: "/mnt/dir/overlap") {
id
}
}
}
}
}
}
}`, &writeRes, &testutil.QueryOptions{Variables: map[string]any{
"id": id,
}})
require.NoError(t, err)
writtenID := writeRes.Container.From.WithMountedDirectory.WithMountedDirectory.WithExec.Directory.ID
execRes := struct {
Container struct {
From struct {
WithMountedDirectory struct {
WithExec struct {
Stdout string
}
}
}
}
}{}
err = testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withMountedDirectory(path: "/mnt/dir", source: $id) {
withExec(args: ["cat", "/mnt/dir/another-file"]) {
stdout
}
}
}
}
}`, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"id": writtenID,
}})
require.NoError(t, err)
require.Equal(t, "hello\n", execRes.Container.From.WithMountedDirectory.WithExec.Stdout)
}
func TestContainerDirectoryErrors(t *testing.T) {
t.Parallel()
dirRes := struct {
Directory struct {
WithNewFile struct {
WithNewFile struct {
ID core.DirectoryID
}
}
}
}{}
err := testutil.Query(
`{
directory {
withNewFile(path: "some-file", contents: "some-content") {
withNewFile(path: "some-dir/sub-file", contents: "sub-content") {
id
}
}
}
}`, &dirRes, nil)
require.NoError(t, err)
id := dirRes.Directory.WithNewFile.WithNewFile.ID
err = testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withMountedDirectory(path: "/mnt/dir", source: $id) {
directory(path: "/mnt/dir/some-file") {
id
}
}
}
}
}`, nil, &testutil.QueryOptions{Variables: map[string]any{
"id": id,
}})
require.Error(t, err)
require.Contains(t, err.Error(), "path /mnt/dir/some-file is a file, not a directory")
err = testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withMountedDirectory(path: "/mnt/dir", source: $id) {
directory(path: "/mnt/dir/bogus") {
id
}
}
}
}
}`, nil, &testutil.QueryOptions{Variables: map[string]any{
"id": id,
}})
require.Error(t, err)
require.Contains(t, err.Error(), "bogus: no such file or directory")
err = testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
withMountedTemp(path: "/mnt/tmp") {
directory(path: "/mnt/tmp/bogus") {
id
}
}
}
}
}`, nil, nil)
require.Error(t, err)
require.Contains(t, err.Error(), "bogus: cannot retrieve path from tmpfs")
cacheID := newCache(t)
err = testutil.Query(
`query Test($cache: CacheVolumeID!) {
container {
from(address: "`+alpineImage+`") {
withMountedCache(path: "/mnt/cache", cache: $cache) {
directory(path: "/mnt/cache/bogus") {
id
}
}
}
}
}`, nil, &testutil.QueryOptions{Variables: map[string]any{
"cache": cacheID,
}})
require.Error(t, err)
require.Contains(t, err.Error(), "bogus: cannot retrieve path from cache")
}
func TestContainerDirectorySourcePath(t *testing.T) {
t.Parallel()
dirRes := struct {
Directory struct {
WithNewFile struct {
Directory struct {
ID core.DirectoryID
}
}
}
}{}
err := testutil.Query(
`{
directory {
withNewFile(path: "some-dir/sub-dir/sub-file", contents: "sub-content\n") {
directory(path: "some-dir") {
id
}
}
}
}`, &dirRes, nil)
require.NoError(t, err)
id := dirRes.Directory.WithNewFile.Directory.ID
writeRes := struct {
Container struct {
From struct {
WithMountedDirectory struct {
WithExec struct {
Directory struct {
ID core.DirectoryID
}
}
}
}
}
}{}
err = testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withMountedDirectory(path: "/mnt/dir", source: $id) {
withExec(args: ["sh", "-c", "echo more-content >> /mnt/dir/sub-dir/sub-file"]) {
directory(path: "/mnt/dir/sub-dir") {
id
}
}
}
}
}
}`, &writeRes, &testutil.QueryOptions{Variables: map[string]any{
"id": id,
}})
require.NoError(t, err)
writtenID := writeRes.Container.From.WithMountedDirectory.WithExec.Directory.ID
execRes := struct {
Container struct {
From struct {
WithMountedDirectory struct {
WithExec struct {
Stdout string
}
}
}
}
}{}
err = testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withMountedDirectory(path: "/mnt/dir", source: $id) {
withExec(args: ["cat", "/mnt/dir/sub-file"]) {
stdout
}
}
}
}
}`, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"id": writtenID,
}})
require.NoError(t, err)
require.Equal(t, "sub-content\nmore-content\n", execRes.Container.From.WithMountedDirectory.WithExec.Stdout)
}
func TestContainerFile(t *testing.T) {
t.Parallel()
id := newDirWithFile(t, "some-file", "some-content-")
writeRes := struct {
Container struct {
From struct {
WithMountedDirectory struct {
WithMountedDirectory struct {
WithExec struct {
File struct {
ID core.FileID
}
}
}
}
}
}
}{}
err := testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withMountedDirectory(path: "/mnt/dir", source: $id) {
withMountedDirectory(path: "/mnt/dir/overlap", source: $id) {
withExec(args: ["sh", "-c", "echo -n appended >> /mnt/dir/overlap/some-file"]) {
file(path: "/mnt/dir/overlap/some-file") {
id
}
}
}
}
}
}
}`, &writeRes, &testutil.QueryOptions{Variables: map[string]any{
"id": id,
}})
require.NoError(t, err)
writtenID := writeRes.Container.From.WithMountedDirectory.WithMountedDirectory.WithExec.File.ID
execRes := struct {
Container struct {
From struct {
WithMountedFile struct {
WithExec struct {
Stdout string
}
}
}
}
}{}
err = testutil.Query(
`query Test($id: FileID!) {
container {
from(address: "`+alpineImage+`") {
withMountedFile(path: "/mnt/file", source: $id) {
withExec(args: ["cat", "/mnt/file"]) {
stdout
}
}
}
}
}`, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"id": writtenID,
}})
require.NoError(t, err)
require.Equal(t, "some-content-appended", execRes.Container.From.WithMountedFile.WithExec.Stdout)
}
func TestContainerFileErrors(t *testing.T) {
t.Parallel()
id := newDirWithFile(t, "some-file", "some-content")
err := testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withMountedDirectory(path: "/mnt/dir", source: $id) {
file(path: "/mnt/dir/bogus") {
id
}
}
}
}
}`, nil, &testutil.QueryOptions{Variables: map[string]any{
"id": id,
}})
require.Error(t, err)
require.Contains(t, err.Error(), "bogus: no such file or directory")
err = testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withMountedDirectory(path: "/mnt/dir", source: $id) {
file(path: "/mnt/dir") {
id
}
}
}
}
}`, nil, &testutil.QueryOptions{Variables: map[string]any{
"id": id,
}})
require.Error(t, err)
require.Contains(t, err.Error(), "path /mnt/dir is a directory, not a file")
err = testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
withMountedTemp(path: "/mnt/tmp") {
file(path: "/mnt/tmp/bogus") {
id
}
}
}
}
}`, nil, nil)
require.Error(t, err)
require.Contains(t, err.Error(), "bogus: cannot retrieve path from tmpfs")
cacheID := newCache(t)
err = testutil.Query(
`query Test($cache: CacheVolumeID!) {
container {
from(address: "`+alpineImage+`") {
withMountedCache(path: "/mnt/cache", cache: $cache) {
file(path: "/mnt/cache/bogus") {
id
}
}
}
}
}`, nil, &testutil.QueryOptions{Variables: map[string]any{
"cache": cacheID,
}})
require.Error(t, err)
require.Contains(t, err.Error(), "bogus: cannot retrieve path from cache")
err = testutil.Query(
`query Test($secret: SecretID!) {
container {
from(address: "`+alpineImage+`") {
withMountedSecret(path: "/sekret", source: $secret) {
file(path: "/sekret") {
contents
}
}
}
}
}`, nil, &testutil.QueryOptions{Secrets: map[string]string{
"secret": "some-secret",
}})
require.Error(t, err)
require.Contains(t, err.Error(), "sekret: no such file or directory")
}
func TestContainerFSDirectory(t *testing.T) {
t.Parallel()
dirRes := struct {
Container struct {
From struct {
Directory struct {
ID core.DirectoryID
}
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
directory(path: "/etc") {
id
}
}
}
}`, &dirRes, nil)
require.NoError(t, err)
etcID := dirRes.Container.From.Directory.ID
execRes := struct {
Container struct {
From struct {
WithMountedDirectory struct {
WithExec struct {
Stdout string
}
}
}
}
}{}
err = testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withMountedDirectory(path: "/mnt/etc", source: $id) {
withExec(args: ["cat", "/mnt/etc/alpine-release"]) {
stdout
}
}
}
}
}`, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"id": etcID,
}})
require.NoError(t, err)
require.Equal(t, "3.18.2\n", execRes.Container.From.WithMountedDirectory.WithExec.Stdout)
}
func TestContainerRelativePaths(t *testing.T) {
t.Parallel()
dirRes := struct {
Directory struct {
WithNewFile struct {
ID core.DirectoryID
}
}
}{}
err := testutil.Query(
`{
directory {
withNewFile(path: "some-file", contents: "some-content") {
id
}
}
}`, &dirRes, nil)
require.NoError(t, err)
id := dirRes.Directory.WithNewFile.ID
writeRes := struct {
Container struct {
From struct {
WithExec struct {
WithWorkdir struct {
WithWorkdir struct {
Workdir string
WithMountedDirectory struct {
WithMountedTemp struct {
WithMountedCache struct {
Mounts []string
WithExec struct {
Directory struct {
ID core.DirectoryID
}
}
WithoutMount struct {
Mounts []string
}
}
}
}
}
}
}
}
}
}{}
cacheID := newCache(t)
err = testutil.Query(
`query Test($id: DirectoryID!, $cache: CacheVolumeID!) {
container {
from(address: "`+alpineImage+`") {
withExec(args: ["mkdir", "-p", "/mnt/sub"]) {
withWorkdir(path: "/mnt") {
withWorkdir(path: "sub") {
workdir
withMountedDirectory(path: "dir", source: $id) {
withMountedTemp(path: "tmp") {
withMountedCache(path: "cache", cache: $cache) {
mounts
withExec(args: ["touch", "dir/another-file"]) {
directory(path: "dir") {
id
}
}
withoutMount(path: "cache") {
mounts
}
}
}
}
}
}
}
}
}
}`, &writeRes, &testutil.QueryOptions{Variables: map[string]any{
"id": id,
"cache": cacheID,
}})
require.NoError(t, err)
require.Equal(t,
[]string{"/mnt/sub/dir", "/mnt/sub/tmp", "/mnt/sub/cache"},
writeRes.Container.From.WithExec.WithWorkdir.WithWorkdir.WithMountedDirectory.WithMountedTemp.WithMountedCache.Mounts)
require.Equal(t,
[]string{"/mnt/sub/dir", "/mnt/sub/tmp"},
writeRes.Container.From.WithExec.WithWorkdir.WithWorkdir.WithMountedDirectory.WithMountedTemp.WithMountedCache.WithoutMount.Mounts)
writtenID := writeRes.Container.From.WithExec.WithWorkdir.WithWorkdir.WithMountedDirectory.WithMountedTemp.WithMountedCache.WithExec.Directory.ID
execRes := struct {
Container struct {
From struct {
WithMountedDirectory struct {
WithExec struct {
Stdout string
}
}
}
}
}{}
err = testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "`+alpineImage+`") {
withMountedDirectory(path: "/mnt/dir", source: $id) {
withExec(args: ["ls", "/mnt/dir"]) {
stdout
}
}
}
}
}`, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"id": writtenID,
}})
require.NoError(t, err)
require.Equal(t, "another-file\nsome-file\n", execRes.Container.From.WithMountedDirectory.WithExec.Stdout)
}
func TestContainerMultiFrom(t *testing.T) {
t.Parallel()
dirRes := struct {
Directory struct {
ID core.DirectoryID
}
}{}
err := testutil.Query(
`{
directory {
id
}
}`, &dirRes, nil)
require.NoError(t, err)
id := dirRes.Directory.ID
execRes := struct {
Container struct {
From struct {
WithMountedDirectory struct {
WithExec struct {
From struct {
WithExec struct {
WithExec struct {
Stdout string
}
}
}
}
}
}
}
}{}
err = testutil.Query(
`query Test($id: DirectoryID!) {
container {
from(address: "node:18.10.0-alpine") {
withMountedDirectory(path: "/mnt", source: $id) {
withExec(args: ["sh", "-c", "node --version >> /mnt/versions"]) {
from(address: "golang:1.18.2-alpine") {
withExec(args: ["sh", "-c", "go version >> /mnt/versions"]) {
withExec(args: ["cat", "/mnt/versions"]) {
stdout
}
}
}
}
}
}
}
}`, &execRes, &testutil.QueryOptions{Variables: map[string]any{
"id": id,
}})
require.NoError(t, err)
require.Contains(t, execRes.Container.From.WithMountedDirectory.WithExec.From.WithExec.WithExec.Stdout, "v18.10.0\n")
require.Contains(t, execRes.Container.From.WithMountedDirectory.WithExec.From.WithExec.WithExec.Stdout, "go version go1.18.2")
}
func TestContainerPublish(t *testing.T) {
c, ctx := connect(t)
testRef := registryRef("container-publish")
entrypoint := []string{"echo", "im-a-entrypoint"}
ctr := c.Container().From(alpineImage).
WithEntrypoint(entrypoint)
pushedRef, err := ctr.Publish(ctx, testRef)
require.NoError(t, err)
require.NotEqual(t, testRef, pushedRef)
require.Contains(t, pushedRef, "@sha256:")
pulledCtr := c.Container().From(pushedRef)
contents, err := pulledCtr.File("/etc/alpine-release").Contents(ctx)
require.NoError(t, err)
require.Equal(t, contents, "3.18.2\n")
output, err := pulledCtr.WithExec(nil).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "im-a-entrypoint\n", output)
}
func TestExecFromScratch(t *testing.T) {
c, ctx := connect(t)
// execute it from scratch, where there is no default platform, make sure it works and can be pushed
execBusybox := c.Container().
// /bin/busybox is a static binary
WithMountedFile("/busybox", c.Container().From("busybox:musl").File("/bin/busybox")).
WithExec([]string{"/busybox"})
_, err := execBusybox.Stdout(ctx)
require.NoError(t, err)
_, err = execBusybox.Publish(ctx, registryRef("from-scratch"))
require.NoError(t, err)
}
func TestContainerMultipleMounts(t *testing.T) {
c, ctx := connect(t)
dir := t.TempDir()
require.NoError(t, os.WriteFile(filepath.Join(dir, "one"), []byte("1"), 0o600))
require.NoError(t, os.WriteFile(filepath.Join(dir, "two"), []byte("2"), 0o600))
require.NoError(t, os.WriteFile(filepath.Join(dir, "three"), []byte("3"), 0o600))
one := c.Host().Directory(dir).File("one")
two := c.Host().Directory(dir).File("two")
three := c.Host().Directory(dir).File("three")
build := c.Container().From(alpineImage).
WithMountedFile("/example/one", one).
WithMountedFile("/example/two", two).
WithMountedFile("/example/three", three)
build = build.WithExec([]string{"ls", "/example/one", "/example/two", "/example/three"})
build = build.WithExec([]string{"cat", "/example/one", "/example/two", "/example/three"})
out, err := build.Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "123", out)
}
func TestContainerExport(t *testing.T) {
t.Parallel()
wd := t.TempDir()
dest := t.TempDir()
c, ctx := connect(t, dagger.WithWorkdir(wd))
entrypoint := []string{"sh", "-c", "im-a-entrypoint"}
ctr := c.Container().From(alpineImage).
WithEntrypoint(entrypoint)
t.Run("to absolute dir", func(t *testing.T) {
for _, useAsTarball := range []bool{true, false} {
t.Run(fmt.Sprintf("useAsTarball=%t", useAsTarball), func(t *testing.T) {
imagePath := filepath.Join(dest, "image.tar")
if useAsTarball {
tarFile := ctr.AsTarball()
ok, err := tarFile.Export(ctx, imagePath)
require.NoError(t, err)
require.True(t, ok)
} else {
ok, err := ctr.Export(ctx, imagePath)
require.NoError(t, err)
require.True(t, ok)
}
stat, err := os.Stat(imagePath)
require.NoError(t, err)
require.NotZero(t, stat.Size())
require.EqualValues(t, 0o600, stat.Mode().Perm())
entries := tarEntries(t, imagePath)
require.Contains(t, entries, "oci-layout")
require.Contains(t, entries, "index.json")
// a single-platform image includes a manifest.json, making it
// compatible with docker load
require.Contains(t, entries, "manifest.json")
dockerManifestBytes := readTarFile(t, imagePath, "manifest.json")
// NOTE: this is what buildkit integ tests do, use a one-off struct rather than actual defined type
var dockerManifest []struct {
Config string
}
require.NoError(t, json.Unmarshal(dockerManifestBytes, &dockerManifest))
require.Len(t, dockerManifest, 1)
configPath := dockerManifest[0].Config
configBytes := readTarFile(t, imagePath, configPath)
var img ocispecs.Image
require.NoError(t, json.Unmarshal(configBytes, &img))
require.Equal(t, entrypoint, img.Config.Entrypoint)
})
}
})
t.Run("to workdir", func(t *testing.T) {
ok, err := ctr.Export(ctx, "./image.tar")
require.NoError(t, err)
require.True(t, ok)
stat, err := os.Stat(filepath.Join(wd, "image.tar"))
require.NoError(t, err)
require.NotZero(t, stat.Size())
require.EqualValues(t, 0o600, stat.Mode().Perm())
entries := tarEntries(t, filepath.Join(wd, "image.tar"))
require.Contains(t, entries, "oci-layout")
require.Contains(t, entries, "index.json")
require.Contains(t, entries, "manifest.json")
})
t.Run("to subdir", func(t *testing.T) {
ok, err := ctr.Export(ctx, "./foo/image.tar")
require.NoError(t, err)
require.True(t, ok)
entries := tarEntries(t, filepath.Join(wd, "foo", "image.tar"))
require.Contains(t, entries, "oci-layout")
require.Contains(t, entries, "index.json")
require.Contains(t, entries, "manifest.json")
})
t.Run("to outer dir", func(t *testing.T) {
ok, err := ctr.Export(ctx, "../")
require.Error(t, err)
require.False(t, ok)
})
}
// NOTE: more test coverage of Container.AsTarball are in TestContainerExport and TestContainerMultiPlatformExport
func TestContainerAsTarball(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(alpineImage)
output, err := ctr.
WithMountedFile("/foo.tar", ctr.AsTarball()).
WithExec([]string{"apk", "add", "file"}).
WithExec([]string{"file", "/foo.tar"}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "/foo.tar: POSIX tar archive\n", output)
}
func TestContainerImport(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
t.Run("OCI", func(t *testing.T) {
pf, err := c.DefaultPlatform(ctx)
require.NoError(t, err)
platform, err := platforms.Parse(string(pf))
require.NoError(t, err)
config := map[string]any{
"contents": map[string]any{
"keyring": []string{
"https://packages.wolfi.dev/os/wolfi-signing.rsa.pub",
},
"repositories": []string{
"https://packages.wolfi.dev/os",
},
"packages": []string{
"wolfi-base",
},
},
"cmd": "/bin/sh -l",
"environment": map[string]string{
"FOO": "bar",
},
"archs": []string{
platform.Architecture,
},
}
cfgYaml, err := yaml.Marshal(config)
require.NoError(t, err)
apko := c.Container().
From("cgr.dev/chainguard/apko:latest").
WithNewFile("config.yml", dagger.ContainerWithNewFileOpts{
Contents: string(cfgYaml),
})
imageFile := apko.
WithExec([]string{
"build",
"config.yml", "latest", "output.tar",
}).
File("output.tar")
imported := c.Container().Import(imageFile)
out, err := imported.WithExec([]string{"sh", "-c", "echo $FOO"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "bar\n", out)
})
t.Run("Docker", func(t *testing.T) {
out, err := c.Container().
Import(c.Container().From(alpineImage).WithEnvVariable("FOO", "bar").AsTarball(dagger.ContainerAsTarballOpts{
MediaTypes: dagger.Dockermediatypes,
})).
WithExec([]string{"sh", "-c", "echo $FOO"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "bar\n", out)
})
}
func TestContainerFromIDPlatform(t *testing.T) {
c, ctx := connect(t)
var desiredPlatform dagger.Platform = "linux/arm64"
id, err := c.Container(dagger.ContainerOpts{
Platform: desiredPlatform,
}).From(alpineImage).ID(ctx)
require.NoError(t, err)
platform, err := c.Container(dagger.ContainerOpts{
ID: id,
}).Platform(ctx)
require.NoError(t, err)
require.Equal(t, desiredPlatform, platform)
}
func TestContainerMultiPlatformExport(t *testing.T) {
for _, useAsTarball := range []bool{true, false} {
t.Run(fmt.Sprintf("useAsTarball=%t", useAsTarball), func(t *testing.T) {
c, ctx := connect(t)
variants := make([]*dagger.Container, 0, len(platformToUname))
for platform, uname := range platformToUname {
ctr := c.Container(dagger.ContainerOpts{Platform: platform}).
From(alpineImage).
WithExec([]string{"uname", "-m"}).
WithEntrypoint([]string{"echo", uname})
variants = append(variants, ctr)
}
dest := filepath.Join(t.TempDir(), "image.tar")
if useAsTarball {
tarFile := c.Container().AsTarball(dagger.ContainerAsTarballOpts{
PlatformVariants: variants,
})
ok, err := tarFile.Export(ctx, dest)
require.NoError(t, err)
require.True(t, ok)
} else {
ok, err := c.Container().Export(ctx, dest, dagger.ContainerExportOpts{
PlatformVariants: variants,
})
require.NoError(t, err)
require.True(t, ok)
}
entries := tarEntries(t, dest)
require.Contains(t, entries, "oci-layout")
// multi-platform images don't contain a manifest.json
require.NotContains(t, entries, "manifest.json")
indexBytes := readTarFile(t, dest, "index.json")
var index ocispecs.Index
require.NoError(t, json.Unmarshal(indexBytes, &index))
// index is nested (search "nested index" in spec here):
// https://github.com/opencontainers/image-spec/blob/main/image-index.md
nestedIndexDigest := index.Manifests[0].Digest
indexBytes = readTarFile(t, dest, "blobs/sha256/"+nestedIndexDigest.Encoded())
index = ocispecs.Index{}
require.NoError(t, json.Unmarshal(indexBytes, &index))
// make sure all the platforms we expected are there
exportedPlatforms := make(map[string]struct{})
for _, desc := range index.Manifests {
require.NotNil(t, desc.Platform)
platformStr := platforms.Format(*desc.Platform)
exportedPlatforms[platformStr] = struct{}{}
manifestDigest := desc.Digest
manifestBytes := readTarFile(t, dest, "blobs/sha256/"+manifestDigest.Encoded())
var manifest ocispecs.Manifest
require.NoError(t, json.Unmarshal(manifestBytes, &manifest))
configDigest := manifest.Config.Digest
configBytes := readTarFile(t, dest, "blobs/sha256/"+configDigest.Encoded())
var config ocispecs.Image
require.NoError(t, json.Unmarshal(configBytes, &config))
require.Equal(t, []string{"echo", platformToUname[dagger.Platform(platformStr)]}, config.Config.Entrypoint)
}
for platform := range platformToUname {
delete(exportedPlatforms, string(platform))
}
require.Empty(t, exportedPlatforms)
})
}
}
// Multiplatform publish is also tested in more complicated scenarios in platform_test.go
func TestContainerMultiPlatformPublish(t *testing.T) {
c, ctx := connect(t)
variants := make([]*dagger.Container, 0, len(platformToUname))
for platform, uname := range platformToUname {
ctr := c.Container(dagger.ContainerOpts{Platform: platform}).
From(alpineImage).
WithExec([]string{"uname", "-m"}).
WithEntrypoint([]string{"echo", uname})
variants = append(variants, ctr)
}
testRef := registryRef("container-multiplatform-publish")
publishedRef, err := c.Container().Publish(ctx, testRef, dagger.ContainerPublishOpts{
PlatformVariants: variants,
})
require.NoError(t, err)
for platform, uname := range platformToUname {
output, err := c.Container(dagger.ContainerOpts{Platform: platform}).
From(publishedRef).
WithExec(nil).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, uname+"\n", output)
}
}
func TestContainerMultiPlatformImport(t *testing.T) {
c, ctx := connect(t)
variants := make([]*dagger.Container, 0, len(platformToUname))
for platform := range platformToUname {
ctr := c.Container(dagger.ContainerOpts{Platform: platform}).
From(alpineImage)
variants = append(variants, ctr)
}
tmp := t.TempDir()
imagePath := filepath.Join(tmp, "image.tar")
ok, err := c.Container().Export(ctx, imagePath, dagger.ContainerExportOpts{
PlatformVariants: variants,
})
require.NoError(t, err)
require.True(t, ok)
for platform, uname := range platformToUname {
imported := c.Container(dagger.ContainerOpts{Platform: platform}).
Import(c.Host().Directory(tmp).File("image.tar"))
out, err := imported.WithExec([]string{"uname", "-m"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, uname+"\n", out)
}
}
func TestContainerWithDirectoryToMount(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mnt := c.Directory().
WithNewDirectory("/top/sub-dir/sub-file").
Directory("/top") // <-- the important part!
ctr := c.Container().
From(alpineImage).
WithMountedDirectory("/mnt", mnt)
dir := c.Directory().
WithNewFile("/copied-file", "some-content")
ctr = ctr.WithDirectory("/mnt/sub-dir/copied-dir", dir)
contents, err := ctr.WithExec([]string{"find", "/mnt"}).Stdout(ctx)
require.NoError(t, err)
require.ElementsMatch(t, []string{
"/mnt",
"/mnt/sub-dir",
"/mnt/sub-dir/sub-file",
"/mnt/sub-dir/copied-dir",
"/mnt/sub-dir/copied-dir/copied-file",
}, strings.Split(strings.Trim(contents, "\n"), "\n"))
}
func TestContainerExecError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
outMsg := "THIS SHOULD GO TO STDOUT"
encodedOutMsg := base64.StdEncoding.EncodeToString([]byte(outMsg))
errMsg := "THIS SHOULD GO TO STDERR"
encodedErrMsg := base64.StdEncoding.EncodeToString([]byte(errMsg))
t.Run("includes output of failed exec in error", func(t *testing.T) {
_, err := c.Container().
From(alpineImage).
WithExec([]string{"sh", "-c", fmt.Sprintf(
`echo %s | base64 -d >&1; echo %s | base64 -d >&2; exit 1`, encodedOutMsg, encodedErrMsg,
)}).
Sync(ctx)
var exErr *dagger.ExecError
require.ErrorAs(t, err, &exErr)
require.Equal(t, outMsg, exErr.Stdout)
require.Equal(t, errMsg, exErr.Stderr)
})
t.Run("includes output of failed exec in error when redirects are enabled", func(t *testing.T) {
_, err := c.Container().
From(alpineImage).
WithExec(
[]string{"sh", "-c", fmt.Sprintf(
`echo %s | base64 -d >&1; echo %s | base64 -d >&2; exit 1`, encodedOutMsg, encodedErrMsg,
)},
dagger.ContainerWithExecOpts{
RedirectStdout: "/out",
RedirectStderr: "/err",
},
).
Sync(ctx)
var exErr *dagger.ExecError
require.ErrorAs(t, err, &exErr)
require.Equal(t, outMsg, exErr.Stdout)
require.Equal(t, errMsg, exErr.Stderr)
})
t.Run("truncates output past a maximum size", func(t *testing.T) {
// fill a byte buffer with a string that is slightly over the size of the max output
// size, then base64 encode it
var stdoutBuf bytes.Buffer
for i := 0; i < buildkit.MaxExecErrorOutputBytes+50; i++ {
stdoutBuf.WriteByte('a')
}
stdoutStr := stdoutBuf.String()
encodedOutMsg := base64.StdEncoding.EncodeToString(stdoutBuf.Bytes())
var stderrBuf bytes.Buffer
for i := 0; i < buildkit.MaxExecErrorOutputBytes+50; i++ {
stderrBuf.WriteByte('b')
}
stderrStr := stderrBuf.String()
encodedErrMsg := base64.StdEncoding.EncodeToString(stderrBuf.Bytes())
truncMsg := fmt.Sprintf(buildkit.TruncationMessage, 50)
_, err := c.Container().
From(alpineImage).
WithDirectory("/", c.Directory().
WithNewFile("encout", encodedOutMsg).
WithNewFile("encerr", encodedErrMsg),
).
WithExec([]string{"sh", "-c", "base64 -d encout >&1; base64 -d encerr >&2; exit 1"}).
Sync(ctx)
var exErr *dagger.ExecError
require.ErrorAs(t, err, &exErr)
require.Equal(t, truncMsg+stdoutStr[:buildkit.MaxExecErrorOutputBytes-len(truncMsg)], exErr.Stdout)
require.Equal(t, truncMsg+stderrStr[:buildkit.MaxExecErrorOutputBytes-len(truncMsg)], exErr.Stderr)
})
}
func TestContainerWithRegistryAuth(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
testRef := privateRegistryRef("container-with-registry-auth")
container := c.Container().From(alpineImage)
// Push without credentials should fail
_, err := container.Publish(ctx, testRef)
require.Error(t, err)
pushedRef, err := container.
WithRegistryAuth(
privateRegistryHost,
"john",
c.SetSecret("this-secret", "xFlejaPdjrt25Dvr"),
).
Publish(ctx, testRef)
require.NoError(t, err)
require.NotEqual(t, testRef, pushedRef)
require.Contains(t, pushedRef, "@sha256:")
}
func TestContainerImageRef(t *testing.T) {
t.Parallel()
t.Run("should test query returning imageRef", func(t *testing.T) {
res := struct {
Container struct {
From struct {
ImageRef string
}
}
}{}
err := testutil.Query(
`{
container {
from(address: "`+alpineImage+`") {
imageRef
}
}
}`, &res, nil)
require.NoError(t, err)
require.Contains(t, res.Container.From.ImageRef, "docker.io/library/alpine:3.18.2@sha256:")
})
t.Run("should throw error after the container image modification with exec", func(t *testing.T) {
res := struct {
Container struct {
From struct {
ImageRef string
}
}
}{}
err := testutil.Query(
`{
container {
from(address:"hello-world") {
withExec(args:["/hello"]) {
imageRef
}
}
}
}`, &res, nil)
require.Error(t, err)
require.Contains(t, err.Error(), "Image reference can only be retrieved immediately after the 'Container.From' call. Error in fetching imageRef as the container image is changed")
})
t.Run("should throw error after the container image modification with exec", func(t *testing.T) {
res := struct {
Container struct {
From struct {
ImageRef string
}
}
}{}
err := testutil.Query(
`{
container {
from(address:"hello-world") {
withExec(args:["/hello"]) {
imageRef
}
}
}
}`, &res, nil)
require.Error(t, err)
require.Contains(t, err.Error(), "Image reference can only be retrieved immediately after the 'Container.From' call. Error in fetching imageRef as the container image is changed")
})
t.Run("should throw error after the container image modification with directory", func(t *testing.T) {
c, ctx := connect(t)
dir := c.Directory().
WithNewFile("some-file", "some-content").
WithNewFile("some-dir/sub-file", "sub-content").
Directory("some-dir")
ctr := c.Container().
From(alpineImage).
WithWorkdir("/workdir").
WithDirectory("with-dir", dir)
_, err := ctr.ImageRef(ctx)
require.Error(t, err)
require.Contains(t, err.Error(), "Image reference can only be retrieved immediately after the 'Container.From' call. Error in fetching imageRef as the container image is changed")
})
}
func TestContainerBuildNilContextError(t *testing.T) {
t.Parallel()
// regression test, this previously caused the engine to panic
err := testutil.Query(
`{
container {
build(context: "") {
id
}
}
}`, &map[any]any{}, nil)
require.ErrorContains(t, err, "cannot decode empty string as ID")
}
func TestContainerInsecureRootCapabilites(t *testing.T) {
c, ctx := connect(t)
// This isn't exhaustive, but it's the major important ones. Being exhaustive
// is trickier since the full list of caps is host dependent based on the kernel version.
privilegedCaps := []string{
"cap_sys_admin",
"cap_net_admin",
"cap_sys_module",
"cap_sys_ptrace",
"cap_sys_boot",
"cap_sys_rawio",
"cap_sys_resource",
}
for _, capSet := range []string{"CapPrm", "CapEff", "CapBnd"} {
out, err := c.Container().From(alpineImage).
WithExec([]string{"apk", "add", "libcap"}).
WithExec([]string{"sh", "-c", "capsh --decode=$(grep " + capSet + " /proc/self/status | awk '{print $2}')"}).
Stdout(ctx)
require.NoError(t, err)
for _, privCap := range privilegedCaps {
require.NotContains(t, out, privCap)
}
}
for _, capSet := range []string{"CapPrm", "CapEff", "CapBnd", "CapInh", "CapAmb"} {
out, err := c.Container().From(alpineImage).
WithExec([]string{"apk", "add", "libcap"}).
WithExec([]string{"sh", "-c", "capsh --decode=$(grep " + capSet + " /proc/self/status | awk '{print $2}')"}, dagger.ContainerWithExecOpts{
InsecureRootCapabilities: true,
}).
Stdout(ctx)
require.NoError(t, err)
for _, privCap := range privilegedCaps {
require.Contains(t, out, privCap)
}
}
}
func TestContainerInsecureRootCapabilitesWithService(t *testing.T) {
c, ctx := connect(t)
// verify the root capabilities setting works by executing dockerd with it and
// testing it can startup, create containers and bind mount from its filesystem to
// them.
dockerd := c.Container().From("docker:23.0.1-dind").
WithMountedCache("/var/lib/docker", c.CacheVolume("docker-lib"), dagger.ContainerWithMountedCacheOpts{
Sharing: dagger.Private,
}).
WithMountedCache("/tmp", c.CacheVolume("share-tmp")).
WithExposedPort(2375).
WithExec([]string{
"dockerd",
"--host=tcp://0.0.0.0:2375",
"--tls=false",
}, dagger.ContainerWithExecOpts{
InsecureRootCapabilities: true,
}).AsService()
dockerHost, err := dockerd.Endpoint(ctx, dagger.ServiceEndpointOpts{
Scheme: "tcp",
})
require.NoError(t, err)
randID := identity.NewID()
out, err := c.Container().From("docker:23.0.1-cli").
WithMountedCache("/tmp", c.CacheVolume("share-tmp")).
WithServiceBinding("docker", dockerd).
WithEnvVariable("DOCKER_HOST", dockerHost).
WithExec([]string{"sh", "-e", "-c", strings.Join([]string{
fmt.Sprintf("echo %s-from-outside > /tmp/from-outside", randID),
"docker run --rm -v /tmp:/tmp alpine cat /tmp/from-outside",
fmt.Sprintf("docker run --rm -v /tmp:/tmp alpine sh -c 'echo %s-from-inside > /tmp/from-inside'", randID),
"cat /tmp/from-inside",
}, "\n")}).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, fmt.Sprintf("%s-from-outside\n%s-from-inside\n", randID, randID), out)
}
func TestContainerNoExec(t *testing.T) {
c, ctx := connect(t)
stdout, err := c.Container().From(alpineImage).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "", stdout)
stderr, err := c.Container().From(alpineImage).Stderr(ctx)
require.NoError(t, err)
require.Equal(t, "", stderr)
_, err = c.Container().
From(alpineImage).
WithoutDefaultArgs().
Stdout(ctx)
require.Error(t, err)
require.Contains(t, err.Error(), "no command has been set")
}
func TestContainerWithMountedFileOwner(t *testing.T) {
c, ctx := connect(t)
t.Run("simple file", func(t *testing.T) {
tmp := t.TempDir()
err := os.WriteFile(filepath.Join(tmp, "message.txt"), []byte("hello world"), 0o600)
require.NoError(t, err)
file := c.Host().Directory(tmp).File("message.txt")
testOwnership(ctx, t, c, func(ctr *dagger.Container, name string, owner string) *dagger.Container {
return ctr.WithMountedFile(name, file, dagger.ContainerWithMountedFileOpts{
Owner: owner,
})
})
})
t.Run("file from subdirectory", func(t *testing.T) {
tmp := t.TempDir()
err := os.Mkdir(filepath.Join(tmp, "subdir"), 0o755)
require.NoError(t, err)
err = os.WriteFile(filepath.Join(tmp, "subdir", "message.txt"), []byte("hello world"), 0o600)
require.NoError(t, err)
file := c.Host().Directory(tmp).Directory("subdir").File("message.txt")
testOwnership(ctx, t, c, func(ctr *dagger.Container, name string, owner string) *dagger.Container {
return ctr.WithMountedFile(name, file, dagger.ContainerWithMountedFileOpts{
Owner: owner,
})
})
})
}
func TestContainerWithMountedDirectoryOwner(t *testing.T) {
c, ctx := connect(t)
t.Run("simple directory", func(t *testing.T) {
tmp := t.TempDir()
err := os.WriteFile(filepath.Join(tmp, "message.txt"), []byte("hello world"), 0o600)
require.NoError(t, err)
dir := c.Host().Directory(tmp)
testOwnership(ctx, t, c, func(ctr *dagger.Container, name string, owner string) *dagger.Container {
return ctr.WithMountedDirectory(name, dir, dagger.ContainerWithMountedDirectoryOpts{
Owner: owner,
})
})
})
t.Run("subdirectory", func(t *testing.T) {
tmp := t.TempDir()
err := os.Mkdir(filepath.Join(tmp, "subdir"), 0o755)
require.NoError(t, err)
err = os.WriteFile(filepath.Join(tmp, "subdir", "message.txt"), []byte("hello world"), 0o600)
require.NoError(t, err)
dir := c.Host().Directory(tmp).Directory("subdir")
testOwnership(ctx, t, c, func(ctr *dagger.Container, name string, owner string) *dagger.Container {
return ctr.WithMountedDirectory(name, dir, dagger.ContainerWithMountedDirectoryOpts{
Owner: owner,
})
})
})
t.Run("permissions", func(t *testing.T) {
dir := c.Directory().
WithNewDirectory("perms", dagger.DirectoryWithNewDirectoryOpts{
Permissions: 0o745,
}).
WithNewFile("perms/foo", "whee", dagger.DirectoryWithNewFileOpts{
Permissions: 0o645,
}).
Directory("perms")
ctr := c.Container().From(alpineImage).
WithExec([]string{"adduser", "-D", "inherituser"}).
WithExec([]string{"adduser", "-u", "1234", "-D", "auser"}).
WithExec([]string{"addgroup", "-g", "4321", "agroup"}).
WithUser("inherituser").
WithMountedDirectory("/data", dir, dagger.ContainerWithMountedDirectoryOpts{
Owner: "auser:agroup",
})
out, err := ctr.WithExec([]string{"stat", "-c", "%a:%U:%G", "/data"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "745:auser:agroup\n", out)
out, err = ctr.WithExec([]string{"stat", "-c", "%a:%U:%G", "/data/foo"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "645:auser:agroup\n", out)
})
}
func TestContainerWithFileOwner(t *testing.T) {
c, ctx := connect(t)
t.Run("simple file", func(t *testing.T) {
tmp := t.TempDir()
err := os.WriteFile(filepath.Join(tmp, "message.txt"), []byte("hello world"), 0o600)
require.NoError(t, err)
file := c.Host().Directory(tmp).File("message.txt")
testOwnership(ctx, t, c, func(ctr *dagger.Container, name string, owner string) *dagger.Container {
return ctr.WithFile(name, file, dagger.ContainerWithFileOpts{
Owner: owner,
})
})
})
t.Run("file from subdirectory", func(t *testing.T) {
tmp := t.TempDir()
err := os.Mkdir(filepath.Join(tmp, "subdir"), 0o755)
require.NoError(t, err)
err = os.WriteFile(filepath.Join(tmp, "subdir", "message.txt"), []byte("hello world"), 0o600)
require.NoError(t, err)
file := c.Host().Directory(tmp).Directory("subdir").File("message.txt")
testOwnership(ctx, t, c, func(ctr *dagger.Container, name string, owner string) *dagger.Container {
return ctr.WithFile(name, file, dagger.ContainerWithFileOpts{
Owner: owner,
})
})
})
}
func TestContainerWithDirectoryOwner(t *testing.T) {
c, ctx := connect(t)
t.Run("simple directory", func(t *testing.T) {
tmp := t.TempDir()
err := os.WriteFile(filepath.Join(tmp, "message.txt"), []byte("hello world"), 0o600)
require.NoError(t, err)
dir := c.Host().Directory(tmp)
testOwnership(ctx, t, c, func(ctr *dagger.Container, name string, owner string) *dagger.Container {
return ctr.WithDirectory(name, dir, dagger.ContainerWithDirectoryOpts{
Owner: owner,
})
})
})
t.Run("subdirectory", func(t *testing.T) {
tmp := t.TempDir()
err := os.Mkdir(filepath.Join(tmp, "subdir"), 0o755)
require.NoError(t, err)
err = os.WriteFile(filepath.Join(tmp, "subdir", "message.txt"), []byte("hello world"), 0o600)
require.NoError(t, err)
dir := c.Host().Directory(tmp).Directory("subdir")
testOwnership(ctx, t, c, func(ctr *dagger.Container, name string, owner string) *dagger.Container {
return ctr.WithDirectory(name, dir, dagger.ContainerWithDirectoryOpts{
Owner: owner,
})
})
})
}
func TestContainerWithNewFileOwner(t *testing.T) {
c, ctx := connect(t)
testOwnership(ctx, t, c, func(ctr *dagger.Container, name string, owner string) *dagger.Container {
return ctr.WithNewFile(name, dagger.ContainerWithNewFileOpts{
Owner: owner,
})
})
}
func TestContainerWithMountedCacheOwner(t *testing.T) {
c, ctx := connect(t)
cache := c.CacheVolume("test")
testOwnership(ctx, t, c, func(ctr *dagger.Container, name string, owner string) *dagger.Container {
return ctr.WithMountedCache(name, cache, dagger.ContainerWithMountedCacheOpts{
Owner: owner,
})
})
t.Run("permissions (empty)", func(t *testing.T) {
ctr := c.Container().From(alpineImage).
WithExec([]string{"adduser", "-D", "inherituser"}).
WithExec([]string{"adduser", "-u", "1234", "-D", "auser"}).
WithExec([]string{"addgroup", "-g", "4321", "agroup"}).
WithUser("inherituser").
WithMountedCache("/data", cache, dagger.ContainerWithMountedCacheOpts{
Owner: "auser:agroup",
})
out, err := ctr.WithExec([]string{"stat", "-c", "%a:%U:%G", "/data"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "755:auser:agroup\n", out)
})
t.Run("permissions (source)", func(t *testing.T) {
dir := c.Directory().
WithNewDirectory("perms", dagger.DirectoryWithNewDirectoryOpts{
Permissions: 0o745,
}).
WithNewFile("perms/foo", "whee", dagger.DirectoryWithNewFileOpts{
Permissions: 0o645,
}).
Directory("perms")
ctr := c.Container().From(alpineImage).
WithExec([]string{"adduser", "-D", "inherituser"}).
WithExec([]string{"adduser", "-u", "1234", "-D", "auser"}).
WithExec([]string{"addgroup", "-g", "4321", "agroup"}).
WithUser("inherituser").
WithMountedCache("/data", cache, dagger.ContainerWithMountedCacheOpts{
Source: dir,
Owner: "auser:agroup",
})
out, err := ctr.WithExec([]string{"stat", "-c", "%a:%U:%G", "/data"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "745:auser:agroup\n", out)
out, err = ctr.WithExec([]string{"stat", "-c", "%a:%U:%G", "/data/foo"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "645:auser:agroup\n", out)
})
}
func TestContainerWithMountedSecretOwner(t *testing.T) {
c, ctx := connect(t)
secret := c.SetSecret("test", "hunter2")
testOwnership(ctx, t, c, func(ctr *dagger.Container, name string, owner string) *dagger.Container {
return ctr.WithMountedSecret(name, secret, dagger.ContainerWithMountedSecretOpts{
Owner: owner,
})
})
}
func TestContainerParallelMutation(t *testing.T) {
t.Parallel()
res := struct {
Container struct {
A struct {
EnvVariable string
}
B string
}
}{}
err := testutil.Query(
`{
container {
a: withEnvVariable(name: "FOO", value: "BAR") {
envVariable(name: "FOO")
}
b: envVariable(name: "FOO")
}
}`, &res, nil)
require.NoError(t, err)
require.Equal(t, res.Container.A.EnvVariable, "BAR")
require.Empty(t, res.Container.B, "BAR")
}
func TestContainerForceCompression(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
compression dagger.ImageLayerCompression
expectedOCIMediaType string
}{
{
dagger.Gzip,
"application/vnd.oci.image.layer.v1.tar+gzip",
},
{
dagger.Zstd,
"application/vnd.oci.image.layer.v1.tar+zstd",
},
{
dagger.Uncompressed,
"application/vnd.oci.image.layer.v1.tar",
},
{
dagger.Estargz,
"application/vnd.oci.image.layer.v1.tar+gzip",
},
} {
tc := tc
t.Run(string(tc.compression), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ref := registryRef("testcontainerpublishforcecompression" + strings.ToLower(string(tc.compression)))
_, err := c.Container().
From(alpineImage).
Publish(ctx, ref, dagger.ContainerPublishOpts{
ForcedCompression: tc.compression,
})
require.NoError(t, err)
parsedRef, err := name.ParseReference(ref, name.Insecure)
require.NoError(t, err)
imgDesc, err := remote.Get(parsedRef, remote.WithTransport(http.DefaultTransport))
require.NoError(t, err)
img, err := imgDesc.Image()
require.NoError(t, err)
layers, err := img.Layers()
require.NoError(t, err)
for _, layer := range layers {
mediaType, err := layer.MediaType()
require.NoError(t, err)
require.EqualValues(t, tc.expectedOCIMediaType, mediaType)
}
tarPath := filepath.Join(t.TempDir(), "export.tar")
_, err = c.Container().
From(alpineImage).
Export(ctx, tarPath, dagger.ContainerExportOpts{
ForcedCompression: tc.compression,
})
require.NoError(t, err)
// check that docker compatible manifest is present
dockerManifestBytes := readTarFile(t, tarPath, "manifest.json")
require.NotNil(t, dockerManifestBytes)
indexBytes := readTarFile(t, tarPath, "index.json")
var index ocispecs.Index
require.NoError(t, json.Unmarshal(indexBytes, &index))
manifestDigest := index.Manifests[0].Digest
manifestBytes := readTarFile(t, tarPath, "blobs/sha256/"+manifestDigest.Encoded())
var manifest ocispecs.Manifest
require.NoError(t, json.Unmarshal(manifestBytes, &manifest))
for _, layer := range manifest.Layers {
require.EqualValues(t, tc.expectedOCIMediaType, layer.MediaType)
}
})
}
}
func TestContainerMediaTypes(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
mediaTypes dagger.ImageMediaTypes
expectedOCIMediaType string
}{
{
"", // use default
"application/vnd.oci.image.layer.v1.tar+gzip",
},
{
dagger.Ocimediatypes,
"application/vnd.oci.image.layer.v1.tar+gzip",
},
{
dagger.Dockermediatypes,
"application/vnd.docker.image.rootfs.diff.tar.gzip",
},
} {
tc := tc
t.Run(string(tc.mediaTypes), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ref := registryRef("testcontainerpublishmediatypes" + strings.ToLower(string(tc.mediaTypes)))
_, err := c.Container().
From(alpineImage).
Publish(ctx, ref, dagger.ContainerPublishOpts{
MediaTypes: tc.mediaTypes,
})
require.NoError(t, err)
parsedRef, err := name.ParseReference(ref, name.Insecure)
require.NoError(t, err)
imgDesc, err := remote.Get(parsedRef, remote.WithTransport(http.DefaultTransport))
require.NoError(t, err)
img, err := imgDesc.Image()
require.NoError(t, err)
layers, err := img.Layers()
require.NoError(t, err)
for _, layer := range layers {
mediaType, err := layer.MediaType()
require.NoError(t, err)
require.EqualValues(t, tc.expectedOCIMediaType, mediaType)
}
for _, useAsTarball := range []bool{true, false} {
useAsTarball := useAsTarball
t.Run(fmt.Sprintf("useAsTarball=%t", useAsTarball), func(t *testing.T) {
t.Parallel()
tarPath := filepath.Join(t.TempDir(), "export.tar")
if useAsTarball {
_, err := c.Container().
From(alpineImage).
AsTarball(dagger.ContainerAsTarballOpts{
MediaTypes: tc.mediaTypes,
}).
Export(ctx, tarPath)
require.NoError(t, err)
} else {
_, err := c.Container().
From(alpineImage).
Export(ctx, tarPath, dagger.ContainerExportOpts{
MediaTypes: tc.mediaTypes,
})
require.NoError(t, err)
}
// check that docker compatible manifest is present
dockerManifestBytes := readTarFile(t, tarPath, "manifest.json")
require.NotNil(t, dockerManifestBytes)
indexBytes := readTarFile(t, tarPath, "index.json")
var index ocispecs.Index
require.NoError(t, json.Unmarshal(indexBytes, &index))
manifestDigest := index.Manifests[0].Digest
manifestBytes := readTarFile(t, tarPath, "blobs/sha256/"+manifestDigest.Encoded())
var manifest ocispecs.Manifest
require.NoError(t, json.Unmarshal(manifestBytes, &manifest))
for _, layer := range manifest.Layers {
require.EqualValues(t, tc.expectedOCIMediaType, layer.MediaType)
}
})
}
})
}
}
func TestContainerBuildMergesWithParent(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
// Create a builder container
builderCtr := c.Directory().WithNewFile("Dockerfile",
`FROM `+alpineImage+`
ENV FOO=BAR
LABEL "com.example.test-should-replace"="foo"
EXPOSE 8080
`,
)
// Create a container with envs variables and labels
testCtr := c.Container().
WithEnvVariable("BOOL", "DOG").
WithEnvVariable("FOO", "BAZ").
WithLabel("com.example.test-should-exist", "test").
WithLabel("com.example.test-should-replace", "bar").
WithExposedPort(5000, dagger.ContainerWithExposedPortOpts{
Description: "five thousand",
}).
Build(builderCtr)
envShouldExist, err := testCtr.EnvVariable(ctx, "BOOL")
require.NoError(t, err)
require.Equal(t, "DOG", envShouldExist)
envShouldBeReplaced, err := testCtr.EnvVariable(ctx, "FOO")
require.NoError(t, err)
require.Equal(t, "BAR", envShouldBeReplaced)
labelShouldExist, err := testCtr.Label(ctx, "com.example.test-should-exist")
require.NoError(t, err)
require.Equal(t, "test", labelShouldExist)
labelShouldBeReplaced, err := testCtr.Label(ctx, "com.example.test-should-replace")
require.NoError(t, err)
require.Equal(t, "foo", labelShouldBeReplaced)
// FIXME: Pretty clunky to work with lists of objects from the SDK
// so test the exposed ports with a query string for now.
cid, err := testCtr.ID(ctx)
require.NoError(t, err)
res := struct {
Container struct {
ExposedPorts []core.Port
}
}{}
err = testutil.Query(`
query Test($id: ContainerID!) {
container(id: $id) {
exposedPorts {
port
protocol
description
}
}
}`,
&res,
&testutil.QueryOptions{
Variables: map[string]interface{}{
"id": cid,
},
},
)
require.NoError(t, err)
require.Len(t, res.Container.ExposedPorts, 2)
// random order since ImageConfig.ExposedPorts is a map
for _, p := range res.Container.ExposedPorts {
require.Equal(t, core.NetworkProtocolTCP, p.Protocol)
switch p.Port {
case 8080:
require.Nil(t, p.Description)
case 5000:
require.NotNil(t, p.Description)
require.Equal(t, "five thousand", *p.Description)
default:
t.Fatalf("unexpected port %d", p.Port)
}
}
}
func TestContainerFromMergesWithParent(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
// Create a container with envs and pull alpine image on it
testCtr := c.Container().
WithEnvVariable("FOO", "BAR").
WithEnvVariable("PATH", "/replace/me").
WithLabel("moby.buildkit.frontend.caps", "replace-me").
WithLabel("com.example.test-should-exist", "exist").
WithExposedPort(5000).
From("docker/dockerfile:1.5")
envShouldExist, err := testCtr.EnvVariable(ctx, "FOO")
require.NoError(t, err)
require.Equal(t, "BAR", envShouldExist)
envShouldBeReplaced, err := testCtr.EnvVariable(ctx, "PATH")
require.NoError(t, err)
require.Equal(t, "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", envShouldBeReplaced)
labelShouldExist, err := testCtr.Label(ctx, "com.example.test-should-exist")
require.NoError(t, err)
require.Equal(t, "exist", labelShouldExist)
existingLabelFromImageShouldExist, err := testCtr.Label(ctx, "moby.buildkit.frontend.network.none")
require.NoError(t, err)
require.Equal(t, "true", existingLabelFromImageShouldExist)
labelShouldBeReplaced, err := testCtr.Label(ctx, "moby.buildkit.frontend.caps")
require.NoError(t, err)
require.Equal(t, "moby.buildkit.frontend.inputs,moby.buildkit.frontend.subrequests,moby.buildkit.frontend.contexts", labelShouldBeReplaced)
ports, err := testCtr.ExposedPorts(ctx)
require.NoError(t, err)
port, err := ports[0].Port(ctx)
require.NoError(t, err)
require.Equal(t, 5000, port)
}
func TestContainerImageLoadCompatibility(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
for i, dockerVersion := range []string{"20.10", "23.0", "24.0"} {
dockerVersion := dockerVersion
port := 2375 + i
dockerd := c.Container().From(fmt.Sprintf("docker:%s-dind", dockerVersion)).
WithMountedCache("/var/lib/docker", c.CacheVolume(t.Name()+"-"+dockerVersion+"-docker-lib"), dagger.ContainerWithMountedCacheOpts{
Sharing: dagger.Private,
}).
WithExposedPort(port).
WithExec([]string{
"dockerd",
"--host=tcp://0.0.0.0:" + strconv.Itoa(port),
"--tls=false",
}, dagger.ContainerWithExecOpts{
InsecureRootCapabilities: true,
}).
AsService()
dockerHost, err := dockerd.Endpoint(ctx, dagger.ServiceEndpointOpts{
Scheme: "tcp",
})
require.NoError(t, err)
for _, mediaType := range []dagger.ImageMediaTypes{dagger.Ocimediatypes, dagger.Dockermediatypes} {
mediaType := mediaType
for _, compression := range []dagger.ImageLayerCompression{dagger.Gzip, dagger.Zstd, dagger.Uncompressed} {
compression := compression
t.Run(fmt.Sprintf("%s-%s-%s-%s", t.Name(), dockerVersion, mediaType, compression), func(t *testing.T) {
t.Parallel()
tmpdir := t.TempDir()
tmpfile := filepath.Join(tmpdir, fmt.Sprintf("test-%s-%s-%s.tar", dockerVersion, mediaType, compression))
_, err := c.Container().From(alpineImage).
// we need a unique image, otherwise docker load skips it after the first tar load
WithExec([]string{"sh", "-c", "echo '" + string(compression) + string(mediaType) + "' > /foo"}).
Export(ctx, tmpfile, dagger.ContainerExportOpts{
MediaTypes: mediaType,
ForcedCompression: compression,
})
require.NoError(t, err)
randID := identity.NewID()
ctr := c.Container().From(fmt.Sprintf("docker:%s-cli", dockerVersion)).
WithEnvVariable("CACHEBUST", randID).
WithServiceBinding("docker", dockerd).
WithEnvVariable("DOCKER_HOST", dockerHost).
WithMountedFile(path.Join("/", path.Base(tmpfile)), c.Host().File(tmpfile)).
WithExec([]string{"docker", "load", "-i", "/" + path.Base(tmpfile)})
output, err := ctr.Stdout(ctx)
if dockerVersion == "20.10" && compression == dagger.Zstd {
// zstd support in docker wasn't added until 23, so sanity check that it fails
require.Error(t, err)
} else {
require.NoError(t, err)
_, imageID, ok := strings.Cut(output, "sha256:")
require.True(t, ok)
imageID = strings.TrimSpace(imageID)
_, err = ctr.WithExec([]string{"docker", "run", "--rm", imageID, "echo", "hello"}).Sync(ctx)
require.NoError(t, err)
}
// also check that buildkit can load+run it too
_, err = c.Container().
Import(c.Host().File(tmpfile)).
WithExec([]string{"echo", "hello"}).
Sync(ctx)
require.NoError(t, err)
})
}
}
}
}
func TestContainerWithMountedSecretMode(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
t.Cleanup(func() { c.Close() })
secret := c.SetSecret("test", "secret")
ctr := c.Container().From(alpineImage).WithMountedSecret("/secret", secret, dagger.ContainerWithMountedSecretOpts{
Mode: 0o666,
Owner: "root:root",
})
perms, err := ctr.WithExec([]string{"sh", "-c", "stat /secret "}).Stdout(ctx)
require.Contains(t, perms, "0666/-rw-rw-rw-")
require.NoError(t, err)
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,430 | 🐞 Service stop semantics work differently between SDK and Modules | ### What is the issue?
Initially repoted by @matipan here: https://discord.com/channels/707636530424053791/1120503349599543376/1196809237150584995
Given the current function
```go
func (m *Foo) Nginx(ctx context.Context) error {
svc := dag.Container().
From("nginx").
WithExposedPort(80).
AsService()
tunnel, err := dag.Host().Tunnel(svc).Start(ctx)
if err != nil {
return err
}
defer tunnel.Stop(ctx)
endpoint, err := tunnel.Endpoint(ctx)
if err != nil {
return err
}
res, err := http.Get("http://" + endpoint + "/")
if err != nil {
return err
}
defer res.Body.Close()
io.Copy(os.Stdout, res.Body)
return nil
}
```
upon calling `dagger call nginx`, dagger will hang for a long time in the `defer tunnel.Stop(ctx)` call. If instead of just stopping the tunnel, we stop both the service and the tunnel in the defer function, this works as intended.
This doesn't happen while using the SDK directly without modules, the `defer` statement described in the example returns immediately.
### Dagger version
v0.9.6
### Steps to reproduce
Run the snippet above withing a context of a module.
### Log output
_No response_ | https://github.com/dagger/dagger/issues/6430 | https://github.com/dagger/dagger/pull/6518 | 8483a5e7ace6174c60e37ba395ddd1ad9b849c1e | 6982b28be3c7b40fb5b5dae70601077f27bae1b8 | "2024-01-16T14:58:22Z" | go | "2024-01-29T19:37:23Z" | engine/buildkit/client.go | package buildkit
import (
"context"
"encoding/json"
"errors"
"fmt"
"net"
"strings"
"sync"
"time"
"github.com/dagger/dagger/auth"
"github.com/dagger/dagger/engine"
"github.com/dagger/dagger/engine/session"
bkcache "github.com/moby/buildkit/cache"
bkcacheconfig "github.com/moby/buildkit/cache/config"
"github.com/moby/buildkit/cache/remotecache"
bkclient "github.com/moby/buildkit/client"
"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/executor/oci"
bkfrontend "github.com/moby/buildkit/frontend"
bkgw "github.com/moby/buildkit/frontend/gateway/client"
bkcontainer "github.com/moby/buildkit/frontend/gateway/container"
"github.com/moby/buildkit/identity"
bksession "github.com/moby/buildkit/session"
bksecrets "github.com/moby/buildkit/session/secrets"
bksolver "github.com/moby/buildkit/solver"
"github.com/moby/buildkit/solver/llbsolver"
bksolverpb "github.com/moby/buildkit/solver/pb"
solverresult "github.com/moby/buildkit/solver/result"
"github.com/moby/buildkit/util/bklog"
"github.com/moby/buildkit/util/entitlements"
bkworker "github.com/moby/buildkit/worker"
"github.com/opencontainers/go-digest"
"golang.org/x/sync/errgroup"
"google.golang.org/grpc/metadata"
)
const (
// from buildkit, cannot change
entitlementsJobKey = "llb.entitlements"
)
type Opts struct {
Worker bkworker.Worker
SessionManager *bksession.Manager
LLBSolver *llbsolver.Solver
GenericSolver *bksolver.Solver
SecretStore bksecrets.SecretStore
AuthProvider *auth.RegistryAuthProvider
PrivilegedExecEnabled bool
UpstreamCacheImports []bkgw.CacheOptionsEntry
// MainClientCaller is the caller who initialized the server associated with this
// client. It is special in that when it shuts down, the client will be closed and
// that registry auth and sockets are currently only ever sourced from this caller,
// not any nested clients (may change in future).
MainClientCaller bksession.Caller
DNSConfig *oci.DNSConfig
}
type ResolveCacheExporterFunc func(ctx context.Context, g bksession.Group) (remotecache.Exporter, error)
// Client is dagger's internal interface to buildkit APIs
type Client struct {
Opts
session *bksession.Session
job *bksolver.Job
llbBridge bkfrontend.FrontendLLBBridge
clientMu sync.RWMutex
clientIDToSecretToken map[string]string
refs map[*ref]struct{}
refsMu sync.Mutex
containers map[bkgw.Container]struct{}
containersMu sync.Mutex
dialer *net.Dialer
closeCtx context.Context
cancel context.CancelFunc
closeMu sync.RWMutex
execMetadata map[digest.Digest]ContainerExecUncachedMetadata
execMetadataMu sync.Mutex
}
func NewClient(ctx context.Context, opts Opts) (*Client, error) {
closeCtx, cancel := context.WithCancel(context.Background())
client := &Client{
Opts: opts,
clientIDToSecretToken: make(map[string]string),
refs: make(map[*ref]struct{}),
containers: make(map[bkgw.Container]struct{}),
closeCtx: closeCtx,
cancel: cancel,
execMetadata: make(map[digest.Digest]ContainerExecUncachedMetadata),
}
session, err := client.newSession(ctx)
if err != nil {
return nil, err
}
client.session = session
job, err := client.GenericSolver.NewJob(client.ID())
if err != nil {
return nil, err
}
client.job = job
client.job.SessionID = client.ID()
entitlementSet := entitlements.Set{}
if opts.PrivilegedExecEnabled {
entitlementSet[entitlements.EntitlementSecurityInsecure] = struct{}{}
}
client.job.SetValue(entitlementsJobKey, entitlementSet)
client.llbBridge = client.LLBSolver.Bridge(client.job)
client.llbBridge = recordingGateway{client.llbBridge}
client.dialer = &net.Dialer{}
if opts.DNSConfig != nil {
client.dialer.Resolver = &net.Resolver{
PreferGo: true,
Dial: func(ctx context.Context, network, address string) (net.Conn, error) {
if len(opts.DNSConfig.Nameservers) == 0 {
return nil, errors.New("no nameservers configured")
}
var errs []error
for _, ns := range opts.DNSConfig.Nameservers {
conn, err := client.dialer.DialContext(ctx, network, net.JoinHostPort(ns, "53"))
if err != nil {
errs = append(errs, err)
continue
}
return conn, nil
}
return nil, errors.Join(errs...)
},
}
}
return client, nil
}
func (c *Client) ID() string {
return c.session.ID()
}
func (c *Client) Close() error {
c.closeMu.Lock()
defer c.closeMu.Unlock()
select {
case <-c.closeCtx.Done():
// already closed
return nil
default:
}
c.cancel()
c.job.Discard()
c.job.CloseProgress()
c.refsMu.Lock()
for rf := range c.refs {
if rf != nil {
rf.resultProxy.Release(context.Background())
}
}
c.refs = nil
c.refsMu.Unlock()
c.containersMu.Lock()
var containerReleaseGroup errgroup.Group
for ctr := range c.containers {
if ctr := ctr; ctr != nil {
containerReleaseGroup.Go(func() error {
// in theory this shouldn't block very long and just kill the container,
// but add a safeguard just in case
releaseCtx, cancelRelease := context.WithTimeout(context.Background(), 30*time.Second)
defer cancelRelease()
return ctr.Release(releaseCtx)
})
}
}
err := containerReleaseGroup.Wait()
if err != nil {
bklog.G(context.Background()).WithError(err).Error("failed to release containers")
}
c.containers = nil
c.containersMu.Unlock()
return nil
}
func (c *Client) withClientCloseCancel(ctx context.Context) (context.Context, context.CancelFunc, error) {
c.closeMu.RLock()
defer c.closeMu.RUnlock()
select {
case <-c.closeCtx.Done():
return nil, nil, errors.New("client closed")
default:
}
ctx, cancel := context.WithCancel(ctx)
go func() {
select {
case <-c.closeCtx.Done():
cancel()
case <-ctx.Done():
}
}()
return ctx, cancel, nil
}
func (c *Client) Solve(ctx context.Context, req bkgw.SolveRequest) (_ *Result, rerr error) {
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return nil, err
}
defer cancel()
ctx = withOutgoingContext(ctx)
// include upstream cache imports, if any
req.CacheImports = c.UpstreamCacheImports
// include exec metadata that isn't included in the cache key
if req.Definition != nil && req.Definition.Def != nil {
clientMetadata, err := engine.ClientMetadataFromContext(ctx)
if err != nil {
return nil, err
}
dag, err := DefToDAG(req.Definition)
if err != nil {
return nil, err
}
if err := dag.Walk(func(dag *OpDAG) error {
execOp, ok := dag.AsExec()
if !ok {
return nil
}
if execOp.Meta == nil {
execOp.Meta = &bksolverpb.Meta{}
}
if execOp.Meta.ProxyEnv == nil {
execOp.Meta.ProxyEnv = &bksolverpb.ProxyEnv{}
}
// If we already solved for this execop in this dagger session, use
// it's uncached metadata to preserve the same vertex digest.
// This results in buildkit's solver de-duping the op, instead of
// the scheduler's edge merge.
c.execMetadataMu.Lock()
execMeta, ok := c.execMetadata[*execOp.OpDigest]
if !ok {
execMeta = ContainerExecUncachedMetadata{
ParentClientIDs: clientMetadata.ClientIDs(),
ServerID: clientMetadata.ServerID,
}
c.execMetadata[*execOp.OpDigest] = execMeta
}
c.execMetadataMu.Unlock()
var err error
execOp.Meta.ProxyEnv.FtpProxy, err = execMeta.ToPBFtpProxyVal()
if err != nil {
return err
}
return nil
}); err != nil {
return nil, err
}
newDef, err := dag.Marshal()
if err != nil {
return nil, err
}
req.Definition = newDef
}
llbRes, err := c.llbBridge.Solve(ctx, req, c.ID())
if err != nil {
return nil, wrapError(ctx, err, c.ID())
}
res, err := solverresult.ConvertResult(llbRes, func(rp bksolver.ResultProxy) (*ref, error) {
return newRef(rp, c), nil
})
if err != nil {
llbRes.EachRef(func(rp bksolver.ResultProxy) error {
return rp.Release(context.Background())
})
return nil, err
}
c.refsMu.Lock()
defer c.refsMu.Unlock()
if res.Ref != nil {
c.refs[res.Ref] = struct{}{}
}
for _, rf := range res.Refs {
c.refs[rf] = struct{}{}
}
return res, nil
}
func (c *Client) ResolveImageConfig(ctx context.Context, ref string, opt llb.ResolveImageConfigOpt) (string, digest.Digest, []byte, error) {
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return "", "", nil, err
}
defer cancel()
ctx = withOutgoingContext(ctx)
return c.llbBridge.ResolveImageConfig(ctx, ref, opt)
}
func (c *Client) NewContainer(ctx context.Context, req bkgw.NewContainerRequest) (bkgw.Container, error) {
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return nil, err
}
defer cancel()
ctx = withOutgoingContext(ctx)
ctrReq := bkcontainer.NewContainerRequest{
ContainerID: identity.NewID(),
NetMode: req.NetMode,
Hostname: req.Hostname,
Mounts: make([]bkcontainer.Mount, len(req.Mounts)),
}
extraHosts, err := bkcontainer.ParseExtraHosts(req.ExtraHosts)
if err != nil {
return nil, err
}
ctrReq.ExtraHosts = extraHosts
// get the input mounts in parallel in case they need to be evaluated, which can be expensive
eg, egctx := errgroup.WithContext(ctx)
for i, m := range req.Mounts {
i, m := i, m
eg.Go(func() error {
var workerRef *bkworker.WorkerRef
if m.Ref != nil {
ref, ok := m.Ref.(*ref)
if !ok {
return fmt.Errorf("dagger: unexpected ref type: %T", m.Ref)
}
if ref != nil { // TODO(vito): apparently this is possible. scratch?
res, err := ref.resultProxy.Result(egctx)
if err != nil {
return fmt.Errorf("result: %w", err)
}
workerRef, ok = res.Sys().(*bkworker.WorkerRef)
if !ok {
return fmt.Errorf("invalid res: %T", res.Sys())
}
}
}
ctrReq.Mounts[i] = bkcontainer.Mount{
WorkerRef: workerRef,
Mount: &bksolverpb.Mount{
Dest: m.Dest,
Selector: m.Selector,
Readonly: m.Readonly,
MountType: m.MountType,
CacheOpt: m.CacheOpt,
SecretOpt: m.SecretOpt,
SSHOpt: m.SSHOpt,
},
}
return nil
})
}
err = eg.Wait()
if err != nil {
return nil, fmt.Errorf("wait: %w", err)
}
// using context.Background so it continues running until exit or when c.Close() is called
ctr, err := bkcontainer.NewContainer(
context.Background(),
c.Worker,
c.SessionManager,
bksession.NewGroup(c.ID()),
ctrReq,
)
if err != nil {
return nil, err
}
c.containersMu.Lock()
defer c.containersMu.Unlock()
if c.containers == nil {
if err := ctr.Release(context.Background()); err != nil {
return nil, fmt.Errorf("release after close: %w", err)
}
return nil, errors.New("client closed")
}
c.containers[ctr] = struct{}{}
return ctr, nil
}
func (c *Client) WriteStatusesTo(ctx context.Context, ch chan *bkclient.SolveStatus) error {
return c.job.Status(ctx, ch)
}
func (c *Client) RegisterClient(clientID, clientHostname, secretToken string) error {
c.clientMu.Lock()
defer c.clientMu.Unlock()
existingToken, ok := c.clientIDToSecretToken[clientID]
if ok {
if existingToken != secretToken {
return fmt.Errorf("client ID %q already registered with different secret token", clientID)
}
return nil
}
c.clientIDToSecretToken[clientID] = secretToken
// NOTE: we purposely don't delete the secret token, it should never be reused and will be released
// from memory once the dagger server instance corresponding to this buildkit client shuts down.
// Deleting it would make it easier to create race conditions around using the client's session
// before it is fully closed.
return nil
}
func (c *Client) VerifyClient(clientID, secretToken string) error {
c.clientMu.RLock()
defer c.clientMu.RUnlock()
existingToken, ok := c.clientIDToSecretToken[clientID]
if !ok {
return fmt.Errorf("client ID %q not registered", clientID)
}
if existingToken != secretToken {
return fmt.Errorf("client ID %q registered with different secret token", clientID)
}
return nil
}
// CombinedResult returns a buildkit result with all the refs solved by this client so far.
// This is useful for constructing a result for upstream remote caching.
func (c *Client) CombinedResult(ctx context.Context) (*Result, error) {
c.refsMu.Lock()
mergeInputs := make([]llb.State, 0, len(c.refs))
for r := range c.refs {
state, err := r.ToState()
if err != nil {
c.refsMu.Unlock()
return nil, err
}
mergeInputs = append(mergeInputs, state)
}
c.refsMu.Unlock()
llbdef, err := llb.Merge(mergeInputs, llb.WithCustomName("combined session result")).Marshal(ctx)
if err != nil {
return nil, err
}
return c.Solve(ctx, bkgw.SolveRequest{
Definition: llbdef.ToPB(),
})
}
func (c *Client) UpstreamCacheExport(ctx context.Context, cacheExportFuncs []ResolveCacheExporterFunc) error {
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return err
}
defer cancel()
if len(cacheExportFuncs) == 0 {
return nil
}
bklog.G(ctx).Debugf("exporting %d caches", len(cacheExportFuncs))
combinedResult, err := c.CombinedResult(ctx)
if err != nil {
return err
}
cacheRes, err := ConvertToWorkerCacheResult(ctx, combinedResult)
if err != nil {
return fmt.Errorf("failed to convert result: %s", err)
}
bklog.G(ctx).Debugf("converting to solverRes")
solverRes, err := solverresult.ConvertResult(combinedResult, func(rf *ref) (bksolver.CachedResult, error) {
return rf.resultProxy.Result(ctx)
})
if err != nil {
return fmt.Errorf("failed to convert result: %s", err)
}
sessionGroup := bksession.NewGroup(c.ID())
eg, ctx := errgroup.WithContext(ctx)
// TODO: send progrock statuses for cache export progress
for _, exporterFunc := range cacheExportFuncs {
exporterFunc := exporterFunc
eg.Go(func() error {
bklog.G(ctx).Debugf("getting exporter")
exporter, err := exporterFunc(ctx, sessionGroup)
if err != nil {
return err
}
bklog.G(ctx).Debugf("exporting cache with %T", exporter)
compressionCfg := exporter.Config().Compression
err = solverresult.EachRef(solverRes, cacheRes, func(res bksolver.CachedResult, ref bkcache.ImmutableRef) error {
bklog.G(ctx).Debugf("exporting cache for %s", ref.ID())
ctx := withDescHandlerCacheOpts(ctx, ref)
bklog.G(ctx).Debugf("calling exporter")
_, err = res.CacheKeys()[0].Exporter.ExportTo(ctx, exporter, bksolver.CacheExportOpt{
ResolveRemotes: func(ctx context.Context, res bksolver.Result) ([]*bksolver.Remote, error) {
ref, ok := res.Sys().(*bkworker.WorkerRef)
if !ok {
return nil, fmt.Errorf("invalid result: %T", res.Sys())
}
bklog.G(ctx).Debugf("getting remotes for %s", ref.ID())
defer bklog.G(ctx).Debugf("got remotes for %s", ref.ID())
return ref.GetRemotes(ctx, true, bkcacheconfig.RefConfig{Compression: compressionCfg}, false, sessionGroup)
},
Mode: bksolver.CacheExportModeMax,
Session: sessionGroup,
CompressionOpt: &compressionCfg,
})
return err
})
if err != nil {
return err
}
bklog.G(ctx).Debugf("finalizing exporter")
defer bklog.G(ctx).Debugf("finalized exporter")
_, err = exporter.Finalize(ctx)
return err
})
}
bklog.G(ctx).Debugf("waiting for cache export")
defer bklog.G(ctx).Debugf("waited for cache export")
return eg.Wait()
}
func withDescHandlerCacheOpts(ctx context.Context, ref bkcache.ImmutableRef) context.Context {
return bksolver.WithCacheOptGetter(ctx, func(_ bool, keys ...interface{}) map[interface{}]interface{} {
vals := make(map[interface{}]interface{})
for _, k := range keys {
if key, ok := k.(bkcache.DescHandlerKey); ok {
if handler := ref.DescHandler(digest.Digest(key)); handler != nil {
vals[k] = handler
}
}
}
return vals
})
}
func (c *Client) ListenHostToContainer(
ctx context.Context,
hostListenAddr, proto, upstream string,
) (*session.ListenResponse, func() error, error) {
ctx, cancel, err := c.withClientCloseCancel(ctx)
if err != nil {
return nil, nil, err
}
clientMetadata, err := engine.ClientMetadataFromContext(ctx)
if err != nil {
cancel()
return nil, nil, fmt.Errorf("failed to get requester session ID: %s", err)
}
clientCaller, err := c.SessionManager.Get(ctx, clientMetadata.ClientID, false)
if err != nil {
cancel()
return nil, nil, fmt.Errorf("failed to get requester session: %s", err)
}
conn := clientCaller.Conn()
tunnelClient := session.NewTunnelListenerClient(conn)
listener, err := tunnelClient.Listen(ctx)
if err != nil {
cancel()
return nil, nil, fmt.Errorf("failed to listen: %s", err)
}
err = listener.Send(&session.ListenRequest{
Addr: hostListenAddr,
Protocol: proto,
})
if err != nil {
cancel()
return nil, nil, fmt.Errorf("failed to send listen request: %s", err)
}
listenRes, err := listener.Recv()
if err != nil {
cancel()
return nil, nil, fmt.Errorf("failed to receive listen response: %s", err)
}
conns := map[string]net.Conn{}
connsL := &sync.Mutex{}
sendL := &sync.Mutex{}
wg := new(sync.WaitGroup)
wg.Add(1)
go func() {
defer wg.Done()
for {
res, err := listener.Recv()
if err != nil {
bklog.G(ctx).Warnf("listener recv err: %s", err)
return
}
connID := res.GetConnId()
if connID == "" {
continue
}
connsL.Lock()
conn, found := conns[connID]
connsL.Unlock()
if !found {
conn, err := c.dialer.Dial(proto, upstream)
if err != nil {
bklog.G(ctx).Warnf("failed to dial %s %s: %s", proto, upstream, err)
return
}
connsL.Lock()
conns[connID] = conn
connsL.Unlock()
wg.Add(1)
go func() {
defer wg.Done()
data := make([]byte, 32*1024)
for {
n, err := conn.Read(data)
if err != nil {
return
}
sendL.Lock()
err = listener.Send(&session.ListenRequest{
ConnId: connID,
Data: data[:n],
})
sendL.Unlock()
if err != nil {
return
}
}
}()
}
if res.Data != nil {
_, err = conn.Write(res.Data)
if err != nil {
return
}
}
}
}()
return listenRes, func() error {
defer cancel()
sendL.Lock()
err := listener.CloseSend()
sendL.Unlock()
if err == nil {
wg.Wait()
}
return err
}, nil
}
func withOutgoingContext(ctx context.Context) context.Context {
md, ok := metadata.FromIncomingContext(ctx)
if ok {
ctx = metadata.NewOutgoingContext(ctx, md)
}
return ctx
}
// Metadata passed to an exec that doesn't count towards the cache key.
// This should be used with great caution; only for metadata that is
// safe to be de-duplicated across execs.
//
// Currently, this uses the FTPProxy LLB option to pass without becoming
// part of the cache key. This is a hack that, while ugly to look at,
// is simple and robust. Alternatives would be to use secrets or sockets,
// but they are more complicated, or to create a custom buildkit
// worker/executor, which is MUCH more complicated.
//
// If a need to add ftp proxy support arises, then we can just also embed
// the "real" ftp proxy setting in here too and have the shim handle
// leaving only that set in the actual env var.
type ContainerExecUncachedMetadata struct {
ParentClientIDs []string `json:"parentClientIDs,omitempty"`
ServerID string `json:"serverID,omitempty"`
}
func (md ContainerExecUncachedMetadata) ToPBFtpProxyVal() (string, error) {
b, err := json.Marshal(md)
if err != nil {
return "", err
}
return string(b), nil
}
func (md *ContainerExecUncachedMetadata) FromEnv(envKV string) (bool, error) {
_, val, ok := strings.Cut(envKV, "ftp_proxy=")
if !ok {
return false, nil
}
err := json.Unmarshal([]byte(val), md)
if err != nil {
return false, err
}
return true, nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,409 | ✨ Allow cache volumes as CLI parameters | ### What are you trying to do?
I have a module with the following constructor:
```go
func New(
// ...
// Disable mounting cache volumes.
disableCache Optional[bool],
// Module cache volume to mount at /go/pkg/mod.
modCache Optional[*CacheVolume],
// Build cache volume to mount at ~/.cache/go-build.
buildCache Optional[*CacheVolume],
) *Go {
// ...
}
```
Currently, running this module in the CLI fails due to CacheVolume being an unsupported CLI argument:
```shell
❯ dagger call -m "github.com/sagikazarmark/daggerverse/go@main" --help
✘ load call ERROR [1.21s]
├ [0.56s] loading module
├ [0.65s] loading objects
┃ Error: unsupported object type "CacheVolume" for flag: mod-cache
```
Given cache volumes are created by their names (and that other types of objects, like files, are also referenced simply by their path or ID), I think it would be useful to do the same for cache volumes. In this instance:
```shell
❯ dagger call -m "github.com/sagikazarmark/daggerverse/go@main" --mod-cache go-build
```
An alternative I can imagine is adding a pragma comment for ignoring certain arguments from the CLI, but including them in the generated code. That's a temporary measure, but would still be easier for module developers, so they can utilize constructors instead of falling back to method chaining for tasks like setting cache.
### Why is this important to you?
_No response_
### How are you currently working around this?
I will probably remove those arguments from the constructor for now.
I might add them to the module API, but honestly, I'd rather not. | https://github.com/dagger/dagger/issues/6409 | https://github.com/dagger/dagger/pull/6520 | 0b91d2a3e04c81ad0dad799d34af30d3801ae76f | 7350f0b8dd5ff74b7ae0ddfd05e35c37bf16712b | "2024-01-12T07:04:04Z" | go | "2024-01-31T15:53:55Z" | cmd/dagger/call.go | package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"os"
"path/filepath"
"github.com/spf13/cobra"
)
// TODO: remove these ghost commands after next release (v0.9.8)
var downloadCmd = &cobra.Command{
Use: "download",
Short: "Download an asset from module function",
Aliases: []string{"export", "dl"},
Hidden: true,
SilenceUsage: true,
DisableFlagParsing: true,
Args: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf(`%q has been replaced by "dagger call COMMANDS... --output=PATH"`, cmd.CommandPath())
},
Run: func(cmd *cobra.Command, args []string) {
// do nothing
},
}
var upCmd = &cobra.Command{
Use: "up",
Short: "Start a service and expose its ports to the host",
Hidden: true,
SilenceUsage: true,
DisableFlagParsing: true,
Args: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf(`%q has been replaced by "dagger call COMMANDS... up"`, cmd.CommandPath())
},
Run: func(cmd *cobra.Command, args []string) {
// do nothing
},
}
var shellCmd = &cobra.Command{
Use: "shell",
Short: "Open a shell in a container",
Hidden: true,
SilenceUsage: true,
DisableFlagParsing: true,
Args: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf(`%q has been replaced by "dagger call COMMANDS... shell"`, cmd.CommandPath())
},
Run: func(cmd *cobra.Command, args []string) {
// do nothing
},
}
var outputPath string
var jsonOutput bool
var callCmd = &FuncCommand{
Name: "call",
Short: "Call a module function",
Long: `Call a module function and print the result
If the last argument is either Container, Directory, or File, the pipeline
will be evaluated (the result of calling *sync*) without presenting any output.
Providing the --output option (shorthand: -o) is equivalent to calling *export*
instead. To print a property of these core objects, continue chaining by
appending it to the end of the command (for example, *stdout*, *entries*, or
*contents*).
`,
Init: func(cmd *cobra.Command) {
cmd.PersistentFlags().BoolVar(&jsonOutput, "json", false, "Present result as JSON")
cmd.PersistentFlags().StringVarP(&outputPath, "output", "o", "", "Path in the host to save the result to")
},
OnSelectObjectLeaf: func(c *FuncCommand, name string) error {
switch name {
case Container, Directory, File:
if outputPath != "" {
c.Select("export")
c.Arg("path", outputPath)
if name == File {
c.Arg("allowParentDirPath", true)
}
return nil
}
c.Select("sync")
case Terminal:
c.Select("websocketEndpoint")
default:
return fmt.Errorf("return type %q requires a sub-command", name)
}
return nil
},
BeforeRequest: func(_ *FuncCommand, _ *cobra.Command, modType *modTypeDef) error {
if modType.Name() != Terminal {
return nil
}
// Even though these flags are global, we only check them just before query
// execution because you may want to debug an error during loading or for
// --help.
if silent || !(progress == "auto" && autoTTY || progress == "tty") {
return fmt.Errorf("running shell without the TUI is not supported")
}
if debug {
return fmt.Errorf("running shell with --debug is not supported")
}
if outputPath != "" {
return fmt.Errorf("running shell with --output is not supported")
}
return nil
},
AfterResponse: func(c *FuncCommand, cmd *cobra.Command, modType *modTypeDef, response any) error {
switch modType.Name() {
case Terminal:
termEndpoint, ok := response.(string)
if !ok {
return fmt.Errorf("unexpected response %T: %+v", response, response)
}
return attachToShell(cmd.Context(), c.c, termEndpoint)
case Container, Directory, File:
if outputPath != "" {
logOutputSuccess(cmd, outputPath)
return nil
}
// Just `sync`, don't print the result (id), but let user know.
// TODO: This is only "needed" when there's no output because
// you're left wondering if the command did anything. Otherwise,
// the output is sent only to progrock (TUI), so we'd need to check
// there if possible. Decide whether this message is ok in all cases,
// better to not print it, or to conditionally check.
cmd.PrintErrf("%s evaluated. Use \"%s --help\" to see available sub-commands.\n", modType.Name(), cmd.CommandPath())
return nil
default:
// TODO: Since IDs aren't stable to be used in the CLI, we should
// silence all ID results (or present in a compact way like
// ´<ContainerID:etpdi9gue9l5>`), but need a KindScalar TypeDef
// to get the name from modType.
// You can't select `id`, but you can select `sync`, and there
// may be others.
writer := cmd.OutOrStdout()
if outputPath != "" {
file, err := openOutputFile(outputPath)
if err != nil {
return fmt.Errorf("couldn't write output to file: %w", err)
}
defer func() {
file.Close()
logOutputSuccess(cmd, outputPath)
}()
writer = io.MultiWriter(writer, file)
}
// especially useful for lists and maps
if jsonOutput {
// disable HTML escaping to improve readability
var buf bytes.Buffer
encoder := json.NewEncoder(&buf)
encoder.SetEscapeHTML(false)
encoder.SetIndent("", " ")
if err := encoder.Encode(response); err != nil {
return err
}
fmt.Fprintf(writer, "%s\n", buf.String())
return nil
}
return printFunctionResult(writer, response)
}
},
}
// openOutputFile opens a file for writing, creating the parent directories if needed.
func openOutputFile(path string) (*os.File, error) {
if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
return nil, err
}
return os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o644)
}
// logOutputSuccess prints to stderr the the output path to the user.
func logOutputSuccess(cmd *cobra.Command, path string) {
path, err := filepath.Abs(path)
if err != nil {
// don't fail because at this point the output has been saved successfully
cmd.PrintErrf("WARNING: failed to get absolute path: %s\n", err)
path = outputPath
}
cmd.PrintErrf("Saved output to %q.\n", path)
}
func printFunctionResult(w io.Writer, r any) error {
switch t := r.(type) {
case []any:
// TODO: group in progrock
for _, v := range t {
if err := printFunctionResult(w, v); err != nil {
return err
}
}
return nil
case map[string]any:
// TODO: group in progrock
for _, v := range t {
if err := printFunctionResult(w, v); err != nil {
return err
}
}
return nil
default:
fmt.Fprintf(w, "%+v\n", t)
}
return nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,409 | ✨ Allow cache volumes as CLI parameters | ### What are you trying to do?
I have a module with the following constructor:
```go
func New(
// ...
// Disable mounting cache volumes.
disableCache Optional[bool],
// Module cache volume to mount at /go/pkg/mod.
modCache Optional[*CacheVolume],
// Build cache volume to mount at ~/.cache/go-build.
buildCache Optional[*CacheVolume],
) *Go {
// ...
}
```
Currently, running this module in the CLI fails due to CacheVolume being an unsupported CLI argument:
```shell
❯ dagger call -m "github.com/sagikazarmark/daggerverse/go@main" --help
✘ load call ERROR [1.21s]
├ [0.56s] loading module
├ [0.65s] loading objects
┃ Error: unsupported object type "CacheVolume" for flag: mod-cache
```
Given cache volumes are created by their names (and that other types of objects, like files, are also referenced simply by their path or ID), I think it would be useful to do the same for cache volumes. In this instance:
```shell
❯ dagger call -m "github.com/sagikazarmark/daggerverse/go@main" --mod-cache go-build
```
An alternative I can imagine is adding a pragma comment for ignoring certain arguments from the CLI, but including them in the generated code. That's a temporary measure, but would still be easier for module developers, so they can utilize constructors instead of falling back to method chaining for tasks like setting cache.
### Why is this important to you?
_No response_
### How are you currently working around this?
I will probably remove those arguments from the constructor for now.
I might add them to the module API, but honestly, I'd rather not. | https://github.com/dagger/dagger/issues/6409 | https://github.com/dagger/dagger/pull/6520 | 0b91d2a3e04c81ad0dad799d34af30d3801ae76f | 7350f0b8dd5ff74b7ae0ddfd05e35c37bf16712b | "2024-01-12T07:04:04Z" | go | "2024-01-31T15:53:55Z" | cmd/dagger/flags.go | package main
import (
"bytes"
"context"
"crypto/sha256"
"encoding/csv"
"encoding/hex"
"fmt"
"io"
"net"
"net/url"
"os"
"os/exec"
"reflect"
"strconv"
"strings"
"dagger.io/dagger"
"github.com/moby/buildkit/util/gitutil"
"github.com/spf13/pflag"
)
// GetCustomFlagValue returns a pflag.Value instance for a dagger.ObjectTypeDef name.
func GetCustomFlagValue(name string) DaggerValue {
switch name {
case Container:
return &containerValue{}
case Directory:
return &directoryValue{}
case File:
return &fileValue{}
case Secret:
return &secretValue{}
case Service:
return &serviceValue{}
case PortForward:
return &portForwardValue{}
}
return nil
}
// GetCustomFlagValueSlice returns a pflag.Value instance for a dagger.ObjectTypeDef name.
func GetCustomFlagValueSlice(name string) DaggerValue {
switch name {
case Container:
return &sliceValue[*containerValue]{}
case Directory:
return &sliceValue[*directoryValue]{}
case File:
return &sliceValue[*fileValue]{}
case Secret:
return &sliceValue[*secretValue]{}
case Service:
return &sliceValue[*serviceValue]{}
case PortForward:
return &sliceValue[*portForwardValue]{}
}
return nil
}
// DaggerValue is a pflag.Value that requires a dagger.Client for producing the
// final value.
type DaggerValue interface {
pflag.Value
// Get returns the final value for the query builder.
Get(context.Context, *dagger.Client) (any, error)
}
// sliceValue is a pflag.Value that builds a slice of DaggerValue instances.
//
// NOTE: the code defining this type is heavily inspired by stringSliceValue.Set
// for equivalent behaviour as the other builtin slice types
type sliceValue[T DaggerValue] struct {
value []T
}
func (v *sliceValue[T]) Type() string {
var t T
return t.Type()
}
func (v *sliceValue[T]) String() string {
ss := []string{}
for _, v := range v.value {
ss = append(ss, v.String())
}
out, _ := writeAsCSV(ss)
return "[" + out + "]"
}
func (v *sliceValue[T]) Get(ctx context.Context, c *dagger.Client) (any, error) {
out := make([]any, len(v.value))
for i, v := range v.value {
outV, err := v.Get(ctx, c)
if err != nil {
return nil, err
}
out[i] = outV
}
return out, nil
}
func (v *sliceValue[T]) Set(s string) error {
// remove all quote characters
rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "")
// read flag arguments with CSV parser
ss, err := readAsCSV(rmQuote.Replace(s))
if err != nil && err != io.EOF {
return err
}
// parse values into slice
out := make([]T, 0, len(ss))
for _, s := range ss {
var v T
if typ := reflect.TypeOf(v); typ.Kind() == reflect.Ptr {
// hack to get a pointer to a new instance of the underlying type
v = reflect.New(typ.Elem()).Interface().(T)
}
if err := v.Set(strings.TrimSpace(s)); err != nil {
return err
}
out = append(out, v)
}
v.value = append(v.value, out...)
return nil
}
// containerValue is a pflag.Value that builds a dagger.Container from a
// base image name.
type containerValue struct {
address string
}
func (v *containerValue) Type() string {
return Container
}
func (v *containerValue) Set(s string) error {
if s == "" {
return fmt.Errorf("container address cannot be empty")
}
v.address = s
return nil
}
func (v *containerValue) String() string {
return v.address
}
func (v *containerValue) Get(_ context.Context, c *dagger.Client) (any, error) {
if v.address == "" {
return nil, fmt.Errorf("container address cannot be empty")
}
return c.Container().From(v.String()), nil
}
// directoryValue is a pflag.Value that builds a dagger.Directory from a host path.
type directoryValue struct {
address string
}
func (v *directoryValue) Type() string {
return Directory
}
func (v *directoryValue) Set(s string) error {
if s == "" {
return fmt.Errorf("directory address cannot be empty")
}
v.address = s
return nil
}
func (v *directoryValue) String() string {
return v.address
}
func parseGit(urlStr string) (*gitutil.GitURL, error) {
// FIXME: handle tarball-over-http (where http(s):// is scheme but not a git repo)
u, err := gitutil.ParseURL(urlStr)
if err != nil {
return nil, err
}
if u.Fragment == nil {
u.Fragment = &gitutil.GitURLFragment{}
}
if u.Fragment.Ref == "" {
// FIXME: default branch can be remotely looked up, but that would
// require 1) a context, 2) a way to return an error, 3) more time than I have :)
u.Fragment.Ref = "main"
}
return u, nil
}
func (v *directoryValue) Get(_ context.Context, dag *dagger.Client) (any, error) {
if v.String() == "" {
return nil, fmt.Errorf("directory address cannot be empty")
}
// Try parsing as a Git URL
parsedGit, err := parseGit(v.String())
if err == nil {
gitOpts := dagger.GitOpts{
KeepGitDir: true,
}
if authSock, ok := os.LookupEnv("SSH_AUTH_SOCK"); ok {
gitOpts.SSHAuthSocket = dag.Host().UnixSocket(authSock)
}
gitDir := dag.Git(parsedGit.Remote, gitOpts).Branch(parsedGit.Fragment.Ref).Tree()
if subdir := parsedGit.Fragment.Subdir; subdir != "" {
gitDir = gitDir.Directory(subdir)
}
return gitDir, nil
}
// Otherwise it's a local dir path. Allow `file://` scheme or no scheme.
vStr := v.String()
vStr = strings.TrimPrefix(vStr, "file://")
return dag.Host().Directory(vStr), nil
}
// fileValue is a pflag.Value that builds a dagger.File from a host path.
type fileValue struct {
path string
}
func (v *fileValue) Type() string {
return File
}
func (v *fileValue) Set(s string) error {
if s == "" {
return fmt.Errorf("file path cannot be empty")
}
v.path = s
return nil
}
func (v *fileValue) String() string {
return v.path
}
func (v *fileValue) Get(_ context.Context, c *dagger.Client) (any, error) {
if v.String() == "" {
return nil, fmt.Errorf("file path cannot be empty")
}
return c.Host().File(v.String()), nil
}
// secretValue is a pflag.Value that builds a dagger.Secret from a name and a
// plaintext value.
type secretValue struct {
secretSource string
sourceVal string
}
const (
envSecretSource = "env"
fileSecretSource = "file"
commandSecretSource = "cmd"
)
func (v *secretValue) Type() string {
return Secret
}
func (v *secretValue) Set(s string) error {
secretSource, val, ok := strings.Cut(s, ":")
if !ok {
// case of e.g. `--token MY_ENV_SECRET`, which is shorthand for `--token env:MY_ENV_SECRET`
val = secretSource
secretSource = envSecretSource
}
v.secretSource = secretSource
v.sourceVal = val
return nil
}
func (v *secretValue) String() string {
return fmt.Sprintf("%s:%s", v.secretSource, v.sourceVal)
}
func (v *secretValue) Get(ctx context.Context, c *dagger.Client) (any, error) {
var plaintext string
switch v.secretSource {
case envSecretSource:
envPlaintext, ok := os.LookupEnv(v.sourceVal)
if !ok {
// Don't show the entire env var name, in case the user accidentally passed the value instead...
// This is important because users originally *did* have to pass the value, before we changed to
// passing by name instead.
key := v.sourceVal
if len(key) >= 4 {
key = key[:3] + "..."
}
return nil, fmt.Errorf("secret env var not found: %q", key)
}
plaintext = envPlaintext
case fileSecretSource:
filePlaintext, err := os.ReadFile(v.sourceVal)
if err != nil {
return nil, fmt.Errorf("failed to read secret file %q: %w", v.sourceVal, err)
}
plaintext = string(filePlaintext)
case commandSecretSource:
// #nosec G204
stdoutBytes, err := exec.CommandContext(ctx, "sh", "-c", v.sourceVal).Output()
if err != nil {
return nil, fmt.Errorf("failed to run secret command %q: %w", v.sourceVal, err)
}
plaintext = string(stdoutBytes)
default:
return nil, fmt.Errorf("unsupported secret arg source: %q", v.secretSource)
}
// NB: If we allow getting the name from the dagger.Secret instance,
// it can be vulnerable to brute force attacks.
hash := sha256.Sum256([]byte(plaintext))
secretName := hex.EncodeToString(hash[:])
return c.SetSecret(secretName, plaintext), nil
}
// serviceValue is a pflag.Value that builds a dagger.Service from a host:port
// combination.
type serviceValue struct {
address string // for string representation
host string
ports []dagger.PortForward
}
func (v *serviceValue) Type() string {
return Service
}
func (v *serviceValue) String() string {
return v.address
}
func (v *serviceValue) Set(s string) error {
if s == "" {
return fmt.Errorf("service address cannot be empty")
}
u, err := url.Parse(s)
if err != nil {
return err
}
switch u.Scheme {
case "tcp":
host, port, err := net.SplitHostPort(u.Host)
if err != nil {
return err
}
nPort, err := strconv.Atoi(port)
if err != nil {
return err
}
v.host = host
v.ports = append(v.ports, dagger.PortForward{
Backend: nPort,
Frontend: nPort,
Protocol: dagger.Tcp,
})
case "udp":
host, port, err := net.SplitHostPort(u.Host)
if err != nil {
return err
}
nPort, err := strconv.Atoi(port)
if err != nil {
return err
}
v.host = host
v.ports = append(v.ports, dagger.PortForward{
Backend: nPort,
Frontend: nPort,
Protocol: dagger.Udp,
})
default:
return fmt.Errorf("unsupported service address. Must be a valid tcp:// or udp:// URL")
}
v.address = s
return nil
}
func (v *serviceValue) Get(ctx context.Context, c *dagger.Client) (any, error) {
svc, err := c.Host().Service(v.ports, dagger.HostServiceOpts{Host: v.host}).Start(ctx)
if err != nil {
return nil, fmt.Errorf("failed to start service: %w", err)
}
return svc, nil
}
// portForwardValue is a pflag.Value that builds a dagger.
type portForwardValue struct {
frontend int
backend int
}
func (v *portForwardValue) Type() string {
return PortForward
}
func (v *portForwardValue) Set(s string) error {
if s == "" {
return fmt.Errorf("portForward setting cannot be empty")
}
frontendStr, backendStr, ok := strings.Cut(s, ":")
if !ok {
return fmt.Errorf("portForward setting not in the form of frontend:backend: %q", s)
}
frontend, err := strconv.Atoi(frontendStr)
if err != nil {
return fmt.Errorf("portForward frontend not a valid integer: %q", frontendStr)
}
v.frontend = frontend
backend, err := strconv.Atoi(backendStr)
if err != nil {
return fmt.Errorf("portForward backend not a valid integer: %q", backendStr)
}
v.backend = backend
return nil
}
func (v *portForwardValue) String() string {
return fmt.Sprintf("%d:%d", v.frontend, v.backend)
}
func (v *portForwardValue) Get(_ context.Context, c *dagger.Client) (any, error) {
return &dagger.PortForward{
Frontend: v.frontend,
Backend: v.backend,
}, nil
}
// AddFlag adds a flag appropriate for the argument type. Should return a
// pointer to the value.
func (r *modFunctionArg) AddFlag(flags *pflag.FlagSet, dag *dagger.Client) (any, error) {
name := r.FlagName()
usage := r.Description
if flags.Lookup(name) != nil {
return nil, fmt.Errorf("flag already exists: %s", name)
}
switch r.TypeDef.Kind {
case dagger.StringKind:
val, _ := getDefaultValue[string](r)
return flags.String(name, val, usage), nil
case dagger.IntegerKind:
val, _ := getDefaultValue[int](r)
return flags.Int(name, val, usage), nil
case dagger.BooleanKind:
val, _ := getDefaultValue[bool](r)
return flags.Bool(name, val, usage), nil
case dagger.ObjectKind:
objName := r.TypeDef.AsObject.Name
if val := GetCustomFlagValue(objName); val != nil {
flags.Var(val, name, usage)
return val, nil
}
// TODO: default to JSON?
return nil, fmt.Errorf("unsupported object type %q for flag: %s", objName, name)
case dagger.InputKind:
inputName := r.TypeDef.AsInput.Name
if val := GetCustomFlagValue(inputName); val != nil {
flags.Var(val, name, usage)
return val, nil
}
// TODO: default to JSON?
return nil, fmt.Errorf("unsupported input type %q for flag: %s", inputName, name)
case dagger.ListKind:
elementType := r.TypeDef.AsList.ElementTypeDef
switch elementType.Kind {
case dagger.StringKind:
val, _ := getDefaultValue[[]string](r)
return flags.StringSlice(name, val, usage), nil
case dagger.IntegerKind:
val, _ := getDefaultValue[[]int](r)
return flags.IntSlice(name, val, usage), nil
case dagger.BooleanKind:
val, _ := getDefaultValue[[]bool](r)
return flags.BoolSlice(name, val, usage), nil
case dagger.ObjectKind:
objName := elementType.AsObject.Name
if val := GetCustomFlagValueSlice(objName); val != nil {
flags.Var(val, name, usage)
return val, nil
}
// TODO: default to JSON?
return nil, fmt.Errorf("unsupported list of objects %q for flag: %s", objName, name)
case dagger.InputKind:
inputName := elementType.AsInput.Name
if val := GetCustomFlagValueSlice(inputName); val != nil {
flags.Var(val, name, usage)
return val, nil
}
// TODO: default to JSON?
return nil, fmt.Errorf("unsupported list of input type %q for flag: %s", inputName, name)
case dagger.ListKind:
return nil, fmt.Errorf("unsupported list of lists for flag: %s", name)
}
}
return nil, fmt.Errorf("unsupported type for argument: %s", r.Name)
}
func readAsCSV(val string) ([]string, error) {
if val == "" {
return []string{}, nil
}
stringReader := strings.NewReader(val)
csvReader := csv.NewReader(stringReader)
return csvReader.Read()
}
func writeAsCSV(vals []string) (string, error) {
b := &bytes.Buffer{}
w := csv.NewWriter(b)
err := w.Write(vals)
if err != nil {
return "", err
}
w.Flush()
return strings.TrimSuffix(b.String(), "\n"), nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,409 | ✨ Allow cache volumes as CLI parameters | ### What are you trying to do?
I have a module with the following constructor:
```go
func New(
// ...
// Disable mounting cache volumes.
disableCache Optional[bool],
// Module cache volume to mount at /go/pkg/mod.
modCache Optional[*CacheVolume],
// Build cache volume to mount at ~/.cache/go-build.
buildCache Optional[*CacheVolume],
) *Go {
// ...
}
```
Currently, running this module in the CLI fails due to CacheVolume being an unsupported CLI argument:
```shell
❯ dagger call -m "github.com/sagikazarmark/daggerverse/go@main" --help
✘ load call ERROR [1.21s]
├ [0.56s] loading module
├ [0.65s] loading objects
┃ Error: unsupported object type "CacheVolume" for flag: mod-cache
```
Given cache volumes are created by their names (and that other types of objects, like files, are also referenced simply by their path or ID), I think it would be useful to do the same for cache volumes. In this instance:
```shell
❯ dagger call -m "github.com/sagikazarmark/daggerverse/go@main" --mod-cache go-build
```
An alternative I can imagine is adding a pragma comment for ignoring certain arguments from the CLI, but including them in the generated code. That's a temporary measure, but would still be easier for module developers, so they can utilize constructors instead of falling back to method chaining for tasks like setting cache.
### Why is this important to you?
_No response_
### How are you currently working around this?
I will probably remove those arguments from the constructor for now.
I might add them to the module API, but honestly, I'd rather not. | https://github.com/dagger/dagger/issues/6409 | https://github.com/dagger/dagger/pull/6520 | 0b91d2a3e04c81ad0dad799d34af30d3801ae76f | 7350f0b8dd5ff74b7ae0ddfd05e35c37bf16712b | "2024-01-12T07:04:04Z" | go | "2024-01-31T15:53:55Z" | cmd/dagger/functions.go | package main
import (
"context"
"errors"
"fmt"
"io"
"os"
"sort"
"strings"
"dagger.io/dagger"
"dagger.io/dagger/querybuilder"
"github.com/dagger/dagger/engine/client"
"github.com/juju/ansiterm/tabwriter"
"github.com/muesli/termenv"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/vito/progrock"
)
const (
Directory string = "Directory"
Container string = "Container"
File string = "File"
Secret string = "Secret"
Service string = "Service"
Terminal string = "Terminal"
PortForward string = "PortForward"
)
var funcGroup = &cobra.Group{
ID: "functions",
Title: "Functions",
}
var funcCmds = FuncCommands{
funcListCmd,
callCmd,
}
var funcListCmd = &FuncCommand{
Name: "functions",
Short: `List available functions`,
Execute: func(fc *FuncCommand, cmd *cobra.Command) error {
tw := tabwriter.NewWriter(cmd.OutOrStdout(), 0, 0, 3, ' ', tabwriter.DiscardEmptyColumns)
var o functionProvider = fc.mod.GetMainObject()
fmt.Fprintf(tw, "%s\t%s\n",
termenv.String("Name").Bold(),
termenv.String("Description").Bold(),
)
// Walk the hypothetical function pipeline specified by the args
for _, field := range cmd.Flags().Args() {
// Lookup the next function in the specified pipeline
nextFunc, err := o.GetFunction(field)
if err != nil {
return err
}
nextType := nextFunc.ReturnType
if nextType.AsFunctionProvider() != nil {
// sipsma explains why 'nextType.AsObject' is not enough:
// > when we're returning the hierarchies of TypeDefs from the API,
// > and an object shows up as an output/input type to a function,
// > we just return a TypeDef with a name of the object rather than the full object definition.
// > You can get the full object definition only from the "top-level" returned object on the api call.
//
// > The reason is that if we repeated the full object definition every time,
// > you'd at best be using O(n^2) space in the result,
// > and at worst cause json serialization errors due to cyclic references
// > (i.e. with* functions on an object that return the object itself).
o = fc.mod.GetFunctionProvider(nextType.Name())
continue
}
// FIXME: handle arrays of objects
return fmt.Errorf("function '%s' returns non-object type %v", field, nextType.Kind)
}
// List functions on the final object
fns := o.GetFunctions()
sort.Slice(fns, func(i, j int) bool {
return fns[i].Name < fns[j].Name
})
for _, fn := range fns {
desc := strings.SplitN(fn.Description, "\n", 2)[0]
if desc == "" {
desc = "-"
}
fmt.Fprintf(tw, "%s\t%s\n",
cliName(fn.Name),
desc,
)
}
return tw.Flush()
},
}
type FuncCommands []*FuncCommand
func (fcs FuncCommands) AddFlagSet(flags *pflag.FlagSet) {
for _, cmd := range fcs.All() {
cmd.PersistentFlags().AddFlagSet(flags)
}
}
func (fcs FuncCommands) AddParent(rootCmd *cobra.Command) {
rootCmd.AddGroup(funcGroup)
rootCmd.AddCommand(fcs.All()...)
}
func (fcs FuncCommands) All() []*cobra.Command {
cmds := make([]*cobra.Command, len(fcs))
for i, fc := range fcs {
cmds[i] = fc.Command()
}
return cmds
}
func setCmdOutput(cmd *cobra.Command, vtx *progrock.VertexRecorder) {
if silent {
return
}
var stdout io.Writer
var stderr io.Writer
if stdoutIsTTY {
stdout = vtx.Stdout()
} else {
stdout = os.Stdout
}
if stderrIsTTY {
stderr = vtx.Stderr()
} else {
stderr = os.Stderr
}
cmd.SetOut(stdout)
cmd.SetErr(stderr)
}
// FuncCommand is a config object used to create a dynamic set of commands
// for querying a module's functions.
type FuncCommand struct {
// The name of the command (or verb), as shown in usage.
Name string
// Aliases is an array of aliases that can be used instead of the first word in Use.
Aliases []string
// Short is the short description shown in the 'help' output.
Short string
// Long is the long message shown in the 'help <this-command>' output.
Long string
// Example is examples of how to use the command.
Example string
// Init is called when the command is created and initialized,
// before execution.
//
// It can be useful to add persistent flags for all subcommands here.
Init func(*cobra.Command)
// Execute circumvents the default behavior of traversing subcommands
// from the arguments, but still has access to the loaded objects from
// the module.
Execute func(*FuncCommand, *cobra.Command) error
// BeforeParse is called before parsing the flags for a subcommand.
//
// It can be useful to add any additional flags for a subcommand here.
BeforeParse func(*FuncCommand, *cobra.Command, *modFunction) error
// OnSelectObjectLeaf is called when a user provided command ends in a
// object and no more sub-commands are provided.
//
// If set, it should make another selection on the object that results
// return no error. Otherwise if it doesn't handle the object, it should
// return an error.
OnSelectObjectLeaf func(*FuncCommand, string) error
// BeforeRequest is called before making the request with the query that
// contains the whole chain of functions.
//
// It can be useful to validate the return type of the function or as a
// last effort to select a GraphQL sub-field.
BeforeRequest func(*FuncCommand, *cobra.Command, *modTypeDef) error
// AfterResponse is called when the query has completed and returned a result.
AfterResponse func(*FuncCommand, *cobra.Command, *modTypeDef, any) error
// cmd is the parent cobra command.
cmd *cobra.Command
// mod is the loaded module definition.
mod *moduleDef
// showHelp is set in the loader vertex to flag whether to show the help
// in the execution vertex.
showHelp bool
// showUsage flags whether to show a one-line usage message after error.
showUsage bool
q *querybuilder.Selection
c *client.Client
}
func (fc *FuncCommand) Command() *cobra.Command {
if fc.cmd == nil {
use := fmt.Sprintf("%s [flags] [command [flags]]...", fc.Name)
disableFlagsInUse := true
if fc.Execute != nil {
use = fc.Name
disableFlagsInUse = false
}
fc.cmd = &cobra.Command{
Use: use,
Aliases: fc.Aliases,
Short: fc.Short,
Long: fc.Long,
Example: fc.Example,
GroupID: funcGroup.ID,
Hidden: true, // for now, remove once we're ready for primetime
// We need to disable flag parsing because it'll act on --help
// and validate the args before we have a chance to add the
// subcommands.
DisableFlagParsing: true,
DisableFlagsInUseLine: disableFlagsInUse,
PreRunE: func(c *cobra.Command, a []string) error {
// Recover what DisableFlagParsing disabled.
// In PreRunE it's, already past the --help check and
// args validation, but not flag validation which we want.
c.DisableFlagParsing = false
// Since we disabled flag parsing, we'll get all args,
// not just flags. We want to stop parsing at the first
// possible dynamic sub-command since they've not been
// added yet.
c.Flags().SetInterspersed(false)
// Allow using flags with the name that was reported
// by the SDK. This avoids confusion as users are editing
// a module and trying to test its functions.
c.SetGlobalNormalizationFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName {
return pflag.NormalizedName(cliName(name))
})
// temporarily allow unknown flags so we can parse any global flags before starting
// the engine+TUI while not erroring out on module constructor flags (which can't be
// added until the engine has started)
c.FParseErrWhitelist.UnknownFlags = true
if err := c.ParseFlags(a); err != nil {
// This gives a chance for FuncCommand implementations to
// handle errors from parsing flags.
return c.FlagErrorFunc()(c, err)
}
c.FParseErrWhitelist.UnknownFlags = false
fc.showHelp, _ = c.Flags().GetBool("help")
return nil
},
// Between PreRunE and RunE, flags are validated.
RunE: func(c *cobra.Command, a []string) error {
return withEngineAndTUI(c.Context(), client.Params{}, func(ctx context.Context, engineClient *client.Client) (rerr error) {
fc.c = engineClient
// withEngineAndTUI changes the context.
c.SetContext(ctx)
// We need to print the errors ourselves because the root command
// will print the command path for this one (parent), not any
// sub-command.
c.SilenceErrors = true
return fc.execute(c, a)
})
},
}
if fc.Init != nil {
fc.Init(fc.cmd)
}
}
return fc.cmd
}
func (fc *FuncCommand) execute(c *cobra.Command, a []string) (rerr error) {
ctx := c.Context()
rec := progrock.FromContext(ctx)
// NB: Don't print full os.Args in Vertex name because we don't know which
// flags hold a secret value yet and don't want to risk exposing them.
// We'll print just the command path when we have the leaf command.
loader := rec.Vertex("cmd-func-loader", "load "+c.Name())
setCmdOutput(c, loader)
cmd, flags, err := fc.load(c, a, loader)
loader.Done(err)
if err != nil {
return err
}
vtx := rec.Vertex("cmd-func-exec", cmd.CommandPath(), progrock.Focused())
setCmdOutput(c, vtx)
defer func() {
if rerr != nil {
cmd.PrintErrln("Error:", rerr.Error())
if fc.showUsage {
cmd.PrintErrf("Run '%v --help' for usage.\n", cmd.CommandPath())
}
}
vtx.Done(rerr)
}()
// TODO: Move help output out of progrock?
if fc.showHelp {
// Hide aliases for sub-commands. They just allow using the SDK's
// casing for functions but there's no need to advertise.
if cmd != c {
cmd.Aliases = nil
}
return cmd.Help()
}
// There should be no args left, if there are it's an unknown command.
if err := cobra.NoArgs(cmd, flags); err != nil {
return err
}
if fc.Execute != nil {
return fc.Execute(fc, cmd)
}
// No args to the parent command, default to showing help.
if cmd == c {
return cmd.Help()
}
err = cmd.RunE(cmd, flags)
if err != nil {
return err
}
return nil
}
func (fc *FuncCommand) load(c *cobra.Command, a []string, vtx *progrock.VertexRecorder) (cmd *cobra.Command, _ []string, rerr error) {
ctx := c.Context()
dag := fc.c.Dagger()
// Print error in current vertex, before completing it.
defer func() {
if cmd == nil {
cmd = c
}
if rerr != nil {
cmd.PrintErrln("Error:", rerr.Error())
if fc.showHelp {
// Explicitly show the help here while still returning the error.
// This handles the case of `dagger call --help` run on a broken module; in that case
// we want to error out since we can't actually load the module and show all subcommands
// and flags in the help output, but we still want to show the user *something*
cmd.Help()
}
if fc.showUsage {
cmd.PrintErrf("Run '%v --help' for usage.\n", cmd.CommandPath())
}
}
}()
load := vtx.Task("loading module")
modConf, err := getDefaultModuleConfiguration(ctx, dag, "")
if err != nil {
return nil, nil, fmt.Errorf("failed to get configured module: %w", err)
}
if !modConf.FullyInitialized() {
return nil, nil, fmt.Errorf("module at source dir %q doesn't exist or is invalid", modConf.LocalSourcePath)
}
mod := modConf.Mod.Initialize()
_, err = mod.Serve(ctx)
load.Done(err)
if err != nil {
return nil, nil, err
}
load = vtx.Task("loading objects")
modDef, err := loadModTypeDefs(ctx, dag, mod)
load.Done(err)
if err != nil {
return nil, nil, err
}
obj := modDef.GetMainObject()
if obj == nil {
return nil, nil, fmt.Errorf("main object not found")
}
fc.mod = modDef
if fc.Execute != nil {
// if `Execute` is set, there's no need for sub-commands.
return nil, nil, nil
}
if obj.Constructor != nil {
// add constructor args as top-level flags
if err := fc.addArgsForFunction(c, a, obj.Constructor, dag); err != nil {
return nil, nil, err
}
fc.selectFunc(obj.Name, obj.Constructor, c, dag)
} else {
fc.Select(obj.Name)
}
// Add main object's functions as subcommands
fc.addSubCommands(c, dag, obj)
if fc.showHelp {
return nil, nil, nil
}
traverse := vtx.Task("traversing arguments")
cmd, flags, err := fc.traverse(c)
defer func() { traverse.Done(rerr) }()
if err != nil {
if errors.Is(err, pflag.ErrHelp) {
fc.showHelp = true
return cmd, flags, nil
}
fc.showUsage = true
return cmd, flags, err
}
return cmd, flags, nil
}
// traverse the arguments to build the command tree and return the leaf command.
func (fc *FuncCommand) traverse(c *cobra.Command) (*cobra.Command, []string, error) {
cmd, args, err := c.Find(c.Flags().Args())
if err != nil {
return cmd, args, err
}
// Leaf command
if cmd == c {
return cmd, args, nil
}
cmd.SetContext(c.Context())
cmd.InitDefaultHelpFlag()
// Load and ParseFlags
err = cmd.PreRunE(cmd, args)
if err != nil {
return cmd, args, err
}
return fc.traverse(cmd)
}
func (fc *FuncCommand) addSubCommands(cmd *cobra.Command, dag *dagger.Client, fnProvider functionProvider) {
if fnProvider != nil {
for _, fn := range fnProvider.GetFunctions() {
subCmd := fc.makeSubCmd(dag, fn)
cmd.AddCommand(subCmd)
}
}
}
func (fc *FuncCommand) makeSubCmd(dag *dagger.Client, fn *modFunction) *cobra.Command {
newCmd := &cobra.Command{
Use: cliName(fn.Name),
Short: fn.Description,
PreRunE: func(cmd *cobra.Command, args []string) (err error) {
if err := fc.addArgsForFunction(cmd, args, fn, dag); err != nil {
return err
}
fnProvider := fn.ReturnType.AsFunctionProvider()
if fnProvider == nil && fn.ReturnType.AsList != nil {
fnProvider = fn.ReturnType.AsList.ElementTypeDef.AsFunctionProvider()
}
fc.addSubCommands(cmd, dag, fnProvider)
// Show help for first command that has the --help flag.
help, _ := cmd.Flags().GetBool("help")
if help {
return pflag.ErrHelp
}
// Need to make the query selection before chaining off.
return fc.selectFunc(fn.Name, fn, cmd, dag)
},
// This is going to be executed in the "execution" vertex, when
// we have the final/leaf command.
RunE: func(cmd *cobra.Command, args []string) (err error) {
switch fn.ReturnType.Kind {
case dagger.ObjectKind, dagger.InterfaceKind:
if fc.OnSelectObjectLeaf == nil {
// there is no handling of this object and no further selections, error out
fc.showUsage = true
return fmt.Errorf("%q requires a sub-command", cmd.Name())
}
// the top-level command may handle this via OnSelectObjectLeaf
err := fc.OnSelectObjectLeaf(fc, fn.ReturnType.Name())
if err != nil {
fc.showUsage = true
return fmt.Errorf("invalid selection for command %q: %w", cmd.Name(), err)
}
case dagger.ListKind:
fnProvider := fn.ReturnType.AsList.ElementTypeDef.AsFunctionProvider()
if fnProvider != nil && len(fnProvider.GetFunctions()) > 0 {
// we don't handle lists of objects/interfaces w/ extra functions on any commands right now
fc.showUsage = true
return fmt.Errorf("%q requires a sub-command", cmd.Name())
}
}
if fc.BeforeRequest != nil {
if err = fc.BeforeRequest(fc, cmd, fn.ReturnType); err != nil {
return err
}
}
ctx := cmd.Context()
query, _ := fc.q.Build(ctx)
rec := progrock.FromContext(ctx)
rec.Debug("executing", progrock.Labelf("query", "%+v", query))
var response any
q := fc.q.Bind(&response)
if err := q.Execute(ctx, dag.GraphQLClient()); err != nil {
return fmt.Errorf("response from query: %w", err)
}
if fc.AfterResponse != nil {
return fc.AfterResponse(fc, cmd, fn.ReturnType, response)
}
if fn.ReturnType.Kind != dagger.VoidKind {
cmd.Println(response)
}
return nil
},
}
// Allow using the function name from the SDK as an alias for the command.
if fn.Name != newCmd.Name() {
newCmd.Aliases = append(newCmd.Aliases, fn.Name)
}
newCmd.Flags().SetInterspersed(false)
return newCmd
}
func (fc *FuncCommand) addArgsForFunction(cmd *cobra.Command, cmdArgs []string, fn *modFunction, dag *dagger.Client) error {
fc.mod.LoadTypeDef(fn.ReturnType)
for _, arg := range fn.Args {
fc.mod.LoadTypeDef(arg.TypeDef)
}
for _, arg := range fn.Args {
_, err := arg.AddFlag(cmd.Flags(), dag)
if err != nil {
return err
}
if !arg.TypeDef.Optional {
cmd.MarkFlagRequired(arg.FlagName())
}
}
if fc.BeforeParse != nil {
if err := fc.BeforeParse(fc, cmd, fn); err != nil {
return err
}
}
if err := cmd.ParseFlags(cmdArgs); err != nil {
// This gives a chance for FuncCommand implementations to
// handle errors from parsing flags.
return cmd.FlagErrorFunc()(cmd, err)
}
help, _ := cmd.Flags().GetBool("help")
if !help {
if err := cmd.ValidateRequiredFlags(); err != nil {
return err
}
if err := cmd.ValidateFlagGroups(); err != nil {
return err
}
}
return nil
}
// selectFunc adds the function selection to the query.
// Note that the type can change if there's an extra selection for supported types.
func (fc *FuncCommand) selectFunc(selectName string, fn *modFunction, cmd *cobra.Command, dag *dagger.Client) error {
fc.Select(selectName)
for _, arg := range fn.Args {
var val any
flag := cmd.Flags().Lookup(arg.FlagName())
if flag == nil {
return fmt.Errorf("no flag for %q", arg.FlagName())
}
// Don't send optional arguments that weren't set.
if arg.TypeDef.Optional && !flag.Changed {
continue
}
val = flag.Value
switch v := val.(type) {
case DaggerValue:
obj, err := v.Get(cmd.Context(), dag)
if err != nil {
return fmt.Errorf("failed to get value for argument %q: %w", arg.Name, err)
}
if obj == nil {
return fmt.Errorf("no value for argument: %s", arg.Name)
}
val = obj
case pflag.SliceValue:
val = v.GetSlice()
}
fc.Arg(arg.Name, val)
}
return nil
}
func (fc *FuncCommand) Select(name string) {
if fc.q == nil {
fc.q = querybuilder.Query()
}
fc.q = fc.q.Select(gqlFieldName(name))
}
func (fc *FuncCommand) Arg(name string, value any) {
fc.q = fc.q.Arg(gqlArgName(name), value)
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,409 | ✨ Allow cache volumes as CLI parameters | ### What are you trying to do?
I have a module with the following constructor:
```go
func New(
// ...
// Disable mounting cache volumes.
disableCache Optional[bool],
// Module cache volume to mount at /go/pkg/mod.
modCache Optional[*CacheVolume],
// Build cache volume to mount at ~/.cache/go-build.
buildCache Optional[*CacheVolume],
) *Go {
// ...
}
```
Currently, running this module in the CLI fails due to CacheVolume being an unsupported CLI argument:
```shell
❯ dagger call -m "github.com/sagikazarmark/daggerverse/go@main" --help
✘ load call ERROR [1.21s]
├ [0.56s] loading module
├ [0.65s] loading objects
┃ Error: unsupported object type "CacheVolume" for flag: mod-cache
```
Given cache volumes are created by their names (and that other types of objects, like files, are also referenced simply by their path or ID), I think it would be useful to do the same for cache volumes. In this instance:
```shell
❯ dagger call -m "github.com/sagikazarmark/daggerverse/go@main" --mod-cache go-build
```
An alternative I can imagine is adding a pragma comment for ignoring certain arguments from the CLI, but including them in the generated code. That's a temporary measure, but would still be easier for module developers, so they can utilize constructors instead of falling back to method chaining for tasks like setting cache.
### Why is this important to you?
_No response_
### How are you currently working around this?
I will probably remove those arguments from the constructor for now.
I might add them to the module API, but honestly, I'd rather not. | https://github.com/dagger/dagger/issues/6409 | https://github.com/dagger/dagger/pull/6520 | 0b91d2a3e04c81ad0dad799d34af30d3801ae76f | 7350f0b8dd5ff74b7ae0ddfd05e35c37bf16712b | "2024-01-12T07:04:04Z" | go | "2024-01-31T15:53:55Z" | core/integration/module_call_test.go | package core
import (
"fmt"
"strings"
"testing"
"dagger.io/dagger"
"github.com/stretchr/testify/require"
)
func TestModuleDaggerCallArgTypes(t *testing.T) {
t.Parallel()
t.Run("service args", func(t *testing.T) {
t.Parallel()
t.Run("used as service binding", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context, svc *Service) (string, error) {
return dag.Container().From("alpine:3.18").WithExec([]string{"apk", "add", "curl"}).
WithServiceBinding("daserver", svc).
WithExec([]string{"curl", "http://daserver:8000"}).
Stdout(ctx)
}
`,
})
logGen(ctx, t, modGen.Directory("."))
httpServer, _ := httpService(ctx, t, c, "im up")
endpoint, err := httpServer.Endpoint(ctx)
require.NoError(t, err)
out, err := modGen.
WithServiceBinding("testserver", httpServer).
With(daggerCall("fn", "--svc", "tcp://"+endpoint)).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "im up")
})
t.Run("used directly", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"fmt"
"strings"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context, svc *Service) (string, error) {
ports, err := svc.Ports(ctx)
if err != nil {
return "", err
}
var out []string
out = append(out, fmt.Sprintf("%d exposed ports:", len(ports)))
for _, port := range ports {
number, err := port.Port(ctx)
if err != nil {
return "", err
}
out = append(out, fmt.Sprintf("- TCP/%d", number))
}
return strings.Join(out, "\n"), nil
}
`,
})
logGen(ctx, t, modGen.Directory("."))
httpServer, _ := httpService(ctx, t, c, "im up")
endpoint, err := httpServer.Endpoint(ctx)
require.NoError(t, err)
out, err := modGen.
WithServiceBinding("testserver", httpServer).
With(daggerCall("fn", "--svc", "tcp://"+endpoint)).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "1 exposed ports:\n- TCP/8000")
})
})
t.Run("list args", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("foo.txt", dagger.ContainerWithNewFileOpts{
Contents: "bar",
}).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"strings"
)
type Minimal struct {}
func (m *Minimal) Hello(msgs []string) string {
return strings.Join(msgs, "+")
}
func (m *Minimal) Reads(ctx context.Context, files []File) (string, error) {
var contents []string
for _, f := range files {
content, err := f.Contents(ctx)
if err != nil {
return "", err
}
contents = append(contents, content)
}
return strings.Join(contents, "+"), nil
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(daggerCall("hello", "--msgs", "yo", "--msgs", "my", "--msgs", "friend")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "yo+my+friend")
out, err = modGen.With(daggerCall("reads", "--files=foo.txt", "--files=foo.txt")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "bar+bar")
})
t.Run("directory arg inputs", func(t *testing.T) {
t.Parallel()
t.Run("local dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("/dir/subdir/foo.txt", dagger.ContainerWithNewFileOpts{
Contents: "foo",
}).
WithNewFile("/dir/subdir/bar.txt", dagger.ContainerWithNewFileOpts{
Contents: "bar",
}).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct {}
func (m *Test) Fn(dir *Directory) *Directory {
return dir
}
`,
})
out, err := modGen.With(daggerCall("fn", "--dir", "/dir/subdir", "entries")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "bar.txt\nfoo.txt")
out, err = modGen.With(daggerCall("fn", "--dir", "file:///dir/subdir", "entries")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "bar.txt\nfoo.txt")
})
t.Run("git dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct {}
func (m *Test) Fn(dir *Directory, subpath Optional[string]) *Directory {
return dir.Directory(subpath.GetOr("."))
}
`,
})
for _, tc := range []struct {
baseURL string
subpath string
}{
{
baseURL: "https://github.com/dagger/dagger",
},
{
baseURL: "https://github.com/dagger/dagger",
subpath: ".changes",
},
{
baseURL: "https://github.com/dagger/dagger.git",
},
{
baseURL: "https://github.com/dagger/dagger.git",
subpath: ".changes",
},
} {
tc := tc
t.Run(fmt.Sprintf("%s:%s", tc.baseURL, tc.subpath), func(t *testing.T) {
url := tc.baseURL + "#v0.9.1"
if tc.subpath != "" {
url += ":" + tc.subpath
}
args := []string{"fn", "--dir", url}
if tc.subpath == "" {
args = append(args, "--subpath", ".changes")
}
args = append(args, "entries")
out, err := modGen.With(daggerCall(args...)).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, "v0.9.1.md")
require.NotContains(t, out, "v0.9.2.md")
})
}
})
})
t.Run("secret args", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Insecure(ctx context.Context, token *Secret) (string, error) {
return token.Plaintext(ctx)
}
`,
}).
WithEnvVariable("TOPSECRET", "shhh").
WithNewFile("/mysupersecret", dagger.ContainerWithNewFileOpts{Contents: "file shhh"})
t.Run("explicit env", func(t *testing.T) {
t.Run("happy", func(t *testing.T) {
out, err := modGen.With(daggerCall("insecure", "--token", "env:TOPSECRET")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "shhh", strings.TrimSpace(out))
})
t.Run("sad", func(t *testing.T) {
_, err := modGen.With(daggerCall("insecure", "--token", "env:NOWHERETOBEFOUND")).Stdout(ctx)
require.ErrorContains(t, err, `secret env var not found: "NOW..."`)
})
})
t.Run("implicit env", func(t *testing.T) {
t.Parallel()
t.Run("happy", func(t *testing.T) {
out, err := modGen.With(daggerCall("insecure", "--token", "TOPSECRET")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "shhh", strings.TrimSpace(out))
})
t.Run("sad", func(t *testing.T) {
_, err := modGen.With(daggerCall("insecure", "--token", "NOWHERETOBEFOUND")).Stdout(ctx)
require.ErrorContains(t, err, `secret env var not found: "NOW..."`)
})
})
t.Run("file", func(t *testing.T) {
t.Run("happy", func(t *testing.T) {
out, err := modGen.With(daggerCall("insecure", "--token", "file:/mysupersecret")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "file shhh", strings.TrimSpace(out))
})
t.Run("sad", func(t *testing.T) {
_, err := modGen.With(daggerCall("insecure", "--token", "file:/nowheretobefound")).Stdout(ctx)
require.ErrorContains(t, err, `failed to read secret file "/nowheretobefound": open /nowheretobefound: no such file or directory`)
})
})
t.Run("cmd", func(t *testing.T) {
t.Run("happy", func(t *testing.T) {
out, err := modGen.With(daggerCall("insecure", "--token", "cmd:echo -n cmd shhh")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "cmd shhh", strings.TrimSpace(out))
})
t.Run("sad", func(t *testing.T) {
_, err := modGen.With(daggerCall("insecure", "--token", "cmd:exit 1")).Stdout(ctx)
require.ErrorContains(t, err, `failed to run secret command "exit 1": exit status 1`)
})
})
t.Run("invalid source", func(t *testing.T) {
_, err := modGen.With(daggerCall("insecure", "--token", "wtf:HUH")).Stdout(ctx)
require.ErrorContains(t, err, `unsupported secret arg source: "wtf"`)
})
})
}
func TestModuleDaggerCallReturnTypes(t *testing.T) {
t.Parallel()
t.Run("return list objects", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {
Bar int ` + "`" + `json:"bar"` + "`" + `
}
func (m *Minimal) Fn() []*Foo {
var foos []*Foo
for i := 0; i < 3; i++ {
foos = append(foos, &Foo{Bar: i})
}
return foos
}
`,
})
logGen(ctx, t, modGen.Directory("."))
expected := "0\n1\n2"
t.Run("print", func(t *testing.T) {
out, err := modGen.With(daggerCall("fn", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, expected, strings.TrimSpace(out))
})
t.Run("output", func(t *testing.T) {
out, err := modGen.
With(daggerCall("fn", "bar", "-o", "./outfile")).
File("./outfile").
Contents(ctx)
require.NoError(t, err)
require.Equal(t, expected, strings.TrimSpace(out))
})
t.Run("json", func(t *testing.T) {
out, err := modGen.
With(daggerCall("fn", "bar", "--json")).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `[{"bar": 0}, {"bar": 1}, {"bar": 2}]`, out)
})
})
t.Run("return container", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{Ctr: dag.Container().From("alpine:3.18").WithExec([]string{"echo", "hello", "world"})}
}
type Test struct {
Ctr *Container
}
`,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("default", func(t *testing.T) {
ctr := modGen.With(daggerCall("ctr"))
out, err := ctr.Stdout(ctx)
require.NoError(t, err)
require.Empty(t, out)
out, err = ctr.Stderr(ctx)
require.NoError(t, err)
require.Contains(t, out, "Container evaluated")
})
t.Run("output", func(t *testing.T) {
modGen, err := modGen.With(daggerCall("ctr", "-o", "./container.tar")).Sync(ctx)
require.NoError(t, err)
size, err := modGen.File("./container.tar").Size(ctx)
require.NoError(t, err)
require.Greater(t, size, 0)
_, err = modGen.WithExec([]string{"tar", "tf", "./container.tar", "oci-layout"}).Sync(ctx)
require.NoError(t, err)
})
})
t.Run("return directory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
Dir: dag.Directory().WithNewFile("foo.txt", "foo").WithNewFile("bar.txt", "bar"),
}
}
type Test struct {
Dir *Directory
}
`,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("default", func(t *testing.T) {
ctr := modGen.With(daggerCall("dir"))
out, err := ctr.Stdout(ctx)
require.NoError(t, err)
require.Empty(t, out)
out, err = ctr.Stderr(ctx)
require.NoError(t, err)
require.Contains(t, out, "Directory evaluated")
})
t.Run("output", func(t *testing.T) {
modGen, err := modGen.With(daggerCall("dir", "-o", "./outdir")).Sync(ctx)
require.NoError(t, err)
entries, err := modGen.Directory("./outdir").Entries(ctx)
require.NoError(t, err)
require.Equal(t, "bar.txt\nfoo.txt", strings.Join(entries, "\n"))
foo, err := modGen.Directory("./outdir").File("foo.txt").Contents(ctx)
require.NoError(t, err)
require.Equal(t, "foo", strings.TrimSpace(foo))
bar, err := modGen.Directory("./outdir").File("bar.txt").Contents(ctx)
require.NoError(t, err)
require.Equal(t, "bar", strings.TrimSpace(bar))
})
})
t.Run("return file", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
File: dag.Directory().WithNewFile("foo.txt", "foo").File("foo.txt"),
}
}
type Test struct {
File *File
}
`,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("default", func(t *testing.T) {
ctr := modGen.With(daggerCall("file"))
out, err := ctr.Stdout(ctx)
require.NoError(t, err)
require.Empty(t, out)
out, err = ctr.Stderr(ctx)
require.NoError(t, err)
require.Contains(t, out, "File evaluated")
})
t.Run("output", func(t *testing.T) {
out, err := modGen.
With(daggerCall("file", "-o", "./outfile")).
File("./outfile").
Contents(ctx)
require.NoError(t, err)
require.Equal(t, "foo", strings.TrimSpace(out))
})
})
t.Run("sync", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{Ctr: dag.Container().From("alpine:3.18").WithExec([]string{"echo", "hello", "world"})}
}
type Test struct {
Ctr *Container
}
`,
})
// adding sync disables the default behavior of **not** printing the ID
// just verify it works without error for now
_, err := modGen.With(daggerCall("ctr", "sync")).Stdout(ctx)
require.NoError(t, err)
})
}
func TestModuleDaggerCallCoreChaining(t *testing.T) {
t.Parallel()
t.Run("container", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{Ctr: dag.Container().From("alpine:3.18.5")}
}
type Test struct {
Ctr *Container
}
`,
})
t.Run("file", func(t *testing.T) {
out, err := modGen.With(daggerCall("ctr", "file", "--path=/etc/alpine-release", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "3.18.5", strings.TrimSpace(out))
})
t.Run("export", func(t *testing.T) {
modGen, err := modGen.With(daggerCall("ctr", "export", "--path=./container.tar.gz")).Sync(ctx)
require.NoError(t, err)
size, err := modGen.File("./container.tar.gz").Size(ctx)
require.NoError(t, err)
require.Greater(t, size, 0)
})
})
t.Run("directory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
Dir: dag.Directory().WithNewFile("foo.txt", "foo").WithNewFile("bar.txt", "bar"),
}
}
type Test struct {
Dir *Directory
}
`,
})
t.Run("file", func(t *testing.T) {
out, err := modGen.With(daggerCall("dir", "file", "--path=foo.txt", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "foo", strings.TrimSpace(out))
})
t.Run("export", func(t *testing.T) {
modGen, err := modGen.With(daggerCall("dir", "export", "--path=./outdir")).Sync(ctx)
require.NoError(t, err)
ents, err := modGen.Directory("./outdir").Entries(ctx)
require.NoError(t, err)
require.Equal(t, []string{"bar.txt", "foo.txt"}, ents)
})
})
t.Run("return file", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
File: dag.Directory().WithNewFile("foo.txt", "foo").File("foo.txt"),
}
}
type Test struct {
File *File
}
`,
})
t.Run("size", func(t *testing.T) {
out, err := modGen.With(daggerCall("file", "size")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "3", strings.TrimSpace(out))
})
t.Run("export", func(t *testing.T) {
modGen, err := modGen.With(daggerCall("file", "export", "--path=./outfile")).Sync(ctx)
require.NoError(t, err)
contents, err := modGen.File("./outfile").Contents(ctx)
require.NoError(t, err)
require.Equal(t, "foo", strings.TrimSpace(contents))
})
})
}
func TestModuleDaggerCallSaveOutput(t *testing.T) {
// NB: Normal usage is tested in TestModuleDaggerCallReturnTypes.
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct {
}
func (t *Test) Hello() string {
return "hello"
}
func (t *Test) File() *File {
return dag.Directory().WithNewFile("foo.txt", "foo").File("foo.txt")
}
`,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("truncate file", func(t *testing.T) {
out, err := modGen.
WithNewFile("foo.txt", dagger.ContainerWithNewFileOpts{
Contents: "foobar",
}).
With(daggerCall("hello", "-o", "foo.txt")).
File("foo.txt").
Contents(ctx)
require.NoError(t, err)
require.Equal(t, "hello", strings.TrimSpace(out))
})
t.Run("not a file", func(t *testing.T) {
_, err := modGen.With(daggerCall("hello", "-o", ".")).Sync(ctx)
require.ErrorContains(t, err, "is a directory")
})
t.Run("allow dir for file", func(t *testing.T) {
out, err := modGen.
With(daggerCall("file", "-o", ".")).
File("foo.txt").
Contents(ctx)
require.NoError(t, err)
require.Equal(t, "foo", strings.TrimSpace(out))
})
t.Run("create parent dirs", func(t *testing.T) {
ctr, err := modGen.With(daggerCall("hello", "-o", "foo/bar.txt")).Sync(ctx)
require.NoError(t, err)
t.Run("print success", func(t *testing.T) {
// should print success to stderr so it doesn't interfere with piping output
out, err := ctr.Stderr(ctx)
require.NoError(t, err)
require.Contains(t, out, `Saved output to "/work/foo/bar.txt"`)
})
t.Run("check directory permissions", func(t *testing.T) {
out, err := ctr.WithExec([]string{"stat", "-c", "%a", "foo"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "755", strings.TrimSpace(out))
})
t.Run("check file permissions", func(t *testing.T) {
out, err := ctr.WithExec([]string{"stat", "-c", "%a", "foo/bar.txt"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "644", strings.TrimSpace(out))
})
})
t.Run("check umask", func(t *testing.T) {
ctr, err := modGen.
WithNewFile("/entrypoint.sh", dagger.ContainerWithNewFileOpts{
Contents: `#!/bin/sh
umask 027
exec "$@"
`,
Permissions: 0o750,
}).
WithEntrypoint([]string{"/entrypoint.sh"}).
With(daggerCall("hello", "-o", "/tmp/foo/bar.txt")).
Sync(ctx)
require.NoError(t, err)
t.Run("directory", func(t *testing.T) {
out, err := ctr.WithExec([]string{"stat", "-c", "%a", "/tmp/foo"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "750", strings.TrimSpace(out))
})
t.Run("file", func(t *testing.T) {
out, err := ctr.WithExec([]string{"stat", "-c", "%a", "/tmp/foo/bar.txt"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "640", strings.TrimSpace(out))
})
})
}
func TestModuleCallByName(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/mod-a").
With(daggerExec("mod", "init", "--name=mod-a", "--sdk=go")).
WithNewFile("/work/mod-a/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type ModA struct {}
func (m *ModA) Fn(ctx context.Context) string {
return "hi from mod-a"
}
`,
}).
WithWorkdir("/work/mod-b").
With(daggerExec("mod", "init", "--name=mod-b", "--sdk=go")).
WithNewFile("/work/mod-b/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type ModB struct {}
func (m *ModB) Fn(ctx context.Context) string {
return "hi from mod-b"
}
`,
}).
WithWorkdir("/work").
With(daggerExec("mod", "init")).
With(daggerExec("mod", "install", "--name", "foo", "./mod-a")).
With(daggerExec("mod", "install", "--name", "bar", "./mod-b"))
out, err := ctr.With(daggerCallAt("foo", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from mod-a", strings.TrimSpace(out))
out, err = ctr.With(daggerCallAt("bar", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from mod-b", strings.TrimSpace(out))
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,312 | Modules: `dag.Host()` name is extremely confusing | When module code uses `dag.Host()`, the "host" it refers to is the module container's "host", not the CLI caller's host.
While this is technically consistent, it's very non-obvious at first glance and a constant source of confusion.
I think at a minimum we need to change `Host` to something with a more obvious name. TBD if this change also impacts non-module SDKs or if it's somehow scoped just to the codegen for modules.
There's certainly larger scope changes to the API that could also be worth discussing, but changing to a more clear name seems like the bare-minimum baseline thing to do here.
---
As a side-note, support for Module code being able to read files/env vars/etc. from the *CLI caller's host* is a separate topic, discussed in this other issue https://github.com/dagger/dagger/issues/6112 | https://github.com/dagger/dagger/issues/6312 | https://github.com/dagger/dagger/pull/6535 | c241d901a48f699a1d62f0daad882c88730e1fba | 7a63c3d019530d1f08b2f72cc28e753d99b5896d | "2023-12-21T19:46:28Z" | go | "2024-02-01T14:23:42Z" | cmd/codegen/introspection/introspection.go | package introspection
import (
_ "embed"
)
// Query is the query generated by graphiql to determine type information
//
//go:embed introspection.graphql
var Query string
// Response is the introspection query response
type Response struct {
Schema *Schema `json:"__schema"`
}
type Schema struct {
QueryType struct {
Name string `json:"name"`
} `json:"queryType"`
MutationType struct {
Name string `json:"name"`
} `json:"mutationType"`
SubscriptionType struct {
Name string `json:"name"`
} `json:"subscriptionType"`
Types Types `json:"types"`
}
func (s *Schema) Query() *Type {
return s.Types.Get(s.QueryType.Name)
}
func (s *Schema) Mutation() *Type {
return s.Types.Get(s.MutationType.Name)
}
func (s *Schema) Subscription() *Type {
return s.Types.Get(s.SubscriptionType.Name)
}
func (s *Schema) Visit() []*Type {
v := Visitor{schema: s}
return v.Run()
}
type TypeKind string
const (
TypeKindScalar = TypeKind("SCALAR")
TypeKindObject = TypeKind("OBJECT")
TypeKindInterface = TypeKind("INTERFACE")
TypeKindUnion = TypeKind("UNION")
TypeKindEnum = TypeKind("ENUM")
TypeKindInputObject = TypeKind("INPUT_OBJECT")
TypeKindList = TypeKind("LIST")
TypeKindNonNull = TypeKind("NON_NULL")
)
type Scalar string
const (
ScalarInt = Scalar("Int")
ScalarFloat = Scalar("Float")
ScalarString = Scalar("String")
ScalarBoolean = Scalar("Boolean")
)
type Type struct {
Kind TypeKind `json:"kind"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Fields []*Field `json:"fields,omitempty"`
InputFields []InputValue `json:"inputFields,omitempty"`
EnumValues []EnumValue `json:"enumValues,omitempty"`
}
type Types []*Type
func (t Types) Get(name string) *Type {
for _, i := range t {
if i.Name == name {
return i
}
}
return nil
}
type Field struct {
Name string `json:"name"`
Description string `json:"description"`
TypeRef *TypeRef `json:"type"`
Args InputValues `json:"args"`
IsDeprecated bool `json:"isDeprecated"`
DeprecationReason string `json:"deprecationReason"`
ParentObject *Type `json:"-"`
}
type TypeRef struct {
Kind TypeKind `json:"kind"`
Name string `json:"name,omitempty"`
OfType *TypeRef `json:"ofType,omitempty"`
}
func (r TypeRef) IsOptional() bool {
return r.Kind != TypeKindNonNull
}
func (r TypeRef) IsScalar() bool {
ref := r
if r.Kind == TypeKindNonNull {
ref = *ref.OfType
}
if ref.Kind == TypeKindScalar {
return true
}
if ref.Kind == TypeKindEnum {
return true
}
return false
}
func (r TypeRef) IsObject() bool {
ref := r
if r.Kind == TypeKindNonNull {
ref = *ref.OfType
}
if ref.Kind == TypeKindObject {
return true
}
return false
}
func (r TypeRef) IsList() bool {
ref := r
if r.Kind == TypeKindNonNull {
ref = *ref.OfType
}
if ref.Kind == TypeKindList {
return true
}
return false
}
type InputValues []InputValue
func (i InputValues) HasOptionals() bool {
for _, v := range i {
if v.TypeRef.IsOptional() {
return true
}
}
return false
}
type InputValue struct {
Name string `json:"name"`
Description string `json:"description"`
DefaultValue *string `json:"defaultValue"`
TypeRef *TypeRef `json:"type"`
}
type EnumValue struct {
Name string `json:"name"`
Description string `json:"description"`
IsDeprecated bool `json:"isDeprecated"`
DeprecationReason string `json:"deprecationReason"`
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,312 | Modules: `dag.Host()` name is extremely confusing | When module code uses `dag.Host()`, the "host" it refers to is the module container's "host", not the CLI caller's host.
While this is technically consistent, it's very non-obvious at first glance and a constant source of confusion.
I think at a minimum we need to change `Host` to something with a more obvious name. TBD if this change also impacts non-module SDKs or if it's somehow scoped just to the codegen for modules.
There's certainly larger scope changes to the API that could also be worth discussing, but changing to a more clear name seems like the bare-minimum baseline thing to do here.
---
As a side-note, support for Module code being able to read files/env vars/etc. from the *CLI caller's host* is a separate topic, discussed in this other issue https://github.com/dagger/dagger/issues/6112 | https://github.com/dagger/dagger/issues/6312 | https://github.com/dagger/dagger/pull/6535 | c241d901a48f699a1d62f0daad882c88730e1fba | 7a63c3d019530d1f08b2f72cc28e753d99b5896d | "2023-12-21T19:46:28Z" | go | "2024-02-01T14:23:42Z" | core/integration/module_test.go | package core
import (
"context"
_ "embed"
"encoding/json"
"fmt"
"go/format"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"time"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/dagql/idproto"
"github.com/iancoleman/strcase"
"github.com/moby/buildkit/identity"
"github.com/stretchr/testify/require"
"github.com/tidwall/gjson"
"golang.org/x/sync/errgroup"
"dagger.io/dagger"
"github.com/dagger/dagger/cmd/codegen/introspection"
)
func TestModuleGoInit(t *testing.T) {
t.Parallel()
t.Run("from scratch", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=bare", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("reserved go.mod name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=go", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{go{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"go":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("uses expected Go module name, camel-cases Dagger module name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=My-Module", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{myModule{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"myModule":{"containerEcho":{"stdout":"hello\n"}}}`, out)
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
t.Run("creates go.mod beneath an existing go.mod if root points beneath it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/go.mod", dagger.ContainerWithNewFileOpts{
Contents: "module example.com/test\n",
}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/ci").
With(daggerExec("mod", "init", "--name=beneathGoMod", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{beneathGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"beneathGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("names Go module after Dagger module", func(t *testing.T) {
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
})
t.Run("respects existing go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
With(daggerExec("mod", "init", "--name=hasGoMod", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("preserves module name", func(t *testing.T) {
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module example.com/test")
})
})
t.Run("respects parent go.mod if root points to it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
With(daggerExec("mod", "init", "-m=./child", "--name=child", "--sdk=go")).
WithWorkdir("/work/child").
// explicitly sync to see whether it makes a go.mod
With(daggerExec("mod", "sync")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
require.Equal(t, []string{"child", "dagger.json", "foo.go", "go.mod", "go.sum"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.NotContains(t, childEntries, "go.mod")
t.Run("preserves parent module name", func(t *testing.T) {
goMod, err := generated.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, goMod, "module example.com/test")
})
})
t.Run("respects existing go.mod even if root points to parent that has go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/child").
WithExec([]string{"go", "mod", "init", "my-mod"}).
WithWorkdir("/work").
With(daggerExec("mod", "init", "-m=./child", "--name=child", "--sdk=go")).
WithWorkdir("/work/child").
// explicitly sync to see whether it makes a go.mod
With(daggerExec("mod", "sync")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
// no go.sum
require.Equal(t, []string{"child", "dagger.json", "foo.go", "go.mod"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.Contains(t, childEntries, "go.mod")
require.Contains(t, childEntries, "go.sum")
})
t.Run("respects existing main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasMainGo struct {}
func (m *HasMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("mod", "init", "--name=hasMainGo", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{hasMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("respects existing main.go even if it uses types not generated yet", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasDaggerTypes struct {}
func (m *HasDaggerTypes) Hello() *Container {
return dag.Container().
From("` + alpineImage + `").
WithExec([]string{"echo", "Hello, world!"})
}
`,
}).
With(daggerExec("mod", "init", "--name=hasDaggerTypes", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{hasDaggerTypes{hello{stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasDaggerTypes":{"hello":{"stdout":"Hello, world!\n"}}}`, out)
})
t.Run("respects existing package without creating main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/notmain.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type HasNotMainGo struct {}
func (m *HasNotMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("mod", "init", "--name=hasNotMainGo", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{hasNotMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasNotMainGo":{"hello":"Hello, world!"}}`, out)
})
}
func TestModulePythonInit(t *testing.T) {
t.Run("from scratch", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=bare", "--sdk=python"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("with different root", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "-m=child", "--name=bare", "--sdk=python"))
out, err := modGen.
With(daggerQueryAt("child", `{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("respects existing pyproject.toml", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("pyproject.toml", dagger.ContainerWithNewFileOpts{
Contents: `[project]
name = "has-pyproject"
version = "0.0.0"
`,
}).
With(daggerExec("mod", "init", "--name=hasPyproject", "--sdk=python"))
out, err := modGen.
With(daggerQuery(`{hasPyproject{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasPyproject":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("preserves module name", func(t *testing.T) {
generated, err := modGen.File("pyproject.toml").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, `name = "has-pyproject"`)
})
})
t.Run("respects existing main.py", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/src/main/__init__.py", dagger.ContainerWithNewFileOpts{
Contents: "from . import notmain\n",
}).
WithNewFile("/work/src/main/notmain.py", dagger.ContainerWithNewFileOpts{
Contents: `from dagger import function
@function
def hello() -> str:
return "Hello, world!"
`,
}).
With(daggerExec("mod", "init", "--name=hasMainPy", "--sdk=python"))
out, err := modGen.
With(daggerQuery(`{hasMainPy{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasMainPy":{"hello":"Hello, world!"}}`, out)
})
t.Run("uses expected field casing", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=hello-world", "--sdk=python")).
With(sdkSource("python", `from dagger import field, function, object_type
@object_type
class HelloWorld:
my_name: str = field(default="World")
@function
def message(self) -> str:
return f"Hello, {self.my_name}!"
`,
))
out, err := modGen.
With(daggerQuery(`{helloWorld(myName: "Monde"){message}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"helloWorld":{"message":"Hello, Monde!"}}`, out)
})
}
func TestModuleInitLICENSE(t *testing.T) {
t.Run("bootstraps Apache-2.0 LICENSE file if none found", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=licensed-to-ill", "--sdk=go"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("creates LICENSE file in the directory specified by -m", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "-m", "./mymod", "--name=licensed-to-ill", "--sdk=go"))
content, err := modGen.File("mymod/LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("does not bootstrap LICENSE file if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("mod", "init", "--name=licensed-to-ill", "--sdk=go"))
_, err := modGen.File("LICENSE").Contents(ctx)
require.Error(t, err)
})
t.Run("bootstraps a LICENSE file when requested, even if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("mod", "init", "--name=licensed-to-ill", "--sdk=go", "--license=MIT"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "MIT License")
})
}
func TestModuleGit(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
gitGeneratedFiles []string
gitIgnoredFiles []string
}
for _, tc := range []testCase{
{
sdk: "go",
gitGeneratedFiles: []string{
"/dagger.gen.go",
"/querybuilder/**",
},
},
{
sdk: "python",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
{
sdk: "typescript",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
} {
tc := tc
t.Run(fmt.Sprintf("module %s git", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
With(daggerExec("mod", "init", "--name=bare", "--sdk="+tc.sdk))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("configures .gitattributes", func(t *testing.T) {
ignore, err := modGen.File(".gitattributes").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitGeneratedFiles {
require.Contains(t, ignore, fmt.Sprintf("%s linguist-generated\n", fileName))
}
})
if len(tc.gitIgnoredFiles) > 0 {
t.Run("configures .gitignore", func(t *testing.T) {
ignore, err := modGen.File(".gitignore").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitIgnoredFiles {
require.Contains(t, ignore, fileName)
}
})
}
})
}
}
//go:embed testdata/modules/go/minimal/main.go
var goSignatures string
func TestModuleGoSignatures(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("func Hello() string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello"}}`, out)
})
t.Run("func Echo(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echo(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echo":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointer(*string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointerPointer(**string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointerPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointerPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoOptional(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptional(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalPointer(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalPointer}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalSlice([]string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalSlice(msg: ["hello", "there"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"hello+there...hello+there...hello+there..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalSlice}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"foobar...foobar...foobar..."}}`, out)
})
t.Run("func Echoes([]string) []string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoes(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoes":["hello...hello...hello..."]}}`, out)
})
t.Run("func EchoesVariadic(...string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoesVariadic(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoesVariadic":"hello...hello...hello..."}}`, out)
})
t.Run("func HelloContext(context.Context) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloContext}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloContext":"hello context"}}`, out)
})
t.Run("func EchoContext(context.Context, string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoContext(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoContext":"ctx.hello...ctx.hello...ctx.hello..."}}`, out)
})
t.Run("func HelloStringError() (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloStringError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloStringError":"hello i worked"}}`, out)
})
t.Run("func HelloVoid()", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoid}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoid":null}}`, out)
})
t.Run("func HelloVoidError() error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoidError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoidError":null}}`, out)
})
t.Run("func EchoOpts(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInline(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlinePointer(*struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineCtx(ctx, struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineTags(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsPragmas(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsPragmas(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsPragmas":"hi...hi...hi..."}}`, out)
})
}
//go:embed testdata/modules/typescript/minimal/index.ts
var tsSignatures string
func TestModuleTypescriptSignatures(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=typescript")).
WithNewFile("src/index.ts", dagger.ContainerWithNewFileOpts{
Contents: tsSignatures,
})
t.Run("hello(): string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello"}}`, out)
})
t.Run("echoes(msgs: string[]): string[]", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoes(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoes":["hello...hello...hello..."]}}`, out)
})
t.Run("echoOptional(msg = 'default'): string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptional(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"default...default...default..."}}`, out)
})
t.Run("echoesVariadic(...msgs: string[]): string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoesVariadic(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoesVariadic":"hello...hello...hello..."}}`, out)
})
t.Run("echo(msg: string): string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echo(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echo":"hello...hello...hello..."}}`, out)
})
t.Run("echoOptionalSlice(msg = ['foobar']): string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalSlice(msg: ["hello", "there"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"hello+there...hello+there...hello+there..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalSlice}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"foobar...foobar...foobar..."}}`, out)
})
t.Run("helloVoid(): void", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoid}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoid":null}}`, out)
})
t.Run("echoOpts(msg: string, suffix: string = '', times: number = 1): string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi!hi!"}}`, out)
t.Run("execute with unordered args", func(t *testing.T) {
out, err = modGen.With(daggerQuery(`{minimal{echoOpts(times: 2, msg: "order", suffix: "?")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"order?order?"}}`, out)
})
})
t.Run("echoMaybe(msg: string, isQuestion = false): string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoMaybe(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoMaybe":"hi...hi...hi..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoMaybe(msg: "hi", isQuestion: true)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoMaybe":"hi?...hi?...hi?..."}}`, out)
t.Run("execute with unordered args", func(t *testing.T) {
out, err = modGen.With(daggerQuery(`{minimal{echoMaybe(isQuestion: false, msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoMaybe":"hi...hi...hi..."}}`, out)
})
})
}
func TestModuleGoSignaturesBuiltinTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Minimal struct {}
func (m *Minimal) Read(ctx context.Context, dir Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadPointer(ctx context.Context, dir *Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadSlice(ctx context.Context, dir []Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadVariadic(ctx context.Context, dir ...Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadOptional(ctx context.Context, dir Optional[Directory]) (string, error) {
d, ok := dir.Get()
if ok {
return d.File("foo").Contents(ctx)
}
return "", nil
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(daggerQuery(`{directory{withNewFile(path: "foo", contents: "bar"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
dirID := gjson.Get(out, "directory.withNewFile.id").String()
t.Run("func Read(ctx, Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{read(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"read":"bar"}}`, out)
})
t.Run("func ReadPointer(ctx, *Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readPointer(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readPointer":"bar"}}`, out)
})
t.Run("func ReadSlice(ctx, []Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readSlice(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readSlice":"bar"}}`, out)
})
t.Run("func ReadVariadic(ctx, ...Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readVariadic(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readVariadic":"bar"}}`, out)
})
t.Run("func ReadOptional(ctx, Optional[Directory]) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readOptional(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":"bar"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{readOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":""}}`, out)
})
}
func TestModuleGoSignaturesUnexported(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) string {
return name
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(inspectModule).Stdout(ctx)
require.NoError(t, err)
objs := gjson.Get(out, "host.directory.asModule.initialize.objects")
require.Equal(t, 1, len(objs.Array()))
minimal := objs.Get(`0.asObject`)
require.Equal(t, "Minimal", minimal.Get("name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err = modGen.With(inspectModule).Stdout(ctx)
require.NoError(t, err)
objs = gjson.Get(out, "host.directory.asModule.initialize.objects")
require.Equal(t, 2, len(objs.Array()))
minimal = objs.Get(`0.asObject`)
require.Equal(t, "Minimal", minimal.Get("name").String())
foo := objs.Get(`1.asObject`)
require.Equal(t, "MinimalFoo", foo.Get("name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {
Bar bar
}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
logGen(ctx, t, modGen.Directory("."))
_, err = modGen.With(inspectModule).Stderr(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "cannot code-generate unexported type bar")
}
func TestModuleGoSignaturesMixMatch(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
func (m *Minimal) Hello(name string, opts struct{}, opts2 struct{}) string {
return name
}
`,
})
logGen(ctx, t, modGen.Directory("."))
_, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "nested structs are not supported")
}
func TestModuleGoSignaturesNameConflict(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {
Foo Foo
Bar Bar
Baz Baz
}
type Foo struct {}
type Bar struct {}
type Baz struct {}
func (m *Foo) Hello(name string) string {
return name
}
func (f *Bar) Hello(name string, name2 string) string {
return name + name2
}
func (b *Baz) Hello() (string, error) {
return "", nil
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(inspectModule).Stdout(ctx)
require.NoError(t, err)
objs := gjson.Get(out, "host.directory.asModule.initialize.objects")
require.Equal(t, 4, len(objs.Array()))
obj := objs.Get(`0.asObject`)
require.Equal(t, "Minimal", obj.Get("name").String())
obj = objs.Get(`1.asObject`)
require.Equal(t, "MinimalFoo", obj.Get("name").String())
obj = objs.Get(`2.asObject`)
require.Equal(t, "MinimalBar", obj.Get("name").String())
obj = objs.Get(`3.asObject`)
require.Equal(t, "MinimalBaz", obj.Get("name").String())
}
var inspectModule = daggerQuery(`
query {
host {
directory(path: ".") {
asModule {
initialize {
description
objects {
asObject {
name
description
functions {
name
description
args {
name
description
defaultValue
}
}
fields {
name
description
}
}
}
}
}
}
}
}
`)
func TestModuleGoDocs(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(inspectModule).Stdout(ctx)
require.NoError(t, err)
obj := gjson.Get(out, "host.directory.asModule.initialize.objects.0.asObject")
require.Equal(t, "Minimal", obj.Get("name").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Empty(t, hello.Get("description").String())
require.Empty(t, hello.Get("args").Array())
// test the args-based form
echoOpts := obj.Get(`functions.#(name="echoOpts")`)
require.Equal(t, "echoOpts", echoOpts.Get("name").String())
require.Equal(t, "EchoOpts does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the inline struct form
echoOpts = obj.Get(`functions.#(name="echoOptsInline")`)
require.Equal(t, "echoOptsInline", echoOpts.Get("name").String())
require.Equal(t, "EchoOptsInline does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the arg-based form (with pragmas)
echoOpts = obj.Get(`functions.#(name="echoOptsPragmas")`)
require.Equal(t, "echoOptsPragmas", echoOpts.Get("name").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "", echoOpts.Get("args.0.defaultValue").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "\"...\"", echoOpts.Get("args.1.defaultValue").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "3", echoOpts.Get("args.2.defaultValue").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
}
func TestModuleGoDocsEdgeCases(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
// Minimal is a thing
type Minimal struct {
// X is this
X, Y string // Y is not this
// +private
Z string
}
// some docs
func (m *Minimal) Hello(foo string, bar string,
// hello
baz string, qux string, x string, // lol
) string {
return foo + bar
}
func (m *Minimal) HelloMore(
// foo here
foo,
// bar here
bar string,
) string {
return foo + bar
}
func (m *Minimal) HelloMoreInline(opts struct{
// foo here
foo, bar string
}) string {
return opts.foo + opts.bar
}
func (m *Minimal) HelloAgain( // docs for helloagain
foo string,
bar string, // docs for bar
baz string,
) string {
return foo + bar
}
func (m *Minimal) HelloFinal(
foo string) string { // woops
return foo
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(inspectModule).Stdout(ctx)
require.NoError(t, err)
obj := gjson.Get(out, "host.directory.asModule.initialize.objects.0.asObject")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Equal(t, "Minimal is a thing", obj.Get("description").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 5)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "hello", hello.Get("args.2.description").String())
require.Equal(t, "qux", hello.Get("args.3.name").String())
require.Equal(t, "", hello.Get("args.3.description").String())
require.Equal(t, "x", hello.Get("args.4.name").String())
require.Equal(t, "lol", hello.Get("args.4.description").String())
hello = obj.Get(`functions.#(name="helloMore")`)
require.Equal(t, "helloMore", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "bar here", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloMoreInline")`)
require.Equal(t, "helloMoreInline", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloAgain")`)
require.Equal(t, "helloAgain", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 3)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "docs for bar", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "", hello.Get("args.2.description").String())
hello = obj.Get(`functions.#(name="helloFinal")`)
require.Equal(t, "helloFinal", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 1)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Len(t, obj.Get(`fields`).Array(), 2)
prop := obj.Get(`fields.#(name="x")`)
require.Equal(t, "x", prop.Get("name").String())
require.Equal(t, "X is this", prop.Get("description").String())
prop = obj.Get(`fields.#(name="y")`)
require.Equal(t, "y", prop.Get("name").String())
require.Equal(t, "", prop.Get("description").String())
}
func TestModuleGoWeirdFields(t *testing.T) {
// these are all cases that used to panic due to the disparity in the type spec and the ast
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Z string
type Minimal struct {
// field with single (normal) name
W string
// field with multiple names
X, Y string
// field with no names
Z
}
func New() Minimal {
return Minimal{
W: "-",
X: "-",
Y: "-",
Z: Z("-"),
}
}
// struct with no fields
type Bar struct{}
func (m *Minimal) Say(
// field with single (normal) name
a string,
// field with multiple names
b, c string,
// field with no names (not included, mixed names not allowed)
// string
) string {
return a + " " + b + " " + c
}
func (m *Minimal) Hello(
// field with no names
string,
) string {
return "hello"
}
func (m *Minimal) SayOpts(opts struct{
// field with single (normal) name
A string
// field with multiple names
B, C string
// field with no names (not included because of above)
// string
}) string {
return opts.A + " " + opts.B + " " + opts.C
}
func (m *Minimal) HelloOpts(opts struct{
// field with no names
string
}) string {
return "hello"
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(daggerQuery(`{minimal{w, x, y, z}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"w": "-", "x": "-", "y": "-", "z": "-"}}`, out)
for _, name := range []string{"say", "sayOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(a: "hello", b: "world", c: "!")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello world !"}}`, name), out)
}
for _, name := range []string{"hello", "helloOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(string: "")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello"}}`, name), out)
}
}
func TestModuleGoOptionalMustBeNil(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
func (m *Minimal) Foo(x *Optional[*string]) string {
if v, _ := x.Get(); v != nil {
panic("uh oh")
}
return ""
}
func (m *Minimal) Bar(opts struct {
x *Optional[*string]
}) string {
if v, _ := opts.x.Get(); v != nil {
panic("uh oh")
}
return ""
}
func (m *Minimal) Baz(
// +optional
x *string,
) string {
if x != nil {
panic("uh oh")
}
return ""
}
func (m *Minimal) Qux(opts struct {
// +optional
x *string
}) string {
if opts.x != nil {
panic("uh oh")
}
return ""
}
`,
})
logGen(ctx, t, modGen.Directory("."))
for _, name := range []string{"foo", "bar", "baz", "qux"} {
out, err := modGen.With(daggerQuery(`{minimal{%s}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": ""}}`, name), out)
}
}
func TestModuleGoFieldMustBeNil(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "fmt"
type Minimal struct {
Src *Directory
Name *string
}
func New() *Minimal {
return &Minimal{}
}
func (m *Minimal) IsEmpty() bool {
if m.Name != nil {
panic(fmt.Sprintf("name should be nil but is %v", m.Name))
}
if m.Src != nil {
panic(fmt.Sprintf("src should be nil but is %v", m.Src))
}
return true
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{isEmpty}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"isEmpty": true}}`, out)
}
func TestModuleDescription(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
sdk string
source string
}{
{
sdk: "python",
source: `"""Minimal module, short description
Long description, with full sentences.
"""
from dagger import field, function, object_type
@object_type
class Minimal:
"""Minimal object, short description"""
foo: str = field(default="foo")
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(inspectModule).Stdout(ctx)
require.NoError(t, err)
mod := gjson.Get(out, "host.directory.asModule.initialize")
require.Equal(t,
"Minimal module, short description\n\nLong description, with full sentences.",
mod.Get("description").String(),
)
require.Equal(t,
"Minimal object, short description",
mod.Get("objects.0.asObject.description").String(),
)
})
}
}
func TestModulePrivateField(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
sdk string
source string
}{
{
sdk: "go",
source: `package main
type Minimal struct {
Foo string
Bar string // +private
}
func (m *Minimal) Set(foo string, bar string) *Minimal {
m.Foo = foo
m.Bar = bar
return m
}
func (m *Minimal) Hello() string {
return m.Foo + m.Bar
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Minimal:
foo: str = field(default="")
bar: str = ""
@function
def set(self, foo: str, bar: str) -> "Minimal":
self.foo = foo
self.bar = bar
return self
@function
def hello(self) -> str:
return self.foo + self.bar
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object
class Minimal {
@field
foo: string
bar?: string
constructor(foo?: string, bar?: string) {
this.foo = foo
this.bar = bar
}
@func
set(foo: string, bar: string): Minimal {
this.foo = foo
this.bar = bar
return this
}
@func
hello(): string {
return this.foo + this.bar
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=minimal", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(inspectModule).Stdout(ctx)
require.NoError(t, err)
obj := gjson.Get(out, "host.directory.asModule.initialize.objects.0.asObject")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Len(t, obj.Get(`fields`).Array(), 1)
prop := obj.Get(`fields.#(name="foo")`)
require.Equal(t, "foo", prop.Get("name").String())
out, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){hello}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"hello": "abcxyz"}}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){foo}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"foo": "abc"}}}`, out)
_, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){bar}}}`)).Stdout(ctx)
require.ErrorContains(t, err, `Minimal has no such field: "bar"`)
})
}
}
// this is no longer allowed, but verify the SDK errors out
func TestModuleGoExtendCore(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=container", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
func (c *Container) Echo(ctx context.Context, msg string) (string, error) {
return c.WithExec([]string{"echo", msg}).Stdout(ctx)
}
`,
}).
With(daggerQuery(`{container{from(address:"` + alpineImage + `"){echo(msg:"echo!"){stdout}}}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "cannot define methods on objects from outside this module")
}
func TestModuleCustomTypes(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Test struct{}
func (m *Test) Repeater(msg string, times int) *Repeater {
return &Repeater{
Message: msg,
Times: times,
}
}
type Repeater struct {
Message string
Times int
}
func (t *Repeater) Render() string {
return strings.Repeat(t.Message, t.Times)
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Repeater:
message: str = field(default="")
times: int = field(default=0)
@function
def render(self) -> str:
return self.message * self.times
@function
def repeater(msg: str, times: int) -> Repeater:
return Repeater(message=msg, times=times)
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object
class Repeater {
@field
message: string
@field
times: number
constructor(message: string, times: number) {
this.message = message
this.times = times
}
@func
render(): string {
return this.message.repeat(this.times)
}
}
@object
class Test {
@func
repeater(msg: string, times: number): Repeater {
return new Repeater(msg, times)
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("custom %s types", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{test{repeater(msg:"echo!", times: 3){render}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"repeater":{"render":"echo!echo!echo!"}}}`, out)
})
}
}
func TestModuleReturnTypeDetection(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
}
func (m *Foo) MyFunction() X {
return X{Message: "foo"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
@function
def my_function() -> X:
return X(message="foo")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object
class X {
@field
message: string
constructor(message: string) {
this.message = message;
}
}
@object
class Foo {
@func
myFunction(): X {
return new X("foo");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{foo{myFunction{message}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo"}}}`, out)
})
}
}
func TestModuleReturnObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
When string ` + "`json:\"Timestamp\"`" + `
To string ` + "`json:\"recipient\"`" + `
From string
}
func (m *Foo) MyFunction() X {
return X{Message: "foo", When: "now", To: "user", From: "admin"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
when: str = field(default="", name="Timestamp")
to: str = field(default="", name="recipient")
from_: str = field(default="", name="from")
@object_type
class Foo:
@function
def my_function(self) -> X:
return X(message="foo", when="now", to="user", from_="admin")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object
class X {
@field
message: string
@field
timestamp: string
@field
recipient: string
@field
from: string
constructor(message: string, timestamp: string, recipient: string, from: string) {
this.message = message;
this.timestamp = timestamp;
this.recipient = recipient;
this.from = from;
}
}
@object
class Foo {
@func
myFunction(): X {
return new X("foo", "now", "user", "admin");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{foo{myFunction{message, recipient, from, timestamp}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo", "recipient":"user", "from":"admin", "timestamp":"now"}}}`, out)
})
}
}
func TestModuleReturnNestedObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type Foo struct {
MsgContainer Bar
}
type Bar struct {
Msg string
}
func (m *Playground) MyFunction() Foo {
return Foo{MsgContainer: Bar{Msg: "hello world"}}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Bar:
msg: str = field()
@object_type
class Foo:
msg_container: Bar = field()
@object_type
class Playground:
@function
def my_function(self) -> Foo:
return Foo(msg_container=Bar(msg="hello world"))
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object
class Bar {
@field
msg: string;
constructor(msg: string) {
this.msg = msg;
}
}
@object
class Foo {
@field
msgContainer: Bar;
constructor(msgContainer: Bar) {
this.msgContainer = msgContainer;
}
}
@object
class Playground {
@func
myFunction(): Foo {
return new Foo(new Bar("hello world"));
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{playground{myFunction{msgContainer{msg}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myFunction":{"msgContainer":{"msg": "hello world"}}}}`, out)
})
}
}
func TestModuleReturnCompositeCore(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
func (m *Playground) MySlice() []*Container {
return []*Container{dag.Container().From("alpine:latest").WithExec([]string{"echo", "hello world"})}
}
type Foo struct {
Con *Container
// verify fields can remain nil w/out error too
UnsetFile *File
}
func (m *Playground) MyStruct() *Foo {
return &Foo{Con: dag.Container().From("alpine:latest").WithExec([]string{"echo", "hello world"})}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class Foo:
con: dagger.Container = field()
unset_file: dagger.File | None = field(default=None)
@object_type
class Playground:
@function
def my_slice(self) -> list[dagger.Container]:
return [dag.container().from_("alpine:latest").with_exec(["echo", "hello world"])]
@function
def my_struct(self) -> Foo:
return Foo(con=dag.container().from_("alpine:latest").with_exec(["echo", "hello world"]))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, File, object, func, field } from "@dagger.io/dagger"
@object
class Foo {
@field
con: Container
@field
unsetFile?: File
constructor(con: Container, usetFile?: File) {
this.con = con
this.usetFile = usetFile
}
}
@object
class Playground {
@func
mySlice(): Container[] {
return [
dag.container().from("alpine:latest").withExec(["echo", "hello world"])
]
}
@func
myStruct(): Foo {
return new Foo(
dag.container().from("alpine:latest").withExec(["echo", "hello world"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{playground{mySlice{stdout}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"mySlice":[{"stdout":"hello world\n"}]}}`, out)
out, err = modGen.With(daggerQuery(`{playground{myStruct{con{stdout}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myStruct":{"con":{"stdout":"hello world\n"}}}}`, out)
})
}
}
func TestModuleReturnComplexThing(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type ScanResult struct {
Containers []*Container ` + "`json:\"targets\"`" + `
Report ScanReport
}
type ScanReport struct {
Contents string ` + "`json:\"contents\"`" + `
Authors []string ` + "`json:\"Authors\"`" + `
}
func (m *Playground) Scan() ScanResult {
return ScanResult{
Containers: []*Container{
dag.Container().From("alpine:latest").WithExec([]string{"echo", "hello world"}),
},
Report: ScanReport{
Contents: "hello world",
Authors: []string{"foo", "bar"},
},
}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class ScanReport:
contents: str = field()
authors: list[str] = field()
@object_type
class ScanResult:
containers: list[dagger.Container] = field(name="targets")
report: ScanReport = field()
@object_type
class Playground:
@function
def scan(self) -> ScanResult:
return ScanResult(
containers=[
dag.container().from_("alpine:latest").with_exec(["echo", "hello world"]),
],
report=ScanReport(
contents="hello world",
authors=["foo", "bar"],
),
)
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object
class ScanReport {
@field
contents: string
@field
authors: string[]
constructor(contents: string, authors: string[]) {
this.contents = contents
this.authors = authors
}
}
@object
class ScanResult {
@field
targets: Container[]
@field
report: ScanReport
constructor(containers: Container[], report: ScanReport) {
this.targets = containers
this.report = report
}
}
@object
class Playground {
@func
async scan(): Promise<ScanResult> {
return new ScanResult(
[
dag.container().from("alpine:latest").withExec(["echo", "hello world"])
],
new ScanReport("hello world", ["foo", "bar"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{playground{scan{targets{stdout},report{contents,authors}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"scan":{"targets":[{"stdout":"hello world\n"}],"report":{"contents":"hello world","authors":["foo","bar"]}}}}`, out)
})
}
}
func TestModulePythonReturnSelf(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=foo", "--sdk=python")).
WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `from typing import Self
from dagger import field, function, object_type
@object_type
class Foo:
message: str = field(default="")
@function
def bar(self) -> Self:
self.message = "foobar"
return self
`,
})
out, err := modGen.With(daggerQuery(`{foo{bar{message}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"bar":{"message":"foobar"}}}`, out)
}
func TestModuleGlobalVarDAG(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
type Foo struct {}
var someDefault = dag.Container().From("alpine:latest")
func (m *Foo) Fn(ctx context.Context) (string, error) {
return someDefault.WithExec([]string{"echo", "foo"}).Stdout(ctx)
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function, object_type
SOME_DEFAULT = dag.container().from_("alpine:latest")
@object_type
class Foo:
@function
async def fn(self) -> str:
return await SOME_DEFAULT.with_exec(["echo", "foo"]).stdout()
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from "@dagger.io/dagger"
var someDefault = dag.container().from("alpine:latest")
@object
class Foo {
@func
async fn(): Promise<string> {
return someDefault.withExec(["echo", "foo"]).stdout()
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{foo{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"fn":"foo\n"}}`, out)
})
}
}
func TestModuleIDableType(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {
Data string
}
func (m *Foo) Set(data string) *Foo {
m.Data = data
return m
}
func (m *Foo) Get() string {
return m.Data
}
`,
},
{
sdk: "python",
source: `from typing import Self
from dagger import field, function, object_type
@object_type
class Foo:
data: str = ""
@function
def set(self, data: str) -> Self:
self.data = data
return self
@function
def get(self) -> str:
return self.data
`,
},
{
sdk: "typescript",
source: `
import { object, func } from "@dagger.io/dagger"
@object
class Foo {
data: string = ""
@func
set(data: string): Foo {
this.data = data
return this
}
@func
get(): string {
return this.data
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
// sanity check
out, err := modGen.With(daggerQuery(`{foo{set(data: "abc"){get}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"set":{"get": "abc"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{set(data: "abc"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.set.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.set(data: "abc"): Foo!`)
out, err = modGen.With(daggerQuery(`{loadFooFromID(id: "%s"){get}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"loadFooFromID":{"get": "abc"}}`, out)
})
}
}
func TestModuleArgOwnType(t *testing.T) {
// Verify use of a module's own object as an argument type.
// The server needs to specifically decode the input type from an ID into
// the raw JSON, since the module doesn't understand it's own types as IDs
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Foo struct{}
type Message struct {
Content string
}
func (m *Foo) SayHello(name string) Message {
return Message{Content: "hello " + name}
}
func (m *Foo) Upper(msg Message) Message {
msg.Content = strings.ToUpper(msg.Content)
return msg
}
func (m *Foo) Uppers(msg []Message) []Message {
for i := range msg {
msg[i].Content = strings.ToUpper(msg[i].Content)
}
return msg
}`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Message:
content: str = field()
@object_type
class Foo:
@function
def say_hello(self, name: str) -> Message:
return Message(content=f"hello {name}")
@function
def upper(self, msg: Message) -> Message:
msg.content = msg.content.upper()
return msg
@function
def uppers(self, msg: list[Message]) -> list[Message]:
for m in msg:
m.content = m.content.upper()
return msg
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object
class Message {
@field
content: string
constructor(content: string) {
this.content = content
}
}
@object
class Foo {
@func
sayHello(name: string): Message {
return new Message("hello " + name)
}
@func
upper(msg: Message): Message {
msg.content = msg.content.toUpperCase()
return msg
}
@func
uppers(msg: Message[]): Message[] {
for (let i = 0; i < msg.length; i++) {
msg[i].content = msg[i].content.toUpperCase()
}
return msg
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{foo{sayHello(name: "world"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.sayHello.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.sayHello(name: "world"): FooMessage!`)
out, err = modGen.With(daggerQuery(`{foo{upper(msg:"%s"){content}}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"upper":{"content": "HELLO WORLD"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{uppers(msg:["%s", "%s"]){content}}}`, id, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"uppers":[{"content": "HELLO WORLD"}, {"content": "HELLO WORLD"}]}}`, out)
})
}
}
func TestModuleConflictingSameNameDeps(t *testing.T) {
// A -> B -> Dint
// A -> C -> Dstr
// where Dint and Dstr are modules with the same name and same object names but conflicting types
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dstr").
With(daggerExec("mod", "init", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo string
}
func (m *D) Fn(foo string) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dint").
With(daggerExec("mod", "init", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo int
}
func (m *D) Fn(foo int) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("mod", "init", "-m=c", "--name=c", "--sdk=go")).
WithWorkdir("/work/c").
With(daggerExec("mod", "install", "../dstr")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type C struct{}
func (m *C) Fn(ctx context.Context, foo string) (string, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("mod", "init", "-m=b", "--name=b", "--sdk=go")).
With(daggerExec("mod", "install", "-m=b", "./dint")).
WithNewFile("/work/b/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type B struct{}
func (m *B) Fn(ctx context.Context, foo int) (int, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("mod", "init", "-m=a", "--name=a", "--sdk=go")).
WithWorkdir("/work/a").
With(daggerExec("mod", "install", "../b")).
With(daggerExec("mod", "install", "../c")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"strconv"
)
type A struct{}
func (m *A) Fn(ctx context.Context) (string, error) {
fooStr, err := dag.C().Fn(ctx, "foo")
if err != nil {
return "", err
}
fooInt, err := dag.B().Fn(ctx, 123)
if err != nil {
return "", err
}
return fooStr + strconv.Itoa(fooInt), nil
}
`,
})
out, err := ctr.With(daggerQuery(`{a{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"a":{"fn": "foo123"}}`, out)
// verify that no types from (transitive) deps show up
types := currentSchema(ctx, t, ctr).Types
require.NotNil(t, types.Get("A"))
require.Nil(t, types.Get("B"))
require.Nil(t, types.Get("C"))
require.Nil(t, types.Get("D"))
}
func TestModuleSelfAPICall(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"github.com/Khan/genqlient/graphql"
)
type Test struct{}
func (m *Test) FnA(ctx context.Context) (string, error) {
resp := &graphql.Response{}
err := dag.c.MakeRequest(ctx, &graphql.Request{
Query: "{test{fnB}}",
}, resp)
if err != nil {
return "", err
}
return resp.Data.(map[string]any)["test"].(map[string]any)["fnB"].(string), nil
}
func (m *Test) FnB() string {
return "hi from b"
}
`,
}).
With(daggerQuery(`{test{fnA}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fnA": "hi from b"}}`, out)
}
func TestModuleGoWithOtherModuleTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("mod", "init", "--name=dep", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Dep struct{}
type Obj struct {
Foo string
}
func (m *Dep) Fn() Obj {
return Obj{Foo: "foo"}
}
`,
}).
WithWorkdir("/work").
With(daggerExec("mod", "init", "-m=test", "--name=test", "--sdk=go")).
With(daggerExec("mod", "install", "-m=test", "./dep")).
WithWorkdir("/work/test")
t.Run("return as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() (*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() ([]*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
})
t.Run("arg as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj *DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj []*DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
})
t.Run("field as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo *DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo []*DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
})
}
func TestModulePythonWithOtherModuleTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("mod", "init", "--name=dep", "--sdk=python")).
WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `from dagger import field, function, object_type
@object_type
class Foo:
...
@object_type
class Obj:
foo: str = field()
@object_type
class Dep:
@function
def fn(self) -> Obj:
return Obj(foo="foo")
`,
}).
WithWorkdir("/work").
With(daggerExec("mod", "init", "-m=test", "--name=test", "--sdk=python")).
WithWorkdir("/work/test").
With(daggerExec("mod", "install", "../dep"))
t.Run("return as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `import dagger
@dagger.object_type
class Test:
@dagger.function
def fn(self) -> dagger.DepObj:
...
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.Regexp(t, fmt.Sprintf(
`object\s+%q\s+function\s+%q\s+cannot\s+return\s+external\s+type\s+from\s+dependency\s+module\s+%q`,
"Test", "fn", "dep",
), err.Error())
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `import dagger
@dagger.object_type
class Test:
@dagger.function
def fn(self) -> list[dagger.DepObj]:
...
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.Regexp(t, fmt.Sprintf(
`object\s+%q\s+function\s+%q\s+cannot\s+return\s+external\s+type\s+from\s+dependency\s+module\s+%q`,
"Test", "fn", "dep",
), err.Error())
})
})
t.Run("arg as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `import dagger
@dagger.object_type
class Test:
@dagger.function
def fn(self, obj: dagger.DepObj):
...
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.Regexp(t, fmt.Sprintf(
`object\s+%q\s+function\s+%q\s+arg\s+%q\s+cannot\s+reference\s+external\s+type\s+from\s+dependency\s+module\s+%q`,
"Test", "fn", "obj", "dep",
), err.Error())
})
t.Run("list", func(t *testing.T) {
_, err := ctr.WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `import dagger
@dagger.object_type
class Test:
@dagger.function
def fn(self, obj: list[dagger.DepObj]):
...
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.Regexp(t, fmt.Sprintf(
`object\s+%q\s+function\s+%q\s+arg\s+%q\s+cannot\s+reference\s+external\s+type\s+from\s+dependency\s+module\s+%q`,
"Test", "fn", "obj", "dep",
), err.Error())
})
})
t.Run("field as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `import dagger
@dagger.object_type
class Obj:
foo: dagger.DepObj = dagger.field()
@dagger.object_type
class Test:
@dagger.function
def fn(self) -> Obj:
...
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.Regexp(t, fmt.Sprintf(
`object\s+%q\s+field\s+%q\s+cannot\s+reference\s+external\s+type\s+from\s+dependency\s+module\s+%q`,
"Obj", "foo", "dep",
), err.Error())
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("src/main.py", dagger.ContainerWithNewFileOpts{
Contents: `import dagger
@dagger.object_type
class Obj:
foo: list[dagger.DepObj] = dagger.field()
@dagger.object_type
class Test:
@dagger.function
def fn(self) -> list[Obj]:
...
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.Regexp(t, fmt.Sprintf(
`object\s+%q\s+field\s+%q\s+cannot\s+reference\s+external\s+type\s+from\s+dependency\s+module\s+%q`,
"Obj", "foo", "dep",
), err.Error())
})
})
}
var useInner = `package main
type Dep struct{}
func (m *Dep) Hello() string {
return "hello"
}
`
var useGoOuter = `package main
import "context"
type Use struct{}
func (m *Use) UseHello(ctx context.Context) (string, error) {
return dag.Dep().Hello(ctx)
}
`
var usePythonOuter = `from dagger import dag, function
@function
def use_hello() -> str:
return dag.dep().hello()
`
var useTSOuter = `
import { dag, object, func } from '@dagger.io/dagger'
@object
class Use {
@func
async useHello(): Promise<string> {
return dag.dep().hello()
}
}
`
func TestModuleUseLocal(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("mod", "init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("mod", "install", "./dep"))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// cannot use transitive dependency directly
_, err = modGen.With(daggerQuery(`{dep{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, `Query has no such field: "dep"`)
})
}
}
func TestModuleCodegenOnDepChange(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
changed string
expected string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
expected: "Hellov2",
changed: strings.ReplaceAll(useGoOuter, `Hello(ctx)`, `Hellov2(ctx)`),
},
{
sdk: "python",
source: usePythonOuter,
expected: "hellov2",
changed: strings.ReplaceAll(usePythonOuter, `.hello()`, `.hellov2()`),
},
{
sdk: "typescript",
source: useTSOuter,
expected: "hellov2",
changed: strings.ReplaceAll(useTSOuter, `.hello()`, `.hellov2()`),
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("mod", "init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("mod", "install", "./dep"))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// make back-incompatible change to dep
newInner := strings.ReplaceAll(useInner, `Hello()`, `Hellov2()`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("mod", "sync"))
codegenContents, err := modGen.File(sdkCodegenFile(t, tc.sdk)).Contents(ctx)
require.NoError(t, err)
require.Contains(t, codegenContents, tc.expected)
modGen = modGen.With(sdkSource(tc.sdk, tc.changed))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
})
}
}
func TestModuleSyncDeps(t *testing.T) {
// verify that changes to deps result in a sync to the depender module
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("mod", "init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("mod", "install", "./dep"))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
modGen = modGen.With(daggerQuery(`{use{useHello}}`))
out, err := modGen.Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
newInner := strings.ReplaceAll(useInner, `"hello"`, `"goodbye"`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("mod", "sync"))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"goodbye"}}`, out)
})
}
}
func TestModuleUseLocalMulti(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
import "fmt"
type Use struct {}
func (m *Use) Names(ctx context.Context) ([]string, error) {
fooName, err := dag.Foo().Name(ctx)
if err != nil {
return nil, fmt.Errorf("foo.name: %w", err)
}
barName, err := dag.Bar().Name(ctx)
if err != nil {
return nil, fmt.Errorf("bar.name: %w", err)
}
return []string{fooName, barName}, nil
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function
@function
async def names() -> list[str]:
return [
await dag.foo().name(),
await dag.bar().name(),
]
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from '@dagger.io/dagger'
@object
class Use {
@func
async names(): Promise<string[]> {
return [await dag.foo().name(), await dag.bar().name()]
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/foo").
WithNewFile("/work/foo/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Foo struct {}
func (m *Foo) Name() string { return "foo" }
`,
}).
With(daggerExec("mod", "init", "--name=foo", "--sdk=go")).
WithWorkdir("/work/bar").
WithNewFile("/work/bar/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Bar struct {}
func (m *Bar) Name() string { return "bar" }
`,
}).
With(daggerExec("mod", "init", "--name=bar", "--sdk=go")).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=use", "--sdk="+tc.sdk)).
With(daggerExec("mod", "install", "./foo")).
With(daggerExec("mod", "install", "./bar")).
With(sdkSource(tc.sdk, tc.source)).
WithEnvVariable("BUST", identity.NewID()) // NB(vito): hmm...
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{use{names}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"names":["foo", "bar"]}}`, out)
})
}
}
func TestModuleConstructor(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("basic", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(
ctx context.Context,
foo string,
bar Optional[int],
baz []string,
dir *Directory,
) *Test {
return &Test{
Foo: foo,
Bar: bar.GetOr(42),
Baz: baz,
Dir: dir,
}
}
type Test struct {
Foo string
Bar int
Baz []string
Dir *Directory
NeverSetDir *Directory
}
func (m *Test) GimmeFoo() string {
return m.Foo
}
func (m *Test) GimmeBar() int {
return m.Bar
}
func (m *Test) GimmeBaz() []string {
return m.Baz
}
func (m *Test) GimmeDirEnts(ctx context.Context) ([]string, error) {
return m.Dir.Entries(ctx)
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import field, function, object_type
@object_type
class Test:
foo: str = field()
dir: dagger.Directory = field()
bar: int = field(default=42)
baz: list[str] = field(default=list)
never_set_dir: dagger.Directory | None = field(default=None)
@function
def gimme_foo(self) -> str:
return self.foo
@function
def gimme_bar(self) -> int:
return self.bar
@function
def gimme_baz(self) -> list[str]:
return self.baz
@function
async def gimme_dir_ents(self) -> list[str]:
return await self.dir.entries()
`,
},
{
sdk: "typescript",
source: `
import { Directory, object, func, field } from '@dagger.io/dagger';
@object
class Test {
@field
foo: string
@field
dir: Directory
@field
bar: number
@field
baz: string[]
@field
neverSetDir?: Directory
constructor(foo: string, dir: Directory, bar = 42, baz: string[] = []) {
this.foo = foo;
this.dir = dir;
this.bar = bar;
this.baz = baz;
}
@func
gimmeFoo(): string {
return this.foo;
}
@func
gimmeBar(): number {
return this.bar;
}
@func
gimmeBaz(): string[] {
return this.baz;
}
@func
async gimmeDirEnts(): Promise<string[]> {
return this.dir.entries();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("mod", "init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-dir-ents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, strings.TrimSpace(out), "dagger.json")
})
}
})
t.Run("fields only", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(ctx context.Context) (Test, error) {
v, err := dag.Container().From("alpine:3.18.4").File("/etc/alpine-release").Contents(ctx)
if err != nil {
return Test{}, err
}
return Test{
AlpineVersion: v,
}, nil
}
type Test struct {
AlpineVersion string
}
`,
},
{
sdk: "python",
source: `from dagger import dag, field, function, object_type
@object_type
class Test:
alpine_version: str = field()
@classmethod
async def create(cls) -> "Test":
return cls(alpine_version=await (
dag.container()
.from_("alpine:3.18.4")
.file("/etc/alpine-release")
.contents()
))
`,
},
{
sdk: "typescript",
source: `
import { dag, object, field } from "@dagger.io/dagger"
@object
class Test {
@field
alpineVersion: string
// NOTE: this is standard to do async operations in the constructor.
// This is only for testing purpose but it shouldn't be done in real usage.
constructor() {
return (async () => {
this.alpineVersion = await dag.container().from("alpine:3.18.4").file("/etc/alpine-release").contents()
return this; // Return the newly-created instance
})();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("mod", "init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := ctr.With(daggerCall("alpine-version")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "3.18.4")
})
}
})
t.Run("return error", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"fmt"
)
func New() (*Test, error) {
return nil, fmt.Errorf("too bad")
}
type Test struct {
Foo string
}
`,
},
{
sdk: "python",
source: `from dagger import object_type, field
@object_type
class Test:
foo: str = field()
def __init__(self):
raise ValueError("too bad")
`,
},
{
sdk: "typescript",
source: `
import { object, field } from "@dagger.io/dagger"
@object
class Test {
@field
foo: string
constructor() {
throw new Error("too bad")
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("mod", "init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
_, err := ctr.With(daggerCall("foo")).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "too bad")
})
}
})
t.Run("python: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("mod", "init", "--name=test", "--sdk=python")).
With(sdkSource("python", fmt.Sprintf(`import dagger
from dagger import dag, object_type, field
@object_type
class Test:
foo: dagger.File = field(default=lambda: (
dag.directory()
.with_new_file("foo.txt", contents="%s")
.file("foo.txt")
))
bar: list[str] = field(default=list)
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "python"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
t.Run("typescript: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("mod", "init", "--name=test", "--sdk=typescript")).
With(sdkSource("typescript", fmt.Sprintf(`
import { dag, File, object, field } from "@dagger.io/dagger"
@object
class Test {
@field
foo: File = dag.directory().withNewFile("foo.txt", "%s").file("foo.txt")
@field
bar: string[] = []
// Allow foo to be set through the constructor
constructor(foo?: File) {
if (foo) {
this.foo = foo
}
}
}
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "typescript"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
}
func TestModuleWrapping(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Wrapper struct{}
func (m *Wrapper) Container() *WrappedContainer {
return &WrappedContainer{
dag.Container().From("alpine"),
}
}
type WrappedContainer struct {
Unwrap *Container` + "`" + `json:"unwrap"` + "`" + `
}
func (c *WrappedContainer) Echo(msg string) *WrappedContainer {
return &WrappedContainer{
c.Unwrap.WithExec([]string{"echo", "-n", msg}),
}
}
`,
},
{
sdk: "python",
source: `from typing import Self
import dagger
from dagger import dag, field, function, object_type
@object_type
class WrappedContainer:
unwrap: dagger.Container = field()
@function
def echo(self, msg: str) -> Self:
return WrappedContainer(unwrap=self.unwrap.with_exec(["echo", "-n", msg]))
@object_type
class Wrapper:
@function
def container(self) -> WrappedContainer:
return WrappedContainer(unwrap=dag.container().from_("alpine"))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object
class WrappedContainer {
@field
unwrap: Container
constructor(unwrap: Container) {
this.unwrap = unwrap
}
@func
echo(msg: string): WrappedContainer {
return new WrappedContainer(this.unwrap.withExec(["echo", "-n", msg]))
}
}
@object
class Wrapper {
@func
container(): WrappedContainer {
return new WrappedContainer(dag.container().from("alpine"))
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=wrapper", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
id := identity.NewID()
out, err := modGen.With(daggerQuery(
fmt.Sprintf(`{wrapper{container{echo(msg:%q){unwrap{stdout}}}}}`, id),
)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t,
fmt.Sprintf(`{"wrapper":{"container":{"echo":{"unwrap":{"stdout":%q}}}}}`, id),
out)
})
}
}
func TestModuleTypescriptInit(t *testing.T) {
t.Run("from scratch", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=bare", "--sdk=typescript"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("with different root", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "-m=child", "--name=bare", "--sdk=typescript"))
out, err := modGen.
With(daggerQueryAt("child", `{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
out, err = modGen.
WithWorkdir("/work/child").
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("camel-cases Dagger module name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=My-Module", "--sdk=typescript"))
out, err := modGen.
With(daggerQuery(`{myModule{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"myModule":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("respect existing package.json", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/package.json", dagger.ContainerWithNewFileOpts{
Contents: `{
"name": "my-module",
"version": "1.0.0",
"description": "My module",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "John doe",
"license": "MIT"
}`,
}).
With(daggerExec("mod", "init", "--name=hasPkgJson", "--sdk=typescript"))
out, err := modGen.
With(daggerQuery(`{hasPkgJson{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasPkgJson":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("Add dagger dependencies to the existing package.json", func(t *testing.T) {
pkgJSON, err := modGen.File("/work/package.json").Contents(ctx)
require.NoError(t, err)
require.Contains(t, pkgJSON, `"@dagger.io/dagger":`)
require.Contains(t, pkgJSON, `"name": "my-module"`)
})
})
t.Run("respect existing tsconfig.json", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/tsconfig.json", dagger.ContainerWithNewFileOpts{
Contents: `{
"compilerOptions": {
"target": "ES2022",
"moduleResolution": "Node",
"experimentalDecorators": true
}
}`,
}).
With(daggerExec("mod", "init", "--name=hasTsConfig", "--sdk=typescript"))
out, err := modGen.
With(daggerQuery(`{hasTsConfig{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasTsConfig":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("Add dagger paths to the existing tsconfig.json", func(t *testing.T) {
tsConfig, err := modGen.File("/work/tsconfig.json").Contents(ctx)
require.NoError(t, err)
require.Contains(t, tsConfig, `"@dagger.io/dagger":`)
})
})
t.Run("respect existing src/index.ts", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithDirectory("/work/src", c.Directory()).
WithNewFile("/work/src/index.ts", dagger.ContainerWithNewFileOpts{
Contents: `
import { dag, Container, object, func } from "@dagger.io/dagger"
@object
// eslint-disable-next-line @typescript-eslint/no-unused-vars
class ExistingSource {
/**
* example usage: "dagger call container-echo --string-arg yo"
*/
@func
helloWorld(stringArg: string): Container {
return dag.container().from("alpine:latest").withExec(["echo", stringArg])
}
}
`,
}).
With(daggerExec("mod", "init", "--name=existingSource", "--sdk=typescript"))
out, err := modGen.
With(daggerQuery(`{existingSource{helloWorld(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"existingSource":{"helloWorld":{"stdout":"hello\n"}}}`, out)
})
}
func TestModuleLotsOfFunctions(t *testing.T) {
t.Parallel()
const funcCount = 100
t.Run("go sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
package main
type PotatoSack struct {}
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
func (m *PotatoSack) Potato%d() string {
return "potato #%d"
}
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("mod", "init", "--name=potatoSack", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("python sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `from dagger import function
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@function
def potato_%d() -> str:
return "potato #%d"
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("./src/main.py", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("mod", "init", "--name=potatoSack", "--sdk=python"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("typescript sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
import { object, func } from "@dagger.io/dagger"
@object
class PotatoSack {
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@func
potato_%d(): string {
return "potato #%d"
}
`, i, i)
}
mainSrc += "\n}"
modGen := c.
Container().
From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(sdkSource("typescript", mainSrc)).
With(daggerExec("mod", "init", "--name=potatoSack", "--sdk=typescript"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
}
func TestModuleLotsOfDeps(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
modCount := 0
getModMainSrc := func(name string, depNames []string) string {
t.Helper()
mainSrc := fmt.Sprintf(`package main
import "context"
type %s struct {}
func (m *%s) Fn(ctx context.Context) (string, error) {
s := "%s"
var depS string
_ = depS
var err error
_ = err
`, strcase.ToCamel(name), strcase.ToCamel(name), name)
for _, depName := range depNames {
mainSrc += fmt.Sprintf(`
depS, err = dag.%s().Fn(ctx)
if err != nil {
return "", err
}
s += depS
`, strcase.ToCamel(depName))
}
mainSrc += "return s, nil\n}\n"
fmted, err := format.Source([]byte(mainSrc))
require.NoError(t, err)
return string(fmted)
}
// need to construct dagger.json directly in order to avoid excessive
// `dagger mod use` calls while constructing the huge DAG of deps
var rootCfg modules.ModuleConfig
addModulesWithDeps := func(newMods int, depNames []string) []string {
t.Helper()
var newModNames []string
for i := 0; i < newMods; i++ {
name := fmt.Sprintf("mod%d", modCount)
modCount++
newModNames = append(newModNames, name)
modGen = modGen.
WithWorkdir("/work/"+name).
WithNewFile("./main.go", dagger.ContainerWithNewFileOpts{
Contents: getModMainSrc(name, depNames),
})
var depCfgs []*modules.ModuleConfigDependency
for _, depName := range depNames {
depCfgs = append(depCfgs, &modules.ModuleConfigDependency{
Name: depName,
Source: filepath.Join("..", depName),
})
}
modGen = modGen.With(configFile(".", &modules.ModuleConfig{
Name: name,
SDK: "go",
Dependencies: depCfgs,
}))
rootCfg.RootFor = append(rootCfg.RootFor, &modules.ModuleConfigRootFor{
Source: name,
})
}
return newModNames
}
// Create a base module, then add 6 layers of deps, where each layer has one more module
// than the previous layer and each module within the layer has a dep on each module
// from the previous layer. Finally add a single module at the top that depends on all
// modules from the last layer and call that.
// Basically, this creates a quadratically growing DAG of modules and verifies we
// handle it efficiently enough to be callable.
curDeps := addModulesWithDeps(1, nil)
for i := 0; i < 6; i++ {
curDeps = addModulesWithDeps(len(curDeps)+1, curDeps)
}
addModulesWithDeps(1, curDeps)
modGen = modGen.With(configFile("..", &rootCfg))
_, err := modGen.With(daggerCall("fn")).Sync(ctx)
require.NoError(t, err)
}
func TestModuleNamespacing(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
moduleSrcPath, err := filepath.Abs("./testdata/modules/go/namespacing")
require.NoError(t, err)
ctr := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithMountedDirectory("/work", c.Host().Directory(moduleSrcPath)).
WithWorkdir("/work")
out, err := ctr.
With(daggerQuery(`{test{fn(s:"yo")}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fn":["*main.Sub1Obj made 1:yo", "*main.Sub2Obj made 2:yo"]}}`, out)
}
func TestModuleLoops(t *testing.T) {
// verify circular module dependencies result in an error
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
With(daggerExec("mod", "init", "-m=depA", "--name=depA", "--sdk=go")).
With(daggerExec("mod", "init", "-m=depB", "--name=depB", "--sdk=go")).
With(daggerExec("mod", "init", "-m=depC", "--name=depC", "--sdk=go")).
With(daggerExec("mod", "install", "-m=depC", "./depB")).
With(daggerExec("mod", "install", "-m=depB", "./depA")).
With(daggerExec("mod", "install", "-m=depA", "./depC")).
Sync(ctx)
require.ErrorContains(t, err, "module depA has a circular dependency")
}
//go:embed testdata/modules/go/id/arg/main.go
var badIDArgGoSrc string
//go:embed testdata/modules/python/id/arg/main.py
var badIDArgPySrc string
//go:embed testdata/modules/typescript/id/arg/index.ts
var badIDArgTSSrc string
//go:embed testdata/modules/go/id/field/main.go
var badIDFieldGoSrc string
//go:embed testdata/modules/typescript/id/field/index.ts
var badIDFieldTSSrc string
//go:embed testdata/modules/go/id/fn/main.go
var badIDFnGoSrc string
//go:embed testdata/modules/python/id/fn/main.py
var badIDFnPySrc string
//go:embed testdata/modules/typescript/id/fn/index.ts
var badIDFnTSSrc string
func TestModuleReservedWords(t *testing.T) {
// verify disallowed names are rejected
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("id", func(t *testing.T) {
t.Parallel()
t.Run("arg", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDArgGoSrc,
},
{
sdk: "python",
source: badIDArgPySrc,
},
{
sdk: "typescript",
source: badIDArgTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{fn(id:"no")}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define argument with reserved name \"id\"")
})
}
})
t.Run("field", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFieldGoSrc,
},
{
sdk: "typescript",
source: badIDFieldTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{fn{id}}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define field with reserved name \"id\"")
})
}
})
t.Run("fn", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFnGoSrc,
},
{
sdk: "python",
source: badIDFnPySrc,
},
{
sdk: "typescript",
source: badIDFnTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{id}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define function with reserved name \"id\"")
})
}
})
})
}
//go:embed testdata/modules/typescript/syntax/index.ts
var tsSyntax string
func TestModuleTypescriptSyntaxSupport(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=syntax", "--sdk=typescript")).
WithNewFile("src/index.ts", dagger.ContainerWithNewFileOpts{
Contents: tsSyntax,
})
t.Run("singleQuoteDefaultArgHello(msg: string = 'world'): string", func(t *testing.T) {
t.Parallel()
defaultOut, err := modGen.With(daggerQuery(`{syntax{singleQuoteDefaultArgHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"syntax":{"singleQuoteDefaultArgHello":"hello world"}}`, defaultOut)
out, err := modGen.With(daggerQuery(`{syntax{singleQuoteDefaultArgHello(msg: "dagger")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"syntax":{"singleQuoteDefaultArgHello":"hello dagger"}}`, out)
})
t.Run("doubleQuotesDefaultArgHello(msg: string = \"world\"): string", func(t *testing.T) {
t.Parallel()
defaultOut, err := modGen.With(daggerQuery(`{syntax{doubleQuotesDefaultArgHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"syntax":{"doubleQuotesDefaultArgHello":"hello world"}}`, defaultOut)
out, err := modGen.With(daggerQuery(`{syntax{doubleQuotesDefaultArgHello(msg: "dagger")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"syntax":{"doubleQuotesDefaultArgHello":"hello dagger"}}`, out)
})
}
func TestModuleExecError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=playground", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
import (
"context"
"errors"
)
type Playground struct{}
func (p *Playground) DoThing(ctx context.Context) error {
_, err := dag.Container().From("alpine").WithExec([]string{"sh", "-c", "exit 5"}).Sync(ctx)
var e *ExecError
if errors.As(err, &e) {
if e.ExitCode == 5 {
return nil
}
}
panic("yikes")
}
`})
logGen(ctx, t, modGen.Directory("."))
_, err := modGen.
With(daggerQuery(`{playground{doThing}}`)).
Stdout(ctx)
require.NoError(t, err)
}
func TestModuleCurrentModuleAPI(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
t.Run("name", func(t *testing.T) {
t.Parallel()
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=WaCkY", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type WaCkY struct {}
func (m *WaCkY) Fn(ctx context.Context) (string, error) {
return dag.CurrentModule().Name(ctx)
}
`,
}).
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "WaCkY", strings.TrimSpace(out))
})
t.Run("source", func(t *testing.T) {
t.Parallel()
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("/work/subdir/coolfile.txt", dagger.ContainerWithNewFileOpts{
Contents: "nice",
}).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) *File {
return dag.CurrentModule().Source().File("subdir/coolfile.txt")
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("workdir", func(t *testing.T) {
t.Parallel()
t.Run("dir", func(t *testing.T) {
t.Parallel()
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*Directory, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().Workdir("subdir/moresubdir"), nil
}
`,
}).
With(daggerCall("fn", "file", "--path=coolfile.txt", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("file", func(t *testing.T) {
t.Parallel()
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*File, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().WorkdirFile("subdir/moresubdir/coolfile.txt"), nil
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("error on escape", func(t *testing.T) {
t.Parallel()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
func New() (*Test, error) {
if err := os.WriteFile("/rootfile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
if err := os.MkdirAll("/foo", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("/foo/foofile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
return &Test{}, nil
}
type Test struct {}
func (m *Test) EscapeFile(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("../rootfile.txt")
}
func (m *Test) EscapeFileAbs(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("/rootfile.txt")
}
func (m *Test) EscapeDir(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("../foo")
}
func (m *Test) EscapeDirAbs(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("/foo")
}
`,
})
_, err := ctr.
With(daggerCall("escape-file", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-file-abs", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../foo" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir-abs", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/foo" escapes workdir`)
})
})
}
func TestModuleCustomSDK(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/coolsdk").
With(daggerExec("mod", "init", "--name=cool-sdk", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type CoolSdk struct {}
func (m *CoolSdk) ModuleRuntime(modSource *ModuleSource, introspectionJson string) *Container {
return modSource.AsModule().WithSDK("go").Initialize().Runtime().WithEnvVariable("COOL", "true")
}
func (m *CoolSdk) Codegen(modSource *ModuleSource, introspectionJson string) *GeneratedCode {
existingConfig := modSource.Directory("/").File("dagger.json")
return dag.GeneratedCode(modSource.
AsModule().
WithSDK("go").
GeneratedSourceRootDirectory().
WithFile("dagger.json", existingConfig),
)
}
`,
}).
WithWorkdir("/work").
With(daggerExec("mod", "init", "--name=test", "--sdk=coolsdk")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "os"
type Test struct {}
func (m *Test) Fn() string {
return os.Getenv("COOL")
}
`,
})
out, err := ctr.
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "true", strings.TrimSpace(out))
}
func daggerExec(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerQuery(query string, args ...any) dagger.WithContainerFunc {
return daggerQueryAt("", query, args...)
}
func daggerQueryAt(modPath string, query string, args ...any) dagger.WithContainerFunc {
query = fmt.Sprintf(query, args...)
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "query"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(execArgs, dagger.ContainerWithExecOpts{
Stdin: query,
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerCall(args ...string) dagger.WithContainerFunc {
return daggerCallAt("", args...)
}
func daggerCallAt(modPath string, args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "call"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(append(execArgs, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerFunctions(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug", "functions"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func configFile(dirPath string, cfg *modules.ModuleConfig) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
cfgPath := filepath.Join(dirPath, "dagger.json")
cfgBytes, err := json.Marshal(cfg)
if err != nil {
panic(err)
}
return c.WithNewFile(cfgPath, dagger.ContainerWithNewFileOpts{
Contents: string(cfgBytes),
})
}
}
// command for a dagger cli call direct on the host
func hostDaggerCommand(ctx context.Context, t testing.TB, workdir string, args ...string) *exec.Cmd {
t.Helper()
cmd := exec.CommandContext(ctx, daggerCliPath(t), args...)
cmd.Dir = workdir
return cmd
}
// runs a dagger cli command directly on the host, rather than in an exec
func hostDaggerExec(ctx context.Context, t testing.TB, workdir string, args ...string) ([]byte, error) {
t.Helper()
cmd := hostDaggerCommand(ctx, t, workdir, args...)
output, err := cmd.CombinedOutput()
if err != nil {
err = fmt.Errorf("%s: %w", string(output), err)
}
return output, err
}
func sdkSource(sdk, contents string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
var sourcePath string
switch sdk {
case "go":
sourcePath = "main.go"
case "python":
sourcePath = "src/main.py"
case "typescript":
sourcePath = "src/index.ts"
default:
return c
}
return c.WithNewFile(sourcePath, dagger.ContainerWithNewFileOpts{
Contents: contents,
})
}
}
func sdkCodegenFile(t *testing.T, sdk string) string {
t.Helper()
switch sdk {
case "go":
return "dagger.gen.go"
case "python":
return "sdk/src/dagger/client/gen.py"
case "typescript":
return "sdk/api/client.gen.ts"
default:
return ""
}
}
func currentSchema(ctx context.Context, t *testing.T, ctr *dagger.Container) *introspection.Schema {
t.Helper()
out, err := ctr.With(daggerQuery(introspection.Query)).Stdout(ctx)
require.NoError(t, err)
var schemaResp introspection.Response
err = json.Unmarshal([]byte(out), &schemaResp)
require.NoError(t, err)
return schemaResp.Schema
}
func goGitBase(t *testing.T, c *dagger.Client) *dagger.Container {
t.Helper()
return c.Container().From(golangImage).
WithExec([]string{"apk", "add", "git"}).
WithExec([]string{"git", "config", "--global", "user.email", "dagger@example.com"}).
WithExec([]string{"git", "config", "--global", "user.name", "Dagger Tests"}).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"})
}
func logGen(ctx context.Context, t *testing.T, modSrc *dagger.Directory) {
t.Helper()
generated, err := modSrc.File("dagger.gen.go").Contents(ctx)
require.NoError(t, err)
t.Cleanup(func() {
t.Name()
fileName := filepath.Join(
os.TempDir(),
t.Name(),
fmt.Sprintf("dagger.gen.%d.go", time.Now().Unix()),
)
if err := os.MkdirAll(filepath.Dir(fileName), 0o755); err != nil {
t.Logf("failed to create temp dir for generated code: %v", err)
return
}
if err := os.WriteFile(fileName, []byte(generated), 0644); err != nil {
t.Logf("failed to write generated code to %s: %v", fileName, err)
} else {
t.Logf("wrote generated code to %s", fileName)
}
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,312 | Modules: `dag.Host()` name is extremely confusing | When module code uses `dag.Host()`, the "host" it refers to is the module container's "host", not the CLI caller's host.
While this is technically consistent, it's very non-obvious at first glance and a constant source of confusion.
I think at a minimum we need to change `Host` to something with a more obvious name. TBD if this change also impacts non-module SDKs or if it's somehow scoped just to the codegen for modules.
There's certainly larger scope changes to the API that could also be worth discussing, but changing to a more clear name seems like the bare-minimum baseline thing to do here.
---
As a side-note, support for Module code being able to read files/env vars/etc. from the *CLI caller's host* is a separate topic, discussed in this other issue https://github.com/dagger/dagger/issues/6112 | https://github.com/dagger/dagger/issues/6312 | https://github.com/dagger/dagger/pull/6535 | c241d901a48f699a1d62f0daad882c88730e1fba | 7a63c3d019530d1f08b2f72cc28e753d99b5896d | "2023-12-21T19:46:28Z" | go | "2024-02-01T14:23:42Z" | core/moddeps.go | package core
import (
"context"
"encoding/json"
"fmt"
"sync"
"github.com/dagger/dagger/cmd/codegen/introspection"
"github.com/dagger/dagger/dagql"
dagintro "github.com/dagger/dagger/dagql/introspection"
"github.com/dagger/dagger/tracing"
)
const (
modMetaDirPath = "/.daggermod"
modMetaOutputPath = "output.json"
ModuleName = "daggercore"
)
/*
ModDeps represents a set of dependencies for a module or for a caller depending on a
particular set of modules to be served.
*/
type ModDeps struct {
root *Query
Mods []Mod // TODO hide
// should not be read directly, call Schema and SchemaIntrospectionJSON instead
lazilyLoadedSchema *dagql.Server
lazilyLoadedIntrospectionJSON string
loadSchemaErr error
loadSchemaLock sync.Mutex
}
func NewModDeps(root *Query, mods []Mod) *ModDeps {
return &ModDeps{
root: root,
Mods: mods,
}
}
func (d *ModDeps) Prepend(mods ...Mod) *ModDeps {
deps := append([]Mod{}, mods...)
deps = append(deps, d.Mods...)
return NewModDeps(d.root, deps)
}
func (d *ModDeps) Append(mods ...Mod) *ModDeps {
deps := append([]Mod{}, d.Mods...)
deps = append(deps, mods...)
return NewModDeps(d.root, deps)
}
// The combined schema exposed by each mod in this set of dependencies
func (d *ModDeps) Schema(ctx context.Context) (*dagql.Server, error) {
schema, _, err := d.lazilyLoadSchema(ctx)
if err != nil {
return nil, err
}
return schema, nil
}
// The introspection json for combined schema exposed by each mod in this set of dependencies
func (d *ModDeps) SchemaIntrospectionJSON(ctx context.Context) (string, error) {
_, introspectionJSON, err := d.lazilyLoadSchema(ctx)
if err != nil {
return "", err
}
return introspectionJSON, nil
}
// All the TypeDefs exposed by this set of dependencies
func (d *ModDeps) TypeDefs(ctx context.Context) ([]*TypeDef, error) {
var typeDefs []*TypeDef
for _, mod := range d.Mods {
modTypeDefs, err := mod.TypeDefs(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get objects from mod %q: %w", mod.Name(), err)
}
typeDefs = append(typeDefs, modTypeDefs...)
}
return typeDefs, nil
}
func schemaIntrospectionJSON(ctx context.Context, dag *dagql.Server) (json.RawMessage, error) {
data, err := dag.Query(ctx, introspection.Query, nil)
if err != nil {
return nil, fmt.Errorf("introspection query failed: %w", err)
}
jsonBytes, err := json.Marshal(data)
if err != nil {
return nil, fmt.Errorf("failed to marshal introspection result: %w", err)
}
return json.RawMessage(jsonBytes), nil
}
func (d *ModDeps) lazilyLoadSchema(ctx context.Context) (loadedSchema *dagql.Server, loadedIntrospectionJSON string, rerr error) {
d.loadSchemaLock.Lock()
defer d.loadSchemaLock.Unlock()
if d.lazilyLoadedSchema != nil {
return d.lazilyLoadedSchema, d.lazilyLoadedIntrospectionJSON, nil
}
if d.loadSchemaErr != nil {
return nil, "", d.loadSchemaErr
}
defer func() {
d.lazilyLoadedSchema = loadedSchema
d.lazilyLoadedIntrospectionJSON = loadedIntrospectionJSON
d.loadSchemaErr = rerr
}()
dag := dagql.NewServer[*Query](d.root)
dag.Around(tracing.AroundFunc)
// share the same cache session-wide
dag.Cache = d.root.Cache
dagintro.Install[*Query](dag)
var objects []*ModuleObjectType
var ifaces []*InterfaceType
for _, mod := range d.Mods {
err := mod.Install(ctx, dag)
if err != nil {
return nil, "", fmt.Errorf("failed to get schema for module %q: %w", mod.Name(), err)
}
// TODO support core interfaces types
if userMod, ok := mod.(*Module); ok {
defs, err := mod.TypeDefs(ctx)
if err != nil {
return nil, "", fmt.Errorf("failed to get type defs for module %q: %w", mod.Name(), err)
}
for _, def := range defs {
switch def.Kind {
case TypeDefKindObject:
objects = append(objects, &ModuleObjectType{
typeDef: def.AsObject.Value,
mod: userMod,
})
case TypeDefKindInterface:
ifaces = append(ifaces, &InterfaceType{
typeDef: def.AsInterface.Value,
mod: userMod,
})
}
}
}
}
// add any extensions to objects for the interfaces they implement (if any)
for _, objType := range objects {
obj := objType.typeDef
class, found := dag.ObjectType(obj.Name)
if !found {
return nil, "", fmt.Errorf("failed to find object %q in schema", obj.Name)
}
for _, ifaceType := range ifaces {
iface := ifaceType.typeDef
if !obj.IsSubtypeOf(iface) {
continue
}
objType := objType
ifaceType := ifaceType
asIfaceFieldName := gqlFieldName(fmt.Sprintf("as%s", iface.Name))
class.Extend(
dagql.FieldSpec{
Name: asIfaceFieldName,
Description: fmt.Sprintf("Converts this %s to a %s.", obj.Name, iface.Name),
Type: &InterfaceAnnotatedValue{TypeDef: iface},
Module: ifaceType.mod.InstanceID,
},
func(ctx context.Context, self dagql.Object, args map[string]dagql.Input) (dagql.Typed, error) {
inst, ok := self.(dagql.Instance[*ModuleObject])
if !ok {
return nil, fmt.Errorf("expected %T to be a ModuleObject", self)
}
return &InterfaceAnnotatedValue{
TypeDef: iface,
Fields: inst.Self.Fields,
UnderlyingType: objType,
IfaceType: ifaceType,
}, nil
},
)
}
}
introspectionJSON, err := schemaIntrospectionJSON(ctx, dag)
if err != nil {
return nil, "", fmt.Errorf("failed to get schema introspection JSON: %w", err)
}
return dag, string(introspectionJSON), nil
}
// Search the deps for the given type def, returning the ModType if found. This does not recurse
// to transitive dependencies; it only returns types directly exposed by the schema of the top-level
// deps.
func (d *ModDeps) ModTypeFor(ctx context.Context, typeDef *TypeDef) (ModType, bool, error) {
for _, mod := range d.Mods {
modType, ok, err := mod.ModTypeFor(ctx, typeDef, false)
if err != nil {
return nil, false, fmt.Errorf("failed to get type from mod %q: %w", mod.Name(), err)
}
if !ok {
continue
}
return modType, true, nil
}
return nil, false, nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,312 | Modules: `dag.Host()` name is extremely confusing | When module code uses `dag.Host()`, the "host" it refers to is the module container's "host", not the CLI caller's host.
While this is technically consistent, it's very non-obvious at first glance and a constant source of confusion.
I think at a minimum we need to change `Host` to something with a more obvious name. TBD if this change also impacts non-module SDKs or if it's somehow scoped just to the codegen for modules.
There's certainly larger scope changes to the API that could also be worth discussing, but changing to a more clear name seems like the bare-minimum baseline thing to do here.
---
As a side-note, support for Module code being able to read files/env vars/etc. from the *CLI caller's host* is a separate topic, discussed in this other issue https://github.com/dagger/dagger/issues/6112 | https://github.com/dagger/dagger/issues/6312 | https://github.com/dagger/dagger/pull/6535 | c241d901a48f699a1d62f0daad882c88730e1fba | 7a63c3d019530d1f08b2f72cc28e753d99b5896d | "2023-12-21T19:46:28Z" | go | "2024-02-01T14:23:42Z" | core/module.go | package core
import (
"context"
"fmt"
"log/slog"
"sort"
"strings"
"time"
"github.com/dagger/dagger/dagql"
"github.com/dagger/dagger/dagql/idproto"
"github.com/moby/buildkit/solver/pb"
"github.com/opencontainers/go-digest"
"github.com/pkg/errors"
"github.com/vektah/gqlparser/v2/ast"
"golang.org/x/sync/errgroup"
)
type Module struct {
Query *Query
// The source of the module
Source dagql.Instance[*ModuleSource] `field:"true" name:"source" doc:"The source for the module."`
// The name of the module
NameField string `field:"true" name:"name" doc:"The name of the module"`
// The original name of the module set in its configuration file (or first configured via withName).
// Different than NameField when a different name was specified for the module via a dependency.
OriginalName string
// The doc string of the module, if any
Description string `field:"true" doc:"The doc string of the module, if any"`
// The module's SDKConfig, as set in the module config file
SDKConfig string `field:"true" name:"sdk" doc:"The SDK used by this module. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation."`
// The module's root directory containing the config file for it and its source (possibly as a subdir). It includes any generated code or updated config files created after initial load.
GeneratedSourceRootDirectory dagql.Instance[*Directory]
// The subpath of the GeneratedSourceDirectory that contains the actual source code of the module (which may be a subdir when dagger.json is a parent dir).
// This is not always equal to Source.SourceSubpath in the case where the Source is a directory containing
// dagger.json as a subdir.
// E.g. if the module is in a git repo where dagger.json is at /foo/dagger.json and then module source code is at
// /foo/mymod/, then GeneratedSourceSubpath will be "mymod".
GeneratedSourceSubpath string
// Dependencies as configured by the module
DependencyConfig []*ModuleDependency `field:"true" doc:"The dependencies as configured by the module."`
// The module's loaded dependencies, not yet initialized
DependenciesField []dagql.Instance[*Module] `field:"true" name:"dependencies" doc:"Modules used by this module."`
// Deps contains the module's dependency DAG.
Deps *ModDeps
DirectoryIncludeConfig []string
DirectoryExcludeConfig []string
// Runtime is the container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
Runtime *Container `field:"true" name:"runtime" doc:"The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile."`
// The following are populated while initializing the module
// The module's objects
ObjectDefs []*TypeDef `field:"true" name:"objects" doc:"Objects served by this module."`
// The module's interfaces
InterfaceDefs []*TypeDef `field:"true" name:"interfaces" doc:"Interfaces served by this module."`
// InstanceID is the ID of the initialized module.
InstanceID *idproto.ID
}
func (*Module) Type() *ast.Type {
return &ast.Type{
NamedType: "Module",
NonNull: true,
}
}
func (*Module) TypeDescription() string {
return "A Dagger module."
}
type ModuleDependency struct {
Source dagql.Instance[*ModuleSource] `field:"true" name:"source" doc:"The source for the dependency module."`
Name string `field:"true" name:"name" doc:"The name of the dependency module."`
}
func (*ModuleDependency) Type() *ast.Type {
return &ast.Type{
NamedType: "ModuleDependency",
NonNull: true,
}
}
func (*ModuleDependency) TypeDescription() string {
return "The configuration of dependency of a module."
}
func (dep ModuleDependency) Clone() *ModuleDependency {
cp := dep
cp.Source.Self = dep.Source.Self.Clone()
return &cp
}
var _ Mod = (*Module)(nil)
func (mod *Module) Name() string {
return mod.NameField
}
func (mod *Module) Dependencies() []Mod {
mods := make([]Mod, len(mod.DependenciesField))
for i, dep := range mod.DependenciesField {
mods[i] = dep.Self
}
return mods
}
func (mod *Module) WithName(ctx context.Context, name string) (*Module, error) {
if mod.InstanceID != nil {
return nil, fmt.Errorf("cannot update name on initialized module")
}
mod = mod.Clone()
mod.NameField = name
if mod.OriginalName == "" {
mod.OriginalName = name
}
return mod, nil
}
func (mod *Module) WithSDK(ctx context.Context, sdk string) (*Module, error) {
if mod.InstanceID != nil {
return nil, fmt.Errorf("cannot update sdk on initialized module")
}
mod = mod.Clone()
mod.SDKConfig = sdk
return mod, nil
}
func (mod *Module) WithDependencies(
ctx context.Context,
srv *dagql.Server,
dependencies []*ModuleDependency,
) (*Module, error) {
if mod.InstanceID != nil {
return nil, fmt.Errorf("cannot update dependencies on initialized module")
}
if mod.Source.Self == nil {
return nil, fmt.Errorf("cannot update dependencies on module without source")
}
mod = mod.Clone()
clonedDependencies := make([]*ModuleDependency, len(dependencies))
for i, dep := range dependencies {
clonedDependencies[i] = dep.Clone()
}
// resolve the dependency relative to this module's source
var eg errgroup.Group
for i, dep := range dependencies {
if dep.Source.Self == nil {
return nil, fmt.Errorf("dependency %d has no source", i)
}
i, dep := i, dep
eg.Go(func() error {
err := srv.Select(ctx, mod.Source, &clonedDependencies[i].Source,
dagql.Selector{
Field: "resolveDependency",
Args: []dagql.NamedInput{
{Name: "dep", Value: dagql.NewID[*ModuleSource](dep.Source.ID())},
},
},
)
if err != nil {
return fmt.Errorf("failed to resolve dependency module: %w", err)
}
return nil
})
}
if err := eg.Wait(); err != nil {
return nil, err
}
// figure out the set of deps, keyed by their symbolic ref string, which de-dupes
// equivalent sources at different versions, preferring the version provided
// in the dependencies arg here
depSet := make(map[string]*ModuleDependency)
for _, dep := range mod.DependencyConfig {
symbolic, err := dep.Source.Self.Symbolic()
if err != nil {
return nil, fmt.Errorf("failed to get symbolic source ref: %w", err)
}
depSet[symbolic] = dep
}
for _, newDep := range clonedDependencies {
symbolic, err := newDep.Source.Self.Symbolic()
if err != nil {
return nil, fmt.Errorf("failed to get symbolic source ref: %w", err)
}
depSet[symbolic] = newDep
}
mod.DependencyConfig = make([]*ModuleDependency, 0, len(depSet))
for _, dep := range depSet {
mod.DependencyConfig = append(mod.DependencyConfig, dep)
}
refStrs := make([]string, 0, len(mod.DependencyConfig))
for _, dep := range mod.DependencyConfig {
refStr, err := dep.Source.Self.RefString()
if err != nil {
return nil, fmt.Errorf("failed to get ref string for dependency: %w", err)
}
refStrs = append(refStrs, refStr)
}
sort.Slice(mod.DependencyConfig, func(i, j int) bool {
return refStrs[i] < refStrs[j]
})
mod.DependenciesField = make([]dagql.Instance[*Module], len(mod.DependencyConfig))
eg = errgroup.Group{}
for i, depCfg := range mod.DependencyConfig {
i, depCfg := i, depCfg
eg.Go(func() error {
err := srv.Select(ctx, depCfg.Source, &mod.DependenciesField[i],
dagql.Selector{
Field: "asModule",
},
dagql.Selector{
Field: "withName",
Args: []dagql.NamedInput{
{Name: "name", Value: dagql.NewString(depCfg.Name)},
},
},
dagql.Selector{
Field: "initialize",
},
)
if err != nil {
return fmt.Errorf("failed to initialize dependency module: %w", err)
}
return nil
})
}
if err := eg.Wait(); err != nil {
if errors.Is(err, dagql.ErrCacheMapRecursiveCall) {
err = fmt.Errorf("module %s has a circular dependency: %w", mod.NameField, err)
}
return nil, fmt.Errorf("failed to load updated dependencies: %w", err)
}
// fill in any missing names if needed
for i, dep := range mod.DependencyConfig {
if dep.Name == "" {
dep.Name = mod.DependenciesField[i].Self.Name()
}
}
// Check for loops by walking the DAG of deps, seeing if we ever encounter this mod.
// Modules are identified here by their *Source's ID*, which is relatively stable and
// unique to the module.
// Note that this is ultimately best effort, subtle differences in IDs that don't actually
// impact the final module will still result in us considering the two modules different.
// E.g. if you initialize a module from a source directory that had a no-op file change
// made to it, the ID used here will still change.
selfDgst, err := mod.Source.ID().Digest()
if err != nil {
return nil, fmt.Errorf("failed to get digest of module source: %w", err)
}
memo := make(map[digest.Digest]struct{}) // set of id digests
var visit func(dagql.Instance[*Module]) error
visit = func(inst dagql.Instance[*Module]) error {
instDgst, err := inst.Self.Source.ID().Digest()
if err != nil {
return fmt.Errorf("failed to get digest of module source: %w", err)
}
if instDgst == selfDgst {
return fmt.Errorf("module %s has a circular dependency", mod.NameField)
}
if _, ok := memo[instDgst]; ok {
return nil
}
memo[instDgst] = struct{}{}
for _, dep := range inst.Self.DependenciesField {
if err := visit(dep); err != nil {
return err
}
}
return nil
}
for _, dep := range mod.DependenciesField {
if err := visit(dep); err != nil {
return nil, err
}
}
mod.Deps = NewModDeps(mod.Query, mod.Dependencies()).
Append(mod.Query.DefaultDeps.Mods...)
return mod, nil
}
func (mod *Module) Initialize(ctx context.Context, oldSelf dagql.Instance[*Module], newID *idproto.ID) (*Module, error) {
// construct a special function with no object or function name, which tells
// the SDK to return the module's definition (in terms of objects, fields and
// functions)
getModDefFn, err := newModFunction(
ctx,
mod.Query,
oldSelf.Self,
oldSelf.ID(),
nil,
mod.Runtime,
NewFunction("", &TypeDef{
Kind: TypeDefKindObject,
AsObject: dagql.NonNull(NewObjectTypeDef("Module", "")),
}))
if err != nil {
return nil, fmt.Errorf("failed to create module definition function for module %q: %w", mod.Name(), err)
}
result, err := getModDefFn.Call(ctx, newID, &CallOpts{Cache: true, SkipSelfSchema: true})
if err != nil {
return nil, fmt.Errorf("failed to call module %q to get functions: %w", mod.Name(), err)
}
inst, ok := result.(dagql.Instance[*Module])
if !ok {
return nil, fmt.Errorf("expected Module result, got %T", result)
}
newMod := mod.Clone()
newMod.Description = inst.Self.Description
for _, obj := range inst.Self.ObjectDefs {
newMod, err = newMod.WithObject(ctx, obj)
if err != nil {
return nil, fmt.Errorf("failed to add object to module %q: %w", mod.Name(), err)
}
}
for _, iface := range inst.Self.InterfaceDefs {
newMod, err = newMod.WithInterface(ctx, iface)
if err != nil {
return nil, fmt.Errorf("failed to add interface to module %q: %w", mod.Name(), err)
}
}
newMod.InstanceID = newID
return newMod, nil
}
func (mod *Module) Install(ctx context.Context, dag *dagql.Server) error {
slog.Debug("installing module", "name", mod.Name())
start := time.Now()
defer func() { slog.Debug("done installing module", "name", mod.Name(), "took", time.Since(start)) }()
for _, def := range mod.ObjectDefs {
objDef := def.AsObject.Value
slog.Debug("installing object", "name", mod.Name(), "object", objDef.Name)
// check whether this is a pre-existing object from a dependency module
modType, ok, err := mod.Deps.ModTypeFor(ctx, def)
if err != nil {
return fmt.Errorf("failed to get mod type for type def: %w", err)
}
if ok {
// NB: this is defense-in-depth to prevent SDKs or some other future
// component from allowing modules to extend external objects.
return fmt.Errorf("type %q is already defined by module %q",
objDef.Name,
modType.SourceMod().Name())
}
obj := &ModuleObject{
Module: mod,
TypeDef: objDef,
}
if err := obj.Install(ctx, dag); err != nil {
return err
}
}
for _, def := range mod.InterfaceDefs {
ifaceDef := def.AsInterface.Value
slog.Debug("installing interface", "name", mod.Name(), "interface", ifaceDef.Name)
iface := &InterfaceType{
typeDef: ifaceDef,
mod: mod,
}
if err := iface.Install(ctx, dag); err != nil {
return err
}
}
return nil
}
func (mod *Module) TypeDefs(ctx context.Context) ([]*TypeDef, error) {
typeDefs := make([]*TypeDef, 0, len(mod.ObjectDefs)+len(mod.InterfaceDefs))
for _, def := range mod.ObjectDefs {
typeDef := def.Clone()
if typeDef.AsObject.Valid {
typeDef.AsObject.Value.SourceModuleName = mod.Name()
}
typeDefs = append(typeDefs, typeDef)
}
for _, def := range mod.InterfaceDefs {
typeDef := def.Clone()
if typeDef.AsInterface.Valid {
typeDef.AsInterface.Value.SourceModuleName = mod.Name()
}
typeDefs = append(typeDefs, typeDef)
}
return typeDefs, nil
}
func (mod *Module) DependencySchemaIntrospectionJSON(ctx context.Context) (string, error) {
return mod.Deps.SchemaIntrospectionJSON(ctx)
}
func (mod *Module) ModTypeFor(ctx context.Context, typeDef *TypeDef, checkDirectDeps bool) (ModType, bool, error) {
var modType ModType
switch typeDef.Kind {
case TypeDefKindString, TypeDefKindInteger, TypeDefKindBoolean, TypeDefKindVoid:
modType = &PrimitiveType{typeDef}
case TypeDefKindList:
underlyingType, ok, err := mod.ModTypeFor(ctx, typeDef.AsList.Value.ElementTypeDef, checkDirectDeps)
if err != nil {
return nil, false, fmt.Errorf("failed to get underlying type: %w", err)
}
if !ok {
return nil, false, nil
}
modType = &ListType{
Elem: typeDef.AsList.Value.ElementTypeDef,
Underlying: underlyingType,
}
case TypeDefKindObject:
if checkDirectDeps {
// check to see if this is from a *direct* dependency
depType, ok, err := mod.Deps.ModTypeFor(ctx, typeDef)
if err != nil {
return nil, false, fmt.Errorf("failed to get type from dependency: %w", err)
}
if ok {
return depType, true, nil
}
}
var found bool
// otherwise it must be from this module
for _, obj := range mod.ObjectDefs {
if obj.AsObject.Value.Name == typeDef.AsObject.Value.Name {
modType = &ModuleObjectType{
typeDef: obj.AsObject.Value,
mod: mod,
}
found = true
break
}
}
if !found {
slog.Debug("module did not find object", "mod", mod.Name(), "object", typeDef.AsObject.Value.Name)
return nil, false, nil
}
case TypeDefKindInterface:
if checkDirectDeps {
// check to see if this is from a *direct* dependency
depType, ok, err := mod.Deps.ModTypeFor(ctx, typeDef)
if err != nil {
return nil, false, fmt.Errorf("failed to get interface type from dependency: %w", err)
}
if ok {
return depType, true, nil
}
}
var found bool
// otherwise it must be from this module
for _, iface := range mod.InterfaceDefs {
if iface.AsInterface.Value.Name == typeDef.AsInterface.Value.Name {
modType = &InterfaceType{
mod: mod,
typeDef: iface.AsInterface.Value,
}
found = true
break
}
}
if !found {
slog.Debug("module did not find interface", "mod", mod.Name(), "interface", typeDef.AsInterface.Value.Name)
return nil, false, nil
}
default:
return nil, false, fmt.Errorf("unexpected type def kind %s", typeDef.Kind)
}
if typeDef.Optional {
modType = &NullableType{
InnerDef: typeDef.WithOptional(false),
Inner: modType,
}
}
return modType, true, nil
}
// verify the typedef is has no reserved names
func (mod *Module) validateTypeDef(ctx context.Context, typeDef *TypeDef) error {
switch typeDef.Kind {
case TypeDefKindList:
return mod.validateTypeDef(ctx, typeDef.AsList.Value.ElementTypeDef)
case TypeDefKindObject:
return mod.validateObjectTypeDef(ctx, typeDef)
case TypeDefKindInterface:
return mod.validateInterfaceTypeDef(ctx, typeDef)
}
return nil
}
func (mod *Module) validateObjectTypeDef(ctx context.Context, typeDef *TypeDef) error {
// check whether this is a pre-existing object from core or another module
modType, ok, err := mod.Deps.ModTypeFor(ctx, typeDef)
if err != nil {
return fmt.Errorf("failed to get mod type for type def: %w", err)
}
if ok {
if sourceMod := modType.SourceMod(); sourceMod != nil && sourceMod != mod {
// already validated, skip
return nil
}
}
obj := typeDef.AsObject.Value
for _, field := range obj.Fields {
if gqlFieldName(field.Name) == "id" {
return fmt.Errorf("cannot define field with reserved name %q on object %q", field.Name, obj.Name)
}
fieldType, ok, err := mod.Deps.ModTypeFor(ctx, field.TypeDef)
if err != nil {
return fmt.Errorf("failed to get mod type for type def: %w", err)
}
if ok {
sourceMod := fieldType.SourceMod()
// fields can reference core types and local types, but not types from
// other modules
if sourceMod != nil && sourceMod.Name() != ModuleName && sourceMod != mod {
return fmt.Errorf("object %q field %q cannot reference external type from dependency module %q",
obj.OriginalName,
field.OriginalName,
sourceMod.Name(),
)
}
}
if err := mod.validateTypeDef(ctx, field.TypeDef); err != nil {
return err
}
}
for _, fn := range obj.Functions {
if gqlFieldName(fn.Name) == "id" {
return fmt.Errorf("cannot define function with reserved name %q on object %q", fn.Name, obj.Name)
}
// Check if this is a type from another (non-core) module, which is currently not allowed
retType, ok, err := mod.Deps.ModTypeFor(ctx, fn.ReturnType)
if err != nil {
return fmt.Errorf("failed to get mod type for type def: %w", err)
}
if ok {
if sourceMod := retType.SourceMod(); sourceMod != nil && sourceMod.Name() != ModuleName && sourceMod != mod {
// already validated, skip
return fmt.Errorf("object %q function %q cannot return external type from dependency module %q",
obj.OriginalName,
fn.OriginalName,
sourceMod.Name(),
)
}
}
if err := mod.validateTypeDef(ctx, fn.ReturnType); err != nil {
return err
}
for _, arg := range fn.Args {
if gqlArgName(arg.Name) == "id" {
return fmt.Errorf("cannot define argument with reserved name %q on function %q", arg.Name, fn.Name)
}
argType, ok, err := mod.Deps.ModTypeFor(ctx, arg.TypeDef)
if err != nil {
return fmt.Errorf("failed to get mod type for type def: %w", err)
}
if ok {
if sourceMod := argType.SourceMod(); sourceMod != nil && sourceMod.Name() != ModuleName && sourceMod != mod {
// already validated, skip
return fmt.Errorf("object %q function %q arg %q cannot reference external type from dependency module %q",
obj.OriginalName,
fn.OriginalName,
arg.OriginalName,
sourceMod.Name(),
)
}
}
if err := mod.validateTypeDef(ctx, arg.TypeDef); err != nil {
return err
}
}
}
return nil
}
func (mod *Module) validateInterfaceTypeDef(ctx context.Context, typeDef *TypeDef) error {
iface := typeDef.AsInterface.Value
// check whether this is a pre-existing interface from core or another module
modType, ok, err := mod.Deps.ModTypeFor(ctx, typeDef)
if err != nil {
return fmt.Errorf("failed to get mod type for type def: %w", err)
}
if ok {
if sourceMod := modType.SourceMod(); sourceMod != nil && sourceMod != mod {
// already validated, skip
return nil
}
}
for _, fn := range iface.Functions {
if gqlFieldName(fn.Name) == "id" {
return fmt.Errorf("cannot define function with reserved name %q on interface %q", fn.Name, iface.Name)
}
if err := mod.validateTypeDef(ctx, fn.ReturnType); err != nil {
return err
}
for _, arg := range fn.Args {
if gqlArgName(arg.Name) == "id" {
return fmt.Errorf("cannot define argument with reserved name %q on function %q", arg.Name, fn.Name)
}
if err := mod.validateTypeDef(ctx, arg.TypeDef); err != nil {
return err
}
}
}
return nil
}
// prefix the given typedef (and any recursively referenced typedefs) with this module's name for any objects
func (mod *Module) namespaceTypeDef(ctx context.Context, typeDef *TypeDef) error {
switch typeDef.Kind {
case TypeDefKindList:
if err := mod.namespaceTypeDef(ctx, typeDef.AsList.Value.ElementTypeDef); err != nil {
return err
}
case TypeDefKindObject:
obj := typeDef.AsObject.Value
// only namespace objects defined in this module
_, ok, err := mod.Deps.ModTypeFor(ctx, typeDef)
if err != nil {
return fmt.Errorf("failed to get mod type for type def: %w", err)
}
if !ok {
obj.Name = namespaceObject(obj.OriginalName, mod.Name(), mod.OriginalName)
}
for _, field := range obj.Fields {
if err := mod.namespaceTypeDef(ctx, field.TypeDef); err != nil {
return err
}
}
for _, fn := range obj.Functions {
if err := mod.namespaceTypeDef(ctx, fn.ReturnType); err != nil {
return err
}
for _, arg := range fn.Args {
if err := mod.namespaceTypeDef(ctx, arg.TypeDef); err != nil {
return err
}
}
}
case TypeDefKindInterface:
iface := typeDef.AsInterface.Value
// only namespace interfaces defined in this module
_, ok, err := mod.Deps.ModTypeFor(ctx, typeDef)
if err != nil {
return fmt.Errorf("failed to get mod type for type def: %w", err)
}
if !ok {
iface.Name = namespaceObject(iface.OriginalName, mod.Name(), mod.OriginalName)
}
for _, fn := range iface.Functions {
if err := mod.namespaceTypeDef(ctx, fn.ReturnType); err != nil {
return err
}
for _, arg := range fn.Args {
if err := mod.namespaceTypeDef(ctx, arg.TypeDef); err != nil {
return err
}
}
}
}
return nil
}
/*
Mod is a module in loaded into the server's DAG of modules; it's the vertex type of the DAG.
It's an interface so we can abstract over user modules and core and treat them the same.
*/
type Mod interface {
// The name of the module
Name() string
// The direct dependencies of this module
Dependencies() []Mod
// TODO describe
Install(context.Context, *dagql.Server) error
// ModTypeFor returns the ModType for the given typedef based on this module's schema.
// The returned type will have any namespacing already applied.
// If checkDirectDeps is true, then its direct dependencies will also be checked.
ModTypeFor(ctx context.Context, typeDef *TypeDef, checkDirectDeps bool) (ModType, bool, error)
// All the TypeDefs exposed by this module (does not include dependencies)
TypeDefs(ctx context.Context) ([]*TypeDef, error)
}
/*
An SDK is an implementation of the functionality needed to generate code for and execute a module.
There is one special SDK, the Go SDK, which is implemented in `goSDK` below. It's used as the "seed" for all
other SDK implementations.
All other SDKs are themselves implemented as Modules, with Functions matching the two defined in this SDK interface.
An SDK Module needs to choose its own SDK for its implementation. This can be "well-known" built-in SDKs like "go",
"python", etc. Or it can be any external module as specified with a module source ref string.
You can thus think of SDK Modules as a DAG of dependencies, with each SDK using a different SDK to implement its Module,
with the Go SDK as the root of the DAG and the only one without any dependencies.
Built-in SDKs are also a bit special in that they come bundled w/ the engine container image, which allows them
to be used without hard dependencies on the internet. They are loaded w/ the `loadBuiltinSDK` function below, which
loads them as modules from the engine container.
*/
type SDK interface {
/* Codegen generates code for the module at the given source directory and subpath.
The Code field of the returned GeneratedCode object should be the generated contents of the module sourceDirSubpath,
in the case where that's different than the root of the sourceDir.
The provided Module is not fully initialized; the Runtime field will not be set yet.
*/
Codegen(context.Context, *Module, dagql.Instance[*ModuleSource]) (*GeneratedCode, error)
/* Runtime returns a container that is used to execute module code at runtime in the Dagger engine.
The provided Module is not fully initialized; the Runtime field will not be set yet.
*/
Runtime(context.Context, *Module, dagql.Instance[*ModuleSource]) (*Container, error)
}
var _ HasPBDefinitions = (*Module)(nil)
func (mod *Module) PBDefinitions(ctx context.Context) ([]*pb.Definition, error) {
var defs []*pb.Definition
if mod.GeneratedSourceRootDirectory.Self != nil {
dirDefs, err := mod.GeneratedSourceRootDirectory.Self.PBDefinitions(ctx)
if err != nil {
return nil, err
}
defs = append(defs, dirDefs...)
}
return defs, nil
}
func (mod Module) Clone() *Module {
cp := mod
if mod.Source.Self != nil {
cp.Source.Self = mod.Source.Self.Clone()
}
if mod.GeneratedSourceRootDirectory.Self != nil {
cp.GeneratedSourceRootDirectory.Self = mod.GeneratedSourceRootDirectory.Self.Clone()
}
cp.DependencyConfig = make([]*ModuleDependency, len(mod.DependencyConfig))
for i, dep := range mod.DependencyConfig {
cp.DependencyConfig[i] = dep.Clone()
}
cp.DependenciesField = make([]dagql.Instance[*Module], len(mod.DependenciesField))
for i, dep := range mod.DependenciesField {
cp.DependenciesField[i].Self = dep.Self.Clone()
}
if len(mod.DirectoryIncludeConfig) > 0 {
cp.DirectoryIncludeConfig = make([]string, len(mod.DirectoryIncludeConfig))
copy(cp.DirectoryIncludeConfig, mod.DirectoryIncludeConfig)
}
if len(mod.DirectoryExcludeConfig) > 0 {
cp.DirectoryExcludeConfig = make([]string, len(mod.DirectoryExcludeConfig))
copy(cp.DirectoryExcludeConfig, mod.DirectoryExcludeConfig)
}
cp.ObjectDefs = make([]*TypeDef, len(mod.ObjectDefs))
for i, def := range mod.ObjectDefs {
cp.ObjectDefs[i] = def.Clone()
}
cp.InterfaceDefs = make([]*TypeDef, len(mod.InterfaceDefs))
for i, def := range mod.InterfaceDefs {
cp.InterfaceDefs[i] = def.Clone()
}
return &cp
}
func (mod *Module) WithDescription(desc string) *Module {
mod = mod.Clone()
mod.Description = strings.TrimSpace(desc)
return mod
}
func (mod *Module) WithObject(ctx context.Context, def *TypeDef) (*Module, error) {
mod = mod.Clone()
if !def.AsObject.Valid {
return nil, fmt.Errorf("expected object type def, got %s: %+v", def.Kind, def)
}
// skip validation+namespacing for module objects being constructed by SDK with* calls
// they will be validated when merged into the real final module
if mod.Deps != nil {
if err := mod.validateTypeDef(ctx, def); err != nil {
return nil, fmt.Errorf("failed to validate type def: %w", err)
}
}
if mod.NameField != "" {
def = def.Clone()
if err := mod.namespaceTypeDef(ctx, def); err != nil {
return nil, fmt.Errorf("failed to namespace type def: %w", err)
}
}
mod.ObjectDefs = append(mod.ObjectDefs, def)
return mod, nil
}
func (mod *Module) WithInterface(ctx context.Context, def *TypeDef) (*Module, error) {
mod = mod.Clone()
if !def.AsInterface.Valid {
return nil, fmt.Errorf("expected interface type def, got %s: %+v", def.Kind, def)
}
// skip validation+namespacing for module objects being constructed by SDK with* calls
// they will be validated when merged into the real final module
if mod.Deps != nil {
if err := mod.validateTypeDef(ctx, def); err != nil {
return nil, fmt.Errorf("failed to validate type def: %w", err)
}
}
if mod.NameField != "" {
def = def.Clone()
if err := mod.namespaceTypeDef(ctx, def); err != nil {
return nil, fmt.Errorf("failed to namespace type def: %w", err)
}
}
mod.InterfaceDefs = append(mod.InterfaceDefs, def)
return mod, nil
}
type CurrentModule struct {
Module dagql.Instance[*Module]
}
func (*CurrentModule) Type() *ast.Type {
return &ast.Type{
NamedType: "CurrentModule",
NonNull: true,
}
}
func (*CurrentModule) TypeDescription() string {
return "Reflective module API provided to functions at runtime."
}
func (mod CurrentModule) Clone() *CurrentModule {
cp := mod
cp.Module.Self = mod.Module.Self.Clone()
return &cp
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,312 | Modules: `dag.Host()` name is extremely confusing | When module code uses `dag.Host()`, the "host" it refers to is the module container's "host", not the CLI caller's host.
While this is technically consistent, it's very non-obvious at first glance and a constant source of confusion.
I think at a minimum we need to change `Host` to something with a more obvious name. TBD if this change also impacts non-module SDKs or if it's somehow scoped just to the codegen for modules.
There's certainly larger scope changes to the API that could also be worth discussing, but changing to a more clear name seems like the bare-minimum baseline thing to do here.
---
As a side-note, support for Module code being able to read files/env vars/etc. from the *CLI caller's host* is a separate topic, discussed in this other issue https://github.com/dagger/dagger/issues/6112 | https://github.com/dagger/dagger/issues/6312 | https://github.com/dagger/dagger/pull/6535 | c241d901a48f699a1d62f0daad882c88730e1fba | 7a63c3d019530d1f08b2f72cc28e753d99b5896d | "2023-12-21T19:46:28Z" | go | "2024-02-01T14:23:42Z" | core/schema/schema.go | package schema
import (
"context"
"encoding/json"
"fmt"
"net/http"
"runtime/debug"
"strings"
"github.com/99designs/gqlgen/graphql"
"github.com/99designs/gqlgen/graphql/handler"
"github.com/containerd/containerd/content"
"github.com/dagger/dagger/auth"
"github.com/dagger/dagger/cmd/codegen/introspection"
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/dagql"
"github.com/dagger/dagger/engine"
"github.com/dagger/dagger/engine/buildkit"
"github.com/dagger/dagger/tracing"
"github.com/iancoleman/strcase"
"github.com/moby/buildkit/util/bklog"
"github.com/moby/buildkit/util/leaseutil"
specs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/vektah/gqlparser/v2/gqlerror"
"github.com/vito/progrock"
)
type InitializeArgs struct {
BuildkitClient *buildkit.Client
Platform specs.Platform
ProgSockPath string
OCIStore content.Store
LeaseManager *leaseutil.Manager
Auth *auth.RegistryAuthProvider
Secrets *core.SecretStore
}
type APIServer struct {
// The root of the schema, housing all of the state and dependencies for the
// server for easy access from descendent objects.
root *core.Query
}
func New(ctx context.Context, params InitializeArgs) (*APIServer, error) {
svcs := core.NewServices(params.BuildkitClient)
root := core.NewRoot()
root.Buildkit = params.BuildkitClient
root.Services = svcs
root.ProgrockSocketPath = params.ProgSockPath
root.Platform = core.Platform(params.Platform)
root.Secrets = params.Secrets
root.OCIStore = params.OCIStore
root.LeaseManager = params.LeaseManager
root.Auth = params.Auth
dag := dagql.NewServer(root)
// stash away the cache so we can share it between other servers
root.Cache = dag.Cache
dag.Around(tracing.AroundFunc)
coreMod := &CoreMod{dag: dag}
if err := coreMod.Install(ctx, dag); err != nil {
return nil, err
}
// the main client caller starts out with the core API loaded
root.InstallDefaultClientContext(
core.NewModDeps(root, []core.Mod{coreMod}),
)
return &APIServer{
root: root,
}, nil
}
func (s *APIServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
errorOut := func(err error, code int) {
bklog.G(ctx).WithError(err).Error("failed to serve request")
http.Error(w, err.Error(), code)
}
clientMetadata, err := engine.ClientMetadataFromContext(ctx)
if err != nil {
errorOut(err, http.StatusInternalServerError)
return
}
callContext, ok := s.root.ClientCallContext(clientMetadata.ModuleCallerDigest)
if !ok {
errorOut(fmt.Errorf("client call %s not found", clientMetadata.ModuleCallerDigest), http.StatusInternalServerError)
return
}
rec := progrock.FromContext(ctx)
if callContext.ProgrockParent != "" {
rec = rec.WithParent(callContext.ProgrockParent)
}
ctx = progrock.ToContext(ctx, rec)
schema, err := callContext.Deps.Schema(ctx)
if err != nil {
// TODO: technically this is not *always* bad request, should ideally be more specific and differentiate
errorOut(err, http.StatusBadRequest)
return
}
defer func() {
if v := recover(); v != nil {
bklog.G(context.TODO()).Errorf("panic serving schema: %v %s", v, string(debug.Stack()))
// check whether this is a hijacked connection, if so we can't write any http errors to it
_, err := w.Write(nil)
if err == http.ErrHijacked {
return
}
gqlErr := &gqlerror.Error{
Message: "Internal Server Error",
}
code := http.StatusInternalServerError
switch v := v.(type) {
case error:
gqlErr.Err = v
gqlErr.Message = v.Error()
case string:
gqlErr.Message = v
}
res := graphql.Response{
Errors: gqlerror.List{gqlErr},
}
bytes, err := json.Marshal(res)
if err != nil {
panic(err)
}
http.Error(w, string(bytes), code)
}
}()
srv := handler.NewDefaultServer(schema)
// NB: break glass when needed:
// srv.AroundResponses(func(ctx context.Context, next graphql.ResponseHandler) *graphql.Response {
// res := next(ctx)
// pl, err := json.Marshal(res)
// slog.Debug("graphql response", "response", string(pl), "error", err)
// return res
// })
mux := http.NewServeMux()
mux.Handle("/query", srv)
mux.Handle("/shutdown", http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
ctx := req.Context()
bklog.G(ctx).Debugf("shutting down client %s", clientMetadata.ClientID)
if err := s.root.Services.StopClientServices(ctx, clientMetadata); err != nil {
bklog.G(ctx).WithError(err).Error("failed to shutdown")
}
}))
s.root.MuxEndpoints(mux)
r = r.WithContext(ctx)
var handler http.Handler = mux
handler = flushAfterNBytes(buildkit.MaxFileContentsChunkSize)(handler)
handler.ServeHTTP(w, r)
}
func (s *APIServer) ShutdownClient(ctx context.Context, client *engine.ClientMetadata) error {
return s.root.Services.StopClientServices(ctx, client)
}
func (s *APIServer) CurrentServedDeps(ctx context.Context) (*core.ModDeps, error) {
clientMetadata, err := engine.ClientMetadataFromContext(ctx)
if err != nil {
return nil, err
}
callCtx, ok := s.root.ClientCallContext(clientMetadata.ModuleCallerDigest)
if !ok {
return nil, fmt.Errorf("client call %s not found", clientMetadata.ModuleCallerDigest)
}
return callCtx.Deps, nil
}
func (s *APIServer) Introspect(ctx context.Context) (string, error) {
return s.root.DefaultDeps.SchemaIntrospectionJSON(ctx)
}
type SchemaResolvers interface {
Install()
}
func schemaIntrospectionJSON(ctx context.Context, dag *dagql.Server) (json.RawMessage, error) {
data, err := dag.Query(ctx, introspection.Query, nil)
if err != nil {
return nil, fmt.Errorf("introspection query failed: %w", err)
}
jsonBytes, err := json.Marshal(data)
if err != nil {
return nil, fmt.Errorf("failed to marshal introspection result: %w", err)
}
return json.RawMessage(jsonBytes), nil
}
func gqlObjectName(name string) string {
// gql object name is capitalized camel case
return strcase.ToCamel(name)
}
func namespaceObject(objName, namespace string) string {
gqlObjName := gqlObjectName(objName)
if rest := strings.TrimPrefix(gqlObjName, gqlObjectName(namespace)); rest != gqlObjName {
if len(rest) == 0 {
// objName equals namespace, don't namespace this
return gqlObjName
}
// we have this case check here to check for a boundary
// e.g. if objName="Postman" and namespace="Post", then we should still namespace
// this to "PostPostman" instead of just going for "Postman" (but we should do that
// if objName="PostMan")
if 'A' <= rest[0] && rest[0] <= 'Z' {
// objName has namespace prefixed, don't namespace this
return gqlObjName
}
}
return gqlObjectName(namespace + "_" + objName)
}
func gqlFieldName(name string) string {
// gql field name is uncapitalized camel case
return strcase.ToLowerCamel(name)
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,312 | Modules: `dag.Host()` name is extremely confusing | When module code uses `dag.Host()`, the "host" it refers to is the module container's "host", not the CLI caller's host.
While this is technically consistent, it's very non-obvious at first glance and a constant source of confusion.
I think at a minimum we need to change `Host` to something with a more obvious name. TBD if this change also impacts non-module SDKs or if it's somehow scoped just to the codegen for modules.
There's certainly larger scope changes to the API that could also be worth discussing, but changing to a more clear name seems like the bare-minimum baseline thing to do here.
---
As a side-note, support for Module code being able to read files/env vars/etc. from the *CLI caller's host* is a separate topic, discussed in this other issue https://github.com/dagger/dagger/issues/6112 | https://github.com/dagger/dagger/issues/6312 | https://github.com/dagger/dagger/pull/6535 | c241d901a48f699a1d62f0daad882c88730e1fba | 7a63c3d019530d1f08b2f72cc28e753d99b5896d | "2023-12-21T19:46:28Z" | go | "2024-02-01T14:23:42Z" | core/schema/sdk.go | package schema
import (
"context"
"errors"
"fmt"
"path/filepath"
"github.com/dagger/dagger/dagql"
"github.com/vito/progrock"
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/internal/distconsts"
)
const (
runtimeWorkdirPath = "/scratch"
)
// load the SDK implementation with the given name for the module at the given source dir + subpath.
func (s *moduleSchema) sdkForModule(
ctx context.Context,
root *core.Query,
sdk string,
parentDir dagql.Instance[*core.Directory],
) (core.SDK, error) {
builtinSDK, err := s.builtinSDK(ctx, root, sdk)
if err == nil {
return builtinSDK, nil
} else if !errors.Is(err, errUnknownBuiltinSDK) {
return nil, err
}
var sdkMod dagql.Instance[*core.Module]
err = s.dag.Select(ctx, s.dag.Root(), &sdkMod,
dagql.Selector{
Field: "moduleSource",
Args: []dagql.NamedInput{
{Name: "refString", Value: dagql.String(sdk)},
{Name: "rootDirectory", Value: dagql.Opt(dagql.NewID[*core.Directory](parentDir.ID()))},
},
},
dagql.Selector{
Field: "asModule",
},
dagql.Selector{
Field: "initialize",
},
)
if err != nil {
return nil, fmt.Errorf("failed to load sdk module %s: %w", sdk, err)
}
// TODO: include sdk source dir from module config dagger.json once we support default-args/scripts
return s.newModuleSDK(ctx, root, sdkMod, dagql.Instance[*core.Directory]{})
}
var errUnknownBuiltinSDK = fmt.Errorf("unknown builtin sdk")
// return a builtin SDK implementation with the given name
func (s *moduleSchema) builtinSDK(ctx context.Context, root *core.Query, sdkName string) (core.SDK, error) {
switch sdkName {
case "go":
return &goSDK{root: root, dag: s.dag}, nil
case "python":
return s.loadBuiltinSDK(ctx, root, sdkName, distconsts.PythonSDKEngineContainerModulePath)
case "typescript":
return s.loadBuiltinSDK(ctx, root, sdkName, distconsts.TypescriptSDKEngineContainerModulePath)
default:
return nil, fmt.Errorf("%s: %w", sdkName, errUnknownBuiltinSDK)
}
}
// moduleSDK is an SDK implemented as module; i.e. every module besides the special case go sdk.
type moduleSDK struct {
// The module implementing this SDK.
mod dagql.Instance[*core.Module]
// A server that the SDK module has been installed to.
dag *dagql.Server
// The SDK object retrieved from the server, for calling functions against.
sdk dagql.Object
}
func (s *moduleSchema) newModuleSDK(
ctx context.Context,
root *core.Query,
sdkModMeta dagql.Instance[*core.Module],
optionalFullSDKSourceDir dagql.Instance[*core.Directory],
) (*moduleSDK, error) {
dag := dagql.NewServer(root)
dag.Cache = root.Cache
if err := sdkModMeta.Self.Install(ctx, dag); err != nil {
return nil, fmt.Errorf("failed to install sdk module %s: %w", sdkModMeta.Self.Name(), err)
}
for _, defaultDep := range sdkModMeta.Self.Query.DefaultDeps.Mods {
if err := defaultDep.Install(ctx, dag); err != nil {
return nil, fmt.Errorf("failed to install default dep %s for sdk module %s: %w", defaultDep.Name(), sdkModMeta.Self.Name(), err)
}
}
var sdk dagql.Object
var constructorArgs []dagql.NamedInput
if optionalFullSDKSourceDir.Self != nil {
constructorArgs = []dagql.NamedInput{
{Name: "sdkSourceDir", Value: dagql.Opt(dagql.NewID[*core.Directory](optionalFullSDKSourceDir.ID()))},
}
}
if err := dag.Select(ctx, dag.Root(), &sdk,
dagql.Selector{
Field: gqlFieldName(sdkModMeta.Self.Name()),
Args: constructorArgs,
},
); err != nil {
return nil, fmt.Errorf("failed to get sdk object for sdk module %s: %w", sdkModMeta.Self.Name(), err)
}
return &moduleSDK{mod: sdkModMeta, dag: dag, sdk: sdk}, nil
}
// Codegen calls the Codegen function on the SDK Module
func (sdk *moduleSDK) Codegen(ctx context.Context, mod *core.Module, source dagql.Instance[*core.ModuleSource]) (*core.GeneratedCode, error) {
introspectionJSON, err := mod.DependencySchemaIntrospectionJSON(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get schema introspection json during %s module sdk codegen: %w", sdk.mod.Self.Name(), err)
}
var inst dagql.Instance[*core.GeneratedCode]
err = sdk.dag.Select(ctx, sdk.sdk, &inst, dagql.Selector{
Field: "codegen",
Args: []dagql.NamedInput{
{
Name: "modSource",
Value: dagql.NewID[*core.ModuleSource](source.ID()),
},
{
Name: "introspectionJson",
Value: dagql.String(introspectionJSON),
},
},
})
if err != nil {
return nil, fmt.Errorf("failed to call sdk module codegen: %w", err)
}
return inst.Self, nil
}
// Runtime calls the Runtime function on the SDK Module
func (sdk *moduleSDK) Runtime(ctx context.Context, mod *core.Module, source dagql.Instance[*core.ModuleSource]) (*core.Container, error) {
introspectionJSON, err := mod.DependencySchemaIntrospectionJSON(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get schema introspection json during %s module sdk runtime: %w", sdk.mod.Self.Name(), err)
}
var inst dagql.Instance[*core.Container]
err = sdk.dag.Select(ctx, sdk.sdk, &inst,
dagql.Selector{
Field: "moduleRuntime",
Args: []dagql.NamedInput{
{
Name: "modSource",
Value: dagql.NewID[*core.ModuleSource](source.ID()),
},
{
Name: "introspectionJson",
Value: dagql.String(introspectionJSON),
},
},
},
dagql.Selector{
Field: "withWorkdir",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.NewString(runtimeWorkdirPath),
},
},
},
)
if err != nil {
return nil, fmt.Errorf("failed to call sdk module moduleRuntime: %w", err)
}
return inst.Self, nil
}
// loadBuiltinSDK loads an SDK implemented as a module that is "builtin" to engine, which means its pre-packaged
// with the engine container in order to enable use w/out hard dependencies on the internet
func (s *moduleSchema) loadBuiltinSDK(
ctx context.Context,
root *core.Query,
name string,
engineContainerModulePath string,
) (*moduleSDK, error) {
ctx, recorder := progrock.WithGroup(ctx, fmt.Sprintf("load builtin module sdk %s", name))
// TODO: currently hardcoding assumption that builtin sdks put *module* source code at
// subdir right under the *full* sdk source dir. Can be generalized once we support
// default-args/scripts in dagger.json
fullSDKSourcePath := filepath.Dir(engineContainerModulePath)
_, desc, err := root.Buildkit.EngineContainerLocalImport(
ctx,
recorder,
root.Platform.Spec(),
fullSDKSourcePath,
nil,
nil,
)
if err != nil {
return nil, fmt.Errorf("failed to import full sdk source for sdk %s from engine container filesystem: %w", name, err)
}
fullSDKDir, err := core.LoadBlob(ctx, s.dag, desc)
if err != nil {
return nil, fmt.Errorf("failed to load full sdk source for module sdk %s: %w", name, err)
}
var sdkModDir dagql.Instance[*core.Directory]
err = s.dag.Select(ctx, fullSDKDir, &sdkModDir,
dagql.Selector{
Field: "directory",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(filepath.Base(engineContainerModulePath))},
},
},
)
if err != nil {
return nil, fmt.Errorf("failed to import module sdk %s: %w", name, err)
}
var sdkMod dagql.Instance[*core.Module]
err = s.dag.Select(ctx, sdkModDir, &sdkMod,
dagql.Selector{
Field: "asModule",
},
dagql.Selector{
Field: "initialize",
},
)
if err != nil {
return nil, fmt.Errorf("failed to load embedded sdk module %q: %w", name, err)
}
return s.newModuleSDK(ctx, root, sdkMod, fullSDKDir)
}
const (
goSDKUserModSourceDirPath = "/src"
goSDKRuntimePath = "/runtime"
goSDKIntrospectionJSONPath = "/schema.json"
)
/*
goSDK is the one special sdk not implemented as module, instead the
`cmd/codegen/` binary is packaged into a container w/ the go runtime,
tarball'd up and included in the engine image.
The Codegen and Runtime methods are implemented by loading that tarball and
executing the codegen binary inside it to generate user code and then execute
it with the resulting /runtime binary.
*/
type goSDK struct {
root *core.Query
dag *dagql.Server
}
func (sdk *goSDK) Codegen(
ctx context.Context,
mod *core.Module,
source dagql.Instance[*core.ModuleSource],
) (*core.GeneratedCode, error) {
configDir := source.Self.RootDirectory
sourceDirSubpath, err := source.Self.Subpath()
if err != nil {
return nil, fmt.Errorf("failed to get source subpath for go module sdk codegen: %w", err)
}
ctr, err := sdk.baseWithCodegen(ctx, mod, configDir, sourceDirSubpath)
if err != nil {
return nil, err
}
var modifiedSrcDir dagql.Instance[*core.Directory]
if err := sdk.dag.Select(ctx, ctr, &modifiedSrcDir, dagql.Selector{
Field: "directory",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.String(goSDKUserModSourceDirPath),
},
},
}); err != nil {
return nil, fmt.Errorf("failed to get modified source directory for go module sdk codegen: %w", err)
}
return &core.GeneratedCode{
Code: modifiedSrcDir,
VCSGeneratedPaths: []string{
"dagger.gen.go",
"querybuilder/**",
},
}, nil
}
func (sdk *goSDK) Runtime(
ctx context.Context,
mod *core.Module,
source dagql.Instance[*core.ModuleSource],
) (*core.Container, error) {
configDir := source.Self.RootDirectory
sourceDirSubpath, err := source.Self.Subpath()
if err != nil {
return nil, fmt.Errorf("failed to get source subpath for go module sdk codegen: %w", err)
}
ctr, err := sdk.baseWithCodegen(ctx, mod, configDir, sourceDirSubpath)
if err != nil {
return nil, err
}
if err := sdk.dag.Select(ctx, ctr, &ctr,
dagql.Selector{
Field: "withExec",
Args: []dagql.NamedInput{
{
Name: "args",
Value: dagql.ArrayInput[dagql.String]{
"go", "build",
"-o", goSDKRuntimePath,
".",
},
},
{
Name: "skipEntrypoint",
Value: dagql.NewBoolean(true),
},
},
},
dagql.Selector{
Field: "withEntrypoint",
Args: []dagql.NamedInput{
{
Name: "args",
Value: dagql.ArrayInput[dagql.String]{
goSDKRuntimePath,
},
},
},
},
dagql.Selector{
Field: "withWorkdir",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.NewString(runtimeWorkdirPath),
},
},
},
); err != nil {
return nil, fmt.Errorf("failed to exec go build in go module sdk container runtime: %w", err)
}
return ctr.Self, nil
}
func (sdk *goSDK) baseWithCodegen(
ctx context.Context,
mod *core.Module,
configDir dagql.Instance[*core.Directory],
sourceDirSubpath string,
) (dagql.Instance[*core.Container], error) {
var ctr dagql.Instance[*core.Container]
introspectionJSON, err := mod.DependencySchemaIntrospectionJSON(ctx)
if err != nil {
return ctr, fmt.Errorf("failed to get schema introspection json during %s module sdk codegen: %w", mod.Name(), err)
}
ctr, err = sdk.base(ctx)
if err != nil {
return ctr, err
}
// Delete dagger.gen.go if it exists, which is going to be overwritten
// anyways. If it doesn't exist, we ignore not found in the implementation of
// `withoutFile` so it will be a no-op.
// need to put this in a separate instance, otherwise the ID won't be updated when used as an arg below
var updatedConfigDir dagql.Instance[*core.Directory]
if err := sdk.dag.Select(ctx, configDir, &updatedConfigDir, dagql.Selector{
Field: "withoutFile",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.String(filepath.Join(sourceDirSubpath, "dagger.gen.go")),
},
},
}); err != nil {
return ctr, fmt.Errorf("failed to remove dagger.gen.go from source directory: %w", err)
}
if err := sdk.dag.Select(ctx, ctr, &ctr, dagql.Selector{
Field: "withNewFile",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.NewString(goSDKIntrospectionJSONPath),
},
{
Name: "contents",
Value: dagql.NewString(introspectionJSON),
},
{
Name: "permissions",
Value: dagql.NewInt(0444),
},
},
}, dagql.Selector{
Field: "withMountedDirectory",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.NewString(goSDKUserModSourceDirPath),
},
{
Name: "source",
Value: dagql.NewID[*core.Directory](updatedConfigDir.ID()),
},
},
}, dagql.Selector{
Field: "withWorkdir",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.NewString(filepath.Join(goSDKUserModSourceDirPath, sourceDirSubpath)),
},
},
}, dagql.Selector{
Field: "withoutDefaultArgs",
}, dagql.Selector{
Field: "withExec",
Args: []dagql.NamedInput{
{
Name: "args",
Value: dagql.ArrayInput[dagql.String]{
"--module-source-root", goSDKUserModSourceDirPath,
"--module-name", dagql.String(mod.OriginalName),
"--propagate-logs=true",
"--introspection-json-path", goSDKIntrospectionJSONPath,
},
},
{
Name: "experimentalPrivilegedNesting",
Value: dagql.NewBoolean(true),
},
},
}); err != nil {
return ctr, fmt.Errorf("failed to mount introspection json file into go module sdk container codegen: %w", err)
}
return ctr, nil
}
func (sdk *goSDK) base(ctx context.Context) (dagql.Instance[*core.Container], error) {
var inst dagql.Instance[*core.Container]
ctx, recorder := progrock.WithGroup(ctx, "load builtin module sdk go")
tarDir, tarName := filepath.Split(distconsts.GoSDKEngineContainerTarballPath)
_, desc, err := sdk.root.Buildkit.EngineContainerLocalImport(
ctx,
recorder,
sdk.root.Platform.Spec(),
tarDir,
nil,
[]string{tarName},
)
if err != nil {
return inst, fmt.Errorf("failed to import go module sdk tarball from engine container filesystem: %s", err)
}
blobDir, err := core.LoadBlob(ctx, sdk.dag, desc)
if err != nil {
return inst, fmt.Errorf("failed to load go module sdk tarball: %w", err)
}
var tarballFile dagql.Instance[*core.File]
if err := sdk.dag.Select(ctx, blobDir, &tarballFile, dagql.Selector{
Field: "file",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.String(tarName),
},
},
}); err != nil {
return inst, fmt.Errorf("failed to get tarball file from go module sdk tarball: %w", err)
}
var modCache dagql.Instance[*core.CacheVolume]
if err := sdk.dag.Select(ctx, sdk.dag.Root(), &modCache, dagql.Selector{
Field: "cacheVolume",
Args: []dagql.NamedInput{
{
Name: "key",
Value: dagql.String("modgomodcache"),
},
},
}); err != nil {
return inst, fmt.Errorf("failed to get mod cache from go module sdk tarball: %w", err)
}
var buildCache dagql.Instance[*core.CacheVolume]
if err := sdk.dag.Select(ctx, sdk.dag.Root(), &buildCache, dagql.Selector{
Field: "cacheVolume",
Args: []dagql.NamedInput{
{
Name: "key",
Value: dagql.String("modgobuildcache"),
},
},
}); err != nil {
return inst, fmt.Errorf("failed to get build cache from go module sdk tarball: %w", err)
}
var ctr dagql.Instance[*core.Container]
if err := sdk.dag.Select(ctx, sdk.dag.Root(), &ctr, dagql.Selector{
Field: "container",
}, dagql.Selector{
Field: "import",
Args: []dagql.NamedInput{
{
Name: "source",
Value: dagql.NewID[*core.File](tarballFile.ID()),
},
},
}, dagql.Selector{
Field: "withMountedCache",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.String("/go/pkg/mod"),
},
{
Name: "cache",
Value: dagql.NewID[*core.CacheVolume](modCache.ID()),
},
{
Name: "sharing",
Value: core.CacheSharingModeShared,
},
},
}, dagql.Selector{
Field: "withMountedCache",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.String("/root/.cache/go-build"),
},
{
Name: "cache",
Value: dagql.NewID[*core.CacheVolume](buildCache.ID()),
},
{
Name: "sharing",
Value: core.CacheSharingModeShared,
},
},
}); err != nil {
return inst, fmt.Errorf("failed to get container from go module sdk tarball: %w", err)
}
return ctr, nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,312 | Modules: `dag.Host()` name is extremely confusing | When module code uses `dag.Host()`, the "host" it refers to is the module container's "host", not the CLI caller's host.
While this is technically consistent, it's very non-obvious at first glance and a constant source of confusion.
I think at a minimum we need to change `Host` to something with a more obvious name. TBD if this change also impacts non-module SDKs or if it's somehow scoped just to the codegen for modules.
There's certainly larger scope changes to the API that could also be worth discussing, but changing to a more clear name seems like the bare-minimum baseline thing to do here.
---
As a side-note, support for Module code being able to read files/env vars/etc. from the *CLI caller's host* is a separate topic, discussed in this other issue https://github.com/dagger/dagger/issues/6112 | https://github.com/dagger/dagger/issues/6312 | https://github.com/dagger/dagger/pull/6535 | c241d901a48f699a1d62f0daad882c88730e1fba | 7a63c3d019530d1f08b2f72cc28e753d99b5896d | "2023-12-21T19:46:28Z" | go | "2024-02-01T14:23:42Z" | dagql/types.go | package dagql
import (
"context"
"encoding/json"
"fmt"
"reflect"
"strconv"
"strings"
"github.com/dagger/dagger/dagql/idproto"
"github.com/vektah/gqlparser/v2/ast"
"golang.org/x/exp/constraints"
)
// Typed is any value that knows its GraphQL type.
type Typed interface {
// Type returns the GraphQL type of the value.
Type() *ast.Type
}
// Type is an object that defines a new GraphQL type.
type Type interface {
// TypeName returns the name of the type.
TypeName() string
// Typically a Type will optionally define either of the two interfaces:
// Descriptive
// Definitive
}
// ObjectType represents a GraphQL Object type.
type ObjectType interface {
Type
// Typed returns a Typed value whose Type refers to the object type.
Typed() Typed
// IDType returns the scalar type for the object's IDs.
IDType() (IDType, bool)
// New creates a new instance of the type.
New(*idproto.ID, Typed) (Object, error)
// ParseField parses the given field and returns a Selector and an expected
// return type.
ParseField(context.Context, *ast.Field, map[string]any) (Selector, *ast.Type, error)
// Extend registers an additional field onto the type.
//
// Unlike natively added fields, the extended func is limited to the external
// Object interface.
Extend(FieldSpec, FieldFunc)
}
type IDType interface {
Input
IDable
ScalarType
}
// FieldFunc is a function that implements a field on an object while limited
// to the object's external interface.
type FieldFunc func(context.Context, Object, map[string]Input) (Typed, error)
type IDable interface {
// ID returns the ID of the value.
ID() *idproto.ID
}
// Object represents an Object in the graph which has an ID and can have
// sub-selections.
type Object interface {
Typed
IDable
// ObjectType returns the type of the object.
ObjectType() ObjectType
// IDFor returns the ID representing the return value of the given field.
IDFor(context.Context, Selector) (*idproto.ID, error)
// Select evaluates the selected field and returns the result.
//
// The returned value is the raw Typed value returned from the field; it must
// be instantiated with a class for further selection.
//
// Any Nullable values are automatically unwrapped.
Select(context.Context, Selector) (Typed, error)
}
// ScalarType represents a GraphQL Scalar type.
type ScalarType interface {
Type
InputDecoder
}
// Input represents any value which may be passed as an input.
type Input interface {
// All Inputs are typed.
Typed
// All Inputs are able to be represented as a Literal.
idproto.Literate
// All Inputs now how to decode new instances of themselves.
Decoder() InputDecoder
// In principle all Inputs are able to be represented as JSON, but we don't
// require the interface to be implemented since builtins like strings
// (Enums) and slices (Arrays) already marshal appropriately.
// json.Marshaler
}
// Setter allows a type to populate fields of a struct.
//
// This is how builtins are supported.
type Setter interface {
SetField(reflect.Value) error
}
// InputDecoder is a type that knows how to decode values into Inputs.
type InputDecoder interface {
// Decode converts a value to the Input type, if possible.
DecodeInput(any) (Input, error)
}
// Int is a GraphQL Int scalar.
type Int int64
func NewInt[T constraints.Integer](val T) Int {
return Int(val)
}
var _ ScalarType = Int(0)
func (Int) TypeName() string {
return "Int"
}
func (i Int) TypeDefinition() *ast.Definition {
return &ast.Definition{
Kind: ast.Scalar,
Name: i.TypeName(),
Description: "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",
BuiltIn: true,
}
}
func (Int) DecodeInput(val any) (Input, error) {
switch x := val.(type) {
case int:
return NewInt(x), nil
case int32:
return NewInt(x), nil
case int64:
return NewInt(x), nil
case json.Number:
i, err := x.Int64()
if err != nil {
return nil, err
}
return NewInt(i), nil
case string: // default struct tags
i, err := strconv.ParseInt(x, 0, 64)
if err != nil {
return nil, err
}
return NewInt(i), nil
default:
return nil, fmt.Errorf("cannot create Int from %T", x)
}
}
var _ Input = Int(0)
func (Int) Decoder() InputDecoder {
return Int(0)
}
func (i Int) Int() int {
return int(i)
}
func (i Int) Int64() int64 {
return int64(i)
}
func (i Int) ToLiteral() *idproto.Literal {
return &idproto.Literal{
Value: &idproto.Literal_Int{
Int: i.Int64(),
},
}
}
func (Int) Type() *ast.Type {
return &ast.Type{
NamedType: "Int",
NonNull: true,
}
}
func (i Int) MarshalJSON() ([]byte, error) {
return json.Marshal(i.Int())
}
func (i *Int) UnmarshalJSON(p []byte) error {
var num int
if err := json.Unmarshal(p, &num); err != nil {
return err
}
*i = Int(num)
return nil
}
var _ Setter = ID[Typed]{}
func (i Int) SetField(v reflect.Value) error {
switch v.Interface().(type) {
case int, int64:
v.SetInt(i.Int64())
return nil
default:
return fmt.Errorf("cannot set field of type %T with %T", v.Interface(), i)
}
}
// Float is a GraphQL Float scalar.
type Float float64
func NewFloat(val float64) Float {
return Float(val)
}
var _ ScalarType = Float(0)
func (Float) TypeName() string {
return "Float"
}
func (f Float) TypeDefinition() *ast.Definition {
return &ast.Definition{
Kind: ast.Scalar,
Name: f.TypeName(),
Description: "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).",
BuiltIn: true,
}
}
func (Float) DecodeInput(val any) (Input, error) {
switch x := val.(type) {
case float32:
return NewFloat(float64(x)), nil
case float64:
return NewFloat(x), nil
case json.Number:
i, err := x.Float64()
if err != nil {
return nil, err
}
return NewFloat(i), nil
case string: // default struct tags
i, err := strconv.ParseFloat(x, 64)
if err != nil {
return nil, err
}
return NewFloat(i), nil
default:
return nil, fmt.Errorf("cannot create Float from %T", x)
}
}
var _ Input = Float(0)
func (Float) Decoder() InputDecoder {
return Float(0)
}
func (f Float) ToLiteral() *idproto.Literal {
return &idproto.Literal{
Value: &idproto.Literal_Float{
Float: f.Float64(),
},
}
}
func (f Float) Float64() float64 {
return float64(f)
}
func (Float) Type() *ast.Type {
return &ast.Type{
NamedType: "Float",
NonNull: true,
}
}
func (f Float) MarshalJSON() ([]byte, error) {
return json.Marshal(f.Float64())
}
func (f *Float) UnmarshalJSON(p []byte) error {
var num float64
if err := json.Unmarshal(p, &num); err != nil {
return err
}
*f = Float(num)
return nil
}
var _ Setter = Float(0)
func (f Float) SetField(v reflect.Value) error {
switch x := v.Interface().(type) {
case float64:
v.SetFloat(f.Float64())
_ = x
return nil
default:
return fmt.Errorf("cannot set field of type %T with %T", v.Interface(), f)
}
}
// Boolean is a GraphQL Boolean scalar.
type Boolean bool
func NewBoolean(val bool) Boolean {
return Boolean(val)
}
var _ Typed = Boolean(false)
func (Boolean) Type() *ast.Type {
return &ast.Type{
NamedType: "Boolean",
NonNull: true,
}
}
var _ ScalarType = Boolean(false)
func (Boolean) TypeName() string {
return "Boolean"
}
func (b Boolean) TypeDefinition() *ast.Definition {
return &ast.Definition{
Kind: ast.Scalar,
Name: b.TypeName(),
Description: "The `Boolean` scalar type represents `true` or `false`.",
BuiltIn: true,
}
}
func (Boolean) DecodeInput(val any) (Input, error) {
switch x := val.(type) {
case bool:
return NewBoolean(x), nil
case string: // from default
b, err := strconv.ParseBool(x)
if err != nil {
return nil, err
}
return NewBoolean(b), nil
default:
return nil, fmt.Errorf("cannot create Boolean from %T", x)
}
}
var _ Input = Boolean(false)
func (Boolean) Decoder() InputDecoder {
return Boolean(false)
}
func (b Boolean) ToLiteral() *idproto.Literal {
return &idproto.Literal{
Value: &idproto.Literal_Bool{
Bool: b.Bool(),
},
}
}
func (b Boolean) Bool() bool {
return bool(b)
}
func (b Boolean) MarshalJSON() ([]byte, error) {
return json.Marshal(b.Bool())
}
func (b *Boolean) UnmarshalJSON(p []byte) error {
var val bool
if err := json.Unmarshal(p, &val); err != nil {
return err
}
*b = Boolean(val)
return nil
}
var _ Setter = Boolean(false)
func (b Boolean) SetField(v reflect.Value) error {
switch v.Interface().(type) {
case bool:
v.SetBool(b.Bool())
return nil
default:
return fmt.Errorf("cannot set field of type %T with %T", v.Interface(), b)
}
}
// String is a GraphQL String scalar.
type String string
func NewString(val string) String {
return String(val)
}
var _ Typed = String("")
func (String) Type() *ast.Type {
return &ast.Type{
NamedType: "String",
NonNull: true,
}
}
var _ ScalarType = String("")
func (String) TypeName() string {
return "String"
}
func (s String) TypeDefinition() *ast.Definition {
return &ast.Definition{
Kind: ast.Scalar,
Name: s.TypeName(),
Description: "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",
BuiltIn: true,
}
}
func (String) DecodeInput(val any) (Input, error) {
switch x := val.(type) {
case string:
return NewString(x), nil
default:
return nil, fmt.Errorf("cannot create String from %T", x)
}
}
var _ Input = String("")
func (String) Decoder() InputDecoder {
return String("")
}
func (s String) ToLiteral() *idproto.Literal {
return &idproto.Literal{
Value: &idproto.Literal_String_{
String_: s.String(),
},
}
}
func (s String) MarshalJSON() ([]byte, error) {
return json.Marshal(s.String())
}
func (s *String) UnmarshalJSON(p []byte) error {
var str string
if err := json.Unmarshal(p, &str); err != nil {
return err
}
*s = String(str)
return nil
}
func (s String) String() string {
return string(s)
}
var _ Setter = String("")
func (s String) SetField(v reflect.Value) error {
switch v.Interface().(type) {
case string:
v.SetString(s.String())
return nil
default:
return fmt.Errorf("cannot set field of type %T with %T", v.Interface(), s)
}
}
// ID is a type-checked ID scalar.
type ID[T Typed] struct {
id *idproto.ID
inner T
}
func NewID[T Typed](id *idproto.ID) ID[T] {
return ID[T]{
id: id,
}
}
func NewDynamicID[T Typed](id *idproto.ID, typed T) ID[T] {
return ID[T]{
id: id,
inner: typed,
}
}
// TypeName returns the name of the type with "ID" appended, e.g. `FooID`.
func (i ID[T]) TypeName() string {
return i.inner.Type().Name() + "ID"
}
var _ Typed = ID[Typed]{}
// Type returns the GraphQL type of the value.
func (i ID[T]) Type() *ast.Type {
return &ast.Type{
NamedType: i.TypeName(),
NonNull: true,
}
}
var _ IDable = ID[Typed]{}
// ID returns the ID of the value.
func (i ID[T]) ID() *idproto.ID {
return i.id
}
var _ ScalarType = ID[Typed]{}
// TypeDefinition returns the GraphQL definition of the type.
func (i ID[T]) TypeDefinition() *ast.Definition {
return &ast.Definition{
Kind: ast.Scalar,
Name: i.TypeName(),
Description: fmt.Sprintf(
"The `%s` scalar type represents an identifier for an object of type %s.",
i.TypeName(),
i.inner.Type().Name(),
),
BuiltIn: true,
}
}
// New creates a new ID with the given value.
//
// It accepts either an *idproto.ID or a string. The string is expected to be
// the base64-encoded representation of an *idproto.ID.
func (i ID[T]) DecodeInput(val any) (Input, error) {
switch x := val.(type) {
case *idproto.ID:
return ID[T]{id: x, inner: i.inner}, nil
case string:
if err := (&i).Decode(x); err != nil {
return nil, err
}
return i, nil
default:
return nil, fmt.Errorf("cannot create ID[%T] from %T: %#v", i.inner, x, x)
}
}
// String returns the ID in ClassID@sha256:... format.
func (i ID[T]) String() string {
dig, err := i.id.Digest()
if err != nil {
panic(err) // TODO
}
return fmt.Sprintf("%s@%s", i.inner.Type().Name(), dig)
}
var _ Setter = ID[Typed]{}
func (i ID[T]) SetField(v reflect.Value) error {
switch v.Interface().(type) {
case *idproto.ID:
v.Set(reflect.ValueOf(i.ID))
return nil
default:
return fmt.Errorf("cannot set field of type %T with %T", v.Interface(), i)
}
}
// For parsing string IDs provided in queries.
var _ Input = ID[Typed]{}
func (i ID[T]) Decoder() InputDecoder {
return ID[T]{inner: i.inner}
}
func (i ID[T]) ToLiteral() *idproto.Literal {
return &idproto.Literal{
Value: &idproto.Literal_Id{
Id: i.id,
},
}
}
func (i ID[T]) Encode() (string, error) {
return i.id.Encode()
}
func (i ID[T]) Display() string {
return i.id.Display()
}
func (i *ID[T]) Decode(str string) error {
if str == "" {
return fmt.Errorf("cannot decode empty string as ID")
}
expectedName := i.inner.Type().Name()
var idp idproto.ID
if err := idp.Decode(str); err != nil {
return err
}
if idp.Type == nil {
return fmt.Errorf("expected %q ID, got untyped ID", expectedName)
}
if idp.Type.NamedType != expectedName {
return fmt.Errorf("expected %q ID, got %s ID", expectedName, idp.Type.ToAST())
}
i.id = &idp
return nil
}
// For returning responses.
var _ json.Marshaler = ID[Typed]{}
func (i ID[T]) MarshalJSON() ([]byte, error) {
enc, err := i.Encode()
if err != nil {
return nil, err
}
return json.Marshal(enc)
}
// Not actually used, but implemented for completeness.
//
// FromValue is what's used in practice.
var _ json.Unmarshaler = (*ID[Typed])(nil)
func (i *ID[T]) UnmarshalJSON(p []byte) error {
var str string
if err := json.Unmarshal(p, &str); err != nil {
return err
}
return i.Decode(str)
}
// Load loads the instance with the given ID from the server.
func (i ID[T]) Load(ctx context.Context, server *Server) (Instance[T], error) {
val, err := server.Load(ctx, i.id)
if err != nil {
return Instance[T]{}, fmt.Errorf("load %s: %w", i.id.Display(), err)
}
obj, ok := val.(Instance[T])
if !ok {
return Instance[T]{}, fmt.Errorf("load %s: expected %T, got %T", i.id.Display(), obj, val)
}
return obj, nil
}
// Enumerable is a value that has a length and allows indexing.
type Enumerable interface {
// Len returns the number of elements in the Enumerable.
Len() int
// Nth returns the Nth element of the Enumerable, with 1 representing the
// first entry.
Nth(int) (Typed, error)
}
// Array is an array of GraphQL values.
type ArrayInput[I Input] []I
func MapArrayInput[T Input, R Typed](opt ArrayInput[T], fn func(T) (R, error)) (Array[R], error) {
r := make(Array[R], len(opt))
for i, val := range opt {
var err error
r[i], err = fn(val)
if err != nil {
return nil, fmt.Errorf("map array[%d]: %w", i, err)
}
}
return r, nil
}
func (a ArrayInput[S]) ToArray() Array[S] {
return Array[S](a)
}
var _ Typed = ArrayInput[Input]{}
func (a ArrayInput[S]) Type() *ast.Type {
var elem S
return &ast.Type{
Elem: elem.Type(),
NonNull: true,
}
}
var _ Input = ArrayInput[Input]{}
func (a ArrayInput[S]) Decoder() InputDecoder {
return a
}
var _ InputDecoder = ArrayInput[Input]{}
func (a ArrayInput[I]) DecodeInput(val any) (Input, error) {
var zero I
decoder := zero.Decoder()
switch x := val.(type) {
case []any:
arr := make(ArrayInput[I], len(x))
for i, val := range x {
elem, err := decoder.DecodeInput(val)
if err != nil {
return nil, fmt.Errorf("ArrayInput.New[%d]: %w", i, err)
}
arr[i] = elem.(I) // TODO sus
}
return arr, nil
case string: // default
var vals []any
dec := json.NewDecoder(strings.NewReader(x))
dec.UseNumber()
if err := dec.Decode(&vals); err != nil {
return nil, fmt.Errorf("decode %q: %w", x, err)
}
return a.DecodeInput(vals)
default:
return nil, fmt.Errorf("cannot create ArrayInput from %T", x)
}
}
func (i ArrayInput[S]) ToLiteral() *idproto.Literal {
list := &idproto.List{}
for _, elem := range i {
list.Values = append(list.Values, elem.ToLiteral())
}
return &idproto.Literal{
Value: &idproto.Literal_List{
List: list,
},
}
}
var _ Setter = ArrayInput[Input]{}
func (d ArrayInput[I]) SetField(val reflect.Value) error {
if val.Kind() != reflect.Slice {
return fmt.Errorf("expected slice, got %v", val.Kind())
}
val.Set(reflect.MakeSlice(val.Type(), len(d), len(d)))
for i, elem := range d {
if err := assign(val.Index(i), elem); err != nil {
return err
}
}
return nil
}
// Array is an array of GraphQL values.
type Array[T Typed] []T
// ToArray creates a new Array by applying the given function to each element
// of the given slice.
func ToArray[A any, T Typed](fn func(A) T, elems ...A) Array[T] {
arr := make(Array[T], len(elems))
for i, elem := range elems {
arr[i] = fn(elem)
}
return arr
}
func NewStringArray(elems ...string) Array[String] {
return ToArray(NewString, elems...)
}
func NewBoolArray(elems ...bool) Array[Boolean] {
return ToArray(NewBoolean, elems...)
}
func NewIntArray(elems ...int) Array[Int] {
return ToArray(NewInt, elems...)
}
func NewFloatArray(elems ...float64) Array[Float] {
return ToArray(NewFloat, elems...)
}
var _ Typed = Array[Typed]{}
func (i Array[T]) Type() *ast.Type {
var t T
return &ast.Type{
Elem: t.Type(),
NonNull: true,
}
}
var _ Enumerable = Array[Typed]{}
func (arr Array[T]) Len() int {
return len(arr)
}
func (arr Array[T]) Nth(i int) (Typed, error) {
if i < 1 || i > len(arr) {
return nil, fmt.Errorf("index %d out of bounds", i)
}
return arr[i-1], nil
}
type EnumValue interface {
Input
~string
}
// EnumValues is a list of possible values for an Enum.
type EnumValues[T EnumValue] struct {
values []T
descriptions []string
}
// NewEnum creates a new EnumType with the given possible values.
func NewEnum[T EnumValue](vals ...T) *EnumValues[T] {
return &EnumValues[T]{
values: vals,
descriptions: make([]string, len(vals)),
}
}
func (e *EnumValues[T]) Type() *ast.Type {
var zero T
return zero.Type()
}
func (e *EnumValues[T]) TypeName() string {
return e.Type().Name()
}
func (e *EnumValues[T]) TypeDefinition() *ast.Definition {
def := &ast.Definition{
Kind: ast.Enum,
Name: e.TypeName(),
EnumValues: e.PossibleValues(),
}
var val T
if isType, ok := any(val).(Descriptive); ok {
def.Description = isType.TypeDescription()
}
return def
}
func (e *EnumValues[T]) DecodeInput(val any) (Input, error) {
switch x := val.(type) {
case string:
return e.Lookup(x)
default:
return nil, fmt.Errorf("cannot create Enum from %T", x)
}
}
func (e *EnumValues[T]) PossibleValues() ast.EnumValueList {
var values ast.EnumValueList
for i, val := range e.values {
values = append(values, &ast.EnumValueDefinition{
Name: string(val),
Description: e.descriptions[i],
})
}
return values
}
func (e *EnumValues[T]) Literal(val T) *idproto.Literal {
return &idproto.Literal{
Value: &idproto.Literal_Enum{
Enum: string(val),
},
}
}
func (e *EnumValues[T]) Lookup(val string) (T, error) {
var enum T
for _, possible := range e.values {
if val == string(possible) {
return possible, nil
}
}
return enum, fmt.Errorf("invalid enum value %q", val)
}
func (e *EnumValues[T]) Register(val T, desc ...string) T {
e.values = append(e.values, val)
e.descriptions = append(e.descriptions, FormatDescription(desc...))
return val
}
func (e *EnumValues[T]) Install(srv *Server) {
var zero T
srv.scalars[zero.Type().Name()] = e
}
// InputType represents a GraphQL Input Object type.
type InputType[T Type] struct{}
func MustInputSpec(val Type) InputObjectSpec {
spec := InputObjectSpec{
Name: val.TypeName(),
}
if desc, ok := val.(Descriptive); ok {
spec.Description = desc.TypeDescription()
}
inputs, err := inputSpecsForType(val, true)
if err != nil {
panic(fmt.Errorf("input specs for %T: %w", val, err))
}
spec.Fields = inputs
return spec
}
type InputObjectSpec struct {
Name string
Description string
Fields InputSpecs
}
func (spec InputObjectSpec) Install(srv *Server) {
srv.InstallTypeDef(spec)
}
func (spec InputObjectSpec) Type() *ast.Type {
return &ast.Type{
NamedType: spec.Name,
NonNull: true,
}
}
func (spec InputObjectSpec) TypeName() string {
return spec.Name
}
func (spec InputObjectSpec) TypeDefinition() *ast.Definition {
return &ast.Definition{
Kind: ast.InputObject,
Name: spec.Name,
Description: spec.Description,
Fields: spec.Fields.FieldDefinitions(),
}
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,358 | CLI: improve display of core API in `--help` output | https://github.com/dagger/dagger/pull/6293 exposed the core API in `dagger call`, which results in `--help` and `dagger functions` output to be pretty overwhelming and messy when dealing with core types like `Container`.
There's most likely going to be a lot of little things needed to address this, possibly including but not limited to:
1. displaying multi-line doc strings better
2. sorting of functions more cleanly
I think we should start out trying to do this purely from the CLI without engine-side changes. But if that ends up not being feasible then we can consider whether typedefs could get optional support for annotating CLI specific presentation metadata. Preferable to avoid going down that road if possible though. | https://github.com/dagger/dagger/issues/6358 | https://github.com/dagger/dagger/pull/6549 | 7a63c3d019530d1f08b2f72cc28e753d99b5896d | 7c0ee45d762719005fad5981d41b038811ebb7f6 | "2024-01-03T20:03:17Z" | go | "2024-02-01T14:32:43Z" | cmd/dagger/cloud.go | package main
import (
"context"
"os"
"github.com/dagger/dagger/internal/cloud"
"github.com/dagger/dagger/internal/cloud/auth"
"github.com/spf13/cobra"
)
func init() {
cloud := &CloudCLI{}
rootCmd.PersistentFlags().StringVar(&cloud.API, "api", "https://api.dagger.cloud", "Dagger Cloud API URL")
rootCmd.PersistentFlags().MarkHidden("api")
loginCmd := &cobra.Command{
Use: "login",
Short: "Log in to Dagger Cloud",
RunE: cloud.Login,
}
rootCmd.AddCommand(loginCmd)
logoutCmd := &cobra.Command{
Use: "logout",
Short: "Log out from Dagger Cloud",
RunE: cloud.Logout,
}
rootCmd.AddCommand(logoutCmd)
}
type CloudCLI struct {
API string
}
func (cli *CloudCLI) Client(ctx context.Context) (*cloud.Client, error) {
return cloud.NewClient(ctx, cli.API)
}
func (cli *CloudCLI) Login(cmd *cobra.Command, args []string) error {
lg := Logger(os.Stderr)
ctx := lg.WithContext(cmd.Context())
if err := auth.Login(ctx); err != nil {
return err
}
client, err := cli.Client(ctx)
if err != nil {
return err
}
user, err := client.User(ctx)
if err != nil {
return err
}
lg.Info().Str("user", user.ID).Msg("logged in")
return nil
}
func (cli *CloudCLI) Logout(cmd *cobra.Command, args []string) error {
lg := Logger(os.Stderr)
if err := auth.Logout(); err != nil {
return err
}
lg.Info().Msg("logged out")
return nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,358 | CLI: improve display of core API in `--help` output | https://github.com/dagger/dagger/pull/6293 exposed the core API in `dagger call`, which results in `--help` and `dagger functions` output to be pretty overwhelming and messy when dealing with core types like `Container`.
There's most likely going to be a lot of little things needed to address this, possibly including but not limited to:
1. displaying multi-line doc strings better
2. sorting of functions more cleanly
I think we should start out trying to do this purely from the CLI without engine-side changes. But if that ends up not being feasible then we can consider whether typedefs could get optional support for annotating CLI specific presentation metadata. Preferable to avoid going down that road if possible though. | https://github.com/dagger/dagger/issues/6358 | https://github.com/dagger/dagger/pull/6549 | 7a63c3d019530d1f08b2f72cc28e753d99b5896d | 7c0ee45d762719005fad5981d41b038811ebb7f6 | "2024-01-03T20:03:17Z" | go | "2024-02-01T14:32:43Z" | cmd/dagger/functions.go | package main
import (
"context"
"errors"
"fmt"
"io"
"os"
"sort"
"strings"
"dagger.io/dagger"
"dagger.io/dagger/querybuilder"
"github.com/dagger/dagger/engine/client"
"github.com/juju/ansiterm/tabwriter"
"github.com/muesli/termenv"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/vito/progrock"
)
const (
Directory string = "Directory"
Container string = "Container"
File string = "File"
Secret string = "Secret"
Service string = "Service"
Terminal string = "Terminal"
PortForward string = "PortForward"
CacheVolume string = "CacheVolume"
)
var funcCmds = FuncCommands{
funcListCmd,
callCmd,
}
var funcListCmd = &FuncCommand{
Name: "functions [flags] [FUNCTION]...",
Short: `List available functions`,
Long: strings.ReplaceAll(`List available functions in a module.
This is similar to ´dagger call --help´, but only focused on showing the
available functions.
`,
"´",
"`",
),
Execute: func(fc *FuncCommand, cmd *cobra.Command) error {
tw := tabwriter.NewWriter(cmd.OutOrStdout(), 0, 0, 3, ' ', tabwriter.DiscardEmptyColumns)
var o functionProvider = fc.mod.GetMainObject()
fmt.Fprintf(tw, "%s\t%s\n",
termenv.String("Name").Bold(),
termenv.String("Description").Bold(),
)
// Walk the hypothetical function pipeline specified by the args
for _, field := range cmd.Flags().Args() {
// Lookup the next function in the specified pipeline
nextFunc, err := o.GetFunction(field)
if err != nil {
return err
}
nextType := nextFunc.ReturnType
if nextType.AsFunctionProvider() != nil {
// sipsma explains why 'nextType.AsObject' is not enough:
// > when we're returning the hierarchies of TypeDefs from the API,
// > and an object shows up as an output/input type to a function,
// > we just return a TypeDef with a name of the object rather than the full object definition.
// > You can get the full object definition only from the "top-level" returned object on the api call.
//
// > The reason is that if we repeated the full object definition every time,
// > you'd at best be using O(n^2) space in the result,
// > and at worst cause json serialization errors due to cyclic references
// > (i.e. with* functions on an object that return the object itself).
o = fc.mod.GetFunctionProvider(nextType.Name())
continue
}
// FIXME: handle arrays of objects
return fmt.Errorf("function '%s' returns non-object type %v", field, nextType.Kind)
}
// List functions on the final object
fns := o.GetFunctions()
sort.Slice(fns, func(i, j int) bool {
return fns[i].Name < fns[j].Name
})
for _, fn := range fns {
desc := strings.SplitN(fn.Description, "\n", 2)[0]
if desc == "" {
desc = "-"
}
fmt.Fprintf(tw, "%s\t%s\n",
cliName(fn.Name),
desc,
)
}
return tw.Flush()
},
}
type FuncCommands []*FuncCommand
func (fcs FuncCommands) AddFlagSet(flags *pflag.FlagSet) {
for _, cmd := range fcs.All() {
cmd.PersistentFlags().AddFlagSet(flags)
}
}
func (fcs FuncCommands) AddParent(rootCmd *cobra.Command) {
rootCmd.AddCommand(fcs.All()...)
}
func (fcs FuncCommands) All() []*cobra.Command {
cmds := make([]*cobra.Command, len(fcs))
for i, fc := range fcs {
cmds[i] = fc.Command()
}
return cmds
}
func setCmdOutput(cmd *cobra.Command, vtx *progrock.VertexRecorder) {
if silent {
return
}
var stdout io.Writer
var stderr io.Writer
if stdoutIsTTY {
stdout = vtx.Stdout()
} else {
stdout = os.Stdout
}
if stderrIsTTY {
stderr = vtx.Stderr()
} else {
stderr = os.Stderr
}
cmd.SetOut(stdout)
cmd.SetErr(stderr)
}
// FuncCommand is a config object used to create a dynamic set of commands
// for querying a module's functions.
type FuncCommand struct {
// The name of the command (or verb), as shown in usage.
Name string
// Aliases is an array of aliases that can be used instead of the first word in Use.
Aliases []string
// Short is the short description shown in the 'help' output.
Short string
// Long is the long message shown in the 'help <this-command>' output.
Long string
// Example is examples of how to use the command.
Example string
// Init is called when the command is created and initialized,
// before execution.
//
// It can be useful to add persistent flags for all subcommands here.
Init func(*cobra.Command)
// Execute circumvents the default behavior of traversing subcommands
// from the arguments, but still has access to the loaded objects from
// the module.
Execute func(*FuncCommand, *cobra.Command) error
// BeforeParse is called before parsing the flags for a subcommand.
//
// It can be useful to add any additional flags for a subcommand here.
BeforeParse func(*FuncCommand, *cobra.Command, *modFunction) error
// OnSelectObjectLeaf is called when a user provided command ends in a
// object and no more sub-commands are provided.
//
// If set, it should make another selection on the object that results
// return no error. Otherwise if it doesn't handle the object, it should
// return an error.
OnSelectObjectLeaf func(*FuncCommand, string) error
// BeforeRequest is called before making the request with the query that
// contains the whole chain of functions.
//
// It can be useful to validate the return type of the function or as a
// last effort to select a GraphQL sub-field.
BeforeRequest func(*FuncCommand, *cobra.Command, *modTypeDef) error
// AfterResponse is called when the query has completed and returned a result.
AfterResponse func(*FuncCommand, *cobra.Command, *modTypeDef, any) error
// cmd is the parent cobra command.
cmd *cobra.Command
// mod is the loaded module definition.
mod *moduleDef
// showHelp is set in the loader vertex to flag whether to show the help
// in the execution vertex.
showHelp bool
// showUsage flags whether to show a one-line usage message after error.
showUsage bool
q *querybuilder.Selection
c *client.Client
}
func (fc *FuncCommand) Command() *cobra.Command {
if fc.cmd == nil {
fc.cmd = &cobra.Command{
Use: fc.Name,
Aliases: fc.Aliases,
Short: fc.Short,
Long: fc.Long,
Example: fc.Example,
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "",
},
// We need to disable flag parsing because it'll act on --help
// and validate the args before we have a chance to add the
// subcommands.
DisableFlagParsing: true,
DisableFlagsInUseLine: true,
PreRunE: func(c *cobra.Command, a []string) error {
// Recover what DisableFlagParsing disabled.
// In PreRunE it's, already past the --help check and
// args validation, but not flag validation which we want.
c.DisableFlagParsing = false
// Since we disabled flag parsing, we'll get all args,
// not just flags. We want to stop parsing at the first
// possible dynamic sub-command since they've not been
// added yet.
c.Flags().SetInterspersed(false)
// Allow using flags with the name that was reported
// by the SDK. This avoids confusion as users are editing
// a module and trying to test its functions.
c.SetGlobalNormalizationFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName {
return pflag.NormalizedName(cliName(name))
})
// temporarily allow unknown flags so we can parse any global flags before starting
// the engine+TUI while not erroring out on module constructor flags (which can't be
// added until the engine has started)
c.FParseErrWhitelist.UnknownFlags = true
if err := c.ParseFlags(a); err != nil {
// This gives a chance for FuncCommand implementations to
// handle errors from parsing flags.
return c.FlagErrorFunc()(c, err)
}
c.FParseErrWhitelist.UnknownFlags = false
fc.showHelp, _ = c.Flags().GetBool("help")
return nil
},
// Between PreRunE and RunE, flags are validated.
RunE: func(c *cobra.Command, a []string) error {
return withEngineAndTUI(c.Context(), client.Params{}, func(ctx context.Context, engineClient *client.Client) (rerr error) {
fc.c = engineClient
// withEngineAndTUI changes the context.
c.SetContext(ctx)
// We need to print the errors ourselves because the root command
// will print the command path for this one (parent), not any
// sub-command.
c.SilenceErrors = true
return fc.execute(c, a)
})
},
}
if fc.Init != nil {
fc.Init(fc.cmd)
}
}
return fc.cmd
}
func (fc *FuncCommand) execute(c *cobra.Command, a []string) (rerr error) {
ctx := c.Context()
rec := progrock.FromContext(ctx)
// NB: Don't print full os.Args in Vertex name because we don't know which
// flags hold a secret value yet and don't want to risk exposing them.
// We'll print just the command path when we have the leaf command.
loader := rec.Vertex("cmd-func-loader", "load "+c.Name())
setCmdOutput(c, loader)
cmd, flags, err := fc.load(c, a, loader)
loader.Done(err)
if err != nil {
return err
}
vtx := rec.Vertex("cmd-func-exec", cmd.CommandPath(), progrock.Focused())
setCmdOutput(c, vtx)
defer func() {
if rerr != nil {
cmd.PrintErrln("Error:", rerr.Error())
if fc.showUsage {
cmd.PrintErrf("Run '%v --help' for usage.\n", cmd.CommandPath())
}
}
vtx.Done(rerr)
}()
// TODO: Move help output out of progrock?
if fc.showHelp {
// Hide aliases for sub-commands. They just allow using the SDK's
// casing for functions but there's no need to advertise.
if cmd != c {
cmd.Aliases = nil
}
return cmd.Help()
}
// There should be no args left, if there are it's an unknown command.
if err := cobra.NoArgs(cmd, flags); err != nil {
return err
}
if fc.Execute != nil {
return fc.Execute(fc, cmd)
}
// No args to the parent command, default to showing help.
if cmd == c {
return cmd.Help()
}
err = cmd.RunE(cmd, flags)
if err != nil {
return err
}
return nil
}
func (fc *FuncCommand) load(c *cobra.Command, a []string, vtx *progrock.VertexRecorder) (cmd *cobra.Command, _ []string, rerr error) {
ctx := c.Context()
dag := fc.c.Dagger()
// Print error in current vertex, before completing it.
defer func() {
if cmd == nil {
cmd = c
}
if rerr != nil {
cmd.PrintErrln("Error:", rerr.Error())
if fc.showHelp {
// Explicitly show the help here while still returning the error.
// This handles the case of `dagger call --help` run on a broken module; in that case
// we want to error out since we can't actually load the module and show all subcommands
// and flags in the help output, but we still want to show the user *something*
cmd.Help()
}
if fc.showUsage {
cmd.PrintErrf("Run '%v --help' for usage.\n", cmd.CommandPath())
}
}
}()
load := vtx.Task("loading module")
modConf, err := getDefaultModuleConfiguration(ctx, dag, "")
if err != nil {
return nil, nil, fmt.Errorf("failed to get configured module: %w", err)
}
if !modConf.FullyInitialized() {
return nil, nil, fmt.Errorf("module at source dir %q doesn't exist or is invalid", modConf.LocalSourcePath)
}
mod := modConf.Mod.Initialize()
_, err = mod.Serve(ctx)
load.Done(err)
if err != nil {
return nil, nil, err
}
load = vtx.Task("loading objects")
modDef, err := loadModTypeDefs(ctx, dag, mod)
load.Done(err)
if err != nil {
return nil, nil, err
}
obj := modDef.GetMainObject()
if obj == nil {
return nil, nil, fmt.Errorf("main object not found")
}
fc.mod = modDef
if fc.Execute != nil {
// if `Execute` is set, there's no need for sub-commands.
return nil, nil, nil
}
if obj.Constructor != nil {
// add constructor args as top-level flags
if err := fc.addArgsForFunction(c, a, obj.Constructor, dag); err != nil {
return nil, nil, err
}
fc.selectFunc(obj.Name, obj.Constructor, c, dag)
} else {
fc.Select(obj.Name)
}
// Add main object's functions as subcommands
fc.addSubCommands(c, dag, obj)
if fc.showHelp {
return nil, nil, nil
}
traverse := vtx.Task("traversing arguments")
cmd, flags, err := fc.traverse(c)
defer func() { traverse.Done(rerr) }()
if err != nil {
if errors.Is(err, pflag.ErrHelp) {
fc.showHelp = true
return cmd, flags, nil
}
fc.showUsage = true
return cmd, flags, err
}
return cmd, flags, nil
}
// traverse the arguments to build the command tree and return the leaf command.
func (fc *FuncCommand) traverse(c *cobra.Command) (*cobra.Command, []string, error) {
cmd, args, err := c.Find(c.Flags().Args())
if err != nil {
return cmd, args, err
}
// Leaf command
if cmd == c {
return cmd, args, nil
}
cmd.SetContext(c.Context())
cmd.InitDefaultHelpFlag()
// Load and ParseFlags
err = cmd.PreRunE(cmd, args)
if err != nil {
return cmd, args, err
}
return fc.traverse(cmd)
}
func (fc *FuncCommand) addSubCommands(cmd *cobra.Command, dag *dagger.Client, fnProvider functionProvider) {
if fnProvider != nil {
for _, fn := range fnProvider.GetFunctions() {
subCmd := fc.makeSubCmd(dag, fn)
cmd.AddCommand(subCmd)
}
}
}
func (fc *FuncCommand) makeSubCmd(dag *dagger.Client, fn *modFunction) *cobra.Command {
newCmd := &cobra.Command{
Use: cliName(fn.Name),
Short: fn.Description,
PreRunE: func(cmd *cobra.Command, args []string) (err error) {
if err := fc.addArgsForFunction(cmd, args, fn, dag); err != nil {
return err
}
fnProvider := fn.ReturnType.AsFunctionProvider()
if fnProvider == nil && fn.ReturnType.AsList != nil {
fnProvider = fn.ReturnType.AsList.ElementTypeDef.AsFunctionProvider()
}
fc.addSubCommands(cmd, dag, fnProvider)
// Show help for first command that has the --help flag.
help, _ := cmd.Flags().GetBool("help")
if help {
return pflag.ErrHelp
}
// Need to make the query selection before chaining off.
return fc.selectFunc(fn.Name, fn, cmd, dag)
},
// This is going to be executed in the "execution" vertex, when
// we have the final/leaf command.
RunE: func(cmd *cobra.Command, args []string) (err error) {
switch fn.ReturnType.Kind {
case dagger.ObjectKind, dagger.InterfaceKind:
if fc.OnSelectObjectLeaf == nil {
// there is no handling of this object and no further selections, error out
fc.showUsage = true
return fmt.Errorf("%q requires a sub-command", cmd.Name())
}
// the top-level command may handle this via OnSelectObjectLeaf
err := fc.OnSelectObjectLeaf(fc, fn.ReturnType.Name())
if err != nil {
fc.showUsage = true
return fmt.Errorf("invalid selection for command %q: %w", cmd.Name(), err)
}
case dagger.ListKind:
fnProvider := fn.ReturnType.AsList.ElementTypeDef.AsFunctionProvider()
if fnProvider != nil && len(fnProvider.GetFunctions()) > 0 {
// we don't handle lists of objects/interfaces w/ extra functions on any commands right now
fc.showUsage = true
return fmt.Errorf("%q requires a sub-command", cmd.Name())
}
}
if fc.BeforeRequest != nil {
if err = fc.BeforeRequest(fc, cmd, fn.ReturnType); err != nil {
return err
}
}
ctx := cmd.Context()
query, _ := fc.q.Build(ctx)
rec := progrock.FromContext(ctx)
rec.Debug("executing", progrock.Labelf("query", "%+v", query))
var response any
q := fc.q.Bind(&response)
if err := q.Execute(ctx, dag.GraphQLClient()); err != nil {
return fmt.Errorf("response from query: %w", err)
}
if fc.AfterResponse != nil {
return fc.AfterResponse(fc, cmd, fn.ReturnType, response)
}
if fn.ReturnType.Kind != dagger.VoidKind {
cmd.Println(response)
}
return nil
},
}
// Allow using the function name from the SDK as an alias for the command.
if fn.Name != newCmd.Name() {
newCmd.Aliases = append(newCmd.Aliases, fn.Name)
}
newCmd.Flags().SetInterspersed(false)
return newCmd
}
func (fc *FuncCommand) addArgsForFunction(cmd *cobra.Command, cmdArgs []string, fn *modFunction, dag *dagger.Client) error {
fc.mod.LoadTypeDef(fn.ReturnType)
for _, arg := range fn.Args {
fc.mod.LoadTypeDef(arg.TypeDef)
}
for _, arg := range fn.Args {
_, err := arg.AddFlag(cmd.Flags(), dag)
if err != nil {
return err
}
if !arg.TypeDef.Optional {
cmd.MarkFlagRequired(arg.FlagName())
}
}
if fc.BeforeParse != nil {
if err := fc.BeforeParse(fc, cmd, fn); err != nil {
return err
}
}
if err := cmd.ParseFlags(cmdArgs); err != nil {
// This gives a chance for FuncCommand implementations to
// handle errors from parsing flags.
return cmd.FlagErrorFunc()(cmd, err)
}
help, _ := cmd.Flags().GetBool("help")
if !help {
if err := cmd.ValidateRequiredFlags(); err != nil {
return err
}
if err := cmd.ValidateFlagGroups(); err != nil {
return err
}
}
return nil
}
// selectFunc adds the function selection to the query.
// Note that the type can change if there's an extra selection for supported types.
func (fc *FuncCommand) selectFunc(selectName string, fn *modFunction, cmd *cobra.Command, dag *dagger.Client) error {
fc.Select(selectName)
for _, arg := range fn.Args {
var val any
flag := cmd.Flags().Lookup(arg.FlagName())
if flag == nil {
return fmt.Errorf("no flag for %q", arg.FlagName())
}
// Don't send optional arguments that weren't set.
if arg.TypeDef.Optional && !flag.Changed {
continue
}
val = flag.Value
switch v := val.(type) {
case DaggerValue:
obj, err := v.Get(cmd.Context(), dag)
if err != nil {
return fmt.Errorf("failed to get value for argument %q: %w", arg.Name, err)
}
if obj == nil {
return fmt.Errorf("no value for argument: %s", arg.Name)
}
val = obj
case pflag.SliceValue:
val = v.GetSlice()
}
fc.Arg(arg.Name, val)
}
return nil
}
func (fc *FuncCommand) Select(name string) {
if fc.q == nil {
fc.q = querybuilder.Query()
}
fc.q = fc.q.Select(gqlFieldName(name))
}
func (fc *FuncCommand) Arg(name string, value any) {
fc.q = fc.q.Arg(gqlArgName(name), value)
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,358 | CLI: improve display of core API in `--help` output | https://github.com/dagger/dagger/pull/6293 exposed the core API in `dagger call`, which results in `--help` and `dagger functions` output to be pretty overwhelming and messy when dealing with core types like `Container`.
There's most likely going to be a lot of little things needed to address this, possibly including but not limited to:
1. displaying multi-line doc strings better
2. sorting of functions more cleanly
I think we should start out trying to do this purely from the CLI without engine-side changes. But if that ends up not being feasible then we can consider whether typedefs could get optional support for annotating CLI specific presentation metadata. Preferable to avoid going down that road if possible though. | https://github.com/dagger/dagger/issues/6358 | https://github.com/dagger/dagger/pull/6549 | 7a63c3d019530d1f08b2f72cc28e753d99b5896d | 7c0ee45d762719005fad5981d41b038811ebb7f6 | "2024-01-03T20:03:17Z" | go | "2024-02-01T14:32:43Z" | cmd/dagger/main.go | package main
import (
"fmt"
"io"
"os"
"path/filepath"
"runtime/pprof"
"runtime/trace"
"github.com/dagger/dagger/tracing"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
var (
workdir string
cpuprofile string
pprofAddr string
debug bool
)
func init() {
// Disable logrus output, which only comes from the docker
// commandconn library that is used by buildkit's connhelper
// and prints unneeded warning logs.
logrus.StandardLogger().SetOutput(io.Discard)
rootCmd.PersistentFlags().StringVar(&workdir, "workdir", ".", "The host workdir loaded into dagger")
rootCmd.PersistentFlags().BoolVar(&debug, "debug", false, "Show more information for debugging")
rootCmd.PersistentFlags().StringVar(&cpuprofile, "cpuprofile", "", "collect CPU profile to path, and trace at path.trace")
rootCmd.PersistentFlags().StringVar(&pprofAddr, "pprof", "", "serve HTTP pprof at this address")
rootCmd.AddCommand(
listenCmd,
versionCmd,
queryCmd,
runCmd,
moduleCmd,
sessionCmd(),
genDocCmd,
downloadCmd,
upCmd,
shellCmd,
)
funcCmds.AddParent(rootCmd)
cobra.AddTemplateFunc("isExperimental", isExperimental)
rootCmd.SetUsageTemplate(usageTemplate)
rootCmd.AddGroup(moduleGroup)
}
var rootCmd = &cobra.Command{
Use: "dagger",
Short: "The Dagger CLI provides a command-line interface to Dagger.",
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
// if we got this far, CLI parsing worked just fine; no
// need to show usage for runtime errors
cmd.SilenceUsage = true
if cpuprofile != "" {
profF, err := os.Create(cpuprofile)
if err != nil {
return fmt.Errorf("create profile: %w", err)
}
pprof.StartCPUProfile(profF)
tracePath := cpuprofile + ".trace"
traceF, err := os.Create(tracePath)
if err != nil {
return fmt.Errorf("create trace: %w", err)
}
if err := trace.Start(traceF); err != nil {
return fmt.Errorf("start trace: %w", err)
}
}
if pprofAddr != "" {
if err := setupDebugHandlers(pprofAddr); err != nil {
return fmt.Errorf("start pprof: %w", err)
}
}
var err error
workdir, err = NormalizeWorkdir(workdir)
if err != nil {
return err
}
if err := os.Chdir(workdir); err != nil {
return err
}
return nil
},
PersistentPostRun: func(cmd *cobra.Command, args []string) {
pprof.StopCPUProfile()
trace.Stop()
},
}
func main() {
closer := tracing.Init()
if err := rootCmd.Execute(); err != nil {
closer.Close()
os.Exit(1)
}
closer.Close()
}
func NormalizeWorkdir(workdir string) (string, error) {
if workdir == "" {
workdir = os.Getenv("DAGGER_WORKDIR")
}
if workdir == "" {
var err error
workdir, err = os.Getwd()
if err != nil {
return "", err
}
}
workdir, err := filepath.Abs(workdir)
if err != nil {
return "", err
}
return workdir, nil
}
func isExperimental(cmd *cobra.Command) bool {
if _, ok := cmd.Annotations["experimental"]; ok {
return true
}
var experimental bool
cmd.VisitParents(func(cmd *cobra.Command) {
if _, ok := cmd.Annotations["experimental"]; ok {
experimental = true
return
}
})
return experimental
}
const usageTemplate = `Usage:
{{- if .Runnable}}
{{.UseLine}}
{{- end}}
{{- if .HasAvailableSubCommands}}
{{ .CommandPath}} [command]
{{- end}}
{{- if gt (len .Aliases) 0}}
Aliases:
{{.NameAndAliases}}
{{- end}}
{{- if isExperimental .}}
EXPERIMENTAL:
{{.CommandPath}} is currently under development and may change in the future.
{{- end}}
{{- if .HasExample}}
Examples:
{{ .Example }}
{{- end}}
{{- if .HasAvailableSubCommands}}{{$cmds := .Commands}}
{{- if eq (len .Groups) 0}}
Available Commands:
{{- range $cmds }}
{{- if (or .IsAvailableCommand (eq .Name "help"))}}
{{rpad .Name .NamePadding }} {{.Short}}
{{- end}}
{{- end}}
{{- else}}
{{- range $group := .Groups}}
{{.Title}}:
{{- range $cmds }}
{{- if (and (eq .GroupID $group.ID) (or .IsAvailableCommand (eq .Name "help")))}}
{{rpad .Name .NamePadding }} {{.Short}}
{{- end}}
{{- end}}{{/* range $cmds */}}
{{- end}}{{/* range $group := .Groups */}}
{{- if not .AllChildCommandsHaveGroup}}
Additional Commands:
{{- range $cmds }}
{{- if (and (eq .GroupID "") (or .IsAvailableCommand (eq .Name "help")))}}
{{rpad .Name .NamePadding }} {{.Short}}
{{- end}}
{{- end}}{{/* range $cmds */}}
{{- end}}{{/* if not .AllChildCommandsHaveGroup */}}
{{- end}}{{/* if eq (len .Groups) 0 */}}
{{- end}}{{/* if .HasAvailableSubCommands */}}
{{- if .HasAvailableLocalFlags}}
Flags:
{{ .LocalFlags.FlagUsages | trimTrailingWhitespaces}}
{{- end}}
{{- if .HasAvailableInheritedFlags}}
Global Flags:
{{ .InheritedFlags.FlagUsages | trimTrailingWhitespaces}}
{{- end}}
{{- if .HasHelpSubCommands}}
Additional help topics:
{{- range .Commands}}
{{- if .IsAdditionalHelpTopicCommand}}
{{rpad .CommandPath .CommandPathPadding}} {{.Short}}
{{- end}}
{{- end}}
{{- end}}{{/* if .HasHelpSubCommands */}}
{{- if .HasAvailableSubCommands }}
Use "{{.CommandPath}} [command] --help" for more information about a command.
{{- end}}
`
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,358 | CLI: improve display of core API in `--help` output | https://github.com/dagger/dagger/pull/6293 exposed the core API in `dagger call`, which results in `--help` and `dagger functions` output to be pretty overwhelming and messy when dealing with core types like `Container`.
There's most likely going to be a lot of little things needed to address this, possibly including but not limited to:
1. displaying multi-line doc strings better
2. sorting of functions more cleanly
I think we should start out trying to do this purely from the CLI without engine-side changes. But if that ends up not being feasible then we can consider whether typedefs could get optional support for annotating CLI specific presentation metadata. Preferable to avoid going down that road if possible though. | https://github.com/dagger/dagger/issues/6358 | https://github.com/dagger/dagger/pull/6549 | 7a63c3d019530d1f08b2f72cc28e753d99b5896d | 7c0ee45d762719005fad5981d41b038811ebb7f6 | "2024-01-03T20:03:17Z" | go | "2024-02-01T14:32:43Z" | cmd/dagger/module.go | package main
import (
"context"
"encoding/json"
"fmt"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"dagger.io/dagger"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/engine/client"
"github.com/go-git/go-git/v5"
"github.com/iancoleman/strcase"
"github.com/juju/ansiterm/tabwriter"
"github.com/moby/buildkit/util/gitutil"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/vito/progrock"
)
var (
moduleGroup = &cobra.Group{
ID: "module",
Title: "Dagger Modules (Experimental)",
}
moduleURL string
moduleFlags = pflag.NewFlagSet("module", pflag.ContinueOnError)
sdk string
licenseID string
moduleName string
installName string
force bool
)
const (
moduleURLDefault = "."
)
func init() {
moduleFlags.StringVarP(&moduleURL, "mod", "m", "", "Path to dagger.json config file for the module or a directory containing that file. Either local path (e.g. \"/path/to/some/dir\") or a github repo (e.g. \"github.com/dagger/dagger/path/to/some/subdir\")")
moduleFlags.BoolVar(&focus, "focus", true, "Only show output for focused commands")
moduleCmd.PersistentFlags().AddFlagSet(moduleFlags)
listenCmd.PersistentFlags().AddFlagSet(moduleFlags)
queryCmd.PersistentFlags().AddFlagSet(moduleFlags)
funcCmds.AddFlagSet(moduleFlags)
moduleInitCmd.Flags().StringVar(&sdk, "sdk", "", "SDK name or image ref to use for the module")
moduleInitCmd.Flags().StringVar(&moduleName, "name", "", "Name of the new module")
moduleInitCmd.Flags().StringVar(&licenseID, "license", "", "License identifier to generate - see https://spdx.org/licenses/")
moduleInitCmd.MarkFlagsRequiredTogether("sdk", "name")
modulePublishCmd.Flags().BoolVarP(&force, "force", "f", false, "Force publish even if the git repository is not clean")
moduleInstallCmd.Flags().StringVarP(&installName, "name", "n", "", "Name to use for the dependency in the module. Defaults to the name of the module being installed.")
moduleCmd.AddCommand(moduleInitCmd)
moduleCmd.AddCommand(moduleInstallCmd)
moduleCmd.AddCommand(moduleSyncCmd)
moduleCmd.AddCommand(modulePublishCmd)
}
var moduleCmd = &cobra.Command{
Use: "module",
Aliases: []string{"mod"},
Short: "Manage Dagger modules",
Long: "Manage Dagger modules. By default, print the configuration of the specified module in json format.",
Example: strings.TrimSpace(`
dagger mod -m /path/to/some/dir
dagger mod -m github.com/dagger/hello-dagger
`,
),
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
modConf, err := getDefaultModuleConfiguration(ctx, engineClient.Dagger(), "")
if err != nil {
return fmt.Errorf("failed to load module: %w", err)
}
if !modConf.FullyInitialized() {
return fmt.Errorf("module must be fully initialized")
}
mod := modConf.Mod
name, err := mod.Name(ctx)
if err != nil {
return fmt.Errorf("failed to get module name: %w", err)
}
sdk, err := mod.SDK(ctx)
if err != nil {
return fmt.Errorf("failed to get module SDK: %w", err)
}
depMods, err := mod.Dependencies(ctx)
if err != nil {
return fmt.Errorf("failed to get module dependencies: %w", err)
}
var depModNames []string
for _, depMod := range depMods {
depModName, err := depMod.Name(ctx)
if err != nil {
return fmt.Errorf("failed to get module name: %w", err)
}
depModNames = append(depModNames, depModName)
}
tw := tabwriter.NewWriter(cmd.OutOrStdout(), 0, 0, 3, ' ', tabwriter.DiscardEmptyColumns)
fmt.Fprintf(tw, "%s\t%s\n",
"Name:",
name,
)
fmt.Fprintf(tw, "%s\t%s\n",
"SDK:",
sdk,
)
fmt.Fprintf(tw, "%s\t%s\n",
"Root Directory:",
modConf.LocalRootPath,
)
fmt.Fprintf(tw, "%s\t%s\n",
"Source Directory:",
modConf.LocalSourcePath,
)
fmt.Fprintf(tw, "%s\t%s\n",
"Dependencies:",
strings.Join(depModNames, ", "),
)
return tw.Flush()
})
},
}
var moduleInitCmd = &cobra.Command{
Use: "init [--sdk string --name string]",
Short: "Initialize a new Dagger module",
Long: "Initialize a new Dagger module in a local directory.",
Example: "dagger mod init --name=hello --sdk=python",
RunE: func(cmd *cobra.Command, _ []string) (rerr error) {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
dag := engineClient.Dagger()
// default the module root to the current working directory if it doesn't exist yet
cwd, err := os.Getwd()
if err != nil {
return fmt.Errorf("failed to get current working directory: %w", err)
}
modConf, err := getDefaultModuleConfiguration(ctx, dag, cwd)
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
if modConf.SourceKind != dagger.LocalSource {
return fmt.Errorf("module must be local")
}
if modConf.ModuleSourceConfigExists {
return fmt.Errorf("module already exists")
}
_, err = modConf.Mod.
WithName(moduleName).
WithSDK(sdk).
GeneratedSourceRootDirectory().
Export(ctx, modConf.LocalRootPath)
if err != nil {
return fmt.Errorf("failed to generate code: %w", err)
}
if err := findOrCreateLicense(ctx, modConf.LocalSourcePath); err != nil {
return err
}
return nil
})
},
}
var moduleInstallCmd = &cobra.Command{
Use: "install [flags] MODULE",
Aliases: []string{"use"},
Short: "Add a new dependency to a Dagger module",
Long: "Add a Dagger module as a dependency of a local module.",
// TODO: use example from a reference module, using a tag instead of commit
Example: "dagger mod install github.com/shykes/daggerverse/ttlsh@16e40ec244966e55e36a13cb6e1ff8023e1e1473",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
dag := engineClient.Dagger()
modConf, err := getDefaultModuleConfiguration(ctx, dag, "")
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
if modConf.SourceKind != dagger.LocalSource {
return fmt.Errorf("module must be local")
}
if !modConf.FullyInitialized() {
return fmt.Errorf("module must be fully initialized, root directory initialized: %t, source directory initialized: %t", modConf.ModuleRootConfigExists, modConf.ModuleSourceConfigExists)
}
depRefStr := extraArgs[0]
depSrc := dag.ModuleSource(depRefStr)
depSrcKind, err := depSrc.Kind(ctx)
if err != nil {
return fmt.Errorf("failed to get module ref kind: %w", err)
}
if depSrcKind == dagger.LocalSource {
// need to ensure that local dep paths are relative to the parent root source
depAbsPath, err := filepath.Abs(depRefStr)
if err != nil {
return fmt.Errorf("failed to get absolute path for %s: %w", depRefStr, err)
}
depRelPath, err := filepath.Rel(modConf.LocalSourcePath, depAbsPath)
if err != nil {
return fmt.Errorf("failed to get relative path: %w", err)
}
depSrc = dag.ModuleSource(depRelPath)
}
dep := dag.ModuleDependency(depSrc, dagger.ModuleDependencyOpts{
Name: installName,
})
_, err = modConf.Mod.
WithDependencies([]*dagger.ModuleDependency{dep}).
GeneratedSourceRootDirectory().
Export(ctx, modConf.LocalRootPath)
if err != nil {
return fmt.Errorf("failed to generate code: %w", err)
}
return nil
})
},
}
var moduleSyncCmd = &cobra.Command{
Use: "sync",
Short: "Synchronize a Dagger module",
Long: `Synchronize a Dagger module with the latest version of its extensions.
:::note
This is only required for IDE auto-completion/LSP purposes.
:::
This command re-regerates the module's generated code based on dependencies
and the current state of the module's source code.
`,
RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
dag := engineClient.Dagger()
modConf, err := getDefaultModuleConfiguration(ctx, dag, "")
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
if modConf.SourceKind != dagger.LocalSource {
return fmt.Errorf("module must be local")
}
_, err = modConf.Mod.GeneratedSourceRootDirectory().Export(ctx, modConf.LocalRootPath)
if err != nil {
return fmt.Errorf("failed to generate code: %w", err)
}
return nil
})
},
}
const daDaggerverse = "https://daggerverse.dev"
var modulePublishCmd = &cobra.Command{
Use: "publish",
Short: "Publish a Dagger module to the Daggerverse",
Long: fmt.Sprintf(`Publish a local module to the Daggerverse (%s).
The module needs to be committed to a git repository and have a remote
configured with name "origin". The git repository must be clean (unless
forced), to avoid mistakingly depending on uncommitted files.
`,
daDaggerverse,
),
RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
rec := progrock.FromContext(ctx)
vtx := rec.Vertex("publish", strings.Join(os.Args, " "), progrock.Focused())
defer func() { vtx.Done(err) }()
cmd.SetOut(vtx.Stdout())
cmd.SetErr(vtx.Stderr())
dag := engineClient.Dagger()
modConf, err := getDefaultModuleConfiguration(ctx, dag, "")
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
if modConf.SourceKind != dagger.LocalSource {
return fmt.Errorf("module must be local")
}
if !modConf.FullyInitialized() {
return fmt.Errorf("module must be fully initialized")
}
repo, err := git.PlainOpenWithOptions(modConf.LocalSourcePath, &git.PlainOpenOptions{
DetectDotGit: true,
})
if err != nil {
return fmt.Errorf("failed to open git repo: %w", err)
}
wt, err := repo.Worktree()
if err != nil {
return fmt.Errorf("failed to get git worktree: %w", err)
}
st, err := wt.Status()
if err != nil {
return fmt.Errorf("failed to get git status: %w", err)
}
head, err := repo.Head()
if err != nil {
return fmt.Errorf("failed to get git HEAD: %w", err)
}
commit := head.Hash()
rec.Debug("git commit", progrock.Labelf("commit", commit.String()))
orig, err := repo.Remote("origin")
if err != nil {
return fmt.Errorf("failed to get git remote: %w", err)
}
refPath, err := originToPath(orig.Config().URLs[0])
if err != nil {
return fmt.Errorf("failed to get module path: %w", err)
}
// calculate path relative to repo root
gitRoot := wt.Filesystem.Root()
pathFromRoot, err := filepath.Rel(gitRoot, modConf.LocalSourcePath)
if err != nil {
return fmt.Errorf("failed to get path from git root: %w", err)
}
// NB: you might think to ignore changes to files outside of the module,
// but we should probably play it safe. in a monorepo for example this
// could mean publishing a broken module because it depends on
// uncommitted code in a dependent module.
//
// TODO: the proper fix here might be to check for dependent code, too.
// Specifically I should be able to publish a dependency before
// committing + pushing its dependers. but in the end it doesn't really
// matter; just commit everything and _then_ publish.
if !st.IsClean() && !force {
cmd.Println(st)
return fmt.Errorf("git repository is not clean; run with --force to ignore")
}
refStr := fmt.Sprintf("%s@%s", path.Join(refPath, pathFromRoot), commit)
crawlURL, err := url.JoinPath(daDaggerverse, "crawl")
if err != nil {
return fmt.Errorf("failed to get module URL: %w", err)
}
data := url.Values{}
data.Add("ref", refStr)
req, err := http.NewRequest(http.MethodPut, crawlURL, strings.NewReader(data.Encode()))
if err != nil {
return fmt.Errorf("failed to create request: %w", err)
}
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := http.DefaultClient.Do(req)
if err != nil {
return fmt.Errorf("failed to get module: %w", err)
}
// TODO(vito): inspect response and/or poll, would be nice to surface errors here
cmd.Println("Publishing", refStr, "to", daDaggerverse+"...")
cmd.Println()
cmd.Println("You can check on the crawling status here:")
cmd.Println()
cmd.Println(" " + res.Request.URL.String())
modURL, err := url.JoinPath(daDaggerverse, "mod", refStr)
if err != nil {
return fmt.Errorf("failed to get module URL: %w", err)
}
cmd.Println()
cmd.Println("Once the crawl is complete, you can view your module here:")
cmd.Println()
cmd.Println(" " + modURL)
return res.Body.Close()
})
},
}
func originToPath(origin string) (string, error) {
url, err := gitutil.ParseURL(origin)
if err != nil {
return "", fmt.Errorf("failed to parse git remote origin URL: %w", err)
}
return strings.TrimSuffix(path.Join(url.Host, url.Path), ".git"), nil
}
type configuredModule struct {
Mod *dagger.Module
SourceKind dagger.ModuleSourceKind
LocalRootPath string
LocalSourcePath string
// whether the dagger.json in the module root dir exists yet
ModuleRootConfigExists bool
// whether the dagger.json in the module source dir exists yet
ModuleSourceConfigExists bool
}
func (c *configuredModule) FullyInitialized() bool {
return c.ModuleRootConfigExists && c.ModuleSourceConfigExists
}
func getDefaultModuleConfiguration(ctx context.Context, dag *dagger.Client, defaultRootPath string) (*configuredModule, error) {
srcRefStr := moduleURL
if srcRefStr == "" {
// it's unset or default value, use mod if present
if v, ok := os.LookupEnv("DAGGER_MODULE"); ok {
srcRefStr = v
}
// it's still unset, set to the default
if srcRefStr == "" {
srcRefStr = moduleURLDefault
}
}
return getModuleConfigurationForSourceRef(ctx, dag, srcRefStr, defaultRootPath)
}
func getModuleConfigurationForSourceRef(
ctx context.Context,
dag *dagger.Client,
srcRefStr string,
defaultRootPath string,
) (*configuredModule, error) {
conf := &configuredModule{}
// first check if this is a named module from the default find-up dagger.json
cwd, err := os.Getwd()
if err != nil {
return nil, fmt.Errorf("failed to get current working directory: %w", err)
}
defaultConfigDir, foundDefaultConfig, err := findUp(cwd)
if err != nil {
return nil, fmt.Errorf("error trying to find config path for %s: %s", cwd, err)
}
if foundDefaultConfig {
configPath := filepath.Join(defaultConfigDir, modules.Filename)
contents, err := os.ReadFile(configPath)
if err != nil {
return nil, fmt.Errorf("failed to read %s: %w", configPath, err)
}
var modCfg modules.ModuleConfig
if err := json.Unmarshal(contents, &modCfg); err != nil {
return nil, fmt.Errorf("failed to unmarshal %s: %s", configPath, err)
}
if err := modCfg.Validate(); err != nil {
return nil, fmt.Errorf("error validating %s: %s", configPath, err)
}
if namedDep, ok := modCfg.DependencyByName(srcRefStr); ok {
srcRefStr = namedDep.Source
}
}
src := dag.ModuleSource(srcRefStr)
conf.SourceKind, err = src.Kind(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get module ref kind: %w", err)
}
if conf.SourceKind == dagger.LocalSource {
conf.LocalSourcePath, err = filepath.Abs(srcRefStr)
if err != nil {
return nil, fmt.Errorf("failed to get absolute path for %s: %w", srcRefStr, err)
}
conf.LocalRootPath, conf.ModuleRootConfigExists, err = findUpRootFor(conf.LocalSourcePath, conf.LocalSourcePath)
if err != nil {
return nil, fmt.Errorf("error trying to find config path for %s: %s", conf.LocalSourcePath, err)
}
if !conf.ModuleRootConfigExists {
if defaultRootPath == "" {
// Just use the source dir. This can happen legitimately when loading
// an older dagger.json that didn't have root-for yet.
conf.LocalRootPath = conf.LocalSourcePath
} else {
// use the default, but double check it's not above any .git hit by the findUpRootFor
defaultRelPath, err := filepath.Rel(conf.LocalRootPath, defaultRootPath)
if err != nil {
return nil, fmt.Errorf("failed to get relative path: %s", err)
}
if !filepath.IsLocal(defaultRelPath) {
return nil, fmt.Errorf("default module root directory %s escapes git root %s", cwd, conf.LocalRootPath)
}
conf.LocalRootPath = cwd
}
}
src, conf.ModuleSourceConfigExists, err = loadLocalModuleSource(dag, conf.LocalRootPath, conf.LocalSourcePath)
if err != nil {
return nil, fmt.Errorf("error loading local module: %s", err)
}
if !conf.ModuleRootConfigExists && conf.ModuleSourceConfigExists && defaultRootPath == "" {
// finish up the case above where we default old dagger.jsons that didn't
// have root-for to using the source dir. We know now that the source config
// file actually existed, so the root exists too. It will be updated in the engine
// when calling functions (and exported back to the client if they sync/install)
conf.ModuleRootConfigExists = true
}
conf.Mod = src.AsModule()
} else {
conf.Mod = src.AsModule()
conf.ModuleRootConfigExists = true
conf.ModuleSourceConfigExists = true
}
return conf, nil
}
// loadLocalModuleSource loads the module specified by the given paths.
func loadLocalModuleSource(
dag *dagger.Client,
sourceRootAbsPath string,
sourceSubdirAbsPath string,
) (*dagger.ModuleSource, bool, error) {
var include []string
var exclude []string
var exists bool
configPath := filepath.Join(sourceSubdirAbsPath, modules.Filename)
configBytes, err := os.ReadFile(configPath)
switch {
case err == nil:
var modCfg modules.ModuleConfig
if err := json.Unmarshal(configBytes, &modCfg); err != nil {
return nil, false, fmt.Errorf("error unmarshaling %s: %s", configPath, err)
}
if err := modCfg.Validate(); err != nil {
return nil, false, fmt.Errorf("error validating %s: %s", configPath, err)
}
include = modCfg.Include
exclude = modCfg.Exclude
exists = true
case os.IsNotExist(err):
// config doesn't exist yet, load with no include/exclude
default:
return nil, false, fmt.Errorf("error reading config %s: %s", configPath, err)
}
// reposition sourceSubdirAbsPath to be relative to configDirPath
sourceSubdirRelPath, err := filepath.Rel(sourceRootAbsPath, sourceSubdirAbsPath)
if err != nil {
return nil, false, err
}
return dag.ModuleSource(sourceSubdirRelPath, dagger.ModuleSourceOpts{
RootDirectory: dag.Host().Directory(sourceRootAbsPath, dagger.HostDirectoryOpts{
Include: include,
Exclude: exclude,
}),
}), exists, nil
}
func findUp(curDirPath string) (string, bool, error) {
if !filepath.IsAbs(curDirPath) {
return "", false, fmt.Errorf("path is not absolute: %s", curDirPath)
}
configPath := filepath.Join(curDirPath, modules.Filename)
stat, err := os.Lstat(configPath)
switch {
case os.IsNotExist(err):
case err == nil:
// make sure it's a file
if !stat.Mode().IsRegular() {
return "", false, fmt.Errorf("expected %s to be a file", configPath)
}
return curDirPath, true, nil
default:
return "", false, fmt.Errorf("failed to lstat %s: %s", configPath, err)
}
// didn't exist, try parent unless we've hit "/" or a git repo checkout root
if curDirPath == "/" {
return curDirPath, false, nil
}
_, err = os.Lstat(filepath.Join(curDirPath, ".git"))
if err == nil {
return curDirPath, false, nil
}
parentDirPath := filepath.Dir(curDirPath)
return findUp(parentDirPath)
}
func findUpRootFor(curDirPath string, sourceSubpath string) (string, bool, error) {
foundDir, found, err := findUp(curDirPath)
if err != nil {
return "", false, err
}
if !found {
return foundDir, false, nil
}
configPath := filepath.Join(foundDir, modules.Filename)
contents, err := os.ReadFile(configPath)
if err != nil {
return "", false, fmt.Errorf("failed to read %s: %s", configPath, err)
}
var modCfg modules.ModuleConfig
if err := json.Unmarshal(contents, &modCfg); err != nil {
return "", false, fmt.Errorf("failed to unmarshal %s: %s", configPath, err)
}
if err := modCfg.Validate(); err != nil {
return "", false, fmt.Errorf("error validating %s: %s", configPath, err)
}
sourceRelSubpath, err := filepath.Rel(curDirPath, sourceSubpath)
if err != nil {
return "", false, fmt.Errorf("failed to get relative path: %s", err)
}
if modCfg.IsRootFor(sourceRelSubpath) {
return curDirPath, true, nil
}
return findUpRootFor(filepath.Dir(foundDir), sourceSubpath)
}
// Wraps a command with optional module loading. If a module was explicitly specified by the user,
// it will try to load it and error out if it's not found or invalid. If no module was specified,
// it will try the current directory as a module but provide a nil module if it's not found, not
// erroring out.
func optionalModCmdWrapper(
fn func(context.Context, *client.Client, *dagger.Module, *cobra.Command, []string) error,
presetSecretToken string,
) func(*cobra.Command, []string) error {
return func(cmd *cobra.Command, cmdArgs []string) error {
return withEngineAndTUI(cmd.Context(), client.Params{
SecretToken: presetSecretToken,
}, func(ctx context.Context, engineClient *client.Client) (err error) {
rec := progrock.FromContext(ctx)
vtx := rec.Vertex("cmd-loader", strings.Join(os.Args, " "))
defer func() { vtx.Done(err) }()
modConf, err := getDefaultModuleConfiguration(ctx, engineClient.Dagger(), "")
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
var loadedMod *dagger.Module
if modConf.FullyInitialized() {
loadedMod = modConf.Mod.Initialize()
load := vtx.Task("loading module")
_, err := loadedMod.Serve(ctx)
load.Done(err)
if err != nil {
return fmt.Errorf("failed to serve module: %w", err)
}
}
return fn(ctx, engineClient, loadedMod, cmd, cmdArgs)
})
}
}
// loadModTypeDefs loads the objects defined by the given module in an easier to use data structure.
func loadModTypeDefs(ctx context.Context, dag *dagger.Client, mod *dagger.Module) (*moduleDef, error) {
var res struct {
TypeDefs []*modTypeDef
}
const query = `
fragment TypeDefRefParts on TypeDef {
kind
optional
asObject {
name
}
asInterface {
name
}
asInput {
name
}
asList {
elementTypeDef {
kind
asObject {
name
}
asInterface {
name
}
asInput {
name
}
}
}
}
fragment FunctionParts on Function {
name
description
returnType {
...TypeDefRefParts
}
args {
name
description
defaultValue
typeDef {
...TypeDefRefParts
}
}
}
fragment FieldParts on FieldTypeDef {
name
description
typeDef {
...TypeDefRefParts
}
}
query TypeDefs($module: ModuleID!) {
typeDefs: currentTypeDefs {
kind
optional
asObject {
name
sourceModuleName
constructor {
...FunctionParts
}
functions {
...FunctionParts
}
fields {
...FieldParts
}
}
asInterface {
name
sourceModuleName
functions {
...FunctionParts
}
}
asInput {
name
fields {
...FieldParts
}
}
}
}
`
err := dag.Do(ctx, &dagger.Request{
Query: query,
Variables: map[string]interface{}{
"module": mod,
},
}, &dagger.Response{
Data: &res,
})
if err != nil {
return nil, fmt.Errorf("query module objects: %w", err)
}
name, err := mod.Name(ctx)
if err != nil {
return nil, fmt.Errorf("get module name: %w", err)
}
modDef := &moduleDef{Name: name}
for _, typeDef := range res.TypeDefs {
switch typeDef.Kind {
case dagger.ObjectKind:
modDef.Objects = append(modDef.Objects, typeDef)
case dagger.InterfaceKind:
modDef.Interfaces = append(modDef.Interfaces, typeDef)
case dagger.InputKind:
modDef.Inputs = append(modDef.Inputs, typeDef)
}
}
return modDef, nil
}
// moduleDef is a representation of dagger.Module.
type moduleDef struct {
Name string
Objects []*modTypeDef
Interfaces []*modTypeDef
Inputs []*modTypeDef
}
func (m *moduleDef) AsFunctionProviders() []functionProvider {
providers := make([]functionProvider, 0, len(m.Objects)+len(m.Interfaces))
for _, obj := range m.AsObjects() {
providers = append(providers, obj)
}
for _, iface := range m.AsInterfaces() {
providers = append(providers, iface)
}
return providers
}
// AsObjects returns the module's object type definitions.
func (m *moduleDef) AsObjects() []*modObject {
var defs []*modObject
for _, typeDef := range m.Objects {
if typeDef.AsObject != nil {
defs = append(defs, typeDef.AsObject)
}
}
return defs
}
func (m *moduleDef) AsInterfaces() []*modInterface {
var defs []*modInterface
for _, typeDef := range m.Interfaces {
if typeDef.AsInterface != nil {
defs = append(defs, typeDef.AsInterface)
}
}
return defs
}
func (m *moduleDef) AsInputs() []*modInput {
var defs []*modInput
for _, typeDef := range m.Inputs {
if typeDef.AsInput != nil {
defs = append(defs, typeDef.AsInput)
}
}
return defs
}
// GetObject retrieves a saved object type definition from the module.
func (m *moduleDef) GetObject(name string) *modObject {
for _, obj := range m.AsObjects() {
// Normalize name in case an SDK uses a different convention for object names.
if gqlObjectName(obj.Name) == gqlObjectName(name) {
return obj
}
}
return nil
}
// GetInterface retrieves a saved interface type definition from the module.
func (m *moduleDef) GetInterface(name string) *modInterface {
for _, iface := range m.AsInterfaces() {
// Normalize name in case an SDK uses a different convention for interface names.
if gqlObjectName(iface.Name) == gqlObjectName(name) {
return iface
}
}
return nil
}
// GetInterface retrieves a saved object or interface type definition from the module as a functionProvider.
func (m *moduleDef) GetFunctionProvider(name string) functionProvider {
if obj := m.GetObject(name); obj != nil {
return obj
}
if iface := m.GetInterface(name); iface != nil {
return iface
}
return nil
}
// GetInput retrieves a saved interface type definition from the module.
func (m *moduleDef) GetInput(name string) *modInput {
for _, input := range m.AsInputs() {
// Normalize name in case an SDK uses a different convention for input names.
if gqlObjectName(input.Name) == gqlObjectName(name) {
return input
}
}
return nil
}
func (m *moduleDef) GetMainObject() *modObject {
return m.GetObject(m.Name)
}
// LoadTypeDef attempts to replace a function's return object type or argument's
// object type with with one from the module's object type definitions, to
// recover missing function definitions in those places when chaining functions.
func (m *moduleDef) LoadTypeDef(typeDef *modTypeDef) {
if typeDef.AsObject != nil && typeDef.AsObject.Functions == nil && typeDef.AsObject.Fields == nil {
obj := m.GetObject(typeDef.AsObject.Name)
if obj != nil {
typeDef.AsObject = obj
}
}
if typeDef.AsInterface != nil && typeDef.AsInterface.Functions == nil {
iface := m.GetInterface(typeDef.AsInterface.Name)
if iface != nil {
typeDef.AsInterface = iface
}
}
if typeDef.AsInput != nil && typeDef.AsInput.Fields == nil {
input := m.GetInput(typeDef.AsInput.Name)
if input != nil {
typeDef.AsInput = input
}
}
if typeDef.AsList != nil {
m.LoadTypeDef(typeDef.AsList.ElementTypeDef)
}
}
// modTypeDef is a representation of dagger.TypeDef.
type modTypeDef struct {
Kind dagger.TypeDefKind
Optional bool
AsObject *modObject
AsInterface *modInterface
AsInput *modInput
AsList *modList
}
type functionProvider interface {
ProviderName() string
GetFunctions() []*modFunction
GetFunction(name string) (*modFunction, error)
}
func (t *modTypeDef) Name() string {
if t.AsObject != nil {
return t.AsObject.Name
}
if t.AsInterface != nil {
return t.AsInterface.Name
}
return ""
}
func (t *modTypeDef) AsFunctionProvider() functionProvider {
if t.AsObject != nil {
return t.AsObject
}
if t.AsInterface != nil {
return t.AsInterface
}
return nil
}
// modObject is a representation of dagger.ObjectTypeDef.
type modObject struct {
Name string
Functions []*modFunction
Fields []*modField
Constructor *modFunction
SourceModuleName string
}
var _ functionProvider = (*modObject)(nil)
func (o *modObject) ProviderName() string {
return o.Name
}
// GetFunctions returns the object's function definitions as well as the fields,
// which are treated as functions with no arguments.
func (o *modObject) GetFunctions() []*modFunction {
fns := make([]*modFunction, 0, len(o.Functions)+len(o.Fields))
for _, f := range o.Fields {
fns = append(fns, &modFunction{
Name: f.Name,
Description: f.Description,
ReturnType: f.TypeDef,
})
}
fns = append(fns, o.Functions...)
return fns
}
func (o *modObject) GetFunction(name string) (*modFunction, error) {
for _, fn := range o.Functions {
if fn.Name == name || cliName(fn.Name) == name {
return fn, nil
}
}
for _, f := range o.Fields {
if f.Name == name || cliName(f.Name) == name {
return &modFunction{
Name: f.Name,
Description: f.Description,
ReturnType: f.TypeDef,
}, nil
}
}
return nil, fmt.Errorf("no function '%s' in object type '%s'", name, o.Name)
}
type modInterface struct {
Name string
Functions []*modFunction
}
var _ functionProvider = (*modInterface)(nil)
func (o *modInterface) ProviderName() string {
return o.Name
}
func (o *modInterface) GetFunctions() []*modFunction {
fns := make([]*modFunction, 0, len(o.Functions))
fns = append(fns, o.Functions...)
return fns
}
func (o *modInterface) GetFunction(name string) (*modFunction, error) {
for _, fn := range o.Functions {
if fn.Name == name || cliName(fn.Name) == name {
return fn, nil
}
}
return nil, fmt.Errorf("no function '%s' in interface type '%s'", name, o.Name)
}
type modInput struct {
Name string
Fields []*modField
}
// modList is a representation of dagger.ListTypeDef.
type modList struct {
ElementTypeDef *modTypeDef
}
// modField is a representation of dagger.FieldTypeDef.
type modField struct {
Name string
Description string
TypeDef *modTypeDef
}
// modFunction is a representation of dagger.Function.
type modFunction struct {
Name string
Description string
ReturnType *modTypeDef
Args []*modFunctionArg
}
// modFunctionArg is a representation of dagger.FunctionArg.
type modFunctionArg struct {
Name string
Description string
TypeDef *modTypeDef
DefaultValue dagger.JSON
flagName string
}
// FlagName returns the name of the argument using CLI naming conventions.
func (r *modFunctionArg) FlagName() string {
if r.flagName == "" {
r.flagName = cliName(r.Name)
}
return r.flagName
}
func getDefaultValue[T any](r *modFunctionArg) (T, error) {
var val T
err := json.Unmarshal([]byte(r.DefaultValue), &val)
return val, err
}
// gqlObjectName converts casing to a GraphQL object name
func gqlObjectName(name string) string {
return strcase.ToCamel(name)
}
// gqlFieldName converts casing to a GraphQL object field name
func gqlFieldName(name string) string {
return strcase.ToLowerCamel(name)
}
// gqlArgName converts casing to a GraphQL field argument name
func gqlArgName(name string) string {
return strcase.ToLowerCamel(name)
}
// cliName converts casing to the CLI convention (kebab)
func cliName(name string) string {
return strcase.ToKebab(name)
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,358 | CLI: improve display of core API in `--help` output | https://github.com/dagger/dagger/pull/6293 exposed the core API in `dagger call`, which results in `--help` and `dagger functions` output to be pretty overwhelming and messy when dealing with core types like `Container`.
There's most likely going to be a lot of little things needed to address this, possibly including but not limited to:
1. displaying multi-line doc strings better
2. sorting of functions more cleanly
I think we should start out trying to do this purely from the CLI without engine-side changes. But if that ends up not being feasible then we can consider whether typedefs could get optional support for annotating CLI specific presentation metadata. Preferable to avoid going down that road if possible though. | https://github.com/dagger/dagger/issues/6358 | https://github.com/dagger/dagger/pull/6549 | 7a63c3d019530d1f08b2f72cc28e753d99b5896d | 7c0ee45d762719005fad5981d41b038811ebb7f6 | "2024-01-03T20:03:17Z" | go | "2024-02-01T14:32:43Z" | cmd/dagger/query.go | package main
import (
"context"
"encoding/json"
"fmt"
"io"
"os"
"strings"
"dagger.io/dagger"
"github.com/dagger/dagger/engine/client"
"github.com/spf13/cobra"
"github.com/vito/progrock"
"golang.org/x/term"
)
var (
queryFile string
queryVarsInput []string
queryVarsJSONInput string
)
var queryCmd = &cobra.Command{
Use: "query [flags] [OPERATION]",
Aliases: []string{"q"},
Short: "Send API queries to a dagger engine",
Long: `Send API queries to a dagger engine.
When no document file is provided, reads query from standard input.
Can optionally provide the GraphQL operation name if there are multiple
queries in the document.
`,
Example: `dagger query <<EOF
{
container {
from(address:"hello-world") {
withExec(args:["/hello"]) {
stdout
}
}
}
}
EOF
`,
Args: cobra.MaximumNArgs(1), // operation can be specified
RunE: func(cmd *cobra.Command, args []string) error {
return optionalModCmdWrapper(Query, "")(cmd, args)
},
}
func Query(ctx context.Context, engineClient *client.Client, _ *dagger.Module, _ *cobra.Command, args []string) (rerr error) {
rec := progrock.FromContext(ctx)
vtx := rec.Vertex("query", "query", progrock.Focused())
defer func() { vtx.Done(rerr) }()
res, err := runQuery(ctx, engineClient, args)
if err != nil {
return err
}
result, err := json.MarshalIndent(res, "", " ")
if err != nil {
return err
}
var out io.Writer
if !term.IsTerminal(int(os.Stdout.Fd())) {
out = os.Stdout
} else {
out = vtx.Stdout()
}
fmt.Fprintf(out, "%s\n", result)
return nil
}
func runQuery(
ctx context.Context,
engineClient *client.Client,
args []string,
) (map[string]any, error) {
var operation string
if len(args) > 0 {
operation = args[0]
}
vars := make(map[string]interface{})
if len(queryVarsJSONInput) > 0 {
if err := json.Unmarshal([]byte(queryVarsJSONInput), &vars); err != nil {
return nil, err
}
} else {
vars = getKVInput(queryVarsInput)
}
// Use the provided query file if specified
// Otherwise, if stdin is a pipe or other non-tty thing, read from it.
var operations string
if queryFile != "" {
inBytes, err := os.ReadFile(queryFile)
if err != nil {
return nil, err
}
operations = string(inBytes)
} else if !term.IsTerminal(int(os.Stdin.Fd())) {
inBytes, err := io.ReadAll(os.Stdin)
if err != nil {
return nil, err
}
operations = string(inBytes)
}
res := make(map[string]interface{})
err := engineClient.Do(ctx, operations, operation, vars, &res)
return res, err
}
func getKVInput(kvs []string) map[string]interface{} {
m := make(map[string]interface{})
for _, kv := range kvs {
split := strings.SplitN(kv, "=", 2)
m[split[0]] = split[1]
}
return m
}
func init() {
// changing usage template so examples are displayed below flags
queryCmd.SetUsageTemplate(`Usage:{{if .Runnable}}
{{.UseLine}}{{end}}{{if .HasAvailableSubCommands}}
{{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}}
Aliases:
{{.NameAndAliases}}{{end}}{{if .HasAvailableSubCommands}}{{$cmds := .Commands}}{{if eq (len .Groups) 0}}
Available Commands:{{range $cmds}}{{if (or .IsAvailableCommand (eq .Name "help"))}}
{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{else}}{{range $group := .Groups}}
{{.Title}}{{range $cmds}}{{if (and (eq .GroupID $group.ID) (or .IsAvailableCommand (eq .Name "help")))}}
{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if not .AllChildCommandsHaveGroup}}
Additional Commands:{{range $cmds}}{{if (and (eq .GroupID "") (or .IsAvailableCommand (eq .Name "help")))}}
{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}
Flags:
{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}}{{if .HasExample}}
Examples:
{{.Example}}{{end}}
Global Flags:
{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}}
Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}}
{{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}}
Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}}
`)
queryCmd.Flags().StringVar(&queryFile, "doc", "", "Read query from file (defaults to reading from stdin)")
queryCmd.Flags().StringSliceVar(&queryVarsInput, "var", nil, "List of query variables, in key=value format")
queryCmd.Flags().StringVar(&queryVarsJSONInput, "var-json", "", "Query variables in JSON format (overrides --var)")
queryCmd.MarkFlagFilename("doc", "graphql", "gql")
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,358 | CLI: improve display of core API in `--help` output | https://github.com/dagger/dagger/pull/6293 exposed the core API in `dagger call`, which results in `--help` and `dagger functions` output to be pretty overwhelming and messy when dealing with core types like `Container`.
There's most likely going to be a lot of little things needed to address this, possibly including but not limited to:
1. displaying multi-line doc strings better
2. sorting of functions more cleanly
I think we should start out trying to do this purely from the CLI without engine-side changes. But if that ends up not being feasible then we can consider whether typedefs could get optional support for annotating CLI specific presentation metadata. Preferable to avoid going down that road if possible though. | https://github.com/dagger/dagger/issues/6358 | https://github.com/dagger/dagger/pull/6549 | 7a63c3d019530d1f08b2f72cc28e753d99b5896d | 7c0ee45d762719005fad5981d41b038811ebb7f6 | "2024-01-03T20:03:17Z" | go | "2024-02-01T14:32:43Z" | cmd/dagger/run.go | package main
import (
"context"
"errors"
"fmt"
"net"
"net/http"
"os"
"os/exec"
"strings"
"time"
"github.com/dagger/dagger/engine/client"
"github.com/dagger/dagger/internal/tui"
"github.com/google/uuid"
"github.com/spf13/cobra"
"github.com/vito/progrock"
)
var runCmd = &cobra.Command{
Use: "run [flags] COMMAND",
Aliases: []string{"r"},
Short: "Run a command in a Dagger session",
Long: strings.ReplaceAll(
`Executes the specified command in a Dagger Session and displays
live progress in a TUI.
´DAGGER_SESSION_PORT´ and ´DAGGER_SESSION_TOKEN´ will be convieniently
injected automatically.
For example:
´´´shell
jq -n '{query:"{container{id}}"}' | \
dagger run sh -c 'curl -s \
-u $DAGGER_SESSION_TOKEN: \
-H "content-type:application/json" \
-d @- \
http://127.0.0.1:$DAGGER_SESSION_PORT/query
´´´`,
"´",
"`",
),
Example: strings.TrimSpace(`
dagger run go run main.go
dagger run node index.mjs
dagger run python main.py
`,
),
Run: Run,
Args: cobra.MinimumNArgs(1),
SilenceUsage: true,
}
var waitDelay time.Duration
var runFocus bool
func init() {
// don't require -- to disambiguate subcommand flags
runCmd.Flags().SetInterspersed(false)
runCmd.Flags().DurationVar(
&waitDelay,
"cleanup-timeout",
10*time.Second,
"max duration to wait between SIGTERM and SIGKILL on interrupt",
)
runCmd.Flags().BoolVar(&runFocus, "focus", false, "Only show output for focused commands.")
}
func Run(cmd *cobra.Command, args []string) {
ctx := context.Background()
err := run(ctx, args)
if err != nil {
if errors.Is(err, context.Canceled) {
fmt.Fprintln(os.Stderr, "run canceled")
os.Exit(2)
return
}
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
return
}
}
func run(ctx context.Context, args []string) error {
u, err := uuid.NewRandom()
if err != nil {
return fmt.Errorf("generate uuid: %w", err)
}
sessionToken := u.String()
focus = runFocus
return withEngineAndTUI(ctx, client.Params{
SecretToken: sessionToken,
}, func(ctx context.Context, engineClient *client.Client) error {
sessionL, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil {
return fmt.Errorf("session listen: %w", err)
}
defer sessionL.Close()
sessionPort := fmt.Sprintf("%d", sessionL.Addr().(*net.TCPAddr).Port)
os.Setenv("DAGGER_SESSION_PORT", sessionPort)
os.Setenv("DAGGER_SESSION_TOKEN", sessionToken)
subCmd := exec.CommandContext(ctx, args[0], args[1:]...) // #nosec
// allow piping to the command
subCmd.Stdin = os.Stdin
// NB: go run lets its child process roam free when you interrupt it, so
// make sure they all get signalled. (you don't normally notice this in a
// shell because Ctrl+C sends to the process group.)
ensureChildProcessesAreKilled(subCmd)
go http.Serve(sessionL, engineClient) //nolint:gosec
var cmdErr error
if !silent {
rec := progrock.FromContext(ctx)
cmdline := strings.Join(subCmd.Args, " ")
cmdVtx := rec.Vertex(tui.RootVertex, cmdline)
if stdoutIsTTY {
subCmd.Stdout = cmdVtx.Stdout()
} else {
subCmd.Stdout = os.Stdout
}
if stderrIsTTY {
subCmd.Stderr = cmdVtx.Stderr()
} else {
subCmd.Stderr = os.Stderr
}
cmdErr = subCmd.Run()
cmdVtx.Done(cmdErr)
} else {
subCmd.Stdout = os.Stdout
subCmd.Stderr = os.Stderr
cmdErr = subCmd.Run()
}
return cmdErr
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 451 | SIGSEGV when two cue files have different package names in the same environment | Here is my environment:
```
dmp@macArena:~/Projects/Go/src/github.com/blocklayerhq/dagger$ cat ~/.dagger/store/docker-elastic/deployment.json
{
"id": "4d81378c-db20-45fb-a15d-df768d5d336e",
"name": "docker-elastic",
"plan": {
"type": "dir",
"dir": {
"path": "/Users/dmp/Projects/Distribution/docker-images/infrastructure/docker-elastic",
"include": [
"*.cue",
"cue.mod"
]
}
},
"inputs": [
{
"key": "Root",
"value": {
"type": "dir",
"dir": {
"path": "/Users/dmp/Projects/Distribution/docker-images/infrastructure/docker-elastic"
}
}
}
]
}
```
Going "up", segfaults in client.go line 124 (which apparently loads the environment).
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x12673c6]
goroutine 55 [running]:
cuelang.org/go/internal/core/adt.(*Vertex).getNodeContext(0x0, 0xc0008d1a00, 0xc000b30000)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/cuelang.org/go@v0.4.0-beta.1/internal/core/adt/eval.go:911 +0x26
cuelang.org/go/internal/core/adt.(*OpContext).Unify(0xc0008d1a00, 0x0, 0xc0008d1a05)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/cuelang.org/go@v0.4.0-beta.1/internal/core/adt/eval.go:172 +0x50
cuelang.org/go/internal/core/adt.(*Vertex).Finalize(...)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/cuelang.org/go@v0.4.0-beta.1/internal/core/adt/composite.go:445
cuelang.org/go/cue.newVertexRoot(0xc00011cd70, 0xc0008d1a00, 0x0, 0xc0008d1a00, 0x12bf84b, 0xc000680480)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/cuelang.org/go@v0.4.0-beta.1/cue/types.go:615 +0x6f
cuelang.org/go/cue.newValueRoot(0xc00011cd70, 0xc0008d1a00, 0x23ed858, 0x0, 0x0, 0x0, 0xc0005c94a8)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/cuelang.org/go@v0.4.0-beta.1/cue/types.go:624 +0x70
cuelang.org/go/cue.(*Context).make(0xc00011cd70, 0x0, 0x23eced8, 0xc000ad9c80, 0x23eced8)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/cuelang.org/go@v0.4.0-beta.1/cue/context.go:249 +0x51
cuelang.org/go/cue.(*Context).BuildInstances(0xc00011cd70, 0xc00011fcf8, 0x1, 0x1, 0xc00011fcf8, 0x1, 0x1, 0xc00051cbd0, 0xc0005679f0)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/cuelang.org/go@v0.4.0-beta.1/cue/context.go:150 +0xf8
dagger.io/go/dagger/compiler.Build(0xc0005c9828, 0x0, 0x0, 0x0, 0xc0005c9938, 0xc00003cb20, 0x0)
/Users/dmp/Projects/Go/src/github.com/blocklayerhq/dagger/dagger/compiler/build.go:60 +0x25f
dagger.io/go/dagger.(*Environment).LoadPlan(0xc00003c2e0, 0x23e9818, 0xc00023a800, 0xc000052480, 0xc000286028, 0x23edd58, 0xc00002e680, 0xc00003cb20, 0x0, 0x0, ...)
/Users/dmp/Projects/Go/src/github.com/blocklayerhq/dagger/dagger/environment.go:108 +0x3c5
dagger.io/go/dagger.(*Client).buildfn.func1(0x23e9818, 0xc00023a800, 0x23edd58, 0xc00002e680, 0x0, 0x0, 0x0)
/Users/dmp/Projects/Go/src/github.com/blocklayerhq/dagger/dagger/client.go:124 +0x1c5
github.com/moby/buildkit/frontend/gateway/grpcclient.(*grpcClient).Run(0xc00002e680, 0x23e9818, 0xc00023a800, 0xc00023aec0, 0x0, 0x0)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/github.com/moby/buildkit@v0.8.3/frontend/gateway/grpcclient/client.go:187 +0x142
github.com/moby/buildkit/client.(*Client).Build.func2(0xc00029a161, 0x19, 0xc000468380, 0x0, 0x0)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/github.com/moby/buildkit@v0.8.3/client/build.go:56 +0x2a2
github.com/moby/buildkit/client.(*Client).solve.func3(0x0, 0x0)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/github.com/moby/buildkit@v0.8.3/client/solve.go:224 +0x6e
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc00045a9c0, 0xc00055b100)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/golang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9/errgroup/errgroup.go:57 +0x59
created by golang.org/x/sync/errgroup.(*Group).Go
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/golang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9/errgroup/errgroup.go:54 +0x66
```
Maybe this should be fixed for #448 ? | https://github.com/dagger/dagger/issues/451 | https://github.com/dagger/dagger/pull/6572 | 6a3634f6e9b66c124511e07ffc669e3fe5e709ed | 57be8a6f2e65ea108abdc65e58c328365386491a | "2021-05-12T18:28:35Z" | go | "2024-02-01T20:31:11Z" | go.mod | module github.com/dagger/dagger
go 1.21
replace dagger.io/dagger => ./sdk/go
require (
dagger.io/dagger v0.9.7
github.com/99designs/gqlgen v0.17.41
github.com/Khan/genqlient v0.6.0
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2
github.com/adrg/xdg v0.4.0
github.com/blang/semver v3.5.1+incompatible
github.com/cenkalti/backoff/v4 v4.2.1
github.com/charmbracelet/bubbles v0.17.1
github.com/charmbracelet/bubbletea v0.25.0
github.com/charmbracelet/lipgloss v0.9.1
github.com/containerd/containerd v1.7.12
github.com/containerd/continuity v0.4.3
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6
github.com/containerd/stargz-snapshotter v0.15.1
github.com/containernetworking/cni v1.1.2
github.com/coreos/go-systemd/v22 v22.5.0
github.com/creack/pty v1.1.18
github.com/dave/jennifer v1.7.0
github.com/docker/cli v25.0.1+incompatible
github.com/docker/distribution v2.8.2+incompatible
github.com/docker/docker v25.0.1+incompatible
github.com/dschmidt/go-layerfs v0.1.0
github.com/go-git/go-git/v5 v5.11.0
github.com/gofrs/flock v0.8.1
github.com/gogo/protobuf v1.3.2
github.com/google/go-containerregistry v0.15.2
github.com/google/go-github/v50 v50.2.0
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/google/uuid v1.5.0
github.com/gorilla/websocket v1.5.0
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/iancoleman/strcase v0.3.0
github.com/jackpal/gateway v1.0.7
github.com/juju/ansiterm v1.0.0
github.com/klauspost/compress v1.17.4
github.com/mackerelio/go-osstat v0.2.4
github.com/mattn/go-isatty v0.0.20
github.com/mitchellh/go-spdx v0.1.0
github.com/moby/buildkit v0.13.0-beta3 // https://github.com/moby/buildkit/commit/1981eb123dc979fc71d097adeb5bbb84110aa9f4
github.com/moby/locker v1.0.1
github.com/moby/patternmatcher v0.6.0
github.com/moby/sys/mount v0.3.3
github.com/muesli/termenv v0.15.2
github.com/nxadm/tail v1.4.8
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.0-rc5
github.com/opencontainers/runc v1.1.12
github.com/opencontainers/runtime-spec v1.1.0
github.com/pelletier/go-toml v1.9.5
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/pkg/errors v0.9.1
github.com/prometheus/procfs v0.12.0
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e
github.com/rs/cors v1.10.0
github.com/rs/zerolog v1.31.0
github.com/samber/slog-logrus/v2 v2.2.0
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29
github.com/sirupsen/logrus v1.9.3
github.com/sourcegraph/conc v0.3.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
github.com/tidwall/gjson v1.17.0
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea
github.com/urfave/cli v1.22.14
github.com/vektah/gqlparser/v2 v2.5.10
github.com/vito/midterm v0.1.4
github.com/vito/progrock v0.10.2-0.20240119030128-52ef9ee1a291
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63
github.com/zeebo/xxh3 v1.0.2
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/exporters/jaeger v1.17.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
go.opentelemetry.io/otel/sdk v1.21.0
go.opentelemetry.io/otel/trace v1.21.0
go.opentelemetry.io/proto/otlp v1.0.0
golang.org/x/crypto v0.18.0
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/mod v0.14.0
golang.org/x/net v0.20.0
golang.org/x/oauth2 v0.16.0
golang.org/x/sync v0.6.0
golang.org/x/sys v0.16.0
golang.org/x/term v0.16.0
golang.org/x/text v0.14.0
golang.org/x/tools v0.17.0
google.golang.org/grpc v1.60.1
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools/v3 v3.5.1
oss.terrastruct.com/d2 v0.6.1
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2
)
require (
cdr.dev/slog v1.4.2 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.11.4 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/PuerkitoBio/goquery v1.8.1 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/alecthomas/chroma v0.10.0 // indirect
github.com/alecthomas/chroma/v2 v2.11.1 // indirect
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 // indirect
github.com/aws/aws-sdk-go-v2 v1.24.1 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 // indirect
github.com/aws/aws-sdk-go-v2/config v1.26.6 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.16.16 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 // indirect
github.com/aws/smithy-go v1.19.0 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/charmbracelet/harmonica v0.2.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/containerd/fifo v1.1.0 // indirect
github.com/containerd/go-cni v1.1.9 // indirect
github.com/containerd/go-runc v1.1.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/nydus-snapshotter v0.13.1 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/containerd/ttrpc v1.2.2 // indirect
github.com/containerd/typeurl/v2 v2.1.1 // indirect
github.com/containernetworking/plugins v1.4.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/docker/docker-credential-helpers v0.8.0 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect
github.com/hanwen/go-fuse/v2 v2.4.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.3 // indirect
github.com/in-toto/in-toto-golang v0.5.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jonboulle/clockwork v0.4.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/lunixbochs/vtclean v1.0.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mazznoer/csscolorparser v0.1.3 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/sys/mountinfo v0.7.1 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/signal v0.7.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/opencontainers/selinux v1.11.0 // indirect
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/profile v1.5.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/samber/lo v1.38.1 // indirect
github.com/samber/slog-common v0.14.0 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.4.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/shibumi/go-pathspec v1.3.0 // indirect
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/sosodev/duration v1.1.0 // indirect
github.com/spdx/tools-golang v0.5.1 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 // indirect
github.com/tonistiigi/go-archvariant v1.0.0 // indirect
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/vishvananda/netlink v1.2.1-beta.2 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/weaveworks/promrus v1.2.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/yuin/goldmark v1.6.0 // indirect
github.com/zmb3/spotify/v2 v2.3.1 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.42.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.19.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/image v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gonum.org/v1/plot v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
|
closed | dagger/dagger | https://github.com/dagger/dagger | 451 | SIGSEGV when two cue files have different package names in the same environment | Here is my environment:
```
dmp@macArena:~/Projects/Go/src/github.com/blocklayerhq/dagger$ cat ~/.dagger/store/docker-elastic/deployment.json
{
"id": "4d81378c-db20-45fb-a15d-df768d5d336e",
"name": "docker-elastic",
"plan": {
"type": "dir",
"dir": {
"path": "/Users/dmp/Projects/Distribution/docker-images/infrastructure/docker-elastic",
"include": [
"*.cue",
"cue.mod"
]
}
},
"inputs": [
{
"key": "Root",
"value": {
"type": "dir",
"dir": {
"path": "/Users/dmp/Projects/Distribution/docker-images/infrastructure/docker-elastic"
}
}
}
]
}
```
Going "up", segfaults in client.go line 124 (which apparently loads the environment).
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x12673c6]
goroutine 55 [running]:
cuelang.org/go/internal/core/adt.(*Vertex).getNodeContext(0x0, 0xc0008d1a00, 0xc000b30000)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/cuelang.org/go@v0.4.0-beta.1/internal/core/adt/eval.go:911 +0x26
cuelang.org/go/internal/core/adt.(*OpContext).Unify(0xc0008d1a00, 0x0, 0xc0008d1a05)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/cuelang.org/go@v0.4.0-beta.1/internal/core/adt/eval.go:172 +0x50
cuelang.org/go/internal/core/adt.(*Vertex).Finalize(...)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/cuelang.org/go@v0.4.0-beta.1/internal/core/adt/composite.go:445
cuelang.org/go/cue.newVertexRoot(0xc00011cd70, 0xc0008d1a00, 0x0, 0xc0008d1a00, 0x12bf84b, 0xc000680480)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/cuelang.org/go@v0.4.0-beta.1/cue/types.go:615 +0x6f
cuelang.org/go/cue.newValueRoot(0xc00011cd70, 0xc0008d1a00, 0x23ed858, 0x0, 0x0, 0x0, 0xc0005c94a8)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/cuelang.org/go@v0.4.0-beta.1/cue/types.go:624 +0x70
cuelang.org/go/cue.(*Context).make(0xc00011cd70, 0x0, 0x23eced8, 0xc000ad9c80, 0x23eced8)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/cuelang.org/go@v0.4.0-beta.1/cue/context.go:249 +0x51
cuelang.org/go/cue.(*Context).BuildInstances(0xc00011cd70, 0xc00011fcf8, 0x1, 0x1, 0xc00011fcf8, 0x1, 0x1, 0xc00051cbd0, 0xc0005679f0)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/cuelang.org/go@v0.4.0-beta.1/cue/context.go:150 +0xf8
dagger.io/go/dagger/compiler.Build(0xc0005c9828, 0x0, 0x0, 0x0, 0xc0005c9938, 0xc00003cb20, 0x0)
/Users/dmp/Projects/Go/src/github.com/blocklayerhq/dagger/dagger/compiler/build.go:60 +0x25f
dagger.io/go/dagger.(*Environment).LoadPlan(0xc00003c2e0, 0x23e9818, 0xc00023a800, 0xc000052480, 0xc000286028, 0x23edd58, 0xc00002e680, 0xc00003cb20, 0x0, 0x0, ...)
/Users/dmp/Projects/Go/src/github.com/blocklayerhq/dagger/dagger/environment.go:108 +0x3c5
dagger.io/go/dagger.(*Client).buildfn.func1(0x23e9818, 0xc00023a800, 0x23edd58, 0xc00002e680, 0x0, 0x0, 0x0)
/Users/dmp/Projects/Go/src/github.com/blocklayerhq/dagger/dagger/client.go:124 +0x1c5
github.com/moby/buildkit/frontend/gateway/grpcclient.(*grpcClient).Run(0xc00002e680, 0x23e9818, 0xc00023a800, 0xc00023aec0, 0x0, 0x0)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/github.com/moby/buildkit@v0.8.3/frontend/gateway/grpcclient/client.go:187 +0x142
github.com/moby/buildkit/client.(*Client).Build.func2(0xc00029a161, 0x19, 0xc000468380, 0x0, 0x0)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/github.com/moby/buildkit@v0.8.3/client/build.go:56 +0x2a2
github.com/moby/buildkit/client.(*Client).solve.func3(0x0, 0x0)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/github.com/moby/buildkit@v0.8.3/client/solve.go:224 +0x6e
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc00045a9c0, 0xc00055b100)
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/golang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9/errgroup/errgroup.go:57 +0x59
created by golang.org/x/sync/errgroup.(*Group).Go
/Users/dmp/Applications/bin/gvm/pkgsets/go1.16/global/pkg/mod/golang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9/errgroup/errgroup.go:54 +0x66
```
Maybe this should be fixed for #448 ? | https://github.com/dagger/dagger/issues/451 | https://github.com/dagger/dagger/pull/6572 | 6a3634f6e9b66c124511e07ffc669e3fe5e709ed | 57be8a6f2e65ea108abdc65e58c328365386491a | "2021-05-12T18:28:35Z" | go | "2024-02-01T20:31:11Z" | go.sum | bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
bazil.org/fuse v0.0.0-20180421153158-65cc252bf669/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
cdr.dev/slog v1.4.2 h1:fIfiqASYQFJBZiASwL825atyzeA96NsqSxx2aL61P8I=
cdr.dev/slog v1.4.2/go.mod h1:0EkH+GkFNxizNR+GAXUEdUHanxUH5t9zqPILmPM/Vn8=
cloud.google.com/go v0.25.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.37.2/go.mod h1:H8IAquKe2L30IxoupDgqTaQvKSwF/c8prYHynGIWQbA=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw=
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY=
cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM=
cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY=
cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ=
cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI=
cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4=
cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA=
cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A=
cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc=
cloud.google.com/go v0.110.9 h1:e7ITSqGFFk4rbz/JFIqZh3G4VEHguhAL4BQcFlWtU68=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow=
cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM=
cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M=
cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s=
cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU=
cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U=
cloud.google.com/go/compute v1.23.2 h1:nWEMDhgbBkBJjfpVySqU4jgWdc22PLR0o4vEexZHers=
cloud.google.com/go/compute v1.23.2/go.mod h1:JJ0atRC0J/oWYiiVBmsSsrRnh92DhZPG4hFDcR04Rns=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY=
cloud.google.com/go/logging v1.8.1 h1:26skQWPeYhvIasWKm48+Eq7oUqdcdbwsCVwz5Ys0FvU=
cloud.google.com/go/logging v1.8.1/go.mod h1:TJjR+SimHwuC8MZ9cjByQulAMgni+RkXeI3wwctHJEI=
cloud.google.com/go/longrunning v0.5.3 h1:maKa7O9YTzmVzwdlRKr981U1Ys2auup6rpeMt8y3+RU=
cloud.google.com/go/longrunning v0.5.3/go.mod h1:y/0ga59EYu58J6SHmmQOvekvND2qODbu8ywBBW7EK7Y=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
code.gitea.io/sdk/gitea v0.12.0/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY=
contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA=
contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0=
contrib.go.opencensus.io/exporter/stackdriver v0.12.1/go.mod h1:iwB6wGarfphGGe/e5CWqyUk/cLzKnWsOKPVW3no6OTw=
contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE=
contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA=
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
git.sr.ht/~sbinet/gg v0.5.0 h1:6V43j30HM623V329xA9Ntq+WJrMjDxRjuAB1LFWF5m8=
git.sr.ht/~sbinet/gg v0.5.0/go.mod h1:G2C0eRESqlKhS7ErsNey6HHrqU1PwsnCQlekFi9Q2Oo=
github.com/99designs/gqlgen v0.17.41 h1:C1/zYMhGVP5TWNCNpmZ9Mb6CqT1Vr5SHEWoTOEJ3v3I=
github.com/99designs/gqlgen v0.17.41/go.mod h1:GQ6SyMhwFbgHR0a8r2Wn8fYgEwPxxmndLFPhU63+cJE=
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/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/AkihiroSuda/containerd-fuse-overlayfs v1.0.0/go.mod h1:0mMDvQFeLbbn1Wy8P2j3hwFhqBq+FKn8OZPno8WLmp8=
github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU=
github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4=
github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc=
github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v19.1.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v29.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v38.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 h1:Ut0ZGdOwJDw0npYEg+TLlPls3Pq6JiZaP2/aGKir7Zw=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1 h1:QSdcrd/UFJv6Bp/CfoVf2SrENpFn9P6Yh8yb+xNhYMM=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1/go.mod h1:eZ4g6GUvXiGulfIbbhh1Xr4XwUYaYaWMqzGD/284wCA=
github.com/Azure/azure-service-bus-go v0.9.1/go.mod h1:yzBx6/BUGfjfeqbRZny9AQIbIe3AcV9WZbAdpkoXOa0=
github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v10.15.5+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v12.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v14.1.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0=
github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630=
github.com/Azure/go-autorest/autorest v0.10.2/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630=
github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc=
github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM=
github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw=
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g=
github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM=
github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc=
github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA=
github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8=
github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI=
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0 h1:XMEdVDFxgulDDl0lQmAZS6j8gRQ/0pJ+ZpXH2FHVtDc=
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/Djarvur/go-err113 v0.1.0/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20191009163259-e802c2cb94ae/go.mod h1:mjwGPas4yKduTyubHvD1Atl9r1rUq8DfVy+gkVvZ+oo=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14=
github.com/Khan/genqlient v0.6.0 h1:Bwb1170ekuNIVIwTJEqvO8y7RxBxXu639VJOkKSrwAk=
github.com/Khan/genqlient v0.6.0/go.mod h1:rvChwWVTqXhiapdhLDV4bp9tz/Xvtewwkon4DpWWCRM=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Masterminds/semver/v3 v3.1.0 h1:Y2lUDsFKVRSYGojLJ1yLxSXdMmMYTYls0rCvoqmMUQk=
github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.4.15-0.20200908182639-5b44b70ab3ab/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.4.15/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
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/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ=
github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8=
github.com/Microsoft/hcsshim v0.8.10/go.mod h1:g5uw8EV2mAlzqe94tfNBNdr89fnbD/n3HV0OhsddkmM=
github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8=
github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w=
github.com/Microsoft/hcsshim/test v0.0.0-20200826032352-301c83a30e7c/go.mod h1:30A5igQ91GEmhYJF8TaRP79pMBOYynRsyOByfVV0dU4=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM=
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg=
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E=
github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo=
github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8=
github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo=
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw=
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM=
github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink=
github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek=
github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s=
github.com/alecthomas/chroma/v2 v2.11.1 h1:m9uUtgcdAwgfFNxuqj7AIG75jD2YmL61BBIJWtdzJPs=
github.com/alecthomas/chroma/v2 v2.11.1/go.mod h1:4TQu7gdfuPjSh76j78ietmqh9LiurGF0EpseFXdKMBw=
github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE=
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 h1:aM1rlcoLz8y5B2r4tTLMiVTrMtpfY0O8EScKJxaSaEc=
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apex/log v1.1.4/go.mod h1:AlpoD9aScyQfJDVHmLMEcx4oU6LqzkWp4Mg9GdAcEvQ=
github.com/apex/log v1.3.0/go.mod h1:jd8Vpsr46WAe3EZSQ/IUMs2qQD/GOycT5rPWCO1yGcs=
github.com/apex/logs v0.0.4/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo=
github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE=
github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs=
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.15.90/go.mod h1:es1KtYUFs7le0xQ3rOihkuoVD90z7D0fR2Qm4S00/gU=
github.com/aws/aws-sdk-go v1.16.26/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.19.18/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.19.45/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.20.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.25.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go-v2 v1.24.1 h1:xAojnj+ktS95YZlDf0zxWBkbFtymPeDP+rvUQIH3uAU=
github.com/aws/aws-sdk-go-v2 v1.24.1/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 h1:OCs21ST2LrepDfD3lwlQiOqIGp6JiEUqG84GzTDoyJs=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4/go.mod h1:usURWEKSNNAcAZuzRn/9ZYPT8aZQkR7xcCtunK/LkJo=
github.com/aws/aws-sdk-go-v2/config v1.26.6 h1:Z/7w9bUqlRI0FFQpetVuFYEsjzE3h7fpU6HuGmfPL/o=
github.com/aws/aws-sdk-go-v2/config v1.26.6/go.mod h1:uKU6cnDmYCvJ+pxO9S4cWDb2yWWIH5hra+32hVh1MI4=
github.com/aws/aws-sdk-go-v2/credentials v1.16.16 h1:8q6Rliyv0aUFAVtzaldUEcS+T5gbadPbWdV1WcAddK8=
github.com/aws/aws-sdk-go-v2/credentials v1.16.16/go.mod h1:UHVZrdUsv63hPXFo1H7c5fEneoVo9UXiz36QG1GEPi0=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 h1:c5I5iH+DZcH3xOIMlz3/tCKJDaHFwYEmxvlh2fAcFo8=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11/go.mod h1:cRrYDYAMUohBJUtUnOhydaMHtiK/1NZ0Otc9lIb6O0Y=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.15 h1:2MUXyGW6dVaQz6aqycpbdLIH1NMcUI6kW6vQ0RabGYg=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.15/go.mod h1:aHbhbR6WEQgHAiRj41EQ2W47yOYwNtIkWTXmcAtYqj8=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 h1:vF+Zgd9s+H4vOXd5BMaPWykta2a6Ih0AKLq/X6NYKn4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10/go.mod h1:6BkRjejp/GR4411UGqkX8+wFMbFbqsUIimfK4XjOKR4=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 h1:nYPe006ktcqUji8S2mqXf9c/7NdiKriOwMvWQHgYztw=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10/go.mod h1:6UV4SZkVvmODfXKql4LCbaZUpF7HO2BX38FgBf9ZOLw=
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3 h1:n3GDfwqF2tzEkXlv5cuy4iy7LpKDtqDMcNLfZDu9rls=
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10 h1:5oE2WzJE56/mVveuDZPJESKlg/00AaS2pY2QZcnxg4M=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10/go.mod h1:FHbKWQtRBYUz4vO5WBWjzMD2by126ny5y/1EoaWoLfI=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3YVNlkzkBrm9LfpaKoaYZUxIAj4sHfOTmLfqw=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 h1:L0ai8WICYHozIKK+OtPzVJBugL7culcuM4E4JOpIEm8=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10/go.mod h1:byqfyxJBshFk0fF9YmK0M0ugIO8OWjzH2T3bPG4eGuA=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 h1:DBYTXwIGQSGs9w4jKm60F5dmCQ3EEruxdc0MFh+3EY4=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10/go.mod h1:wohMUQiFdzo0NtxbBg0mSRGZ4vL3n0dKjLTINdcIino=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10 h1:KOxnQeWy5sXyS37fdKEvAsGHOr9fa/qvwxfJurR/BzE=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10/go.mod h1:jMx5INQFYFYB3lQD9W0D8Ohgq6Wnl7NYOJ2TQndbulI=
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1 h1:5XNlsBsEvBZBMO6p82y+sqpWg8j5aBCe+5C2GBFgqBQ=
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1/go.mod h1:4qXHrG1Ne3VGIMZPCB8OjH/pLFO94sKABIusjh0KWPU=
github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 h1:eajuO3nykDPdYicLlP3AGgOyVN3MOlFmZv7WGTuJPow=
github.com/aws/aws-sdk-go-v2/service/sso v1.18.7/go.mod h1:+mJNDdF+qiUlNKNC3fxn74WWNN+sOiGOEImje+3ScPM=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 h1:QPMJf+Jw8E1l7zqhZmMlFw6w1NmfkfiSK8mS4zOx3BA=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7/go.mod h1:ykf3COxYI0UJmxcfcxcVuz7b6uADi1FkiUz6Eb7AgM8=
github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 h1:NzO4Vrau795RkUdSHKEwiR01FaGzGOH1EETJ+5QHnm0=
github.com/aws/aws-sdk-go-v2/service/sts v1.26.7/go.mod h1:6h2YuIoxaMSCFf5fi1EgZAwdfkGMgDY+DVfa61uLe4U=
github.com/aws/smithy-go v1.19.0 h1:KWFKQV80DpP3vJrrA9sVAHQ5gc2z8i4EzrLhLlWXcBM=
github.com/aws/smithy-go v1.19.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE=
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI=
github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/bombsimon/wsl/v2 v2.0.0/go.mod h1:mf25kr/SqFEPhhcxW1+7pxzGlW+hIl/hYTKY95VwV8U=
github.com/bombsimon/wsl/v2 v2.2.0/go.mod h1:Azh8c3XGEJl9LyX0/sFC+CKMc7Ssgua0g+6abzXN4Pg=
github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk=
github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50=
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw=
github.com/campoy/embedmd v1.0.0 h1:V4kI2qTJJLf4J29RzI/MAt2c3Bl4dQSYPuflzwFH2hY=
github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8=
github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e/go.mod h1:9IOqJGCPMSc6E5ydlp5NIonxObaeu/Iub/X03EKPVYo=
github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e/go.mod h1:oDpT4efm8tSYHXV5tHSdRvBet/b/QzxZ+XyyPehvm3A=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/charmbracelet/bubbles v0.17.1 h1:0SIyjOnkrsfDo88YvPgAWvZMwXe26TP6drRvmkjyUu4=
github.com/charmbracelet/bubbles v0.17.1/go.mod h1:9HxZWlkCqz2PRwsCbYl7a3KXvGzFaDHpYbSYMJ+nE3o=
github.com/charmbracelet/bubbletea v0.25.0 h1:bAfwk7jRz7FKFl9RzlIULPkStffg5k6pNt5dywy4TcM=
github.com/charmbracelet/bubbletea v0.25.0/go.mod h1:EN3QDR1T5ZdWmdfDzYcqOCAps45+QIJbLOBxmVNWNNg=
github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ=
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
github.com/charmbracelet/lipgloss v0.9.1 h1:PNyd3jvaJbg4jRHKWXnCj1akQm4rh8dbEzN1p/u1KWg=
github.com/charmbracelet/lipgloss v0.9.1/go.mod h1:1mPmG4cxScwUQALAAnacHaigiiHB9Pmr+v1VEawJl6I=
github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg=
github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k=
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM=
github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo=
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/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE=
github.com/containerd/console v1.0.0/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE=
github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk=
github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.4.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.4.1-0.20201117152358-0edc412565dc/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0=
github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk=
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo=
github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8=
github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0=
github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY=
github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o=
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6 h1:MWwG/UOQv6J2hvRgKGduhJn5yKZPl4ly+PWMhfPnMzU=
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6/go.mod h1:gfcR4++fMRl37UvYy4Kw6JrQIra1bFFQVVtWEp1oon4=
github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU=
github.com/containerd/go-cni v1.1.9 h1:ORi7P1dYzCwVM6XPN4n3CbkuOx/NZ2DOqy+SHRdo9rU=
github.com/containerd/go-cni v1.1.9/go.mod h1:XYrZJ1d5W6E2VOvjffL3IZq0Dz6bsVlERHbekNK90PM=
github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0=
github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g=
github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok=
github.com/containerd/go-runc v1.1.0 h1:OX4f+/i2y5sUT7LhmcJH7GYrjjhHa1QI4e8yO0gGleA=
github.com/containerd/go-runc v1.1.0/go.mod h1:xJv2hFF7GvHtTJd9JqTS2UVxMkULUYw4JN5XAUZqH5U=
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/nydus-snapshotter v0.13.1 h1:5XNkCZ9ivLXCcyx3Jbbfh/fntkcls69uBg0x9VE8zlk=
github.com/containerd/nydus-snapshotter v0.13.1/go.mod h1:XWAz9ytsjBuKPVXDKP3xoMlcSKNsGnjXlEup6DuzUIo=
github.com/containerd/stargz-snapshotter v0.0.0-20201027054423-3a04e4c2c116/go.mod h1:o59b3PCKVAf9jjiKtCc/9hLAd+5p/rfhBfm6aBcTEr4=
github.com/containerd/stargz-snapshotter v0.15.1 h1:fpsP4kf/Z4n2EYnU0WT8ZCE3eiKDwikDhL6VwxIlgeA=
github.com/containerd/stargz-snapshotter v0.15.1/go.mod h1:74D+J1m1RMXytLmWxegXWhtOSRHPWZKpKc2NdK3S+us=
github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU=
github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk=
github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o=
github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y=
github.com/containerd/ttrpc v1.2.2 h1:9vqZr0pxwOF5koz6N0N3kJ0zDHokrcPxIR/ZR2YFtOs=
github.com/containerd/ttrpc v1.2.2/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak=
github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg=
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/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY=
github.com/containernetworking/cni v1.1.2 h1:wtRGZVv7olUHMOqouPpn3cXJWpJgM6+EUl31EQbXALQ=
github.com/containernetworking/cni v1.1.2/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw=
github.com/containernetworking/plugins v1.4.0 h1:+w22VPYgk7nQHw7KT92lsRmuToHvb7wwSv9iTbXzzic=
github.com/containernetworking/plugins v1.4.0/go.mod h1:UYhcOyjefnrQvKvmmyEKsUA+M9Nfn7tqULPpH0Pkcj0=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/go-systemd/v22 v22.4.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4=
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
github.com/dave/jennifer v1.7.0 h1:uRbSBH9UTS64yXbh4FrMHfgfY762RD+C7bUPKODpSJE=
github.com/dave/jennifer v1.7.0/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc=
github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/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/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0=
github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY=
github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g=
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
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/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c=
github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko=
github.com/docker/cli v0.0.0-20190925022749-754388324470/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v20.10.0-beta1.0.20201029214301-1d20b15adc38+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v25.0.1+incompatible h1:mFpqnrS6Hsm3v1k7Wa/BO23oz0k121MTbTO1lpcGSkU=
github.com/docker/cli v25.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY=
github.com/docker/distribution v2.6.0-rc.1.0.20180327202408-83389a148052+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v0.0.0-20200511152416-a93e9eb0e95c/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v1.4.2-0.20180531152204-71cd53e4a197/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v17.12.0-ce-rc1.0.20200730172259-9f28837c1d93+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v20.10.0-beta1.0.20201110211921-af34b94a78a1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v25.0.1+incompatible h1:k5TYd5rIVQRSqcTwCID+cyVA0yRg86+Pcrz1ls0/frA=
github.com/docker/docker v25.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y=
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8=
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA=
github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI=
github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=
github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw=
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/libnetwork v0.8.0-dev.2.0.20200917202933-d0951081b35f/go.mod h1:93m0aTqz6z+g32wla4l4WxTrdtvBRmVzYRkYvasA5Z8=
github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk=
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d h1:wi6jN5LVt/ljaBG4ue79Ekzb12QfJ52L9Q98tl8SWhw=
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4=
github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y=
github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM=
github.com/dschmidt/go-layerfs v0.1.0 h1:jE6aHDfjNzS/31DS48th6EkmELwTa1Uf+aO4jRkBs3U=
github.com/dschmidt/go-layerfs v0.1.0/go.mod h1:m62aff0hn23Q/tQBRiNSeLD7EUuimDvsuCvCpzBr3Gw=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU=
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA=
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776 h1:VRIbnDWRmAh5yBdz+J6yFMF5vso1It6vn+WmM/5l7MA=
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776/go.mod h1:9wvnDu3YOfxzWM9Cst40msBF1C2UdQgDv962oTxSuMs=
github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4=
github.com/go-critic/go-critic v0.4.1/go.mod h1:7/14rZGnZbY6E38VEGk2kVhoq6itzc1E68facVDK23g=
github.com/go-critic/go-critic v0.4.3/go.mod h1:j4O3D4RoIwRqlZw5jJpx0BNfXWWbpcJoKu5cYSe4YmQ=
github.com/go-fonts/liberation v0.3.1 h1:9RPT2NhUpxQ7ukUvz3jeUckmN42T9D9TpjtQcqK/ceM=
github.com/go-fonts/liberation v0.3.1/go.mod h1:jdJ+cqF+F4SUL2V+qxBth8fvBpBDS7yloUL5Fi8GTGY=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=
github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4=
github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9 h1:NxXI5pTAtpEaU49bpLpQoDsu1zrteW/vxzTz8Cd2UAs=
github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9/go.mod h1:gWuR/CrFDDeVRFQwHPvsv9soJVB/iqymhuZQuJ3a9OM=
github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-pdf/fpdf v0.8.0 h1:IJKpdaagnWUeSkUFUjTcSzTppFxmv8ucGQyNPQWxYOQ=
github.com/go-pdf/fpdf v0.8.0/go.mod h1:gfqhcNwXrsd3XYKte9a7vM3smvU/jB4ZRDrmWSxpfdc=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4=
github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ=
github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg=
github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw=
github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU=
github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk=
github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI=
github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks=
github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc=
github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8=
github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/flock v0.7.3/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU=
github.com/gogo/googleapis v1.3.2/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=
github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc=
github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs=
github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/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.1/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.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
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.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4=
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk=
github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0=
github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8=
github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o=
github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU=
github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU=
github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU=
github.com/golangci/golangci-lint v1.23.7/go.mod h1:g/38bxfhp4rI7zeWSxcdIeHTQGS58TCak8FYcyCmavQ=
github.com/golangci/golangci-lint v1.27.0/go.mod h1:+eZALfxIuthdrHPtfM7w/R3POJLjHDfJJw8XZl9xOng=
github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU=
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg=
github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o=
github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA=
github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA=
github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI=
github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4=
github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4=
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ=
github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/crfs v0.0.0-20191108021818-71d77da419c9/go.mod h1:etGhoOqfwPkooV6aqoX3eBGQOJblqdoc9XvWOeuxpPw=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/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.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/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.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
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-containerregistry v0.0.0-20191010200024-a3d713f9b7f8/go.mod h1:KyKXa9ciM8+lgMXwOVsXi7UxGrsf9mM61Mzs+xKUrKE=
github.com/google/go-containerregistry v0.1.2/go.mod h1:GPivBPgdAyd2SU+vf6EpsgOtWDuPqjW0hJZt4rNdTZ4=
github.com/google/go-containerregistry v0.15.2 h1:MMkSh+tjSdnmJZO7ljvEqV1DjfekB6VUEAZgy3a+TQE=
github.com/google/go-containerregistry v0.15.2/go.mod h1:wWK+LnOv4jXMM23IT/F1wdYftGWGr47Is8CG+pmHK1Q=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM=
github.com/google/go-github/v50 v50.2.0 h1:j2FyongEHlO9nxXLc+LP3wuBSVU9mVxfpdYUexMpIfk=
github.com/google/go-github/v50 v50.2.0/go.mod h1:VBY8FB6yPIjrtKhozXv4FQupxKLS6H4m6xFZlT43q8Q=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/go-replayers/grpcreplay v0.1.0/go.mod h1:8Ig2Idjpr6gifRd6pNVggX6TC1Zw6Jx74AKp7QNH2QE=
github.com/google/go-replayers/httpreplay v0.1.0/go.mod h1:YKZViNhiGgqdBlUbI2MwGpq4pXxNmhJLPHQ7cv2b5no=
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg=
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a h1:fEBsGL/sjAuJrgah5XqmmYsTLzJp/TO9Lhy39gkverk=
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/rpmpack v0.0.0-20191226140753-aa36bfddb3a0/go.mod h1:RaTPr0KUf2K7fnZYLNDrr8rxAamWs3iNywJLtQ2AzBg=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1/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.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/wire v0.3.0/go.mod h1:i1DMg/Lu8Sz5yYl25iOdmc5CT5qusaa+zmRWs16741s=
github.com/google/wire v0.4.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU=
github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM=
github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM=
github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c=
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
github.com/gookit/color v1.2.4/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg=
github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/goreleaser/goreleaser v0.136.0/go.mod h1:wiKrPUeSNh6Wu8nUHxZydSOVQ/OZvOaO7DTtFqie904=
github.com/goreleaser/nfpm v1.2.1/go.mod h1:TtWrABZozuLOttX2uDlYyECfQX7x5XYkVxhjYcR6G9w=
github.com/goreleaser/nfpm v1.3.0/go.mod h1:w0p7Kc9TAUgWMyrub63ex3M2Mgw88M4GZXoTq5UCb40=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.2/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y=
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw=
github.com/hanwen/go-fuse v1.0.0/go.mod h1:unqXarDXqzAk0rt98O2tVndEPIpUgLD9+rwFisZH3Ok=
github.com/hanwen/go-fuse/v2 v2.0.3/go.mod h1:0EQM6aH2ctVpvZ6a+onrQ/vaykxh2GH7hy3e13vzTUY=
github.com/hanwen/go-fuse/v2 v2.4.0 h1:12OhD7CkXXQdvxG2osIdBQLdXh+nmLXY9unkUIe/xaU=
github.com/hanwen/go-fuse/v2 v2.4.0/go.mod h1:xKwi1cF7nXAOBCXujD5ie0ZKsxc8GGSA1rlMJc+8IJs=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM=
github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/go-retryablehttp v0.6.4/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA=
github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru/v2 v2.0.3 h1:kmRrRLlInXvng0SmLxmQpQkpbYAvcXm7NPDrgxJa9mE=
github.com/hashicorp/golang-lru/v2 v2.0.3/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hashicorp/uuid v0.0.0-20160311170451-ebb0a03e909c/go.mod h1:fHzc09UnyJyqyW+bFuq864eh+wC7dj65aXmXLRe5to0=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/in-toto/in-toto-golang v0.5.0 h1:hb8bgwr0M2hGdDsLjkJ3ZqJ8JFLL/tgYdAxF/XEFBbY=
github.com/in-toto/in-toto-golang v0.5.0/go.mod h1:/Rq0IZHLV7Ku5gielPT4wPHJfH1GdHMCq8+WPxw8/BE=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg=
github.com/jackpal/gateway v1.0.7 h1:7tIFeCGmpyrMx9qvT0EgYUi7cxVW48a0mMvnIL17bPM=
github.com/jackpal/gateway v1.0.7/go.mod h1:aRcO0UFKt+MgIZmRmvOmnejdDT4Y1DNiNOsSd1AcIbA=
github.com/jaguilar/vt100 v0.0.0-20150826170717-2703a27b14ea/go.mod h1:QMdK4dGB3YhEW2BmA1wgGpPYI3HZy/5gD705PXKUVSg=
github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s=
github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0=
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0=
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/juju/ansiterm v1.0.0 h1:gmMvnZRq7JZJx6jkfSq9/+2LMrVEwGwt7UR6G+lmDEg=
github.com/juju/ansiterm v1.0.0/go.mod h1:PyXUpnI3olx3bsPcHt98FGPX/KCFZ1Fi+hw1XLI6384=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/lunixbochs/vtclean v1.0.0 h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+LVb8=
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs=
github.com/mackerelio/go-osstat v0.2.4/go.mod h1:Zy+qzGdZs3A9cuIqmgbJvwbmLQH9dJvtio5ZjJTbdlQ=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU=
github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.10/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo=
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY=
github.com/mazznoer/csscolorparser v0.1.3 h1:vug4zh6loQxAUxfU1DZEu70gTPufDPspamZlHAkKcxE=
github.com/mazznoer/csscolorparser v0.1.3/go.mod h1:Aj22+L/rYN/Y6bj3bYqO3N6g1dtdHtGfQ32xZ5PJQic=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk=
github.com/mitchellh/go-spdx v0.1.0 h1:50JnVzkL3kWreQ5Qb4Pi3Qx9e+bbYrt8QglJDpfeBEs=
github.com/mitchellh/go-spdx v0.1.0/go.mod h1:FFi4Cg1fBuN/JCtPtP8PEDmcBjvO3gijQVl28YjIBVQ=
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ=
github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=
github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A=
github.com/moby/buildkit v0.8.1/go.mod h1:/kyU1hKy/aYCuP39GZA9MaKioovHku57N6cqlKZIaiQ=
github.com/moby/buildkit v0.13.0-beta3 h1:eefOGE6SsWYHFfymc09Q7VU5i3L9vUs8ZCZVCDXWNOo=
github.com/moby/buildkit v0.13.0-beta3/go.mod h1:tSWWhq1EDM0eB3ngMNDiH2hOOW9fXTyn2uXuOraCLlE=
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
github.com/moby/sys/mount v0.1.0/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74=
github.com/moby/sys/mount v0.1.1/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74=
github.com/moby/sys/mount v0.3.3 h1:fX1SVkXFJ47XWDoeFW4Sq7PdQJnV2QIDZAqjNqgEjUs=
github.com/moby/sys/mount v0.3.3/go.mod h1:PBaEorSNTLG5t/+4EgukEQVlAvVEc6ZjTySwKdqp5K0=
github.com/moby/sys/mountinfo v0.1.0/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o=
github.com/moby/sys/mountinfo v0.1.3/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o=
github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A=
github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g=
github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
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/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2/go.mod h1:TjQg8pa4iejrUrjiz0MCtMV38jdMNW4doKSiBrEvCQQ=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c=
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
github.com/onsi/ginkgo/v2 v2.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs=
github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
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/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
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/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc10/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc92/go.mod h1:X1zlU4p7wOlX4+WRCz+hvlRv8phdL7UqbYD+vQwNMmE=
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 v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
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-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE=
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02/go.mod h1:JNdpVEzCpXBgIiv4ds+TzhN1hrtxq6ClLrTlT9OQRSc=
github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9/go.mod h1:PLldrQSroqzH70Xl+1DQcGnefIbqsKR7UDaiux3zV+w=
github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170 h1:DiLBVp4DAcZlBVBEtJpNWZpZVq0AEeCY7Hqk8URVs4o=
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170/go.mod h1:uQd4a7Rh3ZsVg5j0lNyAfyxIeGde9yrlhjF78GzeW0c=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/profile v1.5.0 h1:042Buzk+NhDI+DeSAA62RwJL8VAuZUMQZUjCsRz1Mug=
github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18=
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ=
github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=
github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY=
github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
github.com/prometheus/exporter-toolkit v0.8.2/go.mod h1:00shzmJL7KxcsabLWcONwpyNEuWhREOnFqZW7vadFS0=
github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e h1:51xcRlSMBU5rhM9KahnJGfEsBPVPz3182TgFRowA8yY=
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e/go.mod h1:tcaRap0jS3eifrEEllL6ZMd9dg8IlDpi2S1oARrQ+NI=
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
github.com/quasilyte/go-ruleguard v0.1.2-0.20200318202121-b00d7a75d3d8/go.mod h1:CGFX09Ci3pq9QZdj86B+VGIdNj4VyCo2iPOGS9esB/k=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rs/cors v1.10.0 h1:62NOS1h+r8p1mW6FM0FSB0exioXLhd/sh15KpjWBZ+8=
github.com/rs/cors v1.10.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A=
github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryancurrah/gomodguard v1.0.4/go.mod h1:9T/Cfuxs5StfsocWr4WzDL36HqnX0fVb9d5fSEaLhoE=
github.com/ryancurrah/gomodguard v1.1.0/go.mod h1:4O8tr7hBODaGE6VIhfJDHcwzh5GUccKSJBU0UMXJFVM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/samber/slog-common v0.14.0 h1:g4TGALXmqogbJu3epRhjIWUJKSpgqB9VyN2OEnS8Wyg=
github.com/samber/slog-common v0.14.0/go.mod h1:Qjrfhwk79XiCIhBj8+jTq1Cr0u9rlWbjawh3dWXzaHk=
github.com/samber/slog-logrus/v2 v2.2.0 h1:Noku55MKf/x57c2j5/LsLzw75biW86Q29bOkZpnLAgY=
github.com/samber/slog-logrus/v2 v2.2.0/go.mod h1:C0egl62QrwHPY9RcsEXa3E7FHb6/xM9uaVSuc7piJXU=
github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b/go.mod h1:am+Fp8Bt506lA3Rk3QCmSqmYmLMnPDhdDUcosQCAx+I=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624Y=
github.com/sebdah/goldie/v2 v2.5.3/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI=
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
github.com/secure-systems-lab/go-securesystemslib v0.4.0/go.mod h1:FGBZgq2tXWICsxWQW1msNf49F0Pf2Op5Htayx335Qbs=
github.com/securego/gosec v0.0.0-20200103095621-79fbf3af8d83/go.mod h1:vvbZ2Ae7AzSq3/kywjUDxSNq2SJ27RxCz2un0H3ePqE=
github.com/securego/gosec v0.0.0-20200401082031-e946c8c39989/go.mod h1:i9l/TNj+yDFh9SZXUTvspXTjbFXgZGP/UvhU1S65A4A=
github.com/securego/gosec/v2 v2.3.0/go.mod h1:UzeVyUXbxukhLeHKV3VVqo7HdoQR9MrRfFmZYotn8ME=
github.com/sercand/kuberesolver v2.4.0+incompatible/go.mod h1:lWF3GL0xptCB/vCiJPl/ZshwPsX/n4Y7u0CW9E7aQIQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc=
github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI=
github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE=
github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ=
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 h1:B1PEwpArrNp4dkQrfxh/abbBAOZBVp0ds+fBEOUOqOc=
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29/go.mod h1:AuYgA5Kyo4c7HfUmvRGs/6rGlMMV/6B1bVnB9JxJEEg=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
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/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ=
github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/sosodev/duration v1.1.0 h1:kQcaiGbJaIsRqgQy7VGlZrVw1giWO+lDoX3MCPnpVO4=
github.com/sosodev/duration v1.1.0/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE=
github.com/sourcegraph/go-diff v0.5.3/go.mod h1:v9JDtjCE4HHHCZGId75rg8gkKKa98RVjBcBGsVmMmak=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb/go.mod h1:uKWaldnbMnjsSAXRurWqqrdyZen1R7kxl8TkmWk2OyM=
github.com/spdx/tools-golang v0.5.1 h1:fJg3SVOGG+eIva9ZUBm/hvyA7PIPVFjRxUKe6fdAgwE=
github.com/spdx/tools-golang v0.5.1/go.mod h1:/DRDQuBfB37HctM29YtrX1v+bXiVmT2OpQDalRmX9aU=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
github.com/tetafro/godot v0.3.7/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
github.com/tetafro/godot v0.4.2/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM=
github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0=
github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0=
github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao=
github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig=
github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig=
github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85/go.mod h1:a7cilN64dG941IOXfhJhlH0qB92hxJ9A1ewrdUmJ6xo=
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302 h1:ZT8ibgassurSISJ1Pj26NsM3vY2jxFZn63Nd/TpHmRw=
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302/go.mod h1:9kMVqMyQ/Sx2df5LtnGG+nbrmiZzCS7V6gjW3oGHsvI=
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 h1:8eY6m1mjgyB8XySUR7WvebTM8D/Vs86jLJzD/Tw7zkc=
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7/go.mod h1:qqvyZqkfwkoJuPU/bw61bItaoO0SJ8YSW0vSVRRvsRg=
github.com/tonistiigi/go-archvariant v1.0.0 h1:5LC1eDWiBNflnTF1prCiX09yfNHIxDC/aukdhCdTyb0=
github.com/tonistiigi/go-archvariant v1.0.0/go.mod h1:TxFmO5VS6vMq2kvs3ht04iPXtu2rUT/erOnGFYfk5Ho=
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/v/cCndK0AMpt1wiVFb/YYmqB3/QG0=
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk=
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 h1:Y/M5lygoNPKwVNLMPXgVfsRT40CSFKXCxuU8LoHySjs=
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc=
github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-client-go v2.28.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA=
github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA=
github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk=
github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA=
github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s=
github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4=
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts=
github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk=
github.com/vdemeester/k8s-pkg-credentialprovider v1.17.4/go.mod h1:inCTmtUdr5KJbreVojo06krnTgaeAz/Z7lynpPk/Q2c=
github.com/vektah/gqlparser/v2 v2.5.10 h1:6zSM4azXC9u4Nxy5YmdmGu4uKamfwsdKTwp5zsEealU=
github.com/vektah/gqlparser/v2 v2.5.10/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netlink v1.2.1-beta.2 h1:Llsql0lnQEbHj0I1OuKyp8otXp0r3q0mPkuhwHfStVs=
github.com/vishvananda/netlink v1.2.1-beta.2/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
github.com/vito/midterm v0.1.4 h1:SALq5mQ+AgzeZxjL4loB6Uk5TZc9JMyX2ELA/NVH65c=
github.com/vito/midterm v0.1.4/go.mod h1:Mm3u6lrpzo2EFSJbwksKOdottTJzYePK8c1KJy4aRbk=
github.com/vito/progrock v0.10.2-0.20240119030128-52ef9ee1a291 h1:VcLECqiOXx4PTEzsV0QlWVubUeE+k0ZclAlKpUuejo8=
github.com/vito/progrock v0.10.2-0.20240119030128-52ef9ee1a291/go.mod h1:Q8hxIUXZW8vkezLwH4TnRmXv+XdRb4KfLtS9t5RtH9g=
github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU=
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63 h1:qZcnPZbiX8gGs3VmipVc3ft29vPYBZzlox/04Von6+k=
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63/go.mod h1:KoQ+3z63GUJzQ7AhU0AWQNU+LPda2EwL/cx1PlbDzVQ=
github.com/weaveworks/promrus v1.2.0 h1:jOLf6pe6/vss4qGHjXmGz4oDJQA+AOCqEL3FvvZGz7M=
github.com/weaveworks/promrus v1.2.0/go.mod h1:SaE82+OJ91yqjrE1rsvBWVzNZKcHYFtMUyS1+Ogs/KA=
github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xanzy/go-gitlab v0.32.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/goldmark v1.6.0 h1:boZcn2GTjpsynOsC0iJHnBWa4Bi0qzfJjthwauItG68=
github.com/yuin/goldmark v1.6.0/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs=
github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA=
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg=
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
github.com/zmb3/spotify/v2 v2.3.1 h1:aEyIPotROM3JJjHMCImFROgnPIUpzVo8wymYSaPSd9w=
github.com/zmb3/spotify/v2 v2.3.1/go.mod h1:+LVh9CafHu7SedyqYmEf12Rd01dIVlEL845yNhksW0E=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A=
go.opencensus.io v0.19.2/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0 h1:2ea0IkZBsWH+HA2GkD+7+hRw2u97jzdFyRtXuO14a1s=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0/go.mod h1:4m3RnBBb+7dB9d21y510oO1pdB1V4J6smNf14WXcBFQ=
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/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc=
go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo=
go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4=
go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0 h1:ZtfnDL+tUrs1F0Pzfwbg2d59Gru9NCH3bgSHBM6LDwU=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0/go.mod h1:hG4Fj/y8TR/tlEDREo8tWstl9fO9gcFkn4xrx0Io8xU=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.42.0 h1:NmnYCiR0qNufkldjVvyQfZTHSdzeHoZ41zggMsdMcLM=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.42.0/go.mod h1:UVAO61+umUsHLtYb8KXXRoHtxUkdOPkYidzW3gipRLQ=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0 h1:wNMDy/LVGLj2h3p6zg4d0gypKfWKSWI14E1C4smOgl8=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0/go.mod h1:YfbDdXAAkemWJK3H/DshvlrxqFB2rtW4rY6ky/3x/H0=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU=
go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA=
go.opentelemetry.io/otel/exporters/prometheus v0.42.0/go.mod h1:f3bYiqNqhoPxkvI2LrXqQVC546K7BuRDL/kKuxkujhA=
go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4=
go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM=
go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8=
go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E=
go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k=
go.opentelemetry.io/otel/sdk/metric v1.19.0/go.mod h1:XjG0jQyFJrv2PbMvwND7LwCEhsJzCzV5210euduKcKY=
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.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
gocloud.dev v0.19.0/go.mod h1:SmKwiR8YwIMMJvQBKLsC3fHNyMwXLw3PMDO+VVteJMI=
golang.org/x/build v0.0.0-20190314133821-5284462c4bec/go.mod h1:atTaCNAy0f16Ah5aV1gMSwgiKVHwu/JncqDpuRr7lS4=
golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4=
golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20170114055629-f2499483f923/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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/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-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=
golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o=
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
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/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190620070143-6f217b454f45/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191115151921-52ab43148777/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-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200917073148-efd3b9a0ff20/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/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-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/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-20220610221304-9f5ed59c137d/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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE=
golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/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.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113232020-e2727e816f5a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200102140908-9497f49d5709/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200204192400-7124308813f3/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200331202046-9d5940d49312/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc=
golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0=
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ=
gonum.org/v1/plot v0.14.0 h1:+LBDVFYwFe4LHhdP8coW6296MBEY4nQ+Y4vuUpJopcE=
gonum.org/v1/plot v0.14.0/go.mod h1:MLdR9424SJed+5VqC6MsouEpig9pZX2VZ57H9ko2bXU=
google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181220000619-583d854617af/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.2.0/go.mod h1:IfRCZScioGtypHNTlz3gFk67J8uePVW7uDTBzXuIkhU=
google.golang.org/api v0.3.0/go.mod h1:IuvZyQh8jgscv8qWfQ4ABd8m7hEudgBFM/EdhA3BnXw=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4=
google.golang.org/api v0.6.1-0.20190607001116-5213b8090861/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo=
google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4=
google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw=
google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU=
google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k=
google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI=
google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I=
google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo=
google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g=
google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA=
google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8=
google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs=
google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA=
google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw=
google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg=
google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.3.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/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A=
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24=
google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w=
google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 h1:I6WNifs6pF9tNdSob2W24JtyxIYjzFB9qDlpUC76q+U=
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405/go.mod h1:3WDQMjmJk36UQhjQ89emUzb1mdaHcPeeAh4SCBKznB4=
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo=
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.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.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU=
google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20180904230853-4e7be11eab3f/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
k8s.io/api v0.17.4/go.mod h1:5qxx6vjmwUVG2nHQTKGlLts8Tbok8PzHl4vHtVFuZCA=
k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw=
k8s.io/apimachinery v0.0.0-20180904193909-def12e63c512/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=
k8s.io/apimachinery v0.17.4/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0g=
k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA=
k8s.io/apiserver v0.17.4/go.mod h1:5ZDQ6Xr5MNBxyi3iUZXS84QOhZl+W7Oq2us/29c0j9I=
k8s.io/client-go v0.0.0-20180910083459-2cefa64ff137/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s=
k8s.io/client-go v0.17.4/go.mod h1:ouF6o5pz3is8qU0/qYL2RnoxOPqgfuidYLowytyLJmc=
k8s.io/client-go v0.19.0/go.mod h1:H9E/VT95blcFQnlyShFgnFT9ZnJOAceiUHM3MlRC+mU=
k8s.io/cloud-provider v0.17.4/go.mod h1:XEjKDzfD+b9MTLXQFlDGkk6Ho8SGMpaU8Uugx/KNK9U=
k8s.io/code-generator v0.17.2/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s=
k8s.io/component-base v0.17.4/go.mod h1:5BRqHMbbQPm2kKu35v3G+CpVq4K0RJKC7TRioF0I9lE=
k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM=
k8s.io/csi-translation-lib v0.17.4/go.mod h1:CsxmjwxEI0tTNMzffIAcgR9lX4wOh6AKHdxQrT7L0oo=
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc=
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o=
k8s.io/kubernetes v1.11.10/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/legacy-cloud-providers v0.17.4/go.mod h1:FikRNoD64ECjkxO36gkDgJeiQWwyZTuBkhu+yxOc1Js=
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
kernel.org/pub/linux/libs/security/libcap/cap v1.2.67 h1:sPQ9qlSNR26fToTKbxe/HDWJlXvBLqGmt84LGCQkOy0=
kernel.org/pub/linux/libs/security/libcap/cap v1.2.67/go.mod h1:GkntoBuwffz19qtdFVB+k2NtWNN+yCKnC/Ykv/hMiTU=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.67 h1:NxbXJ7pDVq0FKBsqjieT92QDXI2XaqH2HAi4QcCOHt8=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.67/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24=
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw=
mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7/go.mod h1:HGC5lll35J70Y5v7vCGb9oLhHoScFwkHDJm/05RdSTc=
oss.terrastruct.com/d2 v0.6.1 h1:TEk7pl5yS1cnUxHOsIQ7bZCs+iRGsb5FaofaianfZk8=
oss.terrastruct.com/d2 v0.6.1/go.mod h1:ZyzsiefzsZ3w/BDnfF/hcDx9LKBlgieuolX8pXi7oJY=
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2 h1:n6y6RoZCgZDchN4gLGlzNRO1Jdf9xOGGqohDBph5BG8=
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2/go.mod h1:eMWv0sOtD9T2RUl90DLWfuShZCYp4NrsqNpI8eqO6U4=
pack.ag/amqp v0.11.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
sourcegraph.com/sqs/pbtypes v1.0.0/go.mod h1:3AciMUv4qUuRHRHhOG4TZOB+72GdPVz5k+c648qsFS4=
|
closed | dagger/dagger | https://github.com/dagger/dagger | 3,325 | Python: add tests | Use pytest.
1. We can start with barebones integration test and hook it into CI like in https://github.com/dagger/dagger/pull/3292.
2. Then keep iterating to add coverage for existing features.
3. Add tests along with new features. | https://github.com/dagger/dagger/issues/3325 | https://github.com/dagger/dagger/pull/6565 | 877ee23c584d79ef949027b4460fafff49ecad7b | 2ce62d60e33330e15a220a086962b10fb4b8f3ca | "2022-10-12T11:53:17Z" | go | "2024-02-01T20:32:56Z" | sdk/python/requirements/docs.txt | #
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# dagger dl -m dev deps --env=docs lock
#
alabaster==0.7.16
# via sphinx
babel==2.14.0
# via sphinx
certifi==2023.11.17
# via requests
charset-normalizer==3.3.2
# via requests
docutils==0.20.1
# via
# sphinx
# sphinx-rtd-theme
idna==3.6
# via requests
imagesize==1.4.1
# via sphinx
jinja2==3.1.3
# via sphinx
markupsafe==2.1.4
# via jinja2
packaging==23.2
# via sphinx
pygments==2.17.2
# via sphinx
requests==2.31.0
# via sphinx
snowballstemmer==2.2.0
# via sphinx
sphinx==7.2.6
# via
# -r requirements.in
# sphinx-rtd-theme
# sphinxcontrib-jquery
sphinx-rtd-theme==2.0.0
# via -r requirements.in
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jquery==4.1
# via sphinx-rtd-theme
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
urllib3==2.1.0
# via requests
|
closed | dagger/dagger | https://github.com/dagger/dagger | 3,234 | Port `core.#Merge` to Dagger Engine 0.3 | Sub-issue of #3121
This isn't available in `v0.3` yet. | https://github.com/dagger/dagger/issues/3234 | https://github.com/dagger/dagger/pull/6567 | 6d5f4d1f3d06debe2e3e79e037a5e5c7cfe1221b | c7df6b342ebb1c26c3df54c1473f7e7a38f08311 | "2022-10-04T15:14:25Z" | go | "2024-02-02T08:13:17Z" | sdk/java/pom.xml | <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.dagger</groupId>
<artifactId>dagger-sdk-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>dagger-codegen-maven-plugin</module>
<module>dagger-java-sdk</module>
<module>dagger-java-samples</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.dagger</groupId>
<artifactId>dagger-java-sdk</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-graphql-client-api</artifactId>
<version>${smallrye-graphql.version}</version>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-graphql-client-implementation-vertx</artifactId>
<version>${smallrye-graphql.version}</version>
</dependency>
<dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
<version>${jakarta.json-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.json.bind</groupId>
<artifactId>jakarta.json.bind-api</artifactId>
<version>${jakarta.json.bind-api.version}</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>${json-path.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
<version>${yasson.version}</version>
</dependency>
<dependency>
<groupId>com.squareup</groupId>
<artifactId>javapoet</artifactId>
<version>${javapoet.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang.version}</version>
</dependency>
<dependency>
<groupId>net.kothar</groupId>
<artifactId>xdg-java</artifactId>
<version>${xdg-java.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>${commons-compress.version}</version>
</dependency>
<dependency>
<groupId>com.ongres</groupId>
<artifactId>fluent-process</artifactId>
<version>${fluent-process.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven-plugin-api.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>${maven-project.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j-api.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j-simple.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>${maven-plugin-annotations.version}</version>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>uk.org.webcompere</groupId>
<artifactId>system-stubs-jupiter</artifactId>
<version>${system-stubs-jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj-core.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito-core.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>maven-versions-plugin</artifactId>
<version>${maven-versions-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>de.m3y.maven</groupId>
<artifactId>inject-maven-plugin</artifactId>
<version>${inject-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.spotify.fmt</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>${fmt-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>io.dagger</groupId>
<artifactId>dagger-codegen-maven-plugin</artifactId>
<version>${project.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skipITs>true</skipITs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<daggerengine.version>devel</daggerengine.version>
<assertj-core.version>3.25.0</assertj-core.version>
<commons-compress.version>1.24.0</commons-compress.version>
<commons-lang.version>3.13.0</commons-lang.version>
<exec-maven-plugin.version>3.1.0</exec-maven-plugin.version>
<fluent-process.version>1.0.1</fluent-process.version>
<fmt-maven-plugin.version>2.22.1</fmt-maven-plugin.version>
<inject-maven-plugin.version>1.5</inject-maven-plugin.version>
<jakarta.json-api.version>2.1.2</jakarta.json-api.version>
<jakarta.json.bind-api.version>3.0.0</jakarta.json.bind-api.version>
<javapoet.version>1.13.0</javapoet.version>
<json-path.version>2.9.0</json-path.version>
<junit.version>5.10.0</junit.version>
<maven-assembly-plugin.version>3.6.0</maven-assembly-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-failsafe-plugin.version>3.0.0</maven-failsafe-plugin.version>
<maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
<maven-plugin-api.version>3.8.8</maven-plugin-api.version>
<maven-plugin-annotations.version>3.8.1</maven-plugin-annotations.version>
<maven-project.version>2.2.1</maven-project.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
<maven-versions-plugin.version>2.16.0</maven-versions-plugin.version>
<mockito-core.version>5.8.0</mockito-core.version>
<slf4j-api.version>2.0.0</slf4j-api.version>
<slf4j-simple.version>2.0.7</slf4j-simple.version>
<smallrye-graphql.version>2.7.0</smallrye-graphql.version>
<system-stubs-jupiter.version>2.1.3</system-stubs-jupiter.version>
<xdg-java.version>0.1.1</xdg-java.version>
<yasson.version>3.0.3</yasson.version>
</properties>
</project>
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,540 | 🐞 sdk(elixir): wrong os type and architecture detection on Windows for cli downloader | ### What is the issue?
Elixir SDK CLI downloader's `:os.type()` pattern matching expects `{:windows, :nt}` but is actually `{:win32, :nt}` [as documented in Erlang](https://www.erlang.org/doc/man/os#type-0).
[https://github.com/dagger/dagger/blob/7350f0b8dd5ff74b7ae0ddfd05e35c37bf16712b/sdk/elixir/lib/dagger/internal/engine/downloader.ex#L120-L126](https://github.com/dagger/dagger/blob/7350f0b8dd5ff74b7ae0ddfd05e35c37bf16712b/sdk/elixir/lib/dagger/internal/engine/downloader.ex#L120-L126)
```
Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:24:24] [ds:24:24:10] [async-threads:1] [jit:ns]
Interactive Elixir (1.16.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :os.type()
{:win32, :nt}
```
After that, a correct system architecture can't be matched.
[https://github.com/dagger/dagger/blob/7350f0b8dd5ff74b7ae0ddfd05e35c37bf16712b/sdk/elixir/lib/dagger/internal/engine/downloader.ex#L113-L118](https://github.com/dagger/dagger/blob/7350f0b8dd5ff74b7ae0ddfd05e35c37bf16712b/sdk/elixir/lib/dagger/internal/engine/downloader.ex#L113-L118)
```
Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:24:24] [ds:24:24:10] [async-threads:1] [jit:ns]
Interactive Elixir (1.16.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :erlang.system_info(:system_architecture) |> to_string()
"win32"
```
### Dagger version
Elixir SDK 0.9.7
### Steps to reproduce
Run on Windows without a previously downloaded CLI
```elixir
Mix.install([
{:dagger, "~> 0.9", only: [:dev, :test]}
])
Dagger.connect!()
|> Dagger.Client.container()
|> Dagger.Container.from("bash:latest")
|> Dagger.Container.with_entrypoint('')
|> Dagger.Container.with_exec(~w"echo 'hello'")
|> Dagger.Sync.sync()
```
### Log output
os type:
```
** (CaseClauseError) no case clause matching: {:win32, :nt}
(dagger 0.9.7) lib/dagger/internal/engine/downloader.ex:121: Dagger.Internal.Engine.Downloader.os/0
(dagger 0.9.7) lib/dagger/internal/engine/downloader.ex:11: Dagger.Internal.Engine.Downloader.download/2
(dagger 0.9.7) lib/dagger/engine_conn.ex:59: Dagger.EngineConn.from_remote_cli/1
(dagger 0.9.7) lib/dagger.ex:18: Dagger.connect/1
(dagger 0.9.7) lib/dagger.ex:37: Dagger.connect!/1
dagger_repro.ex:7: (file)
```
system architecture:
```
** (CaseClauseError) no case clause matching: "win32"
(dagger 0.0.0) lib/dagger/internal/engine/downloader.ex:114: Dagger.Internal.Engine.Downloader.arch/0
(dagger 0.0.0) lib/dagger/internal/engine/downloader.ex:109: Dagger.Internal.Engine.Downloader.cli_archive_url/2
(dagger 0.0.0) lib/dagger/internal/engine/downloader.ex:30: Dagger.Internal.Engine.Downloader.extract_cli/3
(dagger 0.0.0) lib/dagger/internal/engine/downloader.ex:19: Dagger.Internal.Engine.Downloader.download/2
(dagger 0.0.0) lib/dagger/engine_conn.ex:60: Dagger.EngineConn.from_remote_cli/1
(dagger 0.0.0) lib/dagger/internal/client.ex:13: Dagger.Internal.Client.connect/1
(dagger 0.0.0) lib/dagger.ex:18: Dagger.connect/1
(dagger 0.0.0) lib/dagger.ex:37: Dagger.connect!/1
``` | https://github.com/dagger/dagger/issues/6540 | https://github.com/dagger/dagger/pull/6579 | e988cac9661a11aea5f8995488400b78ae7809a1 | 54d99cba79fdf72156f8174016263110933b8299 | "2024-01-31T16:49:01Z" | go | "2024-02-03T17:10:14Z" | sdk/elixir/.changes/unreleased/Fixed-20240203-105721.yaml | |
closed | dagger/dagger | https://github.com/dagger/dagger | 6,540 | 🐞 sdk(elixir): wrong os type and architecture detection on Windows for cli downloader | ### What is the issue?
Elixir SDK CLI downloader's `:os.type()` pattern matching expects `{:windows, :nt}` but is actually `{:win32, :nt}` [as documented in Erlang](https://www.erlang.org/doc/man/os#type-0).
[https://github.com/dagger/dagger/blob/7350f0b8dd5ff74b7ae0ddfd05e35c37bf16712b/sdk/elixir/lib/dagger/internal/engine/downloader.ex#L120-L126](https://github.com/dagger/dagger/blob/7350f0b8dd5ff74b7ae0ddfd05e35c37bf16712b/sdk/elixir/lib/dagger/internal/engine/downloader.ex#L120-L126)
```
Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:24:24] [ds:24:24:10] [async-threads:1] [jit:ns]
Interactive Elixir (1.16.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :os.type()
{:win32, :nt}
```
After that, a correct system architecture can't be matched.
[https://github.com/dagger/dagger/blob/7350f0b8dd5ff74b7ae0ddfd05e35c37bf16712b/sdk/elixir/lib/dagger/internal/engine/downloader.ex#L113-L118](https://github.com/dagger/dagger/blob/7350f0b8dd5ff74b7ae0ddfd05e35c37bf16712b/sdk/elixir/lib/dagger/internal/engine/downloader.ex#L113-L118)
```
Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:24:24] [ds:24:24:10] [async-threads:1] [jit:ns]
Interactive Elixir (1.16.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :erlang.system_info(:system_architecture) |> to_string()
"win32"
```
### Dagger version
Elixir SDK 0.9.7
### Steps to reproduce
Run on Windows without a previously downloaded CLI
```elixir
Mix.install([
{:dagger, "~> 0.9", only: [:dev, :test]}
])
Dagger.connect!()
|> Dagger.Client.container()
|> Dagger.Container.from("bash:latest")
|> Dagger.Container.with_entrypoint('')
|> Dagger.Container.with_exec(~w"echo 'hello'")
|> Dagger.Sync.sync()
```
### Log output
os type:
```
** (CaseClauseError) no case clause matching: {:win32, :nt}
(dagger 0.9.7) lib/dagger/internal/engine/downloader.ex:121: Dagger.Internal.Engine.Downloader.os/0
(dagger 0.9.7) lib/dagger/internal/engine/downloader.ex:11: Dagger.Internal.Engine.Downloader.download/2
(dagger 0.9.7) lib/dagger/engine_conn.ex:59: Dagger.EngineConn.from_remote_cli/1
(dagger 0.9.7) lib/dagger.ex:18: Dagger.connect/1
(dagger 0.9.7) lib/dagger.ex:37: Dagger.connect!/1
dagger_repro.ex:7: (file)
```
system architecture:
```
** (CaseClauseError) no case clause matching: "win32"
(dagger 0.0.0) lib/dagger/internal/engine/downloader.ex:114: Dagger.Internal.Engine.Downloader.arch/0
(dagger 0.0.0) lib/dagger/internal/engine/downloader.ex:109: Dagger.Internal.Engine.Downloader.cli_archive_url/2
(dagger 0.0.0) lib/dagger/internal/engine/downloader.ex:30: Dagger.Internal.Engine.Downloader.extract_cli/3
(dagger 0.0.0) lib/dagger/internal/engine/downloader.ex:19: Dagger.Internal.Engine.Downloader.download/2
(dagger 0.0.0) lib/dagger/engine_conn.ex:60: Dagger.EngineConn.from_remote_cli/1
(dagger 0.0.0) lib/dagger/internal/client.ex:13: Dagger.Internal.Client.connect/1
(dagger 0.0.0) lib/dagger.ex:18: Dagger.connect/1
(dagger 0.0.0) lib/dagger.ex:37: Dagger.connect!/1
``` | https://github.com/dagger/dagger/issues/6540 | https://github.com/dagger/dagger/pull/6579 | e988cac9661a11aea5f8995488400b78ae7809a1 | 54d99cba79fdf72156f8174016263110933b8299 | "2024-01-31T16:49:01Z" | go | "2024-02-03T17:10:14Z" | sdk/elixir/lib/dagger/internal/engine/downloader.ex | defmodule Dagger.Internal.Engine.Downloader do
@moduledoc false
@dagger_bin_prefix "dagger-"
@dagger_default_cli_host "dl.dagger.io"
@doc false
def download(cli_version, opts \\ []) do
cli_host = opts[:cli_host] || @dagger_default_cli_host
cache_dir = :filename.basedir(:user_cache, "dagger")
bin_name = dagger_bin_name(cli_version, os())
cache_bin_path = Path.join([cache_dir, bin_name])
perm = 0o700
with :ok <- File.mkdir_p(cache_dir),
:ok <- File.chmod(cache_dir, perm),
{:error, :enoent} <- File.stat(cache_bin_path),
temp_bin_path = Path.join([cache_dir, "temp-" <> bin_name]),
:ok <- extract_cli(cli_host, cli_version, temp_bin_path),
:ok <- File.chmod(temp_bin_path, perm),
:ok <- File.rename(temp_bin_path, cache_bin_path) do
{:ok, cache_bin_path}
else
{:ok, _stat} -> {:ok, cache_bin_path}
error -> error
end
end
defp extract_cli(cli_host, cli_version, bin_path) do
req = Req.new(url: cli_archive_url(cli_host, cli_version))
with {:ok, response} <- Req.get(req, raw: true),
:ok <- verify_checksum(response, cli_host, cli_version) do
{_, %{body: files}} = Req.Steps.decode_body({req, response})
{_, dagger_bin} =
Enum.find(files, fn {filename, _bin} ->
filename == dagger_bin_in_archive(os())
end)
File.write(bin_path, dagger_bin)
end
end
defp verify_checksum(response, cli_host, cli_version) do
calculated_checksum = :crypto.hash(:sha256, response.body) |> Base.encode16(case: :lower)
case expected_checksum(cli_host, cli_version) do
{:ok, expected_checksum} ->
if :crypto.hash_equals(calculated_checksum, expected_checksum) do
:ok
else
{:error, "checksum mismatch: expected #{expected_checksum}, got #{calculated_checksum}"}
end
error ->
error
end
end
defp expected_checksum(cli_host, cli_version) do
archive_name = default_cli_archive_name(os(), arch(), cli_version)
{:ok, checksum_map} = checksum_map(cli_host, cli_version)
expected_value =
Enum.find_value(checksum_map, fn {key, value} ->
if to_string(key) == archive_name, do: value
end)
if is_nil(expected_value) do
{:error, "expected value find error"}
else
{:ok, expected_value}
end
end
defp checksum_map(cli_host, cli_version) do
try do
with {:ok, response} <- Req.get(checksum_url(cli_host, cli_version)) do
checksum_map =
response.body
|> String.split("\n", trim: true)
|> Enum.map(&String.split/1)
|> Enum.map(fn
[hash, file] ->
{file, hash}
list ->
raise "Invalid checksum line: #{length(list)}"
end)
|> Enum.into(%{})
{:ok, checksum_map}
end
rescue
reason in RuntimeError -> {:error, reason}
end
end
defp dagger_bin_in_archive(:windows), do: ~c"dagger.exe"
defp dagger_bin_in_archive(_), do: ~c"dagger"
defp checksum_url(cli_host, cli_version) do
"https://#{cli_host}/dagger/releases/#{cli_version}/checksums.txt"
end
defp cli_archive_url(cli_host, cli_version) do
archive_name = default_cli_archive_name(os(), arch(), cli_version)
"https://#{cli_host}/dagger/releases/#{cli_version}/#{archive_name}"
end
defp arch() do
case :erlang.system_info(:system_architecture) |> to_string() do
"aarch64" <> _rest -> "arm64"
"x86_64" <> _rest -> "amd64"
end
end
defp os() do
case :os.type() do
{:unix, :darwin} -> :darwin
{:unix, :linux} -> :linux
{:windows, :nt} -> :windows
end
end
defp default_cli_archive_name(os, arch, cli_version) do
ext =
case os do
os when os in [:linux, :darwin] -> "tar.gz"
:windows -> "zip"
end
"dagger_v#{cli_version}_#{os}_#{arch}.#{ext}"
end
defp dagger_bin_name(cli_version, :windows) do
@dagger_bin_prefix <> cli_version <> ".exe"
end
defp dagger_bin_name(cli_version, _) do
@dagger_bin_prefix <> cli_version
end
end
|
closed | dagger/dagger | https://github.com/dagger/dagger | 150 | Rename dagger.#Exec: "dir" to "workdir" | I find `dagger.#Exec: dir` to be confusing. It's not explicitly that it sets the working directory for the command. I would rename it to `workdir` instead.
| https://github.com/dagger/dagger/issues/150 | https://github.com/dagger/dagger/pull/6568 | 01268a5fe62067f7d5dddfb5f5d90ecf4909eac4 | e06291a14e7f694ea2b04c1e30c41ebe751f8f21 | "2021-03-03T03:18:38Z" | go | "2024-02-06T12:01:00Z" | go.mod | module github.com/dagger/dagger
go 1.21
replace dagger.io/dagger => ./sdk/go
require (
dagger.io/dagger v0.9.7
github.com/99designs/gqlgen v0.17.41
github.com/Khan/genqlient v0.6.0
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2
github.com/adrg/xdg v0.4.0
github.com/blang/semver v3.5.1+incompatible
github.com/cenkalti/backoff/v4 v4.2.1
github.com/charmbracelet/bubbles v0.18.0
github.com/charmbracelet/bubbletea v0.25.0
github.com/charmbracelet/lipgloss v0.9.1
github.com/containerd/containerd v1.7.12
github.com/containerd/continuity v0.4.3
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6
github.com/containerd/stargz-snapshotter v0.15.1
github.com/containernetworking/cni v1.1.2
github.com/coreos/go-systemd/v22 v22.5.0
github.com/creack/pty v1.1.18
github.com/dave/jennifer v1.7.0
github.com/docker/cli v25.0.1+incompatible
github.com/docker/distribution v2.8.2+incompatible
github.com/docker/docker v25.0.1+incompatible
github.com/dschmidt/go-layerfs v0.1.0
github.com/go-git/go-git/v5 v5.11.0
github.com/gofrs/flock v0.8.1
github.com/gogo/protobuf v1.3.2
github.com/google/go-containerregistry v0.15.2
github.com/google/go-github/v50 v50.2.0
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/google/uuid v1.5.0
github.com/gorilla/websocket v1.5.0
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/iancoleman/strcase v0.3.0
github.com/jackpal/gateway v1.0.7
github.com/juju/ansiterm v1.0.0
github.com/klauspost/compress v1.17.4
github.com/mackerelio/go-osstat v0.2.4
github.com/mattn/go-isatty v0.0.20
github.com/mitchellh/go-spdx v0.1.0
github.com/moby/buildkit v0.13.0-beta3 // https://github.com/moby/buildkit/commit/1981eb123dc979fc71d097adeb5bbb84110aa9f4
github.com/moby/locker v1.0.1
github.com/moby/patternmatcher v0.6.0
github.com/moby/sys/mount v0.3.3
github.com/muesli/termenv v0.15.2
github.com/nxadm/tail v1.4.8
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.0-rc5
github.com/opencontainers/runc v1.1.12
github.com/opencontainers/runtime-spec v1.1.0
github.com/pelletier/go-toml v1.9.5
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/pkg/errors v0.9.1
github.com/prometheus/procfs v0.12.0
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e
github.com/rs/cors v1.10.0
github.com/rs/zerolog v1.31.0
github.com/samber/slog-logrus/v2 v2.2.0
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29
github.com/sirupsen/logrus v1.9.3
github.com/sourcegraph/conc v0.3.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
github.com/tidwall/gjson v1.17.0
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea
github.com/urfave/cli v1.22.14
github.com/vektah/gqlparser/v2 v2.5.10
github.com/vito/midterm v0.1.4
github.com/vito/progrock v0.10.2-0.20240119030128-52ef9ee1a291
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63
github.com/zeebo/xxh3 v1.0.2
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/exporters/jaeger v1.17.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
go.opentelemetry.io/otel/sdk v1.21.0
go.opentelemetry.io/otel/trace v1.21.0
go.opentelemetry.io/proto/otlp v1.0.0
golang.org/x/crypto v0.18.0
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/mod v0.14.0
golang.org/x/net v0.20.0
golang.org/x/oauth2 v0.16.0
golang.org/x/sync v0.6.0
golang.org/x/sys v0.16.0
golang.org/x/term v0.16.0
golang.org/x/text v0.14.0
golang.org/x/tools v0.17.0
google.golang.org/grpc v1.61.0
google.golang.org/protobuf v1.32.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools/v3 v3.5.1
oss.terrastruct.com/d2 v0.6.1
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2
)
require github.com/muesli/reflow v0.3.0
require (
cdr.dev/slog v1.4.2 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.11.4 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/PuerkitoBio/goquery v1.8.1 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/alecthomas/chroma v0.10.0 // indirect
github.com/alecthomas/chroma/v2 v2.11.1 // indirect
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 // indirect
github.com/aws/aws-sdk-go-v2 v1.24.1 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 // indirect
github.com/aws/aws-sdk-go-v2/config v1.26.6 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.16.16 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 // indirect
github.com/aws/smithy-go v1.19.0 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/charmbracelet/harmonica v0.2.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/containerd/fifo v1.1.0 // indirect
github.com/containerd/go-cni v1.1.9 // indirect
github.com/containerd/go-runc v1.1.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/nydus-snapshotter v0.13.1 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/containerd/ttrpc v1.2.2 // indirect
github.com/containerd/typeurl/v2 v2.1.1 // indirect
github.com/containernetworking/plugins v1.4.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denisbrodbeck/machineid v1.0.1 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/docker/docker-credential-helpers v0.8.0 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect
github.com/hanwen/go-fuse/v2 v2.4.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.3 // indirect
github.com/in-toto/in-toto-golang v0.5.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jonboulle/clockwork v0.4.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/lunixbochs/vtclean v1.0.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mazznoer/csscolorparser v0.1.3 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/sys/mountinfo v0.7.1 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/signal v0.7.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/opencontainers/selinux v1.11.0 // indirect
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/profile v1.5.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/rivo/uniseg v0.4.6 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/samber/lo v1.38.1 // indirect
github.com/samber/slog-common v0.14.0 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.4.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/shibumi/go-pathspec v1.3.0 // indirect
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/sosodev/duration v1.1.0 // indirect
github.com/spdx/tools-golang v0.5.1 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 // indirect
github.com/tonistiigi/go-archvariant v1.0.0 // indirect
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/vishvananda/netlink v1.2.1-beta.2 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/weaveworks/promrus v1.2.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/yuin/goldmark v1.6.0 // indirect
github.com/zmb3/spotify/v2 v2.3.1 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.42.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.19.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/image v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gonum.org/v1/plot v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
|
closed | dagger/dagger | https://github.com/dagger/dagger | 150 | Rename dagger.#Exec: "dir" to "workdir" | I find `dagger.#Exec: dir` to be confusing. It's not explicitly that it sets the working directory for the command. I would rename it to `workdir` instead.
| https://github.com/dagger/dagger/issues/150 | https://github.com/dagger/dagger/pull/6568 | 01268a5fe62067f7d5dddfb5f5d90ecf4909eac4 | e06291a14e7f694ea2b04c1e30c41ebe751f8f21 | "2021-03-03T03:18:38Z" | go | "2024-02-06T12:01:00Z" | go.sum | bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
bazil.org/fuse v0.0.0-20180421153158-65cc252bf669/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
cdr.dev/slog v1.4.2 h1:fIfiqASYQFJBZiASwL825atyzeA96NsqSxx2aL61P8I=
cdr.dev/slog v1.4.2/go.mod h1:0EkH+GkFNxizNR+GAXUEdUHanxUH5t9zqPILmPM/Vn8=
cloud.google.com/go v0.25.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.37.2/go.mod h1:H8IAquKe2L30IxoupDgqTaQvKSwF/c8prYHynGIWQbA=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw=
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY=
cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM=
cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY=
cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ=
cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI=
cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4=
cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA=
cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A=
cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc=
cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow=
cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM=
cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M=
cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s=
cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU=
cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U=
cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk=
cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY=
cloud.google.com/go/logging v1.8.1 h1:26skQWPeYhvIasWKm48+Eq7oUqdcdbwsCVwz5Ys0FvU=
cloud.google.com/go/logging v1.8.1/go.mod h1:TJjR+SimHwuC8MZ9cjByQulAMgni+RkXeI3wwctHJEI=
cloud.google.com/go/longrunning v0.5.4 h1:w8xEcbZodnA2BbW6sVirkkoC+1gP8wS57EUUgGS0GVg=
cloud.google.com/go/longrunning v0.5.4/go.mod h1:zqNVncI0BOP8ST6XQD1+VcvuShMmq7+xFSzOL++V0dI=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
code.gitea.io/sdk/gitea v0.12.0/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY=
contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA=
contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0=
contrib.go.opencensus.io/exporter/stackdriver v0.12.1/go.mod h1:iwB6wGarfphGGe/e5CWqyUk/cLzKnWsOKPVW3no6OTw=
contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE=
contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA=
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
git.sr.ht/~sbinet/gg v0.5.0 h1:6V43j30HM623V329xA9Ntq+WJrMjDxRjuAB1LFWF5m8=
git.sr.ht/~sbinet/gg v0.5.0/go.mod h1:G2C0eRESqlKhS7ErsNey6HHrqU1PwsnCQlekFi9Q2Oo=
github.com/99designs/gqlgen v0.17.41 h1:C1/zYMhGVP5TWNCNpmZ9Mb6CqT1Vr5SHEWoTOEJ3v3I=
github.com/99designs/gqlgen v0.17.41/go.mod h1:GQ6SyMhwFbgHR0a8r2Wn8fYgEwPxxmndLFPhU63+cJE=
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/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/AkihiroSuda/containerd-fuse-overlayfs v1.0.0/go.mod h1:0mMDvQFeLbbn1Wy8P2j3hwFhqBq+FKn8OZPno8WLmp8=
github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU=
github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4=
github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc=
github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v19.1.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v29.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v38.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 h1:Ut0ZGdOwJDw0npYEg+TLlPls3Pq6JiZaP2/aGKir7Zw=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1 h1:QSdcrd/UFJv6Bp/CfoVf2SrENpFn9P6Yh8yb+xNhYMM=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1/go.mod h1:eZ4g6GUvXiGulfIbbhh1Xr4XwUYaYaWMqzGD/284wCA=
github.com/Azure/azure-service-bus-go v0.9.1/go.mod h1:yzBx6/BUGfjfeqbRZny9AQIbIe3AcV9WZbAdpkoXOa0=
github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v10.15.5+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v12.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v14.1.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0=
github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630=
github.com/Azure/go-autorest/autorest v0.10.2/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630=
github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc=
github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM=
github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw=
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g=
github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM=
github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc=
github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA=
github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8=
github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI=
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0 h1:XMEdVDFxgulDDl0lQmAZS6j8gRQ/0pJ+ZpXH2FHVtDc=
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/Djarvur/go-err113 v0.1.0/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20191009163259-e802c2cb94ae/go.mod h1:mjwGPas4yKduTyubHvD1Atl9r1rUq8DfVy+gkVvZ+oo=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14=
github.com/Khan/genqlient v0.6.0 h1:Bwb1170ekuNIVIwTJEqvO8y7RxBxXu639VJOkKSrwAk=
github.com/Khan/genqlient v0.6.0/go.mod h1:rvChwWVTqXhiapdhLDV4bp9tz/Xvtewwkon4DpWWCRM=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Masterminds/semver/v3 v3.1.0 h1:Y2lUDsFKVRSYGojLJ1yLxSXdMmMYTYls0rCvoqmMUQk=
github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.4.15-0.20200908182639-5b44b70ab3ab/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.4.15/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
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/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ=
github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8=
github.com/Microsoft/hcsshim v0.8.10/go.mod h1:g5uw8EV2mAlzqe94tfNBNdr89fnbD/n3HV0OhsddkmM=
github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8=
github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w=
github.com/Microsoft/hcsshim/test v0.0.0-20200826032352-301c83a30e7c/go.mod h1:30A5igQ91GEmhYJF8TaRP79pMBOYynRsyOByfVV0dU4=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM=
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg=
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E=
github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo=
github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8=
github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo=
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw=
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM=
github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink=
github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek=
github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s=
github.com/alecthomas/chroma/v2 v2.11.1 h1:m9uUtgcdAwgfFNxuqj7AIG75jD2YmL61BBIJWtdzJPs=
github.com/alecthomas/chroma/v2 v2.11.1/go.mod h1:4TQu7gdfuPjSh76j78ietmqh9LiurGF0EpseFXdKMBw=
github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE=
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 h1:aM1rlcoLz8y5B2r4tTLMiVTrMtpfY0O8EScKJxaSaEc=
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apex/log v1.1.4/go.mod h1:AlpoD9aScyQfJDVHmLMEcx4oU6LqzkWp4Mg9GdAcEvQ=
github.com/apex/log v1.3.0/go.mod h1:jd8Vpsr46WAe3EZSQ/IUMs2qQD/GOycT5rPWCO1yGcs=
github.com/apex/logs v0.0.4/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo=
github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE=
github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs=
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.15.90/go.mod h1:es1KtYUFs7le0xQ3rOihkuoVD90z7D0fR2Qm4S00/gU=
github.com/aws/aws-sdk-go v1.16.26/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.19.18/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.19.45/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.20.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.25.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go-v2 v1.24.1 h1:xAojnj+ktS95YZlDf0zxWBkbFtymPeDP+rvUQIH3uAU=
github.com/aws/aws-sdk-go-v2 v1.24.1/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 h1:OCs21ST2LrepDfD3lwlQiOqIGp6JiEUqG84GzTDoyJs=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4/go.mod h1:usURWEKSNNAcAZuzRn/9ZYPT8aZQkR7xcCtunK/LkJo=
github.com/aws/aws-sdk-go-v2/config v1.26.6 h1:Z/7w9bUqlRI0FFQpetVuFYEsjzE3h7fpU6HuGmfPL/o=
github.com/aws/aws-sdk-go-v2/config v1.26.6/go.mod h1:uKU6cnDmYCvJ+pxO9S4cWDb2yWWIH5hra+32hVh1MI4=
github.com/aws/aws-sdk-go-v2/credentials v1.16.16 h1:8q6Rliyv0aUFAVtzaldUEcS+T5gbadPbWdV1WcAddK8=
github.com/aws/aws-sdk-go-v2/credentials v1.16.16/go.mod h1:UHVZrdUsv63hPXFo1H7c5fEneoVo9UXiz36QG1GEPi0=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 h1:c5I5iH+DZcH3xOIMlz3/tCKJDaHFwYEmxvlh2fAcFo8=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11/go.mod h1:cRrYDYAMUohBJUtUnOhydaMHtiK/1NZ0Otc9lIb6O0Y=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.15 h1:2MUXyGW6dVaQz6aqycpbdLIH1NMcUI6kW6vQ0RabGYg=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.15/go.mod h1:aHbhbR6WEQgHAiRj41EQ2W47yOYwNtIkWTXmcAtYqj8=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 h1:vF+Zgd9s+H4vOXd5BMaPWykta2a6Ih0AKLq/X6NYKn4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10/go.mod h1:6BkRjejp/GR4411UGqkX8+wFMbFbqsUIimfK4XjOKR4=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 h1:nYPe006ktcqUji8S2mqXf9c/7NdiKriOwMvWQHgYztw=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10/go.mod h1:6UV4SZkVvmODfXKql4LCbaZUpF7HO2BX38FgBf9ZOLw=
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3 h1:n3GDfwqF2tzEkXlv5cuy4iy7LpKDtqDMcNLfZDu9rls=
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10 h1:5oE2WzJE56/mVveuDZPJESKlg/00AaS2pY2QZcnxg4M=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10/go.mod h1:FHbKWQtRBYUz4vO5WBWjzMD2by126ny5y/1EoaWoLfI=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3YVNlkzkBrm9LfpaKoaYZUxIAj4sHfOTmLfqw=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 h1:L0ai8WICYHozIKK+OtPzVJBugL7culcuM4E4JOpIEm8=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10/go.mod h1:byqfyxJBshFk0fF9YmK0M0ugIO8OWjzH2T3bPG4eGuA=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 h1:DBYTXwIGQSGs9w4jKm60F5dmCQ3EEruxdc0MFh+3EY4=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10/go.mod h1:wohMUQiFdzo0NtxbBg0mSRGZ4vL3n0dKjLTINdcIino=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10 h1:KOxnQeWy5sXyS37fdKEvAsGHOr9fa/qvwxfJurR/BzE=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10/go.mod h1:jMx5INQFYFYB3lQD9W0D8Ohgq6Wnl7NYOJ2TQndbulI=
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1 h1:5XNlsBsEvBZBMO6p82y+sqpWg8j5aBCe+5C2GBFgqBQ=
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1/go.mod h1:4qXHrG1Ne3VGIMZPCB8OjH/pLFO94sKABIusjh0KWPU=
github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 h1:eajuO3nykDPdYicLlP3AGgOyVN3MOlFmZv7WGTuJPow=
github.com/aws/aws-sdk-go-v2/service/sso v1.18.7/go.mod h1:+mJNDdF+qiUlNKNC3fxn74WWNN+sOiGOEImje+3ScPM=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 h1:QPMJf+Jw8E1l7zqhZmMlFw6w1NmfkfiSK8mS4zOx3BA=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7/go.mod h1:ykf3COxYI0UJmxcfcxcVuz7b6uADi1FkiUz6Eb7AgM8=
github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 h1:NzO4Vrau795RkUdSHKEwiR01FaGzGOH1EETJ+5QHnm0=
github.com/aws/aws-sdk-go-v2/service/sts v1.26.7/go.mod h1:6h2YuIoxaMSCFf5fi1EgZAwdfkGMgDY+DVfa61uLe4U=
github.com/aws/smithy-go v1.19.0 h1:KWFKQV80DpP3vJrrA9sVAHQ5gc2z8i4EzrLhLlWXcBM=
github.com/aws/smithy-go v1.19.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE=
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI=
github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/bombsimon/wsl/v2 v2.0.0/go.mod h1:mf25kr/SqFEPhhcxW1+7pxzGlW+hIl/hYTKY95VwV8U=
github.com/bombsimon/wsl/v2 v2.2.0/go.mod h1:Azh8c3XGEJl9LyX0/sFC+CKMc7Ssgua0g+6abzXN4Pg=
github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk=
github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50=
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw=
github.com/campoy/embedmd v1.0.0 h1:V4kI2qTJJLf4J29RzI/MAt2c3Bl4dQSYPuflzwFH2hY=
github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8=
github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e/go.mod h1:9IOqJGCPMSc6E5ydlp5NIonxObaeu/Iub/X03EKPVYo=
github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e/go.mod h1:oDpT4efm8tSYHXV5tHSdRvBet/b/QzxZ+XyyPehvm3A=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/charmbracelet/bubbles v0.18.0 h1:PYv1A036luoBGroX6VWjQIE9Syf2Wby2oOl/39KLfy0=
github.com/charmbracelet/bubbles v0.18.0/go.mod h1:08qhZhtIwzgrtBjAcJnij1t1H0ZRjwHyGsy6AL11PSw=
github.com/charmbracelet/bubbletea v0.25.0 h1:bAfwk7jRz7FKFl9RzlIULPkStffg5k6pNt5dywy4TcM=
github.com/charmbracelet/bubbletea v0.25.0/go.mod h1:EN3QDR1T5ZdWmdfDzYcqOCAps45+QIJbLOBxmVNWNNg=
github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ=
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
github.com/charmbracelet/lipgloss v0.9.1 h1:PNyd3jvaJbg4jRHKWXnCj1akQm4rh8dbEzN1p/u1KWg=
github.com/charmbracelet/lipgloss v0.9.1/go.mod h1:1mPmG4cxScwUQALAAnacHaigiiHB9Pmr+v1VEawJl6I=
github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg=
github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY=
github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM=
github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo=
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/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE=
github.com/containerd/console v1.0.0/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE=
github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk=
github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.4.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.4.1-0.20201117152358-0edc412565dc/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0=
github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk=
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo=
github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8=
github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0=
github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY=
github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o=
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6 h1:MWwG/UOQv6J2hvRgKGduhJn5yKZPl4ly+PWMhfPnMzU=
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6/go.mod h1:gfcR4++fMRl37UvYy4Kw6JrQIra1bFFQVVtWEp1oon4=
github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU=
github.com/containerd/go-cni v1.1.9 h1:ORi7P1dYzCwVM6XPN4n3CbkuOx/NZ2DOqy+SHRdo9rU=
github.com/containerd/go-cni v1.1.9/go.mod h1:XYrZJ1d5W6E2VOvjffL3IZq0Dz6bsVlERHbekNK90PM=
github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0=
github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g=
github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok=
github.com/containerd/go-runc v1.1.0 h1:OX4f+/i2y5sUT7LhmcJH7GYrjjhHa1QI4e8yO0gGleA=
github.com/containerd/go-runc v1.1.0/go.mod h1:xJv2hFF7GvHtTJd9JqTS2UVxMkULUYw4JN5XAUZqH5U=
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/nydus-snapshotter v0.13.1 h1:5XNkCZ9ivLXCcyx3Jbbfh/fntkcls69uBg0x9VE8zlk=
github.com/containerd/nydus-snapshotter v0.13.1/go.mod h1:XWAz9ytsjBuKPVXDKP3xoMlcSKNsGnjXlEup6DuzUIo=
github.com/containerd/stargz-snapshotter v0.0.0-20201027054423-3a04e4c2c116/go.mod h1:o59b3PCKVAf9jjiKtCc/9hLAd+5p/rfhBfm6aBcTEr4=
github.com/containerd/stargz-snapshotter v0.15.1 h1:fpsP4kf/Z4n2EYnU0WT8ZCE3eiKDwikDhL6VwxIlgeA=
github.com/containerd/stargz-snapshotter v0.15.1/go.mod h1:74D+J1m1RMXytLmWxegXWhtOSRHPWZKpKc2NdK3S+us=
github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU=
github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk=
github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o=
github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y=
github.com/containerd/ttrpc v1.2.2 h1:9vqZr0pxwOF5koz6N0N3kJ0zDHokrcPxIR/ZR2YFtOs=
github.com/containerd/ttrpc v1.2.2/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak=
github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg=
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/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY=
github.com/containernetworking/cni v1.1.2 h1:wtRGZVv7olUHMOqouPpn3cXJWpJgM6+EUl31EQbXALQ=
github.com/containernetworking/cni v1.1.2/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw=
github.com/containernetworking/plugins v1.4.0 h1:+w22VPYgk7nQHw7KT92lsRmuToHvb7wwSv9iTbXzzic=
github.com/containernetworking/plugins v1.4.0/go.mod h1:UYhcOyjefnrQvKvmmyEKsUA+M9Nfn7tqULPpH0Pkcj0=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/go-systemd/v22 v22.4.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4=
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
github.com/dave/jennifer v1.7.0 h1:uRbSBH9UTS64yXbh4FrMHfgfY762RD+C7bUPKODpSJE=
github.com/dave/jennifer v1.7.0/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc=
github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/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/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/denisbrodbeck/machineid v1.0.1 h1:geKr9qtkB876mXguW2X6TU4ZynleN6ezuMSRhl4D7AQ=
github.com/denisbrodbeck/machineid v1.0.1/go.mod h1:dJUwb7PTidGDeYyUBmXZ2GphQBbjJCrnectwCyxcUSI=
github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0=
github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY=
github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g=
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
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/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c=
github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko=
github.com/docker/cli v0.0.0-20190925022749-754388324470/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v20.10.0-beta1.0.20201029214301-1d20b15adc38+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v25.0.1+incompatible h1:mFpqnrS6Hsm3v1k7Wa/BO23oz0k121MTbTO1lpcGSkU=
github.com/docker/cli v25.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY=
github.com/docker/distribution v2.6.0-rc.1.0.20180327202408-83389a148052+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v0.0.0-20200511152416-a93e9eb0e95c/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v1.4.2-0.20180531152204-71cd53e4a197/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v17.12.0-ce-rc1.0.20200730172259-9f28837c1d93+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v20.10.0-beta1.0.20201110211921-af34b94a78a1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v25.0.1+incompatible h1:k5TYd5rIVQRSqcTwCID+cyVA0yRg86+Pcrz1ls0/frA=
github.com/docker/docker v25.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y=
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8=
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA=
github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI=
github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=
github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw=
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/libnetwork v0.8.0-dev.2.0.20200917202933-d0951081b35f/go.mod h1:93m0aTqz6z+g32wla4l4WxTrdtvBRmVzYRkYvasA5Z8=
github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk=
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d h1:wi6jN5LVt/ljaBG4ue79Ekzb12QfJ52L9Q98tl8SWhw=
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4=
github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y=
github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM=
github.com/dschmidt/go-layerfs v0.1.0 h1:jE6aHDfjNzS/31DS48th6EkmELwTa1Uf+aO4jRkBs3U=
github.com/dschmidt/go-layerfs v0.1.0/go.mod h1:m62aff0hn23Q/tQBRiNSeLD7EUuimDvsuCvCpzBr3Gw=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU=
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA=
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776 h1:VRIbnDWRmAh5yBdz+J6yFMF5vso1It6vn+WmM/5l7MA=
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776/go.mod h1:9wvnDu3YOfxzWM9Cst40msBF1C2UdQgDv962oTxSuMs=
github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4=
github.com/go-critic/go-critic v0.4.1/go.mod h1:7/14rZGnZbY6E38VEGk2kVhoq6itzc1E68facVDK23g=
github.com/go-critic/go-critic v0.4.3/go.mod h1:j4O3D4RoIwRqlZw5jJpx0BNfXWWbpcJoKu5cYSe4YmQ=
github.com/go-fonts/liberation v0.3.1 h1:9RPT2NhUpxQ7ukUvz3jeUckmN42T9D9TpjtQcqK/ceM=
github.com/go-fonts/liberation v0.3.1/go.mod h1:jdJ+cqF+F4SUL2V+qxBth8fvBpBDS7yloUL5Fi8GTGY=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=
github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4=
github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9 h1:NxXI5pTAtpEaU49bpLpQoDsu1zrteW/vxzTz8Cd2UAs=
github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9/go.mod h1:gWuR/CrFDDeVRFQwHPvsv9soJVB/iqymhuZQuJ3a9OM=
github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-pdf/fpdf v0.8.0 h1:IJKpdaagnWUeSkUFUjTcSzTppFxmv8ucGQyNPQWxYOQ=
github.com/go-pdf/fpdf v0.8.0/go.mod h1:gfqhcNwXrsd3XYKte9a7vM3smvU/jB4ZRDrmWSxpfdc=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4=
github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ=
github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg=
github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw=
github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU=
github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk=
github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI=
github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks=
github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc=
github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8=
github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/flock v0.7.3/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU=
github.com/gogo/googleapis v1.3.2/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=
github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc=
github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs=
github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/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.1/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.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
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.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4=
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk=
github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0=
github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8=
github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o=
github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU=
github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU=
github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU=
github.com/golangci/golangci-lint v1.23.7/go.mod h1:g/38bxfhp4rI7zeWSxcdIeHTQGS58TCak8FYcyCmavQ=
github.com/golangci/golangci-lint v1.27.0/go.mod h1:+eZALfxIuthdrHPtfM7w/R3POJLjHDfJJw8XZl9xOng=
github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU=
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg=
github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o=
github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA=
github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA=
github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI=
github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4=
github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4=
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ=
github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/crfs v0.0.0-20191108021818-71d77da419c9/go.mod h1:etGhoOqfwPkooV6aqoX3eBGQOJblqdoc9XvWOeuxpPw=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/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.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/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.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
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-containerregistry v0.0.0-20191010200024-a3d713f9b7f8/go.mod h1:KyKXa9ciM8+lgMXwOVsXi7UxGrsf9mM61Mzs+xKUrKE=
github.com/google/go-containerregistry v0.1.2/go.mod h1:GPivBPgdAyd2SU+vf6EpsgOtWDuPqjW0hJZt4rNdTZ4=
github.com/google/go-containerregistry v0.15.2 h1:MMkSh+tjSdnmJZO7ljvEqV1DjfekB6VUEAZgy3a+TQE=
github.com/google/go-containerregistry v0.15.2/go.mod h1:wWK+LnOv4jXMM23IT/F1wdYftGWGr47Is8CG+pmHK1Q=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM=
github.com/google/go-github/v50 v50.2.0 h1:j2FyongEHlO9nxXLc+LP3wuBSVU9mVxfpdYUexMpIfk=
github.com/google/go-github/v50 v50.2.0/go.mod h1:VBY8FB6yPIjrtKhozXv4FQupxKLS6H4m6xFZlT43q8Q=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/go-replayers/grpcreplay v0.1.0/go.mod h1:8Ig2Idjpr6gifRd6pNVggX6TC1Zw6Jx74AKp7QNH2QE=
github.com/google/go-replayers/httpreplay v0.1.0/go.mod h1:YKZViNhiGgqdBlUbI2MwGpq4pXxNmhJLPHQ7cv2b5no=
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg=
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a h1:fEBsGL/sjAuJrgah5XqmmYsTLzJp/TO9Lhy39gkverk=
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/rpmpack v0.0.0-20191226140753-aa36bfddb3a0/go.mod h1:RaTPr0KUf2K7fnZYLNDrr8rxAamWs3iNywJLtQ2AzBg=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1/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.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/wire v0.3.0/go.mod h1:i1DMg/Lu8Sz5yYl25iOdmc5CT5qusaa+zmRWs16741s=
github.com/google/wire v0.4.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU=
github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM=
github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM=
github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c=
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
github.com/gookit/color v1.2.4/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg=
github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/goreleaser/goreleaser v0.136.0/go.mod h1:wiKrPUeSNh6Wu8nUHxZydSOVQ/OZvOaO7DTtFqie904=
github.com/goreleaser/nfpm v1.2.1/go.mod h1:TtWrABZozuLOttX2uDlYyECfQX7x5XYkVxhjYcR6G9w=
github.com/goreleaser/nfpm v1.3.0/go.mod h1:w0p7Kc9TAUgWMyrub63ex3M2Mgw88M4GZXoTq5UCb40=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.2/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y=
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw=
github.com/hanwen/go-fuse v1.0.0/go.mod h1:unqXarDXqzAk0rt98O2tVndEPIpUgLD9+rwFisZH3Ok=
github.com/hanwen/go-fuse/v2 v2.0.3/go.mod h1:0EQM6aH2ctVpvZ6a+onrQ/vaykxh2GH7hy3e13vzTUY=
github.com/hanwen/go-fuse/v2 v2.4.0 h1:12OhD7CkXXQdvxG2osIdBQLdXh+nmLXY9unkUIe/xaU=
github.com/hanwen/go-fuse/v2 v2.4.0/go.mod h1:xKwi1cF7nXAOBCXujD5ie0ZKsxc8GGSA1rlMJc+8IJs=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM=
github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/go-retryablehttp v0.6.4/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA=
github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru/v2 v2.0.3 h1:kmRrRLlInXvng0SmLxmQpQkpbYAvcXm7NPDrgxJa9mE=
github.com/hashicorp/golang-lru/v2 v2.0.3/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hashicorp/uuid v0.0.0-20160311170451-ebb0a03e909c/go.mod h1:fHzc09UnyJyqyW+bFuq864eh+wC7dj65aXmXLRe5to0=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/in-toto/in-toto-golang v0.5.0 h1:hb8bgwr0M2hGdDsLjkJ3ZqJ8JFLL/tgYdAxF/XEFBbY=
github.com/in-toto/in-toto-golang v0.5.0/go.mod h1:/Rq0IZHLV7Ku5gielPT4wPHJfH1GdHMCq8+WPxw8/BE=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg=
github.com/jackpal/gateway v1.0.7 h1:7tIFeCGmpyrMx9qvT0EgYUi7cxVW48a0mMvnIL17bPM=
github.com/jackpal/gateway v1.0.7/go.mod h1:aRcO0UFKt+MgIZmRmvOmnejdDT4Y1DNiNOsSd1AcIbA=
github.com/jaguilar/vt100 v0.0.0-20150826170717-2703a27b14ea/go.mod h1:QMdK4dGB3YhEW2BmA1wgGpPYI3HZy/5gD705PXKUVSg=
github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s=
github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0=
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0=
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/juju/ansiterm v1.0.0 h1:gmMvnZRq7JZJx6jkfSq9/+2LMrVEwGwt7UR6G+lmDEg=
github.com/juju/ansiterm v1.0.0/go.mod h1:PyXUpnI3olx3bsPcHt98FGPX/KCFZ1Fi+hw1XLI6384=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/lunixbochs/vtclean v1.0.0 h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+LVb8=
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs=
github.com/mackerelio/go-osstat v0.2.4/go.mod h1:Zy+qzGdZs3A9cuIqmgbJvwbmLQH9dJvtio5ZjJTbdlQ=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU=
github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.10/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo=
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY=
github.com/mazznoer/csscolorparser v0.1.3 h1:vug4zh6loQxAUxfU1DZEu70gTPufDPspamZlHAkKcxE=
github.com/mazznoer/csscolorparser v0.1.3/go.mod h1:Aj22+L/rYN/Y6bj3bYqO3N6g1dtdHtGfQ32xZ5PJQic=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk=
github.com/mitchellh/go-spdx v0.1.0 h1:50JnVzkL3kWreQ5Qb4Pi3Qx9e+bbYrt8QglJDpfeBEs=
github.com/mitchellh/go-spdx v0.1.0/go.mod h1:FFi4Cg1fBuN/JCtPtP8PEDmcBjvO3gijQVl28YjIBVQ=
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ=
github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=
github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A=
github.com/moby/buildkit v0.8.1/go.mod h1:/kyU1hKy/aYCuP39GZA9MaKioovHku57N6cqlKZIaiQ=
github.com/moby/buildkit v0.13.0-beta3 h1:eefOGE6SsWYHFfymc09Q7VU5i3L9vUs8ZCZVCDXWNOo=
github.com/moby/buildkit v0.13.0-beta3/go.mod h1:tSWWhq1EDM0eB3ngMNDiH2hOOW9fXTyn2uXuOraCLlE=
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
github.com/moby/sys/mount v0.1.0/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74=
github.com/moby/sys/mount v0.1.1/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74=
github.com/moby/sys/mount v0.3.3 h1:fX1SVkXFJ47XWDoeFW4Sq7PdQJnV2QIDZAqjNqgEjUs=
github.com/moby/sys/mount v0.3.3/go.mod h1:PBaEorSNTLG5t/+4EgukEQVlAvVEc6ZjTySwKdqp5K0=
github.com/moby/sys/mountinfo v0.1.0/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o=
github.com/moby/sys/mountinfo v0.1.3/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o=
github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A=
github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g=
github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
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/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2/go.mod h1:TjQg8pa4iejrUrjiz0MCtMV38jdMNW4doKSiBrEvCQQ=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c=
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
github.com/onsi/ginkgo/v2 v2.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs=
github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
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/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
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/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc10/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc92/go.mod h1:X1zlU4p7wOlX4+WRCz+hvlRv8phdL7UqbYD+vQwNMmE=
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 v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
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-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE=
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02/go.mod h1:JNdpVEzCpXBgIiv4ds+TzhN1hrtxq6ClLrTlT9OQRSc=
github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9/go.mod h1:PLldrQSroqzH70Xl+1DQcGnefIbqsKR7UDaiux3zV+w=
github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170 h1:DiLBVp4DAcZlBVBEtJpNWZpZVq0AEeCY7Hqk8URVs4o=
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170/go.mod h1:uQd4a7Rh3ZsVg5j0lNyAfyxIeGde9yrlhjF78GzeW0c=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/profile v1.5.0 h1:042Buzk+NhDI+DeSAA62RwJL8VAuZUMQZUjCsRz1Mug=
github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18=
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ=
github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=
github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY=
github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
github.com/prometheus/exporter-toolkit v0.8.2/go.mod h1:00shzmJL7KxcsabLWcONwpyNEuWhREOnFqZW7vadFS0=
github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e h1:51xcRlSMBU5rhM9KahnJGfEsBPVPz3182TgFRowA8yY=
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e/go.mod h1:tcaRap0jS3eifrEEllL6ZMd9dg8IlDpi2S1oARrQ+NI=
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
github.com/quasilyte/go-ruleguard v0.1.2-0.20200318202121-b00d7a75d3d8/go.mod h1:CGFX09Ci3pq9QZdj86B+VGIdNj4VyCo2iPOGS9esB/k=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.6 h1:Sovz9sDSwbOz9tgUy8JpT+KgCkPYJEN/oYzlJiYTNLg=
github.com/rivo/uniseg v0.4.6/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rs/cors v1.10.0 h1:62NOS1h+r8p1mW6FM0FSB0exioXLhd/sh15KpjWBZ+8=
github.com/rs/cors v1.10.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A=
github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryancurrah/gomodguard v1.0.4/go.mod h1:9T/Cfuxs5StfsocWr4WzDL36HqnX0fVb9d5fSEaLhoE=
github.com/ryancurrah/gomodguard v1.1.0/go.mod h1:4O8tr7hBODaGE6VIhfJDHcwzh5GUccKSJBU0UMXJFVM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/samber/slog-common v0.14.0 h1:g4TGALXmqogbJu3epRhjIWUJKSpgqB9VyN2OEnS8Wyg=
github.com/samber/slog-common v0.14.0/go.mod h1:Qjrfhwk79XiCIhBj8+jTq1Cr0u9rlWbjawh3dWXzaHk=
github.com/samber/slog-logrus/v2 v2.2.0 h1:Noku55MKf/x57c2j5/LsLzw75biW86Q29bOkZpnLAgY=
github.com/samber/slog-logrus/v2 v2.2.0/go.mod h1:C0egl62QrwHPY9RcsEXa3E7FHb6/xM9uaVSuc7piJXU=
github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b/go.mod h1:am+Fp8Bt506lA3Rk3QCmSqmYmLMnPDhdDUcosQCAx+I=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624Y=
github.com/sebdah/goldie/v2 v2.5.3/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI=
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
github.com/secure-systems-lab/go-securesystemslib v0.4.0/go.mod h1:FGBZgq2tXWICsxWQW1msNf49F0Pf2Op5Htayx335Qbs=
github.com/securego/gosec v0.0.0-20200103095621-79fbf3af8d83/go.mod h1:vvbZ2Ae7AzSq3/kywjUDxSNq2SJ27RxCz2un0H3ePqE=
github.com/securego/gosec v0.0.0-20200401082031-e946c8c39989/go.mod h1:i9l/TNj+yDFh9SZXUTvspXTjbFXgZGP/UvhU1S65A4A=
github.com/securego/gosec/v2 v2.3.0/go.mod h1:UzeVyUXbxukhLeHKV3VVqo7HdoQR9MrRfFmZYotn8ME=
github.com/sercand/kuberesolver v2.4.0+incompatible/go.mod h1:lWF3GL0xptCB/vCiJPl/ZshwPsX/n4Y7u0CW9E7aQIQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc=
github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI=
github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE=
github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ=
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 h1:B1PEwpArrNp4dkQrfxh/abbBAOZBVp0ds+fBEOUOqOc=
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29/go.mod h1:AuYgA5Kyo4c7HfUmvRGs/6rGlMMV/6B1bVnB9JxJEEg=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
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/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ=
github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/sosodev/duration v1.1.0 h1:kQcaiGbJaIsRqgQy7VGlZrVw1giWO+lDoX3MCPnpVO4=
github.com/sosodev/duration v1.1.0/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE=
github.com/sourcegraph/go-diff v0.5.3/go.mod h1:v9JDtjCE4HHHCZGId75rg8gkKKa98RVjBcBGsVmMmak=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb/go.mod h1:uKWaldnbMnjsSAXRurWqqrdyZen1R7kxl8TkmWk2OyM=
github.com/spdx/tools-golang v0.5.1 h1:fJg3SVOGG+eIva9ZUBm/hvyA7PIPVFjRxUKe6fdAgwE=
github.com/spdx/tools-golang v0.5.1/go.mod h1:/DRDQuBfB37HctM29YtrX1v+bXiVmT2OpQDalRmX9aU=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
github.com/tetafro/godot v0.3.7/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
github.com/tetafro/godot v0.4.2/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM=
github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0=
github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0=
github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao=
github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig=
github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig=
github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85/go.mod h1:a7cilN64dG941IOXfhJhlH0qB92hxJ9A1ewrdUmJ6xo=
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302 h1:ZT8ibgassurSISJ1Pj26NsM3vY2jxFZn63Nd/TpHmRw=
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302/go.mod h1:9kMVqMyQ/Sx2df5LtnGG+nbrmiZzCS7V6gjW3oGHsvI=
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 h1:8eY6m1mjgyB8XySUR7WvebTM8D/Vs86jLJzD/Tw7zkc=
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7/go.mod h1:qqvyZqkfwkoJuPU/bw61bItaoO0SJ8YSW0vSVRRvsRg=
github.com/tonistiigi/go-archvariant v1.0.0 h1:5LC1eDWiBNflnTF1prCiX09yfNHIxDC/aukdhCdTyb0=
github.com/tonistiigi/go-archvariant v1.0.0/go.mod h1:TxFmO5VS6vMq2kvs3ht04iPXtu2rUT/erOnGFYfk5Ho=
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/v/cCndK0AMpt1wiVFb/YYmqB3/QG0=
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk=
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 h1:Y/M5lygoNPKwVNLMPXgVfsRT40CSFKXCxuU8LoHySjs=
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc=
github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-client-go v2.28.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA=
github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA=
github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk=
github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA=
github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s=
github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4=
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts=
github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk=
github.com/vdemeester/k8s-pkg-credentialprovider v1.17.4/go.mod h1:inCTmtUdr5KJbreVojo06krnTgaeAz/Z7lynpPk/Q2c=
github.com/vektah/gqlparser/v2 v2.5.10 h1:6zSM4azXC9u4Nxy5YmdmGu4uKamfwsdKTwp5zsEealU=
github.com/vektah/gqlparser/v2 v2.5.10/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netlink v1.2.1-beta.2 h1:Llsql0lnQEbHj0I1OuKyp8otXp0r3q0mPkuhwHfStVs=
github.com/vishvananda/netlink v1.2.1-beta.2/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
github.com/vito/midterm v0.1.4 h1:SALq5mQ+AgzeZxjL4loB6Uk5TZc9JMyX2ELA/NVH65c=
github.com/vito/midterm v0.1.4/go.mod h1:Mm3u6lrpzo2EFSJbwksKOdottTJzYePK8c1KJy4aRbk=
github.com/vito/progrock v0.10.2-0.20240119030128-52ef9ee1a291 h1:VcLECqiOXx4PTEzsV0QlWVubUeE+k0ZclAlKpUuejo8=
github.com/vito/progrock v0.10.2-0.20240119030128-52ef9ee1a291/go.mod h1:Q8hxIUXZW8vkezLwH4TnRmXv+XdRb4KfLtS9t5RtH9g=
github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU=
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63 h1:qZcnPZbiX8gGs3VmipVc3ft29vPYBZzlox/04Von6+k=
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63/go.mod h1:KoQ+3z63GUJzQ7AhU0AWQNU+LPda2EwL/cx1PlbDzVQ=
github.com/weaveworks/promrus v1.2.0 h1:jOLf6pe6/vss4qGHjXmGz4oDJQA+AOCqEL3FvvZGz7M=
github.com/weaveworks/promrus v1.2.0/go.mod h1:SaE82+OJ91yqjrE1rsvBWVzNZKcHYFtMUyS1+Ogs/KA=
github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xanzy/go-gitlab v0.32.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/goldmark v1.6.0 h1:boZcn2GTjpsynOsC0iJHnBWa4Bi0qzfJjthwauItG68=
github.com/yuin/goldmark v1.6.0/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs=
github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA=
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg=
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
github.com/zmb3/spotify/v2 v2.3.1 h1:aEyIPotROM3JJjHMCImFROgnPIUpzVo8wymYSaPSd9w=
github.com/zmb3/spotify/v2 v2.3.1/go.mod h1:+LVh9CafHu7SedyqYmEf12Rd01dIVlEL845yNhksW0E=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A=
go.opencensus.io v0.19.2/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0 h1:2ea0IkZBsWH+HA2GkD+7+hRw2u97jzdFyRtXuO14a1s=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0/go.mod h1:4m3RnBBb+7dB9d21y510oO1pdB1V4J6smNf14WXcBFQ=
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/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc=
go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo=
go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4=
go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0 h1:ZtfnDL+tUrs1F0Pzfwbg2d59Gru9NCH3bgSHBM6LDwU=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0/go.mod h1:hG4Fj/y8TR/tlEDREo8tWstl9fO9gcFkn4xrx0Io8xU=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.42.0 h1:NmnYCiR0qNufkldjVvyQfZTHSdzeHoZ41zggMsdMcLM=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.42.0/go.mod h1:UVAO61+umUsHLtYb8KXXRoHtxUkdOPkYidzW3gipRLQ=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0 h1:wNMDy/LVGLj2h3p6zg4d0gypKfWKSWI14E1C4smOgl8=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0/go.mod h1:YfbDdXAAkemWJK3H/DshvlrxqFB2rtW4rY6ky/3x/H0=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU=
go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA=
go.opentelemetry.io/otel/exporters/prometheus v0.42.0/go.mod h1:f3bYiqNqhoPxkvI2LrXqQVC546K7BuRDL/kKuxkujhA=
go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4=
go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM=
go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8=
go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E=
go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k=
go.opentelemetry.io/otel/sdk/metric v1.19.0/go.mod h1:XjG0jQyFJrv2PbMvwND7LwCEhsJzCzV5210euduKcKY=
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.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
gocloud.dev v0.19.0/go.mod h1:SmKwiR8YwIMMJvQBKLsC3fHNyMwXLw3PMDO+VVteJMI=
golang.org/x/build v0.0.0-20190314133821-5284462c4bec/go.mod h1:atTaCNAy0f16Ah5aV1gMSwgiKVHwu/JncqDpuRr7lS4=
golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4=
golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20170114055629-f2499483f923/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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/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-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=
golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o=
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
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/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190620070143-6f217b454f45/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191115151921-52ab43148777/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-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200917073148-efd3b9a0ff20/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/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-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/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-20220610221304-9f5ed59c137d/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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE=
golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/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.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113232020-e2727e816f5a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200102140908-9497f49d5709/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200204192400-7124308813f3/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200331202046-9d5940d49312/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc=
golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0=
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ=
gonum.org/v1/plot v0.14.0 h1:+LBDVFYwFe4LHhdP8coW6296MBEY4nQ+Y4vuUpJopcE=
gonum.org/v1/plot v0.14.0/go.mod h1:MLdR9424SJed+5VqC6MsouEpig9pZX2VZ57H9ko2bXU=
google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181220000619-583d854617af/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.2.0/go.mod h1:IfRCZScioGtypHNTlz3gFk67J8uePVW7uDTBzXuIkhU=
google.golang.org/api v0.3.0/go.mod h1:IuvZyQh8jgscv8qWfQ4ABd8m7hEudgBFM/EdhA3BnXw=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4=
google.golang.org/api v0.6.1-0.20190607001116-5213b8090861/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo=
google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4=
google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw=
google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU=
google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k=
google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI=
google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I=
google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo=
google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g=
google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA=
google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8=
google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs=
google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA=
google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw=
google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg=
google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.3.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/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A=
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24=
google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w=
google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ=
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY=
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo=
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.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.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20180904230853-4e7be11eab3f/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
k8s.io/api v0.17.4/go.mod h1:5qxx6vjmwUVG2nHQTKGlLts8Tbok8PzHl4vHtVFuZCA=
k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw=
k8s.io/apimachinery v0.0.0-20180904193909-def12e63c512/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=
k8s.io/apimachinery v0.17.4/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0g=
k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA=
k8s.io/apiserver v0.17.4/go.mod h1:5ZDQ6Xr5MNBxyi3iUZXS84QOhZl+W7Oq2us/29c0j9I=
k8s.io/client-go v0.0.0-20180910083459-2cefa64ff137/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s=
k8s.io/client-go v0.17.4/go.mod h1:ouF6o5pz3is8qU0/qYL2RnoxOPqgfuidYLowytyLJmc=
k8s.io/client-go v0.19.0/go.mod h1:H9E/VT95blcFQnlyShFgnFT9ZnJOAceiUHM3MlRC+mU=
k8s.io/cloud-provider v0.17.4/go.mod h1:XEjKDzfD+b9MTLXQFlDGkk6Ho8SGMpaU8Uugx/KNK9U=
k8s.io/code-generator v0.17.2/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s=
k8s.io/component-base v0.17.4/go.mod h1:5BRqHMbbQPm2kKu35v3G+CpVq4K0RJKC7TRioF0I9lE=
k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM=
k8s.io/csi-translation-lib v0.17.4/go.mod h1:CsxmjwxEI0tTNMzffIAcgR9lX4wOh6AKHdxQrT7L0oo=
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc=
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o=
k8s.io/kubernetes v1.11.10/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/legacy-cloud-providers v0.17.4/go.mod h1:FikRNoD64ECjkxO36gkDgJeiQWwyZTuBkhu+yxOc1Js=
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
kernel.org/pub/linux/libs/security/libcap/cap v1.2.67 h1:sPQ9qlSNR26fToTKbxe/HDWJlXvBLqGmt84LGCQkOy0=
kernel.org/pub/linux/libs/security/libcap/cap v1.2.67/go.mod h1:GkntoBuwffz19qtdFVB+k2NtWNN+yCKnC/Ykv/hMiTU=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.67 h1:NxbXJ7pDVq0FKBsqjieT92QDXI2XaqH2HAi4QcCOHt8=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.67/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24=
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw=
mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7/go.mod h1:HGC5lll35J70Y5v7vCGb9oLhHoScFwkHDJm/05RdSTc=
oss.terrastruct.com/d2 v0.6.1 h1:TEk7pl5yS1cnUxHOsIQ7bZCs+iRGsb5FaofaianfZk8=
oss.terrastruct.com/d2 v0.6.1/go.mod h1:ZyzsiefzsZ3w/BDnfF/hcDx9LKBlgieuolX8pXi7oJY=
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2 h1:n6y6RoZCgZDchN4gLGlzNRO1Jdf9xOGGqohDBph5BG8=
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2/go.mod h1:eMWv0sOtD9T2RUl90DLWfuShZCYp4NrsqNpI8eqO6U4=
pack.ag/amqp v0.11.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
sourcegraph.com/sqs/pbtypes v1.0.0/go.mod h1:3AciMUv4qUuRHRHhOG4TZOB+72GdPVz5k+c648qsFS4=
|
closed | dagger/dagger | https://github.com/dagger/dagger | 150 | Rename dagger.#Exec: "dir" to "workdir" | I find `dagger.#Exec: dir` to be confusing. It's not explicitly that it sets the working directory for the command. I would rename it to `workdir` instead.
| https://github.com/dagger/dagger/issues/150 | https://github.com/dagger/dagger/pull/6568 | 01268a5fe62067f7d5dddfb5f5d90ecf4909eac4 | e06291a14e7f694ea2b04c1e30c41ebe751f8f21 | "2021-03-03T03:18:38Z" | go | "2024-02-06T12:01:00Z" | internal/mage/go.mod | module github.com/dagger/dagger/internal/mage
go 1.21.3
require (
dagger.io/dagger v0.9.8
github.com/dagger/dagger v0.9.8
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/hexops/gotextdiff v1.0.3
github.com/magefile/mage v1.15.0
github.com/moby/buildkit v0.13.0-beta3
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/mod v0.14.0
golang.org/x/sync v0.6.0
)
require (
github.com/99designs/gqlgen v0.17.41 // indirect
github.com/Khan/genqlient v0.6.0 // indirect
github.com/adrg/xdg v0.4.0 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sosodev/duration v1.1.0 // indirect
github.com/vektah/gqlparser/v2 v2.5.10 // indirect
golang.org/x/sys v0.16.0 // indirect
)
replace github.com/dagger/dagger => ../../
|
closed | dagger/dagger | https://github.com/dagger/dagger | 150 | Rename dagger.#Exec: "dir" to "workdir" | I find `dagger.#Exec: dir` to be confusing. It's not explicitly that it sets the working directory for the command. I would rename it to `workdir` instead.
| https://github.com/dagger/dagger/issues/150 | https://github.com/dagger/dagger/pull/6568 | 01268a5fe62067f7d5dddfb5f5d90ecf4909eac4 | e06291a14e7f694ea2b04c1e30c41ebe751f8f21 | "2021-03-03T03:18:38Z" | go | "2024-02-06T12:01:00Z" | internal/mage/go.sum | dagger.io/dagger v0.9.8 h1:f8bzcI9pHoWsnBlm/d+PXneXINSUEAQ5K3/Kc/PuJYw=
dagger.io/dagger v0.9.8/go.mod h1:aq9P87v4apEOXKPXzn35uK+by5dUplSU5ZeXm+E8Sgw=
github.com/99designs/gqlgen v0.17.41 h1:C1/zYMhGVP5TWNCNpmZ9Mb6CqT1Vr5SHEWoTOEJ3v3I=
github.com/99designs/gqlgen v0.17.41/go.mod h1:GQ6SyMhwFbgHR0a8r2Wn8fYgEwPxxmndLFPhU63+cJE=
github.com/Khan/genqlient v0.6.0 h1:Bwb1170ekuNIVIwTJEqvO8y7RxBxXu639VJOkKSrwAk=
github.com/Khan/genqlient v0.6.0/go.mod h1:rvChwWVTqXhiapdhLDV4bp9tz/Xvtewwkon4DpWWCRM=
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
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/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg=
github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/moby/buildkit v0.13.0-beta3 h1:eefOGE6SsWYHFfymc09Q7VU5i3L9vUs8ZCZVCDXWNOo=
github.com/moby/buildkit v0.13.0-beta3/go.mod h1:tSWWhq1EDM0eB3ngMNDiH2hOOW9fXTyn2uXuOraCLlE=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/sosodev/duration v1.1.0 h1:kQcaiGbJaIsRqgQy7VGlZrVw1giWO+lDoX3MCPnpVO4=
github.com/sosodev/duration v1.1.0/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/vektah/gqlparser/v2 v2.5.10 h1:6zSM4azXC9u4Nxy5YmdmGu4uKamfwsdKTwp5zsEealU=
github.com/vektah/gqlparser/v2 v2.5.10/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
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/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
closed | dagger/dagger | https://github.com/dagger/dagger | 1,764 | `dagger do --help`: "failed to load plan" with no detail | When calling `dagger do --help` against an invalid plan, the error "failed to load plan" is printed, without details. This makes it difficult to fix the issue with the plan. | https://github.com/dagger/dagger/issues/1764 | https://github.com/dagger/dagger/pull/6569 | e06291a14e7f694ea2b04c1e30c41ebe751f8f21 | 806d6580e5158cad92ea4dcf23c966b225402374 | "2022-03-10T22:19:53Z" | go | "2024-02-06T12:01:33Z" | go.mod | module github.com/dagger/dagger
go 1.21
replace dagger.io/dagger => ./sdk/go
require (
dagger.io/dagger v0.9.7
github.com/99designs/gqlgen v0.17.41
github.com/Khan/genqlient v0.6.0
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2
github.com/adrg/xdg v0.4.0
github.com/blang/semver v3.5.1+incompatible
github.com/cenkalti/backoff/v4 v4.2.1
github.com/charmbracelet/bubbles v0.18.0
github.com/charmbracelet/bubbletea v0.25.0
github.com/charmbracelet/lipgloss v0.9.1
github.com/containerd/containerd v1.7.12
github.com/containerd/continuity v0.4.3
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6
github.com/containerd/stargz-snapshotter v0.15.1
github.com/containernetworking/cni v1.1.2
github.com/coreos/go-systemd/v22 v22.5.0
github.com/creack/pty v1.1.18
github.com/dave/jennifer v1.7.0
github.com/docker/cli v25.0.1+incompatible
github.com/docker/distribution v2.8.2+incompatible
github.com/docker/docker v25.0.1+incompatible
github.com/dschmidt/go-layerfs v0.1.0
github.com/go-git/go-git/v5 v5.11.0
github.com/gofrs/flock v0.8.1
github.com/gogo/protobuf v1.3.2
github.com/google/go-containerregistry v0.15.2
github.com/google/go-github/v50 v50.2.0
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/google/uuid v1.6.0
github.com/gorilla/websocket v1.5.0
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/iancoleman/strcase v0.3.0
github.com/jackpal/gateway v1.0.7
github.com/juju/ansiterm v1.0.0
github.com/klauspost/compress v1.17.4
github.com/mackerelio/go-osstat v0.2.4
github.com/mattn/go-isatty v0.0.20
github.com/mitchellh/go-spdx v0.1.0
github.com/moby/buildkit v0.13.0-beta3 // https://github.com/moby/buildkit/commit/1981eb123dc979fc71d097adeb5bbb84110aa9f4
github.com/moby/locker v1.0.1
github.com/moby/patternmatcher v0.6.0
github.com/moby/sys/mount v0.3.3
github.com/muesli/termenv v0.15.2
github.com/nxadm/tail v1.4.8
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.0-rc5
github.com/opencontainers/runc v1.1.12
github.com/opencontainers/runtime-spec v1.1.0
github.com/pelletier/go-toml v1.9.5
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/pkg/errors v0.9.1
github.com/prometheus/procfs v0.12.0
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e
github.com/rs/cors v1.10.0
github.com/rs/zerolog v1.31.0
github.com/samber/slog-logrus/v2 v2.2.0
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29
github.com/sirupsen/logrus v1.9.3
github.com/sourcegraph/conc v0.3.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
github.com/tidwall/gjson v1.17.0
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea
github.com/urfave/cli v1.22.14
github.com/vektah/gqlparser/v2 v2.5.10
github.com/vito/midterm v0.1.4
github.com/vito/progrock v0.10.2-0.20240119030128-52ef9ee1a291
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63
github.com/zeebo/xxh3 v1.0.2
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/exporters/jaeger v1.17.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
go.opentelemetry.io/otel/sdk v1.21.0
go.opentelemetry.io/otel/trace v1.21.0
go.opentelemetry.io/proto/otlp v1.0.0
golang.org/x/crypto v0.18.0
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/mod v0.14.0
golang.org/x/net v0.20.0
golang.org/x/oauth2 v0.16.0
golang.org/x/sync v0.6.0
golang.org/x/sys v0.16.0
golang.org/x/term v0.16.0
golang.org/x/text v0.14.0
golang.org/x/tools v0.17.0
google.golang.org/grpc v1.61.0
google.golang.org/protobuf v1.32.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools/v3 v3.5.1
oss.terrastruct.com/d2 v0.6.1
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2
)
require github.com/muesli/reflow v0.3.0
require (
cdr.dev/slog v1.4.2 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.11.4 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/PuerkitoBio/goquery v1.8.1 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/alecthomas/chroma v0.10.0 // indirect
github.com/alecthomas/chroma/v2 v2.11.1 // indirect
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 // indirect
github.com/aws/aws-sdk-go-v2 v1.24.1 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 // indirect
github.com/aws/aws-sdk-go-v2/config v1.26.6 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.16.16 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 // indirect
github.com/aws/smithy-go v1.19.0 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/charmbracelet/harmonica v0.2.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/containerd/fifo v1.1.0 // indirect
github.com/containerd/go-cni v1.1.9 // indirect
github.com/containerd/go-runc v1.1.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/nydus-snapshotter v0.13.1 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/containerd/ttrpc v1.2.2 // indirect
github.com/containerd/typeurl/v2 v2.1.1 // indirect
github.com/containernetworking/plugins v1.4.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denisbrodbeck/machineid v1.0.1 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/docker/docker-credential-helpers v0.8.0 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect
github.com/hanwen/go-fuse/v2 v2.4.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.3 // indirect
github.com/in-toto/in-toto-golang v0.5.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jonboulle/clockwork v0.4.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/lunixbochs/vtclean v1.0.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mazznoer/csscolorparser v0.1.3 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/sys/mountinfo v0.7.1 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/signal v0.7.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/opencontainers/selinux v1.11.0 // indirect
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/profile v1.5.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/rivo/uniseg v0.4.6 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/samber/lo v1.38.1 // indirect
github.com/samber/slog-common v0.14.0 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.4.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/shibumi/go-pathspec v1.3.0 // indirect
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/sosodev/duration v1.1.0 // indirect
github.com/spdx/tools-golang v0.5.1 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 // indirect
github.com/tonistiigi/go-archvariant v1.0.0 // indirect
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/vishvananda/netlink v1.2.1-beta.2 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/weaveworks/promrus v1.2.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/yuin/goldmark v1.6.0 // indirect
github.com/zmb3/spotify/v2 v2.3.1 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.42.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.19.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/image v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gonum.org/v1/plot v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
|
closed | dagger/dagger | https://github.com/dagger/dagger | 1,764 | `dagger do --help`: "failed to load plan" with no detail | When calling `dagger do --help` against an invalid plan, the error "failed to load plan" is printed, without details. This makes it difficult to fix the issue with the plan. | https://github.com/dagger/dagger/issues/1764 | https://github.com/dagger/dagger/pull/6569 | e06291a14e7f694ea2b04c1e30c41ebe751f8f21 | 806d6580e5158cad92ea4dcf23c966b225402374 | "2022-03-10T22:19:53Z" | go | "2024-02-06T12:01:33Z" | go.sum | bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
bazil.org/fuse v0.0.0-20180421153158-65cc252bf669/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
cdr.dev/slog v1.4.2 h1:fIfiqASYQFJBZiASwL825atyzeA96NsqSxx2aL61P8I=
cdr.dev/slog v1.4.2/go.mod h1:0EkH+GkFNxizNR+GAXUEdUHanxUH5t9zqPILmPM/Vn8=
cloud.google.com/go v0.25.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.37.2/go.mod h1:H8IAquKe2L30IxoupDgqTaQvKSwF/c8prYHynGIWQbA=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw=
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY=
cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM=
cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY=
cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ=
cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI=
cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4=
cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA=
cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A=
cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc=
cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow=
cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM=
cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M=
cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s=
cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU=
cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U=
cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk=
cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY=
cloud.google.com/go/logging v1.8.1 h1:26skQWPeYhvIasWKm48+Eq7oUqdcdbwsCVwz5Ys0FvU=
cloud.google.com/go/logging v1.8.1/go.mod h1:TJjR+SimHwuC8MZ9cjByQulAMgni+RkXeI3wwctHJEI=
cloud.google.com/go/longrunning v0.5.4 h1:w8xEcbZodnA2BbW6sVirkkoC+1gP8wS57EUUgGS0GVg=
cloud.google.com/go/longrunning v0.5.4/go.mod h1:zqNVncI0BOP8ST6XQD1+VcvuShMmq7+xFSzOL++V0dI=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
code.gitea.io/sdk/gitea v0.12.0/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY=
contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA=
contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0=
contrib.go.opencensus.io/exporter/stackdriver v0.12.1/go.mod h1:iwB6wGarfphGGe/e5CWqyUk/cLzKnWsOKPVW3no6OTw=
contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE=
contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA=
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
git.sr.ht/~sbinet/gg v0.5.0 h1:6V43j30HM623V329xA9Ntq+WJrMjDxRjuAB1LFWF5m8=
git.sr.ht/~sbinet/gg v0.5.0/go.mod h1:G2C0eRESqlKhS7ErsNey6HHrqU1PwsnCQlekFi9Q2Oo=
github.com/99designs/gqlgen v0.17.41 h1:C1/zYMhGVP5TWNCNpmZ9Mb6CqT1Vr5SHEWoTOEJ3v3I=
github.com/99designs/gqlgen v0.17.41/go.mod h1:GQ6SyMhwFbgHR0a8r2Wn8fYgEwPxxmndLFPhU63+cJE=
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/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/AkihiroSuda/containerd-fuse-overlayfs v1.0.0/go.mod h1:0mMDvQFeLbbn1Wy8P2j3hwFhqBq+FKn8OZPno8WLmp8=
github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU=
github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4=
github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc=
github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v19.1.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v29.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v38.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 h1:Ut0ZGdOwJDw0npYEg+TLlPls3Pq6JiZaP2/aGKir7Zw=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1 h1:QSdcrd/UFJv6Bp/CfoVf2SrENpFn9P6Yh8yb+xNhYMM=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1/go.mod h1:eZ4g6GUvXiGulfIbbhh1Xr4XwUYaYaWMqzGD/284wCA=
github.com/Azure/azure-service-bus-go v0.9.1/go.mod h1:yzBx6/BUGfjfeqbRZny9AQIbIe3AcV9WZbAdpkoXOa0=
github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v10.15.5+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v12.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v14.1.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0=
github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630=
github.com/Azure/go-autorest/autorest v0.10.2/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630=
github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc=
github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM=
github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw=
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g=
github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM=
github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc=
github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA=
github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8=
github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI=
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0 h1:XMEdVDFxgulDDl0lQmAZS6j8gRQ/0pJ+ZpXH2FHVtDc=
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/Djarvur/go-err113 v0.1.0/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20191009163259-e802c2cb94ae/go.mod h1:mjwGPas4yKduTyubHvD1Atl9r1rUq8DfVy+gkVvZ+oo=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14=
github.com/Khan/genqlient v0.6.0 h1:Bwb1170ekuNIVIwTJEqvO8y7RxBxXu639VJOkKSrwAk=
github.com/Khan/genqlient v0.6.0/go.mod h1:rvChwWVTqXhiapdhLDV4bp9tz/Xvtewwkon4DpWWCRM=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Masterminds/semver/v3 v3.1.0 h1:Y2lUDsFKVRSYGojLJ1yLxSXdMmMYTYls0rCvoqmMUQk=
github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.4.15-0.20200908182639-5b44b70ab3ab/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.4.15/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
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/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ=
github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8=
github.com/Microsoft/hcsshim v0.8.10/go.mod h1:g5uw8EV2mAlzqe94tfNBNdr89fnbD/n3HV0OhsddkmM=
github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8=
github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w=
github.com/Microsoft/hcsshim/test v0.0.0-20200826032352-301c83a30e7c/go.mod h1:30A5igQ91GEmhYJF8TaRP79pMBOYynRsyOByfVV0dU4=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM=
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg=
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E=
github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo=
github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8=
github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo=
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw=
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM=
github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink=
github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek=
github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s=
github.com/alecthomas/chroma/v2 v2.11.1 h1:m9uUtgcdAwgfFNxuqj7AIG75jD2YmL61BBIJWtdzJPs=
github.com/alecthomas/chroma/v2 v2.11.1/go.mod h1:4TQu7gdfuPjSh76j78ietmqh9LiurGF0EpseFXdKMBw=
github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE=
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 h1:aM1rlcoLz8y5B2r4tTLMiVTrMtpfY0O8EScKJxaSaEc=
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apex/log v1.1.4/go.mod h1:AlpoD9aScyQfJDVHmLMEcx4oU6LqzkWp4Mg9GdAcEvQ=
github.com/apex/log v1.3.0/go.mod h1:jd8Vpsr46WAe3EZSQ/IUMs2qQD/GOycT5rPWCO1yGcs=
github.com/apex/logs v0.0.4/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo=
github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE=
github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs=
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.15.90/go.mod h1:es1KtYUFs7le0xQ3rOihkuoVD90z7D0fR2Qm4S00/gU=
github.com/aws/aws-sdk-go v1.16.26/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.19.18/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.19.45/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.20.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.25.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go-v2 v1.24.1 h1:xAojnj+ktS95YZlDf0zxWBkbFtymPeDP+rvUQIH3uAU=
github.com/aws/aws-sdk-go-v2 v1.24.1/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 h1:OCs21ST2LrepDfD3lwlQiOqIGp6JiEUqG84GzTDoyJs=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4/go.mod h1:usURWEKSNNAcAZuzRn/9ZYPT8aZQkR7xcCtunK/LkJo=
github.com/aws/aws-sdk-go-v2/config v1.26.6 h1:Z/7w9bUqlRI0FFQpetVuFYEsjzE3h7fpU6HuGmfPL/o=
github.com/aws/aws-sdk-go-v2/config v1.26.6/go.mod h1:uKU6cnDmYCvJ+pxO9S4cWDb2yWWIH5hra+32hVh1MI4=
github.com/aws/aws-sdk-go-v2/credentials v1.16.16 h1:8q6Rliyv0aUFAVtzaldUEcS+T5gbadPbWdV1WcAddK8=
github.com/aws/aws-sdk-go-v2/credentials v1.16.16/go.mod h1:UHVZrdUsv63hPXFo1H7c5fEneoVo9UXiz36QG1GEPi0=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 h1:c5I5iH+DZcH3xOIMlz3/tCKJDaHFwYEmxvlh2fAcFo8=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11/go.mod h1:cRrYDYAMUohBJUtUnOhydaMHtiK/1NZ0Otc9lIb6O0Y=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.15 h1:2MUXyGW6dVaQz6aqycpbdLIH1NMcUI6kW6vQ0RabGYg=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.15/go.mod h1:aHbhbR6WEQgHAiRj41EQ2W47yOYwNtIkWTXmcAtYqj8=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 h1:vF+Zgd9s+H4vOXd5BMaPWykta2a6Ih0AKLq/X6NYKn4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10/go.mod h1:6BkRjejp/GR4411UGqkX8+wFMbFbqsUIimfK4XjOKR4=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 h1:nYPe006ktcqUji8S2mqXf9c/7NdiKriOwMvWQHgYztw=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10/go.mod h1:6UV4SZkVvmODfXKql4LCbaZUpF7HO2BX38FgBf9ZOLw=
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3 h1:n3GDfwqF2tzEkXlv5cuy4iy7LpKDtqDMcNLfZDu9rls=
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10 h1:5oE2WzJE56/mVveuDZPJESKlg/00AaS2pY2QZcnxg4M=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10/go.mod h1:FHbKWQtRBYUz4vO5WBWjzMD2by126ny5y/1EoaWoLfI=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3YVNlkzkBrm9LfpaKoaYZUxIAj4sHfOTmLfqw=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 h1:L0ai8WICYHozIKK+OtPzVJBugL7culcuM4E4JOpIEm8=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10/go.mod h1:byqfyxJBshFk0fF9YmK0M0ugIO8OWjzH2T3bPG4eGuA=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 h1:DBYTXwIGQSGs9w4jKm60F5dmCQ3EEruxdc0MFh+3EY4=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10/go.mod h1:wohMUQiFdzo0NtxbBg0mSRGZ4vL3n0dKjLTINdcIino=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10 h1:KOxnQeWy5sXyS37fdKEvAsGHOr9fa/qvwxfJurR/BzE=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10/go.mod h1:jMx5INQFYFYB3lQD9W0D8Ohgq6Wnl7NYOJ2TQndbulI=
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1 h1:5XNlsBsEvBZBMO6p82y+sqpWg8j5aBCe+5C2GBFgqBQ=
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1/go.mod h1:4qXHrG1Ne3VGIMZPCB8OjH/pLFO94sKABIusjh0KWPU=
github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 h1:eajuO3nykDPdYicLlP3AGgOyVN3MOlFmZv7WGTuJPow=
github.com/aws/aws-sdk-go-v2/service/sso v1.18.7/go.mod h1:+mJNDdF+qiUlNKNC3fxn74WWNN+sOiGOEImje+3ScPM=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 h1:QPMJf+Jw8E1l7zqhZmMlFw6w1NmfkfiSK8mS4zOx3BA=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7/go.mod h1:ykf3COxYI0UJmxcfcxcVuz7b6uADi1FkiUz6Eb7AgM8=
github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 h1:NzO4Vrau795RkUdSHKEwiR01FaGzGOH1EETJ+5QHnm0=
github.com/aws/aws-sdk-go-v2/service/sts v1.26.7/go.mod h1:6h2YuIoxaMSCFf5fi1EgZAwdfkGMgDY+DVfa61uLe4U=
github.com/aws/smithy-go v1.19.0 h1:KWFKQV80DpP3vJrrA9sVAHQ5gc2z8i4EzrLhLlWXcBM=
github.com/aws/smithy-go v1.19.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE=
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI=
github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/bombsimon/wsl/v2 v2.0.0/go.mod h1:mf25kr/SqFEPhhcxW1+7pxzGlW+hIl/hYTKY95VwV8U=
github.com/bombsimon/wsl/v2 v2.2.0/go.mod h1:Azh8c3XGEJl9LyX0/sFC+CKMc7Ssgua0g+6abzXN4Pg=
github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk=
github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50=
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw=
github.com/campoy/embedmd v1.0.0 h1:V4kI2qTJJLf4J29RzI/MAt2c3Bl4dQSYPuflzwFH2hY=
github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8=
github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e/go.mod h1:9IOqJGCPMSc6E5ydlp5NIonxObaeu/Iub/X03EKPVYo=
github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e/go.mod h1:oDpT4efm8tSYHXV5tHSdRvBet/b/QzxZ+XyyPehvm3A=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/charmbracelet/bubbles v0.18.0 h1:PYv1A036luoBGroX6VWjQIE9Syf2Wby2oOl/39KLfy0=
github.com/charmbracelet/bubbles v0.18.0/go.mod h1:08qhZhtIwzgrtBjAcJnij1t1H0ZRjwHyGsy6AL11PSw=
github.com/charmbracelet/bubbletea v0.25.0 h1:bAfwk7jRz7FKFl9RzlIULPkStffg5k6pNt5dywy4TcM=
github.com/charmbracelet/bubbletea v0.25.0/go.mod h1:EN3QDR1T5ZdWmdfDzYcqOCAps45+QIJbLOBxmVNWNNg=
github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ=
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
github.com/charmbracelet/lipgloss v0.9.1 h1:PNyd3jvaJbg4jRHKWXnCj1akQm4rh8dbEzN1p/u1KWg=
github.com/charmbracelet/lipgloss v0.9.1/go.mod h1:1mPmG4cxScwUQALAAnacHaigiiHB9Pmr+v1VEawJl6I=
github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg=
github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY=
github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM=
github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo=
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/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE=
github.com/containerd/console v1.0.0/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE=
github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk=
github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.4.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.4.1-0.20201117152358-0edc412565dc/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0=
github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk=
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo=
github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8=
github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0=
github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY=
github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o=
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6 h1:MWwG/UOQv6J2hvRgKGduhJn5yKZPl4ly+PWMhfPnMzU=
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6/go.mod h1:gfcR4++fMRl37UvYy4Kw6JrQIra1bFFQVVtWEp1oon4=
github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU=
github.com/containerd/go-cni v1.1.9 h1:ORi7P1dYzCwVM6XPN4n3CbkuOx/NZ2DOqy+SHRdo9rU=
github.com/containerd/go-cni v1.1.9/go.mod h1:XYrZJ1d5W6E2VOvjffL3IZq0Dz6bsVlERHbekNK90PM=
github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0=
github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g=
github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok=
github.com/containerd/go-runc v1.1.0 h1:OX4f+/i2y5sUT7LhmcJH7GYrjjhHa1QI4e8yO0gGleA=
github.com/containerd/go-runc v1.1.0/go.mod h1:xJv2hFF7GvHtTJd9JqTS2UVxMkULUYw4JN5XAUZqH5U=
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/nydus-snapshotter v0.13.1 h1:5XNkCZ9ivLXCcyx3Jbbfh/fntkcls69uBg0x9VE8zlk=
github.com/containerd/nydus-snapshotter v0.13.1/go.mod h1:XWAz9ytsjBuKPVXDKP3xoMlcSKNsGnjXlEup6DuzUIo=
github.com/containerd/stargz-snapshotter v0.0.0-20201027054423-3a04e4c2c116/go.mod h1:o59b3PCKVAf9jjiKtCc/9hLAd+5p/rfhBfm6aBcTEr4=
github.com/containerd/stargz-snapshotter v0.15.1 h1:fpsP4kf/Z4n2EYnU0WT8ZCE3eiKDwikDhL6VwxIlgeA=
github.com/containerd/stargz-snapshotter v0.15.1/go.mod h1:74D+J1m1RMXytLmWxegXWhtOSRHPWZKpKc2NdK3S+us=
github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU=
github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk=
github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o=
github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y=
github.com/containerd/ttrpc v1.2.2 h1:9vqZr0pxwOF5koz6N0N3kJ0zDHokrcPxIR/ZR2YFtOs=
github.com/containerd/ttrpc v1.2.2/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak=
github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg=
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/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY=
github.com/containernetworking/cni v1.1.2 h1:wtRGZVv7olUHMOqouPpn3cXJWpJgM6+EUl31EQbXALQ=
github.com/containernetworking/cni v1.1.2/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw=
github.com/containernetworking/plugins v1.4.0 h1:+w22VPYgk7nQHw7KT92lsRmuToHvb7wwSv9iTbXzzic=
github.com/containernetworking/plugins v1.4.0/go.mod h1:UYhcOyjefnrQvKvmmyEKsUA+M9Nfn7tqULPpH0Pkcj0=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/go-systemd/v22 v22.4.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4=
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
github.com/dave/jennifer v1.7.0 h1:uRbSBH9UTS64yXbh4FrMHfgfY762RD+C7bUPKODpSJE=
github.com/dave/jennifer v1.7.0/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc=
github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/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/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/denisbrodbeck/machineid v1.0.1 h1:geKr9qtkB876mXguW2X6TU4ZynleN6ezuMSRhl4D7AQ=
github.com/denisbrodbeck/machineid v1.0.1/go.mod h1:dJUwb7PTidGDeYyUBmXZ2GphQBbjJCrnectwCyxcUSI=
github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0=
github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY=
github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g=
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
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/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c=
github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko=
github.com/docker/cli v0.0.0-20190925022749-754388324470/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v20.10.0-beta1.0.20201029214301-1d20b15adc38+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v25.0.1+incompatible h1:mFpqnrS6Hsm3v1k7Wa/BO23oz0k121MTbTO1lpcGSkU=
github.com/docker/cli v25.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY=
github.com/docker/distribution v2.6.0-rc.1.0.20180327202408-83389a148052+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v0.0.0-20200511152416-a93e9eb0e95c/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v1.4.2-0.20180531152204-71cd53e4a197/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v17.12.0-ce-rc1.0.20200730172259-9f28837c1d93+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v20.10.0-beta1.0.20201110211921-af34b94a78a1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v25.0.1+incompatible h1:k5TYd5rIVQRSqcTwCID+cyVA0yRg86+Pcrz1ls0/frA=
github.com/docker/docker v25.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y=
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8=
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA=
github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI=
github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=
github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw=
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/libnetwork v0.8.0-dev.2.0.20200917202933-d0951081b35f/go.mod h1:93m0aTqz6z+g32wla4l4WxTrdtvBRmVzYRkYvasA5Z8=
github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk=
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d h1:wi6jN5LVt/ljaBG4ue79Ekzb12QfJ52L9Q98tl8SWhw=
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4=
github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y=
github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM=
github.com/dschmidt/go-layerfs v0.1.0 h1:jE6aHDfjNzS/31DS48th6EkmELwTa1Uf+aO4jRkBs3U=
github.com/dschmidt/go-layerfs v0.1.0/go.mod h1:m62aff0hn23Q/tQBRiNSeLD7EUuimDvsuCvCpzBr3Gw=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU=
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA=
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776 h1:VRIbnDWRmAh5yBdz+J6yFMF5vso1It6vn+WmM/5l7MA=
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776/go.mod h1:9wvnDu3YOfxzWM9Cst40msBF1C2UdQgDv962oTxSuMs=
github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4=
github.com/go-critic/go-critic v0.4.1/go.mod h1:7/14rZGnZbY6E38VEGk2kVhoq6itzc1E68facVDK23g=
github.com/go-critic/go-critic v0.4.3/go.mod h1:j4O3D4RoIwRqlZw5jJpx0BNfXWWbpcJoKu5cYSe4YmQ=
github.com/go-fonts/liberation v0.3.1 h1:9RPT2NhUpxQ7ukUvz3jeUckmN42T9D9TpjtQcqK/ceM=
github.com/go-fonts/liberation v0.3.1/go.mod h1:jdJ+cqF+F4SUL2V+qxBth8fvBpBDS7yloUL5Fi8GTGY=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=
github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4=
github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9 h1:NxXI5pTAtpEaU49bpLpQoDsu1zrteW/vxzTz8Cd2UAs=
github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9/go.mod h1:gWuR/CrFDDeVRFQwHPvsv9soJVB/iqymhuZQuJ3a9OM=
github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-pdf/fpdf v0.8.0 h1:IJKpdaagnWUeSkUFUjTcSzTppFxmv8ucGQyNPQWxYOQ=
github.com/go-pdf/fpdf v0.8.0/go.mod h1:gfqhcNwXrsd3XYKte9a7vM3smvU/jB4ZRDrmWSxpfdc=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4=
github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ=
github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg=
github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw=
github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU=
github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk=
github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI=
github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks=
github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc=
github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8=
github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/flock v0.7.3/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU=
github.com/gogo/googleapis v1.3.2/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=
github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc=
github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs=
github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/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.1/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.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
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.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4=
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk=
github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0=
github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8=
github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o=
github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU=
github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU=
github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU=
github.com/golangci/golangci-lint v1.23.7/go.mod h1:g/38bxfhp4rI7zeWSxcdIeHTQGS58TCak8FYcyCmavQ=
github.com/golangci/golangci-lint v1.27.0/go.mod h1:+eZALfxIuthdrHPtfM7w/R3POJLjHDfJJw8XZl9xOng=
github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU=
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg=
github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o=
github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA=
github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA=
github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI=
github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4=
github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4=
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ=
github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/crfs v0.0.0-20191108021818-71d77da419c9/go.mod h1:etGhoOqfwPkooV6aqoX3eBGQOJblqdoc9XvWOeuxpPw=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/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.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/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.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
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-containerregistry v0.0.0-20191010200024-a3d713f9b7f8/go.mod h1:KyKXa9ciM8+lgMXwOVsXi7UxGrsf9mM61Mzs+xKUrKE=
github.com/google/go-containerregistry v0.1.2/go.mod h1:GPivBPgdAyd2SU+vf6EpsgOtWDuPqjW0hJZt4rNdTZ4=
github.com/google/go-containerregistry v0.15.2 h1:MMkSh+tjSdnmJZO7ljvEqV1DjfekB6VUEAZgy3a+TQE=
github.com/google/go-containerregistry v0.15.2/go.mod h1:wWK+LnOv4jXMM23IT/F1wdYftGWGr47Is8CG+pmHK1Q=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM=
github.com/google/go-github/v50 v50.2.0 h1:j2FyongEHlO9nxXLc+LP3wuBSVU9mVxfpdYUexMpIfk=
github.com/google/go-github/v50 v50.2.0/go.mod h1:VBY8FB6yPIjrtKhozXv4FQupxKLS6H4m6xFZlT43q8Q=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/go-replayers/grpcreplay v0.1.0/go.mod h1:8Ig2Idjpr6gifRd6pNVggX6TC1Zw6Jx74AKp7QNH2QE=
github.com/google/go-replayers/httpreplay v0.1.0/go.mod h1:YKZViNhiGgqdBlUbI2MwGpq4pXxNmhJLPHQ7cv2b5no=
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg=
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a h1:fEBsGL/sjAuJrgah5XqmmYsTLzJp/TO9Lhy39gkverk=
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/rpmpack v0.0.0-20191226140753-aa36bfddb3a0/go.mod h1:RaTPr0KUf2K7fnZYLNDrr8rxAamWs3iNywJLtQ2AzBg=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1/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.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/wire v0.3.0/go.mod h1:i1DMg/Lu8Sz5yYl25iOdmc5CT5qusaa+zmRWs16741s=
github.com/google/wire v0.4.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU=
github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM=
github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM=
github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c=
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
github.com/gookit/color v1.2.4/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg=
github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/goreleaser/goreleaser v0.136.0/go.mod h1:wiKrPUeSNh6Wu8nUHxZydSOVQ/OZvOaO7DTtFqie904=
github.com/goreleaser/nfpm v1.2.1/go.mod h1:TtWrABZozuLOttX2uDlYyECfQX7x5XYkVxhjYcR6G9w=
github.com/goreleaser/nfpm v1.3.0/go.mod h1:w0p7Kc9TAUgWMyrub63ex3M2Mgw88M4GZXoTq5UCb40=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.2/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y=
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw=
github.com/hanwen/go-fuse v1.0.0/go.mod h1:unqXarDXqzAk0rt98O2tVndEPIpUgLD9+rwFisZH3Ok=
github.com/hanwen/go-fuse/v2 v2.0.3/go.mod h1:0EQM6aH2ctVpvZ6a+onrQ/vaykxh2GH7hy3e13vzTUY=
github.com/hanwen/go-fuse/v2 v2.4.0 h1:12OhD7CkXXQdvxG2osIdBQLdXh+nmLXY9unkUIe/xaU=
github.com/hanwen/go-fuse/v2 v2.4.0/go.mod h1:xKwi1cF7nXAOBCXujD5ie0ZKsxc8GGSA1rlMJc+8IJs=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM=
github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/go-retryablehttp v0.6.4/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA=
github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru/v2 v2.0.3 h1:kmRrRLlInXvng0SmLxmQpQkpbYAvcXm7NPDrgxJa9mE=
github.com/hashicorp/golang-lru/v2 v2.0.3/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hashicorp/uuid v0.0.0-20160311170451-ebb0a03e909c/go.mod h1:fHzc09UnyJyqyW+bFuq864eh+wC7dj65aXmXLRe5to0=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/in-toto/in-toto-golang v0.5.0 h1:hb8bgwr0M2hGdDsLjkJ3ZqJ8JFLL/tgYdAxF/XEFBbY=
github.com/in-toto/in-toto-golang v0.5.0/go.mod h1:/Rq0IZHLV7Ku5gielPT4wPHJfH1GdHMCq8+WPxw8/BE=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg=
github.com/jackpal/gateway v1.0.7 h1:7tIFeCGmpyrMx9qvT0EgYUi7cxVW48a0mMvnIL17bPM=
github.com/jackpal/gateway v1.0.7/go.mod h1:aRcO0UFKt+MgIZmRmvOmnejdDT4Y1DNiNOsSd1AcIbA=
github.com/jaguilar/vt100 v0.0.0-20150826170717-2703a27b14ea/go.mod h1:QMdK4dGB3YhEW2BmA1wgGpPYI3HZy/5gD705PXKUVSg=
github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s=
github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0=
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0=
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/juju/ansiterm v1.0.0 h1:gmMvnZRq7JZJx6jkfSq9/+2LMrVEwGwt7UR6G+lmDEg=
github.com/juju/ansiterm v1.0.0/go.mod h1:PyXUpnI3olx3bsPcHt98FGPX/KCFZ1Fi+hw1XLI6384=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/lunixbochs/vtclean v1.0.0 h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+LVb8=
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs=
github.com/mackerelio/go-osstat v0.2.4/go.mod h1:Zy+qzGdZs3A9cuIqmgbJvwbmLQH9dJvtio5ZjJTbdlQ=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU=
github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.10/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo=
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY=
github.com/mazznoer/csscolorparser v0.1.3 h1:vug4zh6loQxAUxfU1DZEu70gTPufDPspamZlHAkKcxE=
github.com/mazznoer/csscolorparser v0.1.3/go.mod h1:Aj22+L/rYN/Y6bj3bYqO3N6g1dtdHtGfQ32xZ5PJQic=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk=
github.com/mitchellh/go-spdx v0.1.0 h1:50JnVzkL3kWreQ5Qb4Pi3Qx9e+bbYrt8QglJDpfeBEs=
github.com/mitchellh/go-spdx v0.1.0/go.mod h1:FFi4Cg1fBuN/JCtPtP8PEDmcBjvO3gijQVl28YjIBVQ=
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ=
github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=
github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A=
github.com/moby/buildkit v0.8.1/go.mod h1:/kyU1hKy/aYCuP39GZA9MaKioovHku57N6cqlKZIaiQ=
github.com/moby/buildkit v0.13.0-beta3 h1:eefOGE6SsWYHFfymc09Q7VU5i3L9vUs8ZCZVCDXWNOo=
github.com/moby/buildkit v0.13.0-beta3/go.mod h1:tSWWhq1EDM0eB3ngMNDiH2hOOW9fXTyn2uXuOraCLlE=
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
github.com/moby/sys/mount v0.1.0/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74=
github.com/moby/sys/mount v0.1.1/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74=
github.com/moby/sys/mount v0.3.3 h1:fX1SVkXFJ47XWDoeFW4Sq7PdQJnV2QIDZAqjNqgEjUs=
github.com/moby/sys/mount v0.3.3/go.mod h1:PBaEorSNTLG5t/+4EgukEQVlAvVEc6ZjTySwKdqp5K0=
github.com/moby/sys/mountinfo v0.1.0/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o=
github.com/moby/sys/mountinfo v0.1.3/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o=
github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A=
github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g=
github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
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/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2/go.mod h1:TjQg8pa4iejrUrjiz0MCtMV38jdMNW4doKSiBrEvCQQ=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c=
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
github.com/onsi/ginkgo/v2 v2.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs=
github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
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/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
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/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc10/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc92/go.mod h1:X1zlU4p7wOlX4+WRCz+hvlRv8phdL7UqbYD+vQwNMmE=
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 v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
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-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE=
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02/go.mod h1:JNdpVEzCpXBgIiv4ds+TzhN1hrtxq6ClLrTlT9OQRSc=
github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9/go.mod h1:PLldrQSroqzH70Xl+1DQcGnefIbqsKR7UDaiux3zV+w=
github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170 h1:DiLBVp4DAcZlBVBEtJpNWZpZVq0AEeCY7Hqk8URVs4o=
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170/go.mod h1:uQd4a7Rh3ZsVg5j0lNyAfyxIeGde9yrlhjF78GzeW0c=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/profile v1.5.0 h1:042Buzk+NhDI+DeSAA62RwJL8VAuZUMQZUjCsRz1Mug=
github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18=
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ=
github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=
github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY=
github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
github.com/prometheus/exporter-toolkit v0.8.2/go.mod h1:00shzmJL7KxcsabLWcONwpyNEuWhREOnFqZW7vadFS0=
github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e h1:51xcRlSMBU5rhM9KahnJGfEsBPVPz3182TgFRowA8yY=
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e/go.mod h1:tcaRap0jS3eifrEEllL6ZMd9dg8IlDpi2S1oARrQ+NI=
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
github.com/quasilyte/go-ruleguard v0.1.2-0.20200318202121-b00d7a75d3d8/go.mod h1:CGFX09Ci3pq9QZdj86B+VGIdNj4VyCo2iPOGS9esB/k=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.6 h1:Sovz9sDSwbOz9tgUy8JpT+KgCkPYJEN/oYzlJiYTNLg=
github.com/rivo/uniseg v0.4.6/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rs/cors v1.10.0 h1:62NOS1h+r8p1mW6FM0FSB0exioXLhd/sh15KpjWBZ+8=
github.com/rs/cors v1.10.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A=
github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryancurrah/gomodguard v1.0.4/go.mod h1:9T/Cfuxs5StfsocWr4WzDL36HqnX0fVb9d5fSEaLhoE=
github.com/ryancurrah/gomodguard v1.1.0/go.mod h1:4O8tr7hBODaGE6VIhfJDHcwzh5GUccKSJBU0UMXJFVM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/samber/slog-common v0.14.0 h1:g4TGALXmqogbJu3epRhjIWUJKSpgqB9VyN2OEnS8Wyg=
github.com/samber/slog-common v0.14.0/go.mod h1:Qjrfhwk79XiCIhBj8+jTq1Cr0u9rlWbjawh3dWXzaHk=
github.com/samber/slog-logrus/v2 v2.2.0 h1:Noku55MKf/x57c2j5/LsLzw75biW86Q29bOkZpnLAgY=
github.com/samber/slog-logrus/v2 v2.2.0/go.mod h1:C0egl62QrwHPY9RcsEXa3E7FHb6/xM9uaVSuc7piJXU=
github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b/go.mod h1:am+Fp8Bt506lA3Rk3QCmSqmYmLMnPDhdDUcosQCAx+I=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624Y=
github.com/sebdah/goldie/v2 v2.5.3/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI=
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
github.com/secure-systems-lab/go-securesystemslib v0.4.0/go.mod h1:FGBZgq2tXWICsxWQW1msNf49F0Pf2Op5Htayx335Qbs=
github.com/securego/gosec v0.0.0-20200103095621-79fbf3af8d83/go.mod h1:vvbZ2Ae7AzSq3/kywjUDxSNq2SJ27RxCz2un0H3ePqE=
github.com/securego/gosec v0.0.0-20200401082031-e946c8c39989/go.mod h1:i9l/TNj+yDFh9SZXUTvspXTjbFXgZGP/UvhU1S65A4A=
github.com/securego/gosec/v2 v2.3.0/go.mod h1:UzeVyUXbxukhLeHKV3VVqo7HdoQR9MrRfFmZYotn8ME=
github.com/sercand/kuberesolver v2.4.0+incompatible/go.mod h1:lWF3GL0xptCB/vCiJPl/ZshwPsX/n4Y7u0CW9E7aQIQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc=
github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI=
github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE=
github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ=
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 h1:B1PEwpArrNp4dkQrfxh/abbBAOZBVp0ds+fBEOUOqOc=
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29/go.mod h1:AuYgA5Kyo4c7HfUmvRGs/6rGlMMV/6B1bVnB9JxJEEg=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
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/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ=
github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/sosodev/duration v1.1.0 h1:kQcaiGbJaIsRqgQy7VGlZrVw1giWO+lDoX3MCPnpVO4=
github.com/sosodev/duration v1.1.0/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE=
github.com/sourcegraph/go-diff v0.5.3/go.mod h1:v9JDtjCE4HHHCZGId75rg8gkKKa98RVjBcBGsVmMmak=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb/go.mod h1:uKWaldnbMnjsSAXRurWqqrdyZen1R7kxl8TkmWk2OyM=
github.com/spdx/tools-golang v0.5.1 h1:fJg3SVOGG+eIva9ZUBm/hvyA7PIPVFjRxUKe6fdAgwE=
github.com/spdx/tools-golang v0.5.1/go.mod h1:/DRDQuBfB37HctM29YtrX1v+bXiVmT2OpQDalRmX9aU=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
github.com/tetafro/godot v0.3.7/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
github.com/tetafro/godot v0.4.2/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM=
github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0=
github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0=
github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao=
github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig=
github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig=
github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85/go.mod h1:a7cilN64dG941IOXfhJhlH0qB92hxJ9A1ewrdUmJ6xo=
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302 h1:ZT8ibgassurSISJ1Pj26NsM3vY2jxFZn63Nd/TpHmRw=
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302/go.mod h1:9kMVqMyQ/Sx2df5LtnGG+nbrmiZzCS7V6gjW3oGHsvI=
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 h1:8eY6m1mjgyB8XySUR7WvebTM8D/Vs86jLJzD/Tw7zkc=
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7/go.mod h1:qqvyZqkfwkoJuPU/bw61bItaoO0SJ8YSW0vSVRRvsRg=
github.com/tonistiigi/go-archvariant v1.0.0 h1:5LC1eDWiBNflnTF1prCiX09yfNHIxDC/aukdhCdTyb0=
github.com/tonistiigi/go-archvariant v1.0.0/go.mod h1:TxFmO5VS6vMq2kvs3ht04iPXtu2rUT/erOnGFYfk5Ho=
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/v/cCndK0AMpt1wiVFb/YYmqB3/QG0=
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk=
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 h1:Y/M5lygoNPKwVNLMPXgVfsRT40CSFKXCxuU8LoHySjs=
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc=
github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-client-go v2.28.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA=
github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA=
github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk=
github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA=
github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s=
github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4=
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts=
github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk=
github.com/vdemeester/k8s-pkg-credentialprovider v1.17.4/go.mod h1:inCTmtUdr5KJbreVojo06krnTgaeAz/Z7lynpPk/Q2c=
github.com/vektah/gqlparser/v2 v2.5.10 h1:6zSM4azXC9u4Nxy5YmdmGu4uKamfwsdKTwp5zsEealU=
github.com/vektah/gqlparser/v2 v2.5.10/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netlink v1.2.1-beta.2 h1:Llsql0lnQEbHj0I1OuKyp8otXp0r3q0mPkuhwHfStVs=
github.com/vishvananda/netlink v1.2.1-beta.2/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
github.com/vito/midterm v0.1.4 h1:SALq5mQ+AgzeZxjL4loB6Uk5TZc9JMyX2ELA/NVH65c=
github.com/vito/midterm v0.1.4/go.mod h1:Mm3u6lrpzo2EFSJbwksKOdottTJzYePK8c1KJy4aRbk=
github.com/vito/progrock v0.10.2-0.20240119030128-52ef9ee1a291 h1:VcLECqiOXx4PTEzsV0QlWVubUeE+k0ZclAlKpUuejo8=
github.com/vito/progrock v0.10.2-0.20240119030128-52ef9ee1a291/go.mod h1:Q8hxIUXZW8vkezLwH4TnRmXv+XdRb4KfLtS9t5RtH9g=
github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU=
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63 h1:qZcnPZbiX8gGs3VmipVc3ft29vPYBZzlox/04Von6+k=
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63/go.mod h1:KoQ+3z63GUJzQ7AhU0AWQNU+LPda2EwL/cx1PlbDzVQ=
github.com/weaveworks/promrus v1.2.0 h1:jOLf6pe6/vss4qGHjXmGz4oDJQA+AOCqEL3FvvZGz7M=
github.com/weaveworks/promrus v1.2.0/go.mod h1:SaE82+OJ91yqjrE1rsvBWVzNZKcHYFtMUyS1+Ogs/KA=
github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xanzy/go-gitlab v0.32.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/goldmark v1.6.0 h1:boZcn2GTjpsynOsC0iJHnBWa4Bi0qzfJjthwauItG68=
github.com/yuin/goldmark v1.6.0/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs=
github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA=
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg=
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
github.com/zmb3/spotify/v2 v2.3.1 h1:aEyIPotROM3JJjHMCImFROgnPIUpzVo8wymYSaPSd9w=
github.com/zmb3/spotify/v2 v2.3.1/go.mod h1:+LVh9CafHu7SedyqYmEf12Rd01dIVlEL845yNhksW0E=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A=
go.opencensus.io v0.19.2/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0 h1:2ea0IkZBsWH+HA2GkD+7+hRw2u97jzdFyRtXuO14a1s=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0/go.mod h1:4m3RnBBb+7dB9d21y510oO1pdB1V4J6smNf14WXcBFQ=
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/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc=
go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo=
go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4=
go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0 h1:ZtfnDL+tUrs1F0Pzfwbg2d59Gru9NCH3bgSHBM6LDwU=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0/go.mod h1:hG4Fj/y8TR/tlEDREo8tWstl9fO9gcFkn4xrx0Io8xU=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.42.0 h1:NmnYCiR0qNufkldjVvyQfZTHSdzeHoZ41zggMsdMcLM=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.42.0/go.mod h1:UVAO61+umUsHLtYb8KXXRoHtxUkdOPkYidzW3gipRLQ=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0 h1:wNMDy/LVGLj2h3p6zg4d0gypKfWKSWI14E1C4smOgl8=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0/go.mod h1:YfbDdXAAkemWJK3H/DshvlrxqFB2rtW4rY6ky/3x/H0=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU=
go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA=
go.opentelemetry.io/otel/exporters/prometheus v0.42.0/go.mod h1:f3bYiqNqhoPxkvI2LrXqQVC546K7BuRDL/kKuxkujhA=
go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4=
go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM=
go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8=
go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E=
go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k=
go.opentelemetry.io/otel/sdk/metric v1.19.0/go.mod h1:XjG0jQyFJrv2PbMvwND7LwCEhsJzCzV5210euduKcKY=
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.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
gocloud.dev v0.19.0/go.mod h1:SmKwiR8YwIMMJvQBKLsC3fHNyMwXLw3PMDO+VVteJMI=
golang.org/x/build v0.0.0-20190314133821-5284462c4bec/go.mod h1:atTaCNAy0f16Ah5aV1gMSwgiKVHwu/JncqDpuRr7lS4=
golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4=
golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20170114055629-f2499483f923/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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/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-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=
golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o=
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
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/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190620070143-6f217b454f45/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191115151921-52ab43148777/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-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200917073148-efd3b9a0ff20/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/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-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/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-20220610221304-9f5ed59c137d/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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE=
golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/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.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113232020-e2727e816f5a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200102140908-9497f49d5709/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200204192400-7124308813f3/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200331202046-9d5940d49312/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc=
golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0=
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ=
gonum.org/v1/plot v0.14.0 h1:+LBDVFYwFe4LHhdP8coW6296MBEY4nQ+Y4vuUpJopcE=
gonum.org/v1/plot v0.14.0/go.mod h1:MLdR9424SJed+5VqC6MsouEpig9pZX2VZ57H9ko2bXU=
google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181220000619-583d854617af/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.2.0/go.mod h1:IfRCZScioGtypHNTlz3gFk67J8uePVW7uDTBzXuIkhU=
google.golang.org/api v0.3.0/go.mod h1:IuvZyQh8jgscv8qWfQ4ABd8m7hEudgBFM/EdhA3BnXw=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4=
google.golang.org/api v0.6.1-0.20190607001116-5213b8090861/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo=
google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4=
google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw=
google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU=
google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k=
google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI=
google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I=
google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo=
google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g=
google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA=
google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8=
google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs=
google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA=
google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw=
google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg=
google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.3.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/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A=
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24=
google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w=
google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ=
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY=
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo=
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.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.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20180904230853-4e7be11eab3f/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
k8s.io/api v0.17.4/go.mod h1:5qxx6vjmwUVG2nHQTKGlLts8Tbok8PzHl4vHtVFuZCA=
k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw=
k8s.io/apimachinery v0.0.0-20180904193909-def12e63c512/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=
k8s.io/apimachinery v0.17.4/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0g=
k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA=
k8s.io/apiserver v0.17.4/go.mod h1:5ZDQ6Xr5MNBxyi3iUZXS84QOhZl+W7Oq2us/29c0j9I=
k8s.io/client-go v0.0.0-20180910083459-2cefa64ff137/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s=
k8s.io/client-go v0.17.4/go.mod h1:ouF6o5pz3is8qU0/qYL2RnoxOPqgfuidYLowytyLJmc=
k8s.io/client-go v0.19.0/go.mod h1:H9E/VT95blcFQnlyShFgnFT9ZnJOAceiUHM3MlRC+mU=
k8s.io/cloud-provider v0.17.4/go.mod h1:XEjKDzfD+b9MTLXQFlDGkk6Ho8SGMpaU8Uugx/KNK9U=
k8s.io/code-generator v0.17.2/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s=
k8s.io/component-base v0.17.4/go.mod h1:5BRqHMbbQPm2kKu35v3G+CpVq4K0RJKC7TRioF0I9lE=
k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM=
k8s.io/csi-translation-lib v0.17.4/go.mod h1:CsxmjwxEI0tTNMzffIAcgR9lX4wOh6AKHdxQrT7L0oo=
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc=
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o=
k8s.io/kubernetes v1.11.10/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/legacy-cloud-providers v0.17.4/go.mod h1:FikRNoD64ECjkxO36gkDgJeiQWwyZTuBkhu+yxOc1Js=
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
kernel.org/pub/linux/libs/security/libcap/cap v1.2.67 h1:sPQ9qlSNR26fToTKbxe/HDWJlXvBLqGmt84LGCQkOy0=
kernel.org/pub/linux/libs/security/libcap/cap v1.2.67/go.mod h1:GkntoBuwffz19qtdFVB+k2NtWNN+yCKnC/Ykv/hMiTU=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.67 h1:NxbXJ7pDVq0FKBsqjieT92QDXI2XaqH2HAi4QcCOHt8=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.67/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24=
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw=
mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7/go.mod h1:HGC5lll35J70Y5v7vCGb9oLhHoScFwkHDJm/05RdSTc=
oss.terrastruct.com/d2 v0.6.1 h1:TEk7pl5yS1cnUxHOsIQ7bZCs+iRGsb5FaofaianfZk8=
oss.terrastruct.com/d2 v0.6.1/go.mod h1:ZyzsiefzsZ3w/BDnfF/hcDx9LKBlgieuolX8pXi7oJY=
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2 h1:n6y6RoZCgZDchN4gLGlzNRO1Jdf9xOGGqohDBph5BG8=
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2/go.mod h1:eMWv0sOtD9T2RUl90DLWfuShZCYp4NrsqNpI8eqO6U4=
pack.ag/amqp v0.11.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
sourcegraph.com/sqs/pbtypes v1.0.0/go.mod h1:3AciMUv4qUuRHRHhOG4TZOB+72GdPVz5k+c648qsFS4=
|
closed | dagger/dagger | https://github.com/dagger/dagger | 1,715 | docs: snippets should be outside of markdown | Flagging this for post-europa.
CUE snippets used to be external to markdown files, like so:
```
```cue file=./tests/cloudformation/template.cue title="todoapp/cloudformation/template.cue"
``
```
This allows:
1. CUE linter cleaning up the files / validating them
2. Adding automated tests using the snippets, to make sure the docs work
I think I've seen a couple of embedded CUE snippets in the latest Europa markdowns (/cc @gerhard @helderco) | https://github.com/dagger/dagger/issues/1715 | https://github.com/dagger/dagger/pull/6569 | e06291a14e7f694ea2b04c1e30c41ebe751f8f21 | 806d6580e5158cad92ea4dcf23c966b225402374 | "2022-03-08T23:03:28Z" | go | "2024-02-06T12:01:33Z" | go.mod | module github.com/dagger/dagger
go 1.21
replace dagger.io/dagger => ./sdk/go
require (
dagger.io/dagger v0.9.7
github.com/99designs/gqlgen v0.17.41
github.com/Khan/genqlient v0.6.0
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2
github.com/adrg/xdg v0.4.0
github.com/blang/semver v3.5.1+incompatible
github.com/cenkalti/backoff/v4 v4.2.1
github.com/charmbracelet/bubbles v0.18.0
github.com/charmbracelet/bubbletea v0.25.0
github.com/charmbracelet/lipgloss v0.9.1
github.com/containerd/containerd v1.7.12
github.com/containerd/continuity v0.4.3
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6
github.com/containerd/stargz-snapshotter v0.15.1
github.com/containernetworking/cni v1.1.2
github.com/coreos/go-systemd/v22 v22.5.0
github.com/creack/pty v1.1.18
github.com/dave/jennifer v1.7.0
github.com/docker/cli v25.0.1+incompatible
github.com/docker/distribution v2.8.2+incompatible
github.com/docker/docker v25.0.1+incompatible
github.com/dschmidt/go-layerfs v0.1.0
github.com/go-git/go-git/v5 v5.11.0
github.com/gofrs/flock v0.8.1
github.com/gogo/protobuf v1.3.2
github.com/google/go-containerregistry v0.15.2
github.com/google/go-github/v50 v50.2.0
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/google/uuid v1.6.0
github.com/gorilla/websocket v1.5.0
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/iancoleman/strcase v0.3.0
github.com/jackpal/gateway v1.0.7
github.com/juju/ansiterm v1.0.0
github.com/klauspost/compress v1.17.4
github.com/mackerelio/go-osstat v0.2.4
github.com/mattn/go-isatty v0.0.20
github.com/mitchellh/go-spdx v0.1.0
github.com/moby/buildkit v0.13.0-beta3 // https://github.com/moby/buildkit/commit/1981eb123dc979fc71d097adeb5bbb84110aa9f4
github.com/moby/locker v1.0.1
github.com/moby/patternmatcher v0.6.0
github.com/moby/sys/mount v0.3.3
github.com/muesli/termenv v0.15.2
github.com/nxadm/tail v1.4.8
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.0-rc5
github.com/opencontainers/runc v1.1.12
github.com/opencontainers/runtime-spec v1.1.0
github.com/pelletier/go-toml v1.9.5
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/pkg/errors v0.9.1
github.com/prometheus/procfs v0.12.0
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e
github.com/rs/cors v1.10.0
github.com/rs/zerolog v1.31.0
github.com/samber/slog-logrus/v2 v2.2.0
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29
github.com/sirupsen/logrus v1.9.3
github.com/sourcegraph/conc v0.3.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
github.com/tidwall/gjson v1.17.0
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea
github.com/urfave/cli v1.22.14
github.com/vektah/gqlparser/v2 v2.5.10
github.com/vito/midterm v0.1.4
github.com/vito/progrock v0.10.2-0.20240119030128-52ef9ee1a291
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63
github.com/zeebo/xxh3 v1.0.2
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/exporters/jaeger v1.17.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
go.opentelemetry.io/otel/sdk v1.21.0
go.opentelemetry.io/otel/trace v1.21.0
go.opentelemetry.io/proto/otlp v1.0.0
golang.org/x/crypto v0.18.0
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/mod v0.14.0
golang.org/x/net v0.20.0
golang.org/x/oauth2 v0.16.0
golang.org/x/sync v0.6.0
golang.org/x/sys v0.16.0
golang.org/x/term v0.16.0
golang.org/x/text v0.14.0
golang.org/x/tools v0.17.0
google.golang.org/grpc v1.61.0
google.golang.org/protobuf v1.32.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools/v3 v3.5.1
oss.terrastruct.com/d2 v0.6.1
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2
)
require github.com/muesli/reflow v0.3.0
require (
cdr.dev/slog v1.4.2 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.11.4 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/PuerkitoBio/goquery v1.8.1 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/alecthomas/chroma v0.10.0 // indirect
github.com/alecthomas/chroma/v2 v2.11.1 // indirect
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 // indirect
github.com/aws/aws-sdk-go-v2 v1.24.1 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 // indirect
github.com/aws/aws-sdk-go-v2/config v1.26.6 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.16.16 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 // indirect
github.com/aws/smithy-go v1.19.0 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/charmbracelet/harmonica v0.2.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/containerd/fifo v1.1.0 // indirect
github.com/containerd/go-cni v1.1.9 // indirect
github.com/containerd/go-runc v1.1.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/nydus-snapshotter v0.13.1 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/containerd/ttrpc v1.2.2 // indirect
github.com/containerd/typeurl/v2 v2.1.1 // indirect
github.com/containernetworking/plugins v1.4.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denisbrodbeck/machineid v1.0.1 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/docker/docker-credential-helpers v0.8.0 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect
github.com/hanwen/go-fuse/v2 v2.4.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.3 // indirect
github.com/in-toto/in-toto-golang v0.5.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jonboulle/clockwork v0.4.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/lunixbochs/vtclean v1.0.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mazznoer/csscolorparser v0.1.3 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/sys/mountinfo v0.7.1 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/signal v0.7.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/opencontainers/selinux v1.11.0 // indirect
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/profile v1.5.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/rivo/uniseg v0.4.6 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/samber/lo v1.38.1 // indirect
github.com/samber/slog-common v0.14.0 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.4.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/shibumi/go-pathspec v1.3.0 // indirect
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/sosodev/duration v1.1.0 // indirect
github.com/spdx/tools-golang v0.5.1 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 // indirect
github.com/tonistiigi/go-archvariant v1.0.0 // indirect
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/vishvananda/netlink v1.2.1-beta.2 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/weaveworks/promrus v1.2.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/yuin/goldmark v1.6.0 // indirect
github.com/zmb3/spotify/v2 v2.3.1 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.42.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.19.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/image v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gonum.org/v1/plot v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
|
closed | dagger/dagger | https://github.com/dagger/dagger | 1,715 | docs: snippets should be outside of markdown | Flagging this for post-europa.
CUE snippets used to be external to markdown files, like so:
```
```cue file=./tests/cloudformation/template.cue title="todoapp/cloudformation/template.cue"
``
```
This allows:
1. CUE linter cleaning up the files / validating them
2. Adding automated tests using the snippets, to make sure the docs work
I think I've seen a couple of embedded CUE snippets in the latest Europa markdowns (/cc @gerhard @helderco) | https://github.com/dagger/dagger/issues/1715 | https://github.com/dagger/dagger/pull/6569 | e06291a14e7f694ea2b04c1e30c41ebe751f8f21 | 806d6580e5158cad92ea4dcf23c966b225402374 | "2022-03-08T23:03:28Z" | go | "2024-02-06T12:01:33Z" | go.sum | bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
bazil.org/fuse v0.0.0-20180421153158-65cc252bf669/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
cdr.dev/slog v1.4.2 h1:fIfiqASYQFJBZiASwL825atyzeA96NsqSxx2aL61P8I=
cdr.dev/slog v1.4.2/go.mod h1:0EkH+GkFNxizNR+GAXUEdUHanxUH5t9zqPILmPM/Vn8=
cloud.google.com/go v0.25.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.37.2/go.mod h1:H8IAquKe2L30IxoupDgqTaQvKSwF/c8prYHynGIWQbA=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw=
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY=
cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM=
cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY=
cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ=
cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI=
cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4=
cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA=
cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A=
cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc=
cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow=
cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM=
cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M=
cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s=
cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU=
cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U=
cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk=
cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY=
cloud.google.com/go/logging v1.8.1 h1:26skQWPeYhvIasWKm48+Eq7oUqdcdbwsCVwz5Ys0FvU=
cloud.google.com/go/logging v1.8.1/go.mod h1:TJjR+SimHwuC8MZ9cjByQulAMgni+RkXeI3wwctHJEI=
cloud.google.com/go/longrunning v0.5.4 h1:w8xEcbZodnA2BbW6sVirkkoC+1gP8wS57EUUgGS0GVg=
cloud.google.com/go/longrunning v0.5.4/go.mod h1:zqNVncI0BOP8ST6XQD1+VcvuShMmq7+xFSzOL++V0dI=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
code.gitea.io/sdk/gitea v0.12.0/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY=
contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA=
contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0=
contrib.go.opencensus.io/exporter/stackdriver v0.12.1/go.mod h1:iwB6wGarfphGGe/e5CWqyUk/cLzKnWsOKPVW3no6OTw=
contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE=
contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA=
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
git.sr.ht/~sbinet/gg v0.5.0 h1:6V43j30HM623V329xA9Ntq+WJrMjDxRjuAB1LFWF5m8=
git.sr.ht/~sbinet/gg v0.5.0/go.mod h1:G2C0eRESqlKhS7ErsNey6HHrqU1PwsnCQlekFi9Q2Oo=
github.com/99designs/gqlgen v0.17.41 h1:C1/zYMhGVP5TWNCNpmZ9Mb6CqT1Vr5SHEWoTOEJ3v3I=
github.com/99designs/gqlgen v0.17.41/go.mod h1:GQ6SyMhwFbgHR0a8r2Wn8fYgEwPxxmndLFPhU63+cJE=
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/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/AkihiroSuda/containerd-fuse-overlayfs v1.0.0/go.mod h1:0mMDvQFeLbbn1Wy8P2j3hwFhqBq+FKn8OZPno8WLmp8=
github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU=
github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4=
github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc=
github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v19.1.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v29.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v38.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 h1:Ut0ZGdOwJDw0npYEg+TLlPls3Pq6JiZaP2/aGKir7Zw=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1 h1:QSdcrd/UFJv6Bp/CfoVf2SrENpFn9P6Yh8yb+xNhYMM=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1/go.mod h1:eZ4g6GUvXiGulfIbbhh1Xr4XwUYaYaWMqzGD/284wCA=
github.com/Azure/azure-service-bus-go v0.9.1/go.mod h1:yzBx6/BUGfjfeqbRZny9AQIbIe3AcV9WZbAdpkoXOa0=
github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v10.15.5+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v12.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v14.1.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0=
github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630=
github.com/Azure/go-autorest/autorest v0.10.2/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630=
github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc=
github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM=
github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw=
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g=
github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM=
github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc=
github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA=
github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8=
github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI=
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0 h1:XMEdVDFxgulDDl0lQmAZS6j8gRQ/0pJ+ZpXH2FHVtDc=
github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/Djarvur/go-err113 v0.1.0/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20191009163259-e802c2cb94ae/go.mod h1:mjwGPas4yKduTyubHvD1Atl9r1rUq8DfVy+gkVvZ+oo=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14=
github.com/Khan/genqlient v0.6.0 h1:Bwb1170ekuNIVIwTJEqvO8y7RxBxXu639VJOkKSrwAk=
github.com/Khan/genqlient v0.6.0/go.mod h1:rvChwWVTqXhiapdhLDV4bp9tz/Xvtewwkon4DpWWCRM=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Masterminds/semver/v3 v3.1.0 h1:Y2lUDsFKVRSYGojLJ1yLxSXdMmMYTYls0rCvoqmMUQk=
github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.4.15-0.20200908182639-5b44b70ab3ab/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.4.15/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
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/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ=
github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8=
github.com/Microsoft/hcsshim v0.8.10/go.mod h1:g5uw8EV2mAlzqe94tfNBNdr89fnbD/n3HV0OhsddkmM=
github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8=
github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w=
github.com/Microsoft/hcsshim/test v0.0.0-20200826032352-301c83a30e7c/go.mod h1:30A5igQ91GEmhYJF8TaRP79pMBOYynRsyOByfVV0dU4=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM=
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg=
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E=
github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo=
github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8=
github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo=
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw=
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM=
github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink=
github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek=
github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s=
github.com/alecthomas/chroma/v2 v2.11.1 h1:m9uUtgcdAwgfFNxuqj7AIG75jD2YmL61BBIJWtdzJPs=
github.com/alecthomas/chroma/v2 v2.11.1/go.mod h1:4TQu7gdfuPjSh76j78ietmqh9LiurGF0EpseFXdKMBw=
github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE=
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 h1:aM1rlcoLz8y5B2r4tTLMiVTrMtpfY0O8EScKJxaSaEc=
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apex/log v1.1.4/go.mod h1:AlpoD9aScyQfJDVHmLMEcx4oU6LqzkWp4Mg9GdAcEvQ=
github.com/apex/log v1.3.0/go.mod h1:jd8Vpsr46WAe3EZSQ/IUMs2qQD/GOycT5rPWCO1yGcs=
github.com/apex/logs v0.0.4/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo=
github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE=
github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs=
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.15.90/go.mod h1:es1KtYUFs7le0xQ3rOihkuoVD90z7D0fR2Qm4S00/gU=
github.com/aws/aws-sdk-go v1.16.26/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.19.18/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.19.45/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.20.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.25.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go-v2 v1.24.1 h1:xAojnj+ktS95YZlDf0zxWBkbFtymPeDP+rvUQIH3uAU=
github.com/aws/aws-sdk-go-v2 v1.24.1/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 h1:OCs21ST2LrepDfD3lwlQiOqIGp6JiEUqG84GzTDoyJs=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4/go.mod h1:usURWEKSNNAcAZuzRn/9ZYPT8aZQkR7xcCtunK/LkJo=
github.com/aws/aws-sdk-go-v2/config v1.26.6 h1:Z/7w9bUqlRI0FFQpetVuFYEsjzE3h7fpU6HuGmfPL/o=
github.com/aws/aws-sdk-go-v2/config v1.26.6/go.mod h1:uKU6cnDmYCvJ+pxO9S4cWDb2yWWIH5hra+32hVh1MI4=
github.com/aws/aws-sdk-go-v2/credentials v1.16.16 h1:8q6Rliyv0aUFAVtzaldUEcS+T5gbadPbWdV1WcAddK8=
github.com/aws/aws-sdk-go-v2/credentials v1.16.16/go.mod h1:UHVZrdUsv63hPXFo1H7c5fEneoVo9UXiz36QG1GEPi0=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 h1:c5I5iH+DZcH3xOIMlz3/tCKJDaHFwYEmxvlh2fAcFo8=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11/go.mod h1:cRrYDYAMUohBJUtUnOhydaMHtiK/1NZ0Otc9lIb6O0Y=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.15 h1:2MUXyGW6dVaQz6aqycpbdLIH1NMcUI6kW6vQ0RabGYg=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.15/go.mod h1:aHbhbR6WEQgHAiRj41EQ2W47yOYwNtIkWTXmcAtYqj8=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 h1:vF+Zgd9s+H4vOXd5BMaPWykta2a6Ih0AKLq/X6NYKn4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10/go.mod h1:6BkRjejp/GR4411UGqkX8+wFMbFbqsUIimfK4XjOKR4=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 h1:nYPe006ktcqUji8S2mqXf9c/7NdiKriOwMvWQHgYztw=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10/go.mod h1:6UV4SZkVvmODfXKql4LCbaZUpF7HO2BX38FgBf9ZOLw=
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3 h1:n3GDfwqF2tzEkXlv5cuy4iy7LpKDtqDMcNLfZDu9rls=
github.com/aws/aws-sdk-go-v2/internal/ini v1.7.3/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10 h1:5oE2WzJE56/mVveuDZPJESKlg/00AaS2pY2QZcnxg4M=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10/go.mod h1:FHbKWQtRBYUz4vO5WBWjzMD2by126ny5y/1EoaWoLfI=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3YVNlkzkBrm9LfpaKoaYZUxIAj4sHfOTmLfqw=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 h1:L0ai8WICYHozIKK+OtPzVJBugL7culcuM4E4JOpIEm8=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10/go.mod h1:byqfyxJBshFk0fF9YmK0M0ugIO8OWjzH2T3bPG4eGuA=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 h1:DBYTXwIGQSGs9w4jKm60F5dmCQ3EEruxdc0MFh+3EY4=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10/go.mod h1:wohMUQiFdzo0NtxbBg0mSRGZ4vL3n0dKjLTINdcIino=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10 h1:KOxnQeWy5sXyS37fdKEvAsGHOr9fa/qvwxfJurR/BzE=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10/go.mod h1:jMx5INQFYFYB3lQD9W0D8Ohgq6Wnl7NYOJ2TQndbulI=
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1 h1:5XNlsBsEvBZBMO6p82y+sqpWg8j5aBCe+5C2GBFgqBQ=
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1/go.mod h1:4qXHrG1Ne3VGIMZPCB8OjH/pLFO94sKABIusjh0KWPU=
github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 h1:eajuO3nykDPdYicLlP3AGgOyVN3MOlFmZv7WGTuJPow=
github.com/aws/aws-sdk-go-v2/service/sso v1.18.7/go.mod h1:+mJNDdF+qiUlNKNC3fxn74WWNN+sOiGOEImje+3ScPM=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 h1:QPMJf+Jw8E1l7zqhZmMlFw6w1NmfkfiSK8mS4zOx3BA=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7/go.mod h1:ykf3COxYI0UJmxcfcxcVuz7b6uADi1FkiUz6Eb7AgM8=
github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 h1:NzO4Vrau795RkUdSHKEwiR01FaGzGOH1EETJ+5QHnm0=
github.com/aws/aws-sdk-go-v2/service/sts v1.26.7/go.mod h1:6h2YuIoxaMSCFf5fi1EgZAwdfkGMgDY+DVfa61uLe4U=
github.com/aws/smithy-go v1.19.0 h1:KWFKQV80DpP3vJrrA9sVAHQ5gc2z8i4EzrLhLlWXcBM=
github.com/aws/smithy-go v1.19.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE=
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI=
github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/bombsimon/wsl/v2 v2.0.0/go.mod h1:mf25kr/SqFEPhhcxW1+7pxzGlW+hIl/hYTKY95VwV8U=
github.com/bombsimon/wsl/v2 v2.2.0/go.mod h1:Azh8c3XGEJl9LyX0/sFC+CKMc7Ssgua0g+6abzXN4Pg=
github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk=
github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50=
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw=
github.com/campoy/embedmd v1.0.0 h1:V4kI2qTJJLf4J29RzI/MAt2c3Bl4dQSYPuflzwFH2hY=
github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8=
github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e/go.mod h1:9IOqJGCPMSc6E5ydlp5NIonxObaeu/Iub/X03EKPVYo=
github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e/go.mod h1:oDpT4efm8tSYHXV5tHSdRvBet/b/QzxZ+XyyPehvm3A=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/charmbracelet/bubbles v0.18.0 h1:PYv1A036luoBGroX6VWjQIE9Syf2Wby2oOl/39KLfy0=
github.com/charmbracelet/bubbles v0.18.0/go.mod h1:08qhZhtIwzgrtBjAcJnij1t1H0ZRjwHyGsy6AL11PSw=
github.com/charmbracelet/bubbletea v0.25.0 h1:bAfwk7jRz7FKFl9RzlIULPkStffg5k6pNt5dywy4TcM=
github.com/charmbracelet/bubbletea v0.25.0/go.mod h1:EN3QDR1T5ZdWmdfDzYcqOCAps45+QIJbLOBxmVNWNNg=
github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ=
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
github.com/charmbracelet/lipgloss v0.9.1 h1:PNyd3jvaJbg4jRHKWXnCj1akQm4rh8dbEzN1p/u1KWg=
github.com/charmbracelet/lipgloss v0.9.1/go.mod h1:1mPmG4cxScwUQALAAnacHaigiiHB9Pmr+v1VEawJl6I=
github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg=
github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY=
github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE=
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM=
github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo=
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/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE=
github.com/containerd/console v1.0.0/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE=
github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk=
github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.4.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.4.1-0.20201117152358-0edc412565dc/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0=
github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk=
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo=
github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8=
github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0=
github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY=
github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o=
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6 h1:MWwG/UOQv6J2hvRgKGduhJn5yKZPl4ly+PWMhfPnMzU=
github.com/containerd/fuse-overlayfs-snapshotter v1.0.6/go.mod h1:gfcR4++fMRl37UvYy4Kw6JrQIra1bFFQVVtWEp1oon4=
github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU=
github.com/containerd/go-cni v1.1.9 h1:ORi7P1dYzCwVM6XPN4n3CbkuOx/NZ2DOqy+SHRdo9rU=
github.com/containerd/go-cni v1.1.9/go.mod h1:XYrZJ1d5W6E2VOvjffL3IZq0Dz6bsVlERHbekNK90PM=
github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0=
github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g=
github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok=
github.com/containerd/go-runc v1.1.0 h1:OX4f+/i2y5sUT7LhmcJH7GYrjjhHa1QI4e8yO0gGleA=
github.com/containerd/go-runc v1.1.0/go.mod h1:xJv2hFF7GvHtTJd9JqTS2UVxMkULUYw4JN5XAUZqH5U=
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/nydus-snapshotter v0.13.1 h1:5XNkCZ9ivLXCcyx3Jbbfh/fntkcls69uBg0x9VE8zlk=
github.com/containerd/nydus-snapshotter v0.13.1/go.mod h1:XWAz9ytsjBuKPVXDKP3xoMlcSKNsGnjXlEup6DuzUIo=
github.com/containerd/stargz-snapshotter v0.0.0-20201027054423-3a04e4c2c116/go.mod h1:o59b3PCKVAf9jjiKtCc/9hLAd+5p/rfhBfm6aBcTEr4=
github.com/containerd/stargz-snapshotter v0.15.1 h1:fpsP4kf/Z4n2EYnU0WT8ZCE3eiKDwikDhL6VwxIlgeA=
github.com/containerd/stargz-snapshotter v0.15.1/go.mod h1:74D+J1m1RMXytLmWxegXWhtOSRHPWZKpKc2NdK3S+us=
github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU=
github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk=
github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o=
github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y=
github.com/containerd/ttrpc v1.2.2 h1:9vqZr0pxwOF5koz6N0N3kJ0zDHokrcPxIR/ZR2YFtOs=
github.com/containerd/ttrpc v1.2.2/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak=
github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg=
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/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY=
github.com/containernetworking/cni v1.1.2 h1:wtRGZVv7olUHMOqouPpn3cXJWpJgM6+EUl31EQbXALQ=
github.com/containernetworking/cni v1.1.2/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw=
github.com/containernetworking/plugins v1.4.0 h1:+w22VPYgk7nQHw7KT92lsRmuToHvb7wwSv9iTbXzzic=
github.com/containernetworking/plugins v1.4.0/go.mod h1:UYhcOyjefnrQvKvmmyEKsUA+M9Nfn7tqULPpH0Pkcj0=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/go-systemd/v22 v22.4.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4=
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
github.com/dave/jennifer v1.7.0 h1:uRbSBH9UTS64yXbh4FrMHfgfY762RD+C7bUPKODpSJE=
github.com/dave/jennifer v1.7.0/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc=
github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/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/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/denisbrodbeck/machineid v1.0.1 h1:geKr9qtkB876mXguW2X6TU4ZynleN6ezuMSRhl4D7AQ=
github.com/denisbrodbeck/machineid v1.0.1/go.mod h1:dJUwb7PTidGDeYyUBmXZ2GphQBbjJCrnectwCyxcUSI=
github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0=
github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY=
github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g=
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
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/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c=
github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko=
github.com/docker/cli v0.0.0-20190925022749-754388324470/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v20.10.0-beta1.0.20201029214301-1d20b15adc38+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v25.0.1+incompatible h1:mFpqnrS6Hsm3v1k7Wa/BO23oz0k121MTbTO1lpcGSkU=
github.com/docker/cli v25.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY=
github.com/docker/distribution v2.6.0-rc.1.0.20180327202408-83389a148052+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v0.0.0-20200511152416-a93e9eb0e95c/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v1.4.2-0.20180531152204-71cd53e4a197/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v17.12.0-ce-rc1.0.20200730172259-9f28837c1d93+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v20.10.0-beta1.0.20201110211921-af34b94a78a1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v25.0.1+incompatible h1:k5TYd5rIVQRSqcTwCID+cyVA0yRg86+Pcrz1ls0/frA=
github.com/docker/docker v25.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y=
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8=
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA=
github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI=
github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=
github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw=
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/libnetwork v0.8.0-dev.2.0.20200917202933-d0951081b35f/go.mod h1:93m0aTqz6z+g32wla4l4WxTrdtvBRmVzYRkYvasA5Z8=
github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk=
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d h1:wi6jN5LVt/ljaBG4ue79Ekzb12QfJ52L9Q98tl8SWhw=
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4=
github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y=
github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM=
github.com/dschmidt/go-layerfs v0.1.0 h1:jE6aHDfjNzS/31DS48th6EkmELwTa1Uf+aO4jRkBs3U=
github.com/dschmidt/go-layerfs v0.1.0/go.mod h1:m62aff0hn23Q/tQBRiNSeLD7EUuimDvsuCvCpzBr3Gw=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU=
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA=
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776 h1:VRIbnDWRmAh5yBdz+J6yFMF5vso1It6vn+WmM/5l7MA=
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776/go.mod h1:9wvnDu3YOfxzWM9Cst40msBF1C2UdQgDv962oTxSuMs=
github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4=
github.com/go-critic/go-critic v0.4.1/go.mod h1:7/14rZGnZbY6E38VEGk2kVhoq6itzc1E68facVDK23g=
github.com/go-critic/go-critic v0.4.3/go.mod h1:j4O3D4RoIwRqlZw5jJpx0BNfXWWbpcJoKu5cYSe4YmQ=
github.com/go-fonts/liberation v0.3.1 h1:9RPT2NhUpxQ7ukUvz3jeUckmN42T9D9TpjtQcqK/ceM=
github.com/go-fonts/liberation v0.3.1/go.mod h1:jdJ+cqF+F4SUL2V+qxBth8fvBpBDS7yloUL5Fi8GTGY=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=
github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4=
github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9 h1:NxXI5pTAtpEaU49bpLpQoDsu1zrteW/vxzTz8Cd2UAs=
github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9/go.mod h1:gWuR/CrFDDeVRFQwHPvsv9soJVB/iqymhuZQuJ3a9OM=
github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-pdf/fpdf v0.8.0 h1:IJKpdaagnWUeSkUFUjTcSzTppFxmv8ucGQyNPQWxYOQ=
github.com/go-pdf/fpdf v0.8.0/go.mod h1:gfqhcNwXrsd3XYKte9a7vM3smvU/jB4ZRDrmWSxpfdc=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4=
github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ=
github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg=
github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw=
github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU=
github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk=
github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI=
github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks=
github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc=
github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8=
github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/flock v0.7.3/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU=
github.com/gogo/googleapis v1.3.2/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=
github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc=
github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs=
github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/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.1/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.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
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.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4=
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk=
github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0=
github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8=
github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o=
github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU=
github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU=
github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU=
github.com/golangci/golangci-lint v1.23.7/go.mod h1:g/38bxfhp4rI7zeWSxcdIeHTQGS58TCak8FYcyCmavQ=
github.com/golangci/golangci-lint v1.27.0/go.mod h1:+eZALfxIuthdrHPtfM7w/R3POJLjHDfJJw8XZl9xOng=
github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU=
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg=
github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o=
github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA=
github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA=
github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI=
github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4=
github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4=
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ=
github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/crfs v0.0.0-20191108021818-71d77da419c9/go.mod h1:etGhoOqfwPkooV6aqoX3eBGQOJblqdoc9XvWOeuxpPw=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/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.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/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.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
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-containerregistry v0.0.0-20191010200024-a3d713f9b7f8/go.mod h1:KyKXa9ciM8+lgMXwOVsXi7UxGrsf9mM61Mzs+xKUrKE=
github.com/google/go-containerregistry v0.1.2/go.mod h1:GPivBPgdAyd2SU+vf6EpsgOtWDuPqjW0hJZt4rNdTZ4=
github.com/google/go-containerregistry v0.15.2 h1:MMkSh+tjSdnmJZO7ljvEqV1DjfekB6VUEAZgy3a+TQE=
github.com/google/go-containerregistry v0.15.2/go.mod h1:wWK+LnOv4jXMM23IT/F1wdYftGWGr47Is8CG+pmHK1Q=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM=
github.com/google/go-github/v50 v50.2.0 h1:j2FyongEHlO9nxXLc+LP3wuBSVU9mVxfpdYUexMpIfk=
github.com/google/go-github/v50 v50.2.0/go.mod h1:VBY8FB6yPIjrtKhozXv4FQupxKLS6H4m6xFZlT43q8Q=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/go-replayers/grpcreplay v0.1.0/go.mod h1:8Ig2Idjpr6gifRd6pNVggX6TC1Zw6Jx74AKp7QNH2QE=
github.com/google/go-replayers/httpreplay v0.1.0/go.mod h1:YKZViNhiGgqdBlUbI2MwGpq4pXxNmhJLPHQ7cv2b5no=
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg=
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a h1:fEBsGL/sjAuJrgah5XqmmYsTLzJp/TO9Lhy39gkverk=
github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/rpmpack v0.0.0-20191226140753-aa36bfddb3a0/go.mod h1:RaTPr0KUf2K7fnZYLNDrr8rxAamWs3iNywJLtQ2AzBg=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1/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.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/wire v0.3.0/go.mod h1:i1DMg/Lu8Sz5yYl25iOdmc5CT5qusaa+zmRWs16741s=
github.com/google/wire v0.4.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU=
github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM=
github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM=
github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c=
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
github.com/gookit/color v1.2.4/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg=
github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/goreleaser/goreleaser v0.136.0/go.mod h1:wiKrPUeSNh6Wu8nUHxZydSOVQ/OZvOaO7DTtFqie904=
github.com/goreleaser/nfpm v1.2.1/go.mod h1:TtWrABZozuLOttX2uDlYyECfQX7x5XYkVxhjYcR6G9w=
github.com/goreleaser/nfpm v1.3.0/go.mod h1:w0p7Kc9TAUgWMyrub63ex3M2Mgw88M4GZXoTq5UCb40=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.2/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y=
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw=
github.com/hanwen/go-fuse v1.0.0/go.mod h1:unqXarDXqzAk0rt98O2tVndEPIpUgLD9+rwFisZH3Ok=
github.com/hanwen/go-fuse/v2 v2.0.3/go.mod h1:0EQM6aH2ctVpvZ6a+onrQ/vaykxh2GH7hy3e13vzTUY=
github.com/hanwen/go-fuse/v2 v2.4.0 h1:12OhD7CkXXQdvxG2osIdBQLdXh+nmLXY9unkUIe/xaU=
github.com/hanwen/go-fuse/v2 v2.4.0/go.mod h1:xKwi1cF7nXAOBCXujD5ie0ZKsxc8GGSA1rlMJc+8IJs=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM=
github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/go-retryablehttp v0.6.4/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA=
github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru/v2 v2.0.3 h1:kmRrRLlInXvng0SmLxmQpQkpbYAvcXm7NPDrgxJa9mE=
github.com/hashicorp/golang-lru/v2 v2.0.3/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hashicorp/uuid v0.0.0-20160311170451-ebb0a03e909c/go.mod h1:fHzc09UnyJyqyW+bFuq864eh+wC7dj65aXmXLRe5to0=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/in-toto/in-toto-golang v0.5.0 h1:hb8bgwr0M2hGdDsLjkJ3ZqJ8JFLL/tgYdAxF/XEFBbY=
github.com/in-toto/in-toto-golang v0.5.0/go.mod h1:/Rq0IZHLV7Ku5gielPT4wPHJfH1GdHMCq8+WPxw8/BE=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg=
github.com/jackpal/gateway v1.0.7 h1:7tIFeCGmpyrMx9qvT0EgYUi7cxVW48a0mMvnIL17bPM=
github.com/jackpal/gateway v1.0.7/go.mod h1:aRcO0UFKt+MgIZmRmvOmnejdDT4Y1DNiNOsSd1AcIbA=
github.com/jaguilar/vt100 v0.0.0-20150826170717-2703a27b14ea/go.mod h1:QMdK4dGB3YhEW2BmA1wgGpPYI3HZy/5gD705PXKUVSg=
github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s=
github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0=
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0=
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/juju/ansiterm v1.0.0 h1:gmMvnZRq7JZJx6jkfSq9/+2LMrVEwGwt7UR6G+lmDEg=
github.com/juju/ansiterm v1.0.0/go.mod h1:PyXUpnI3olx3bsPcHt98FGPX/KCFZ1Fi+hw1XLI6384=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/lunixbochs/vtclean v1.0.0 h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+LVb8=
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs=
github.com/mackerelio/go-osstat v0.2.4/go.mod h1:Zy+qzGdZs3A9cuIqmgbJvwbmLQH9dJvtio5ZjJTbdlQ=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU=
github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.10/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo=
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY=
github.com/mazznoer/csscolorparser v0.1.3 h1:vug4zh6loQxAUxfU1DZEu70gTPufDPspamZlHAkKcxE=
github.com/mazznoer/csscolorparser v0.1.3/go.mod h1:Aj22+L/rYN/Y6bj3bYqO3N6g1dtdHtGfQ32xZ5PJQic=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk=
github.com/mitchellh/go-spdx v0.1.0 h1:50JnVzkL3kWreQ5Qb4Pi3Qx9e+bbYrt8QglJDpfeBEs=
github.com/mitchellh/go-spdx v0.1.0/go.mod h1:FFi4Cg1fBuN/JCtPtP8PEDmcBjvO3gijQVl28YjIBVQ=
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ=
github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=
github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A=
github.com/moby/buildkit v0.8.1/go.mod h1:/kyU1hKy/aYCuP39GZA9MaKioovHku57N6cqlKZIaiQ=
github.com/moby/buildkit v0.13.0-beta3 h1:eefOGE6SsWYHFfymc09Q7VU5i3L9vUs8ZCZVCDXWNOo=
github.com/moby/buildkit v0.13.0-beta3/go.mod h1:tSWWhq1EDM0eB3ngMNDiH2hOOW9fXTyn2uXuOraCLlE=
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
github.com/moby/sys/mount v0.1.0/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74=
github.com/moby/sys/mount v0.1.1/go.mod h1:FVQFLDRWwyBjDTBNQXDlWnSFREqOo3OKX9aqhmeoo74=
github.com/moby/sys/mount v0.3.3 h1:fX1SVkXFJ47XWDoeFW4Sq7PdQJnV2QIDZAqjNqgEjUs=
github.com/moby/sys/mount v0.3.3/go.mod h1:PBaEorSNTLG5t/+4EgukEQVlAvVEc6ZjTySwKdqp5K0=
github.com/moby/sys/mountinfo v0.1.0/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o=
github.com/moby/sys/mountinfo v0.1.3/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o=
github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A=
github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g=
github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
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/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2/go.mod h1:TjQg8pa4iejrUrjiz0MCtMV38jdMNW4doKSiBrEvCQQ=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
github.com/mrunalp/fileutils v0.0.0-20200520151820-abd8a0e76976/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c=
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
github.com/onsi/ginkgo/v2 v2.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs=
github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
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/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
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/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc10/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc92/go.mod h1:X1zlU4p7wOlX4+WRCz+hvlRv8phdL7UqbYD+vQwNMmE=
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 v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
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-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE=
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02/go.mod h1:JNdpVEzCpXBgIiv4ds+TzhN1hrtxq6ClLrTlT9OQRSc=
github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9/go.mod h1:PLldrQSroqzH70Xl+1DQcGnefIbqsKR7UDaiux3zV+w=
github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170 h1:DiLBVp4DAcZlBVBEtJpNWZpZVq0AEeCY7Hqk8URVs4o=
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170/go.mod h1:uQd4a7Rh3ZsVg5j0lNyAfyxIeGde9yrlhjF78GzeW0c=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/profile v1.5.0 h1:042Buzk+NhDI+DeSAA62RwJL8VAuZUMQZUjCsRz1Mug=
github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18=
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ=
github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=
github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY=
github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
github.com/prometheus/exporter-toolkit v0.8.2/go.mod h1:00shzmJL7KxcsabLWcONwpyNEuWhREOnFqZW7vadFS0=
github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e h1:51xcRlSMBU5rhM9KahnJGfEsBPVPz3182TgFRowA8yY=
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e/go.mod h1:tcaRap0jS3eifrEEllL6ZMd9dg8IlDpi2S1oARrQ+NI=
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
github.com/quasilyte/go-ruleguard v0.1.2-0.20200318202121-b00d7a75d3d8/go.mod h1:CGFX09Ci3pq9QZdj86B+VGIdNj4VyCo2iPOGS9esB/k=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.6 h1:Sovz9sDSwbOz9tgUy8JpT+KgCkPYJEN/oYzlJiYTNLg=
github.com/rivo/uniseg v0.4.6/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rs/cors v1.10.0 h1:62NOS1h+r8p1mW6FM0FSB0exioXLhd/sh15KpjWBZ+8=
github.com/rs/cors v1.10.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A=
github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryancurrah/gomodguard v1.0.4/go.mod h1:9T/Cfuxs5StfsocWr4WzDL36HqnX0fVb9d5fSEaLhoE=
github.com/ryancurrah/gomodguard v1.1.0/go.mod h1:4O8tr7hBODaGE6VIhfJDHcwzh5GUccKSJBU0UMXJFVM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/samber/slog-common v0.14.0 h1:g4TGALXmqogbJu3epRhjIWUJKSpgqB9VyN2OEnS8Wyg=
github.com/samber/slog-common v0.14.0/go.mod h1:Qjrfhwk79XiCIhBj8+jTq1Cr0u9rlWbjawh3dWXzaHk=
github.com/samber/slog-logrus/v2 v2.2.0 h1:Noku55MKf/x57c2j5/LsLzw75biW86Q29bOkZpnLAgY=
github.com/samber/slog-logrus/v2 v2.2.0/go.mod h1:C0egl62QrwHPY9RcsEXa3E7FHb6/xM9uaVSuc7piJXU=
github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b/go.mod h1:am+Fp8Bt506lA3Rk3QCmSqmYmLMnPDhdDUcosQCAx+I=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624Y=
github.com/sebdah/goldie/v2 v2.5.3/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI=
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
github.com/secure-systems-lab/go-securesystemslib v0.4.0/go.mod h1:FGBZgq2tXWICsxWQW1msNf49F0Pf2Op5Htayx335Qbs=
github.com/securego/gosec v0.0.0-20200103095621-79fbf3af8d83/go.mod h1:vvbZ2Ae7AzSq3/kywjUDxSNq2SJ27RxCz2un0H3ePqE=
github.com/securego/gosec v0.0.0-20200401082031-e946c8c39989/go.mod h1:i9l/TNj+yDFh9SZXUTvspXTjbFXgZGP/UvhU1S65A4A=
github.com/securego/gosec/v2 v2.3.0/go.mod h1:UzeVyUXbxukhLeHKV3VVqo7HdoQR9MrRfFmZYotn8ME=
github.com/sercand/kuberesolver v2.4.0+incompatible/go.mod h1:lWF3GL0xptCB/vCiJPl/ZshwPsX/n4Y7u0CW9E7aQIQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc=
github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI=
github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE=
github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ=
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 h1:B1PEwpArrNp4dkQrfxh/abbBAOZBVp0ds+fBEOUOqOc=
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29/go.mod h1:AuYgA5Kyo4c7HfUmvRGs/6rGlMMV/6B1bVnB9JxJEEg=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
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/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ=
github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/sosodev/duration v1.1.0 h1:kQcaiGbJaIsRqgQy7VGlZrVw1giWO+lDoX3MCPnpVO4=
github.com/sosodev/duration v1.1.0/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE=
github.com/sourcegraph/go-diff v0.5.3/go.mod h1:v9JDtjCE4HHHCZGId75rg8gkKKa98RVjBcBGsVmMmak=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb/go.mod h1:uKWaldnbMnjsSAXRurWqqrdyZen1R7kxl8TkmWk2OyM=
github.com/spdx/tools-golang v0.5.1 h1:fJg3SVOGG+eIva9ZUBm/hvyA7PIPVFjRxUKe6fdAgwE=
github.com/spdx/tools-golang v0.5.1/go.mod h1:/DRDQuBfB37HctM29YtrX1v+bXiVmT2OpQDalRmX9aU=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
github.com/tetafro/godot v0.3.7/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
github.com/tetafro/godot v0.4.2/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM=
github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0=
github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0=
github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao=
github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig=
github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig=
github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85/go.mod h1:a7cilN64dG941IOXfhJhlH0qB92hxJ9A1ewrdUmJ6xo=
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302 h1:ZT8ibgassurSISJ1Pj26NsM3vY2jxFZn63Nd/TpHmRw=
github.com/tonistiigi/fsutil v0.0.0-20230825212630-f09800878302/go.mod h1:9kMVqMyQ/Sx2df5LtnGG+nbrmiZzCS7V6gjW3oGHsvI=
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 h1:8eY6m1mjgyB8XySUR7WvebTM8D/Vs86jLJzD/Tw7zkc=
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7/go.mod h1:qqvyZqkfwkoJuPU/bw61bItaoO0SJ8YSW0vSVRRvsRg=
github.com/tonistiigi/go-archvariant v1.0.0 h1:5LC1eDWiBNflnTF1prCiX09yfNHIxDC/aukdhCdTyb0=
github.com/tonistiigi/go-archvariant v1.0.0/go.mod h1:TxFmO5VS6vMq2kvs3ht04iPXtu2rUT/erOnGFYfk5Ho=
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/v/cCndK0AMpt1wiVFb/YYmqB3/QG0=
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk=
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 h1:Y/M5lygoNPKwVNLMPXgVfsRT40CSFKXCxuU8LoHySjs=
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc=
github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-client-go v2.28.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA=
github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA=
github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk=
github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA=
github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s=
github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4=
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts=
github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk=
github.com/vdemeester/k8s-pkg-credentialprovider v1.17.4/go.mod h1:inCTmtUdr5KJbreVojo06krnTgaeAz/Z7lynpPk/Q2c=
github.com/vektah/gqlparser/v2 v2.5.10 h1:6zSM4azXC9u4Nxy5YmdmGu4uKamfwsdKTwp5zsEealU=
github.com/vektah/gqlparser/v2 v2.5.10/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netlink v1.2.1-beta.2 h1:Llsql0lnQEbHj0I1OuKyp8otXp0r3q0mPkuhwHfStVs=
github.com/vishvananda/netlink v1.2.1-beta.2/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
github.com/vito/midterm v0.1.4 h1:SALq5mQ+AgzeZxjL4loB6Uk5TZc9JMyX2ELA/NVH65c=
github.com/vito/midterm v0.1.4/go.mod h1:Mm3u6lrpzo2EFSJbwksKOdottTJzYePK8c1KJy4aRbk=
github.com/vito/progrock v0.10.2-0.20240119030128-52ef9ee1a291 h1:VcLECqiOXx4PTEzsV0QlWVubUeE+k0ZclAlKpUuejo8=
github.com/vito/progrock v0.10.2-0.20240119030128-52ef9ee1a291/go.mod h1:Q8hxIUXZW8vkezLwH4TnRmXv+XdRb4KfLtS9t5RtH9g=
github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU=
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63 h1:qZcnPZbiX8gGs3VmipVc3ft29vPYBZzlox/04Von6+k=
github.com/weaveworks/common v0.0.0-20230119144549-0aaa5abd1e63/go.mod h1:KoQ+3z63GUJzQ7AhU0AWQNU+LPda2EwL/cx1PlbDzVQ=
github.com/weaveworks/promrus v1.2.0 h1:jOLf6pe6/vss4qGHjXmGz4oDJQA+AOCqEL3FvvZGz7M=
github.com/weaveworks/promrus v1.2.0/go.mod h1:SaE82+OJ91yqjrE1rsvBWVzNZKcHYFtMUyS1+Ogs/KA=
github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xanzy/go-gitlab v0.32.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/goldmark v1.6.0 h1:boZcn2GTjpsynOsC0iJHnBWa4Bi0qzfJjthwauItG68=
github.com/yuin/goldmark v1.6.0/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs=
github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA=
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg=
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
github.com/zmb3/spotify/v2 v2.3.1 h1:aEyIPotROM3JJjHMCImFROgnPIUpzVo8wymYSaPSd9w=
github.com/zmb3/spotify/v2 v2.3.1/go.mod h1:+LVh9CafHu7SedyqYmEf12Rd01dIVlEL845yNhksW0E=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A=
go.opencensus.io v0.19.2/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0 h1:2ea0IkZBsWH+HA2GkD+7+hRw2u97jzdFyRtXuO14a1s=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.45.0/go.mod h1:4m3RnBBb+7dB9d21y510oO1pdB1V4J6smNf14WXcBFQ=
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/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc=
go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo=
go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4=
go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0 h1:ZtfnDL+tUrs1F0Pzfwbg2d59Gru9NCH3bgSHBM6LDwU=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0/go.mod h1:hG4Fj/y8TR/tlEDREo8tWstl9fO9gcFkn4xrx0Io8xU=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.42.0 h1:NmnYCiR0qNufkldjVvyQfZTHSdzeHoZ41zggMsdMcLM=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.42.0/go.mod h1:UVAO61+umUsHLtYb8KXXRoHtxUkdOPkYidzW3gipRLQ=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0 h1:wNMDy/LVGLj2h3p6zg4d0gypKfWKSWI14E1C4smOgl8=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.42.0/go.mod h1:YfbDdXAAkemWJK3H/DshvlrxqFB2rtW4rY6ky/3x/H0=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU=
go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA=
go.opentelemetry.io/otel/exporters/prometheus v0.42.0/go.mod h1:f3bYiqNqhoPxkvI2LrXqQVC546K7BuRDL/kKuxkujhA=
go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4=
go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM=
go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8=
go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E=
go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k=
go.opentelemetry.io/otel/sdk/metric v1.19.0/go.mod h1:XjG0jQyFJrv2PbMvwND7LwCEhsJzCzV5210euduKcKY=
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.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
gocloud.dev v0.19.0/go.mod h1:SmKwiR8YwIMMJvQBKLsC3fHNyMwXLw3PMDO+VVteJMI=
golang.org/x/build v0.0.0-20190314133821-5284462c4bec/go.mod h1:atTaCNAy0f16Ah5aV1gMSwgiKVHwu/JncqDpuRr7lS4=
golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4=
golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20170114055629-f2499483f923/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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/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-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=
golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o=
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
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/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190620070143-6f217b454f45/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191115151921-52ab43148777/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-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200917073148-efd3b9a0ff20/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/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-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/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-20220610221304-9f5ed59c137d/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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE=
golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/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.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113232020-e2727e816f5a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200102140908-9497f49d5709/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200204192400-7124308813f3/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200331202046-9d5940d49312/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc=
golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0=
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ=
gonum.org/v1/plot v0.14.0 h1:+LBDVFYwFe4LHhdP8coW6296MBEY4nQ+Y4vuUpJopcE=
gonum.org/v1/plot v0.14.0/go.mod h1:MLdR9424SJed+5VqC6MsouEpig9pZX2VZ57H9ko2bXU=
google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181220000619-583d854617af/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.2.0/go.mod h1:IfRCZScioGtypHNTlz3gFk67J8uePVW7uDTBzXuIkhU=
google.golang.org/api v0.3.0/go.mod h1:IuvZyQh8jgscv8qWfQ4ABd8m7hEudgBFM/EdhA3BnXw=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4=
google.golang.org/api v0.6.1-0.20190607001116-5213b8090861/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo=
google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4=
google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw=
google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU=
google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k=
google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI=
google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I=
google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo=
google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g=
google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA=
google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8=
google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs=
google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA=
google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw=
google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg=
google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.3.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/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A=
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24=
google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w=
google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ=
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY=
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo=
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.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.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20180904230853-4e7be11eab3f/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
k8s.io/api v0.17.4/go.mod h1:5qxx6vjmwUVG2nHQTKGlLts8Tbok8PzHl4vHtVFuZCA=
k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw=
k8s.io/apimachinery v0.0.0-20180904193909-def12e63c512/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=
k8s.io/apimachinery v0.17.4/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0g=
k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA=
k8s.io/apiserver v0.17.4/go.mod h1:5ZDQ6Xr5MNBxyi3iUZXS84QOhZl+W7Oq2us/29c0j9I=
k8s.io/client-go v0.0.0-20180910083459-2cefa64ff137/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s=
k8s.io/client-go v0.17.4/go.mod h1:ouF6o5pz3is8qU0/qYL2RnoxOPqgfuidYLowytyLJmc=
k8s.io/client-go v0.19.0/go.mod h1:H9E/VT95blcFQnlyShFgnFT9ZnJOAceiUHM3MlRC+mU=
k8s.io/cloud-provider v0.17.4/go.mod h1:XEjKDzfD+b9MTLXQFlDGkk6Ho8SGMpaU8Uugx/KNK9U=
k8s.io/code-generator v0.17.2/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s=
k8s.io/component-base v0.17.4/go.mod h1:5BRqHMbbQPm2kKu35v3G+CpVq4K0RJKC7TRioF0I9lE=
k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM=
k8s.io/csi-translation-lib v0.17.4/go.mod h1:CsxmjwxEI0tTNMzffIAcgR9lX4wOh6AKHdxQrT7L0oo=
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc=
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o=
k8s.io/kubernetes v1.11.10/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/legacy-cloud-providers v0.17.4/go.mod h1:FikRNoD64ECjkxO36gkDgJeiQWwyZTuBkhu+yxOc1Js=
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
kernel.org/pub/linux/libs/security/libcap/cap v1.2.67 h1:sPQ9qlSNR26fToTKbxe/HDWJlXvBLqGmt84LGCQkOy0=
kernel.org/pub/linux/libs/security/libcap/cap v1.2.67/go.mod h1:GkntoBuwffz19qtdFVB+k2NtWNN+yCKnC/Ykv/hMiTU=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.67 h1:NxbXJ7pDVq0FKBsqjieT92QDXI2XaqH2HAi4QcCOHt8=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.67/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24=
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw=
mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7/go.mod h1:HGC5lll35J70Y5v7vCGb9oLhHoScFwkHDJm/05RdSTc=
oss.terrastruct.com/d2 v0.6.1 h1:TEk7pl5yS1cnUxHOsIQ7bZCs+iRGsb5FaofaianfZk8=
oss.terrastruct.com/d2 v0.6.1/go.mod h1:ZyzsiefzsZ3w/BDnfF/hcDx9LKBlgieuolX8pXi7oJY=
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2 h1:n6y6RoZCgZDchN4gLGlzNRO1Jdf9xOGGqohDBph5BG8=
oss.terrastruct.com/util-go v0.0.0-20231101220827-55b3812542c2/go.mod h1:eMWv0sOtD9T2RUl90DLWfuShZCYp4NrsqNpI8eqO6U4=
pack.ag/amqp v0.11.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
sourcegraph.com/sqs/pbtypes v1.0.0/go.mod h1:3AciMUv4qUuRHRHhOG4TZOB+72GdPVz5k+c648qsFS4=
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,532 | 🐞 Confusing error message when `Context` is not the first parameter of a function | ### What is the issue?
Mostly what the title says. The error message I get from putting the `Context` in the wrong place is cryptic.
### Dagger version
dagger v0.9.7
### Steps to reproduce
Create any Zenith module function and put the `context.Context` in any location but the first parameter.
### Log output
```
Error: failed to automate vcs: failed to get vcs ignored paths: input: resolve: module: withSource: failed to get modified source directory for go module sdk codegen: process "/usr/local/bin/codegen --module . --propagate-logs=true --introspection-json-path /schema.json" did not complete successfully: exit code: 1
input: resolve: module: withSource: failed to get modified source directory for go module sdk codegen: process "/usr/local/bin/codegen --module . --propagate-logs=true --introspection-json-path /schema.json" did not complete successfully: exit code: 1
```
This was also in the output
```
Stderr:
internal error during module code generation: runtime error: invalid memory address or nil pointer dereference
``` | https://github.com/dagger/dagger/issues/6532 | https://github.com/dagger/dagger/pull/6551 | 5b273004464711d1efcf427da9cefa7dc389497d | dcee33ec84858610450ef30ddfcad60a9b9be053 | "2024-01-30T19:02:52Z" | go | "2024-02-07T17:20:29Z" | cmd/codegen/generator/go/templates/module_funcs.go | package templates
import (
"encoding/json"
"fmt"
"go/types"
"maps"
"strconv"
"strings"
. "github.com/dave/jennifer/jen" //nolint:stylecheck
)
const errorTypeName = "error"
var voidDef = Qual("dag", "TypeDef").Call().
Dot("WithKind").Call(Id("VoidKind")).
Dot("WithOptional").Call(Lit(true))
func (ps *parseState) parseGoFunc(parentType *types.Named, fn *types.Func) (*funcTypeSpec, error) {
spec := &funcTypeSpec{
name: fn.Name(),
}
funcDecl, err := ps.declForFunc(parentType, fn)
if err != nil {
return nil, fmt.Errorf("failed to find decl for method %s: %w", fn.Name(), err)
}
spec.doc = funcDecl.Doc.Text()
sig, ok := fn.Type().(*types.Signature)
if !ok {
return nil, fmt.Errorf("expected method to be a func, got %T", fn.Type())
}
spec.goType = sig
spec.argSpecs, err = ps.parseParamSpecs(parentType, fn)
if err != nil {
return nil, err
}
if parentType != nil {
if _, ok := parentType.Underlying().(*types.Struct); ok {
// stash away the method signature so we can remember details on how it's
// invoked (e.g. no error return, no ctx arg, error-only return, etc)
// TODO: clean up w/ new approach of everything being a TypeSpec?
receiverTypeName := parentType.Obj().Name()
ps.methods[receiverTypeName] = append(ps.methods[receiverTypeName], method{fn: fn, paramSpecs: spec.argSpecs})
}
}
results := sig.Results()
switch results.Len() {
case 0:
// returnSpec stays nil, indicating void return
case 1:
result := results.At(0).Type()
if result.String() == errorTypeName {
spec.returnsError = true
break
}
spec.returnSpec, err = ps.parseGoTypeReference(result, nil, false)
if err != nil {
return nil, fmt.Errorf("failed to parse return type: %w", err)
}
case 2:
spec.returnsError = true
result := results.At(0).Type()
spec.returnSpec, err = ps.parseGoTypeReference(result, nil, false)
if err != nil {
return nil, fmt.Errorf("failed to parse return type: %w", err)
}
default:
return nil, fmt.Errorf("method %s has too many return values", fn.Name())
}
return spec, nil
}
type funcTypeSpec struct {
name string
doc string
argSpecs []paramSpec
returnSpec ParsedType // nil if void return
returnsError bool
goType *types.Signature
}
var _ ParsedType = &funcTypeSpec{}
func (spec *funcTypeSpec) TypeDefCode() (*Statement, error) {
var fnReturnTypeDefCode *Statement
if spec.returnSpec == nil {
fnReturnTypeDefCode = voidDef
} else {
var err error
fnReturnTypeDefCode, err = spec.returnSpec.TypeDefCode()
if err != nil {
return nil, fmt.Errorf("failed to generate return type code: %w", err)
}
}
fnTypeDefCode := Qual("dag", "Function").Call(Lit(spec.name), Add(Line(), fnReturnTypeDefCode))
if spec.doc != "" {
fnTypeDefCode = dotLine(fnTypeDefCode, "WithDescription").Call(Lit(strings.TrimSpace(spec.doc)))
}
for i, argSpec := range spec.argSpecs {
if i == 0 && argSpec.paramType.String() == contextTypename {
// ignore ctx arg
continue
}
argTypeDefCode, err := argSpec.typeSpec.TypeDefCode()
if err != nil {
return nil, fmt.Errorf("failed to generate arg type code: %w", err)
}
if argSpec.optional {
argTypeDefCode = argTypeDefCode.Dot("WithOptional").Call(Lit(true))
}
argOptsCode := []Code{}
if argSpec.description != "" {
argOptsCode = append(argOptsCode, Id("Description").Op(":").Lit(argSpec.description))
}
if argSpec.defaultValue != "" {
var jsonEnc string
if argSpec.typeSpec.GoType().String() == "string" {
enc, err := json.Marshal(argSpec.defaultValue)
if err != nil {
return nil, fmt.Errorf("failed to marshal default value: %w", err)
}
jsonEnc = string(enc)
} else {
jsonEnc = argSpec.defaultValue
}
argOptsCode = append(argOptsCode, Id("DefaultValue").Op(":").Id("JSON").Call(Lit(jsonEnc)))
}
// arguments to WithArg (args to arg... ugh, at least the name of the variable is honest?)
argTypeDefArgCode := []Code{Lit(argSpec.name), argTypeDefCode}
if len(argOptsCode) > 0 {
argTypeDefArgCode = append(argTypeDefArgCode, Id("FunctionWithArgOpts").Values(argOptsCode...))
}
fnTypeDefCode = dotLine(fnTypeDefCode, "WithArg").Call(argTypeDefArgCode...)
}
return fnTypeDefCode, nil
}
func (spec *funcTypeSpec) GoType() types.Type {
return spec.goType
}
func (spec *funcTypeSpec) GoSubTypes() []types.Type {
var types []types.Type
if spec.returnSpec != nil {
types = append(types, spec.returnSpec.GoSubTypes()...)
}
for _, argSpec := range spec.argSpecs {
if argSpec.typeSpec == nil {
// ignore context
continue
}
types = append(types, argSpec.typeSpec.GoSubTypes()...)
}
return types
}
func (ps *parseState) parseParamSpecs(parentType *types.Named, fn *types.Func) ([]paramSpec, error) {
sig := fn.Type().(*types.Signature)
params := sig.Params()
if params.Len() == 0 {
return nil, nil
}
specs := make([]paramSpec, 0, params.Len())
i := 0
if params.At(i).Type().String() == contextTypename {
spec, err := ps.parseParamSpecVar(params.At(i), "", "")
if err != nil {
return nil, err
}
specs = append(specs, spec)
i++
}
fnDecl, err := ps.declForFunc(parentType, fn)
if err != nil {
return nil, err
}
// is the first data param an inline struct? if so, process each field of
// the struct as a top-level param
if i+1 == params.Len() {
param := params.At(i)
paramType, ok := asInlineStruct(param.Type())
if ok {
stype, ok := asInlineStructAst(fnDecl.Type.Params.List[i].Type)
if !ok {
return nil, fmt.Errorf("expected struct type for %s", param.Name())
}
parent := ¶mSpec{
name: params.At(i).Name(),
paramType: param.Type(),
}
paramFields := unpackASTFields(stype.Fields)
for f := 0; f < paramType.NumFields(); f++ {
spec, err := ps.parseParamSpecVar(paramType.Field(f), paramFields[f].Doc.Text(), paramFields[f].Comment.Text())
if err != nil {
return nil, err
}
spec.parent = parent
specs = append(specs, spec)
}
return specs, nil
}
}
// if other parameter passing schemes fail, just treat each remaining arg
// as a top-level param
paramFields := unpackASTFields(fnDecl.Type.Params)
for ; i < params.Len(); i++ {
docComment, lineComment := ps.commentForFuncField(fnDecl, paramFields, i)
spec, err := ps.parseParamSpecVar(params.At(i), docComment.Text(), lineComment.Text())
if err != nil {
return nil, err
}
if sig.Variadic() && i == params.Len()-1 {
spec.variadic = true
}
specs = append(specs, spec)
}
return specs, nil
}
func (ps *parseState) parseParamSpecVar(field *types.Var, docComment string, lineComment string) (paramSpec, error) {
if _, ok := field.Type().(*types.Struct); ok {
return paramSpec{}, fmt.Errorf("nested structs are not supported")
}
paramType := field.Type()
baseType := paramType
isPtr := false
for {
ptr, ok := baseType.(*types.Pointer)
if !ok {
break
}
isPtr = true
baseType = ptr.Elem()
}
optional := false
defaultValue := ""
wrappedType, isOptionalType, err := ps.isOptionalWrapper(baseType)
if err != nil {
return paramSpec{}, fmt.Errorf("failed to check if type is optional: %w", err)
}
if isOptionalType {
optional = true
baseType = wrappedType
isPtr = false
for {
ptr, ok := baseType.(*types.Pointer)
if !ok {
break
}
isPtr = true
baseType = ptr.Elem()
}
}
docPragmas, docComment := parsePragmaComment(docComment)
linePragmas, lineComment := parsePragmaComment(lineComment)
comment := strings.TrimSpace(docComment)
if comment == "" {
comment = strings.TrimSpace(lineComment)
}
pragmas := make(map[string]string)
maps.Copy(pragmas, docPragmas)
maps.Copy(pragmas, linePragmas)
if v, ok := pragmas["default"]; ok {
defaultValue = v
}
if v, ok := pragmas["optional"]; ok {
if v == "" {
optional = true
} else {
optional, _ = strconv.ParseBool(v)
}
}
// ignore ctx arg for parsing type reference
isContext := paramType.String() == contextTypename
var typeSpec ParsedType
if !isContext {
var err error
typeSpec, err = ps.parseGoTypeReference(baseType, nil, isPtr)
if err != nil {
return paramSpec{}, fmt.Errorf("failed to parse type reference: %w", err)
}
}
name := field.Name()
if name == "" && typeSpec != nil {
// emulate struct behaviour, where a field with no name gets the type name
name = typeSpec.GoType().String()
}
return paramSpec{
name: name,
paramType: paramType,
typeSpec: typeSpec,
optional: optional,
hasOptionalWrapper: isOptionalType,
isContext: isContext,
defaultValue: defaultValue,
description: comment,
}, nil
}
type paramSpec struct {
name string
description string
optional bool
variadic bool
// hasOptionalWrapper is true if the type is wrapped in the Optional generic type
hasOptionalWrapper bool
// isContext is true if the type is context.Context
isContext bool
defaultValue string
// paramType is the full type declared in the function signature, which may
// include pointer types, Optional, etc
paramType types.Type
// typeSpec is the parsed TypeSpec of the argument's "base type", which doesn't
// include pointers, Optional, etc
typeSpec ParsedType
// parent is set if this paramSpec is nested inside a parent inline struct,
// and is used to create a declaration of the entire inline struct
parent *paramSpec
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,532 | 🐞 Confusing error message when `Context` is not the first parameter of a function | ### What is the issue?
Mostly what the title says. The error message I get from putting the `Context` in the wrong place is cryptic.
### Dagger version
dagger v0.9.7
### Steps to reproduce
Create any Zenith module function and put the `context.Context` in any location but the first parameter.
### Log output
```
Error: failed to automate vcs: failed to get vcs ignored paths: input: resolve: module: withSource: failed to get modified source directory for go module sdk codegen: process "/usr/local/bin/codegen --module . --propagate-logs=true --introspection-json-path /schema.json" did not complete successfully: exit code: 1
input: resolve: module: withSource: failed to get modified source directory for go module sdk codegen: process "/usr/local/bin/codegen --module . --propagate-logs=true --introspection-json-path /schema.json" did not complete successfully: exit code: 1
```
This was also in the output
```
Stderr:
internal error during module code generation: runtime error: invalid memory address or nil pointer dereference
``` | https://github.com/dagger/dagger/issues/6532 | https://github.com/dagger/dagger/pull/6551 | 5b273004464711d1efcf427da9cefa7dc389497d | dcee33ec84858610450ef30ddfcad60a9b9be053 | "2024-01-30T19:02:52Z" | go | "2024-02-07T17:20:29Z" | cmd/codegen/generator/go/templates/modules.go | package templates
import (
"fmt"
"go/ast"
"go/token"
"go/types"
"os"
"path/filepath"
"regexp"
"runtime/debug"
"sort"
"strings"
. "github.com/dave/jennifer/jen" //nolint:stylecheck
"github.com/iancoleman/strcase"
"golang.org/x/tools/go/packages"
)
const (
daggerGenFilename = "dagger.gen.go"
contextTypename = "context.Context"
constructorFuncName = "New"
daggerObjectIfaceName = "DaggerObject"
)
func (funcs goTemplateFuncs) isModuleCode() bool {
return funcs.moduleName != ""
}
/*
moduleMainSrc generates the source code of the main func for Dagger Module code using the Go SDK.
The overall idea is that users just need to create a struct with the same name as their Module and then
add methods to that struct to implement their Module. Methods on that struct become Functions.
They are also free to return custom objects from Functions, which themselves may have methods that become
Functions too. However, only the "top-level" Module struct's Functions will be directly invokable.
This is essentially just the GraphQL execution model.
The implementation works by parsing the user's code and generating a main func that reads function call inputs
from the Engine, calls the relevant function and returns the result. The generated code is mostly a giant switch/case
on the object+function name, with each case doing json deserialization of the input arguments and calling the actual
Go function.
*/
func (funcs goTemplateFuncs) moduleMainSrc() (string, error) {
// HACK: the code in this func can be pretty flaky and tricky to debug -
// it's much easier to debug when we actually have stack traces, so we grab
// those on a panic
defer func() {
if r := recover(); r != nil {
fmt.Fprintf(os.Stderr, "internal error during module code generation: %v\n", r)
debug.PrintStack()
panic(r)
}
}()
if funcs.modulePkg == nil {
// during bootstrapping, we might not have code yet, since it takes
// multiple passes.
return `func main() { panic("no code yet") }`, nil
}
ps := &parseState{
pkg: funcs.modulePkg,
fset: funcs.moduleFset,
methods: make(map[string][]method),
moduleName: funcs.moduleName,
}
pkgScope := funcs.modulePkg.Types.Scope()
objFunctionCases := map[string][]Code{}
createMod := Qual("dag", "Module").Call()
objs := []types.Object{}
for _, name := range pkgScope.Names() {
obj := pkgScope.Lookup(name)
if obj == nil {
continue
}
objs = append(objs, obj)
}
// preserve definition order, so developer can keep more important /
// entrypoint types higher up
sort.Slice(objs, func(i, j int) bool {
return objs[i].Pos() < objs[j].Pos()
})
tps := []types.Type{}
for _, obj := range objs {
// check if this is the constructor func, save it for later if so
if ok := ps.checkConstructor(obj); ok {
continue
}
// check if this is the DaggerObject interface
if ok := ps.checkDaggerObjectIface(obj); ok {
continue
}
if ps.isMainModuleObject(obj.Name()) || ps.isDaggerGenerated(obj) {
tps = append(tps, obj.Type())
}
}
if ps.daggerObjectIfaceType == nil {
return "", fmt.Errorf("cannot find default codegen %s interface", daggerObjectIfaceName)
}
added := map[string]struct{}{}
implementationCode := Empty()
for len(tps) != 0 {
var nextTps []types.Type
for _, tp := range tps {
named, isNamed := tp.(*types.Named)
if !isNamed {
continue
}
obj := named.Obj()
if obj.Pkg() != funcs.modulePkg.Types {
// the type must be created in the target package
continue
}
if !obj.Exported() {
// the type must be exported
return "", fmt.Errorf("cannot code-generate unexported type %s", obj.Name())
}
// avoid adding a struct definition twice (if it's referenced in two function signatures)
if _, ok := added[obj.Name()]; ok {
continue
}
switch underlyingObj := named.Underlying().(type) {
case *types.Struct:
strct := underlyingObj
objTypeSpec, err := ps.parseGoStruct(strct, named)
if err != nil {
return "", err
}
if objTypeSpec == nil {
// not including in module schema, skip it
continue
}
if err := ps.fillObjectFunctionCases(named, objFunctionCases); err != nil {
// errors indicate an internal problem rather than something w/ user code, so error instead
return "", fmt.Errorf("failed to generate function cases for %s: %w", obj.Name(), err)
}
// Add the object to the module
objTypeDefCode, err := objTypeSpec.TypeDefCode()
if err != nil {
return "", fmt.Errorf("failed to generate type def code for %s: %w", obj.Name(), err)
}
createMod = dotLine(createMod, "WithObject").Call(Add(Line(), objTypeDefCode))
added[obj.Name()] = struct{}{}
implCode, err := objTypeSpec.ImplementationCode()
if err != nil {
return "", fmt.Errorf("failed to generate json method code for %s: %w", obj.Name(), err)
}
implementationCode.Add(implCode).Line()
// If the object has any extra sub-types (e.g. for function return
// values), add them to the list of types to process
nextTps = append(nextTps, objTypeSpec.GoSubTypes()...)
case *types.Interface:
iface := underlyingObj
ifaceTypeSpec, err := ps.parseGoIface(iface, named)
if err != nil {
return "", err
}
if ifaceTypeSpec == nil {
// not including in module schema, skip it
continue
}
// Add the iface to the module
ifaceTypeDefCode, err := ifaceTypeSpec.TypeDefCode()
if err != nil {
return "", fmt.Errorf("failed to generate type def code for %s: %w", obj.Name(), err)
}
createMod = dotLine(createMod, "WithInterface").Call(Add(Line(), ifaceTypeDefCode))
added[obj.Name()] = struct{}{}
implCode, err := ifaceTypeSpec.ImplementationCode()
if err != nil {
return "", fmt.Errorf("failed to generate concrete struct code for %s: %w", obj.Name(), err)
}
implementationCode.Add(implCode).Line()
// If the object has any extra sub-types (e.g. for function return
// values), add them to the list of types to process
nextTps = append(nextTps, ifaceTypeSpec.GoSubTypes()...)
}
}
tps, nextTps = nextTps, nil
}
return strings.Join([]string{
fmt.Sprintf("%#v", implementationCode),
mainSrc,
invokeSrc(objFunctionCases, createMod),
}, "\n"), nil
}
func dotLine(a *Statement, id string) *Statement {
return a.Op(".").Line().Id(id)
}
const (
// The static part of the generated code. It calls out to the "invoke" func, which is the mostly
// dynamically generated code that actually calls the user's functions.
mainSrc = `func main() {
ctx := context.Background()
fnCall := dag.CurrentFunctionCall()
parentName, err := fnCall.ParentName(ctx)
if err != nil {
fmt.Println(err.Error())
os.Exit(2)
}
fnName, err := fnCall.Name(ctx)
if err != nil {
fmt.Println(err.Error())
os.Exit(2)
}
parentJson, err := fnCall.Parent(ctx)
if err != nil {
fmt.Println(err.Error())
os.Exit(2)
}
fnArgs, err := fnCall.InputArgs(ctx)
if err != nil {
fmt.Println(err.Error())
os.Exit(2)
}
inputArgs := map[string][]byte{}
for _, fnArg := range fnArgs {
argName, err := fnArg.Name(ctx)
if err != nil {
fmt.Println(err.Error())
os.Exit(2)
}
argValue, err := fnArg.Value(ctx)
if err != nil {
fmt.Println(err.Error())
os.Exit(2)
}
inputArgs[argName] = []byte(argValue)
}
result, err := invoke(ctx, []byte(parentJson), parentName, fnName, inputArgs)
if err != nil {
fmt.Println(err.Error())
os.Exit(2)
}
resultBytes, err := json.Marshal(result)
if err != nil {
fmt.Println(err.Error())
os.Exit(2)
}
_, err = fnCall.ReturnValue(ctx, JSON(resultBytes))
if err != nil {
fmt.Println(err.Error())
os.Exit(2)
}
}
`
parentJSONVar = "parentJSON"
parentNameVar = "parentName"
fnNameVar = "fnName"
inputArgsVar = "inputArgs"
invokeFuncName = "invoke"
)
// the source code of the invoke func, which is the mostly dynamically generated code that actually calls the user's functions
func invokeSrc(objFunctionCases map[string][]Code, createMod Code) string {
// each `case` statement for every object name, which makes up the body of the invoke func
objCases := []Code{}
for objName, functionCases := range objFunctionCases {
objCases = append(objCases, Case(Lit(objName)).Block(Switch(Id(fnNameVar)).Block(functionCases...)))
}
// when the object name is empty, return the module definition
objCases = append(objCases, Case(Lit("")).Block(
Return(createMod, Nil()),
))
// default case (return error)
objCases = append(objCases, Default().Block(
Return(Nil(), Qual("fmt", "Errorf").Call(Lit("unknown object %s"), Id(parentNameVar))),
))
objSwitch := Switch(Id(parentNameVar)).Block(objCases...)
// func invoke(
invokeFunc := Func().Id(invokeFuncName).Params(
// ctx context.Context,
Id("ctx").Qual("context", "Context"),
// parentJSON []byte,
Id(parentJSONVar).Index().Byte(),
// parentName string,
Id(parentNameVar).String(),
// fnName string,
Id(fnNameVar).String(),
// inputArgs map[string][]byte,
Id(inputArgsVar).Map(String()).Index().Byte(),
).Params(
// ) (_ any,
Id("_").Id("any"),
// err error)
Id("err").Error(),
).Block(objSwitch)
return fmt.Sprintf("%#v", invokeFunc)
}
// TODO: use jennifer for generating this magical typedef
func renderNameOrStruct(t types.Type) string {
if ptr, ok := t.(*types.Pointer); ok {
return "*" + renderNameOrStruct(ptr.Elem())
}
if sl, ok := t.(*types.Slice); ok {
return "[]" + renderNameOrStruct(sl.Elem())
}
if st, ok := t.(*types.Struct); ok {
result := "struct {\n"
for i := 0; i < st.NumFields(); i++ {
if !st.Field(i).Embedded() {
result += st.Field(i).Name() + " "
}
result += renderNameOrStruct(st.Field(i).Type())
if tag := st.Tag(i); tag != "" {
result += " `" + tag + "`"
}
result += "\n"
}
result += "}"
return result
}
if named, ok := t.(*types.Named); ok {
if _, ok := named.Underlying().(*types.Interface); ok {
return "*" + formatIfaceImplName(named.Obj().Name())
}
// Assume local
//
// TODO: this isn't always true - we likely want to support returning
// types from other packages as well. However, this is tricky - how
// should we handle returning *time.Time? We should probably convert
// this to a graphql type that all langs can convert to their native
// representation.
base := named.Obj().Name()
if typeArgs := named.TypeArgs(); typeArgs.Len() > 0 {
base += "["
for i := 0; i < typeArgs.Len(); i++ {
if i > 0 {
base += ", "
}
base += renderNameOrStruct(typeArgs.At(i))
}
base += "]"
}
return base
}
// HACK(vito): this is passed to Id(), which is a bit weird, but works
return t.String()
}
func checkErrStatement(label string) *Statement {
return If(Err().Op("!=").Nil()).Block(
// panic(fmt.Errorf("%s: %w", label, Err())
Id("panic").Call(Qual("fmt", "Errorf").Call(Lit("%s: %w"), Lit(label), Err())),
)
}
func (ps *parseState) checkConstructor(obj types.Object) bool {
fn, isFn := obj.(*types.Func)
if !isFn {
return false
}
if fn.Name() != constructorFuncName {
return false
}
ps.constructor = fn
return true
}
func (ps *parseState) checkDaggerObjectIface(obj types.Object) bool {
named, isNamed := obj.Type().(*types.Named)
if !isNamed {
return false
}
iface, isIface := named.Underlying().(*types.Interface)
if !isIface {
return false
}
if named.Obj().Name() != daggerObjectIfaceName {
return false
}
ps.daggerObjectIfaceType = iface
return true
}
// fillObjectFunctionCases recursively fills out the `cases` map with entries for object name -> `case` statement blocks
// for each function in that object
func (ps *parseState) fillObjectFunctionCases(type_ types.Type, cases map[string][]Code) error {
var objName string
switch x := type_.(type) {
case *types.Pointer:
return ps.fillObjectFunctionCases(x.Elem(), cases)
case *types.Named:
objName = x.Obj().Name()
default:
return nil
}
if existingCases := cases[objName]; len(existingCases) > 0 {
// handles recursive types, e.g. objects with chainable methods that return themselves
return nil
}
hasConstructor := ps.isMainModuleObject(objName) && ps.constructor != nil
methods := ps.methods[objName]
if len(methods) == 0 && !hasConstructor {
return nil
}
for _, method := range methods {
fnName, sig := method.fn.Name(), method.fn.Type().(*types.Signature)
if err := ps.fillObjectFunctionCase(objName, fnName, fnName, sig, method.paramSpecs, cases); err != nil {
return err
}
}
// main module object constructor case
if hasConstructor {
sig, ok := ps.constructor.Type().(*types.Signature)
if !ok {
return fmt.Errorf("expected %s to be a function, got %T", constructorFuncName, ps.constructor.Type())
}
paramSpecs, err := ps.parseParamSpecs(nil, ps.constructor)
if err != nil {
return fmt.Errorf("failed to parse %s function: %w", constructorFuncName, err)
}
// Validate the constructor returns the main module object (further general validation happens in fillObjectFunctionCase)
results := sig.Results()
if results.Len() == 0 {
return fmt.Errorf("%s must return a value", constructorFuncName)
}
resultType := results.At(0).Type()
if ptrType, ok := resultType.(*types.Pointer); ok {
resultType = ptrType.Elem()
}
namedType, ok := resultType.(*types.Named)
if !ok {
return fmt.Errorf("%s must return the main module object %q", constructorFuncName, objName)
}
if namedType.Obj().Name() != objName {
return fmt.Errorf("%s must return the main module object %q", constructorFuncName, objName)
}
if err := ps.fillObjectFunctionCase(objName, ps.constructor.Name(), "", sig, paramSpecs, cases); err != nil {
return err
}
}
// default case (return error)
cases[objName] = append(cases[objName], Default().Block(
Return(Nil(), Qual("fmt", "Errorf").Call(Lit("unknown function %s"), Id(fnNameVar))),
))
return nil
}
func (ps *parseState) fillObjectFunctionCase(
objName string,
fnName string,
caseName string, // separate from fnName to handle constructor where the caseName is empty string
sig *types.Signature,
paramSpecs []paramSpec,
cases map[string][]Code,
) error {
statements := []Code{}
parentVarName := "parent"
statements = append(statements,
Var().Id(parentVarName).Id(objName),
Err().Op("=").Qual("json", "Unmarshal").Call(Id(parentJSONVar), Op("&").Id(parentVarName)),
checkErrStatement("failed to unmarshal parent object"),
)
var fnCallArgs []Code
if sig.Recv() != nil {
fnCallArgs = []Code{Op("&").Id(parentVarName)}
}
vars := map[string]struct{}{}
for i, spec := range paramSpecs {
if i == 0 && spec.paramType.String() == contextTypename {
fnCallArgs = append(fnCallArgs, Id("ctx"))
continue
}
var varName string
var varType types.Type
var target *Statement
if spec.parent == nil {
varName = strcase.ToLowerCamel(spec.name)
varType = spec.paramType
target = Id(varName)
} else {
// create only one declaration for option structs
varName = spec.parent.name
varType = spec.parent.paramType
target = Id(spec.parent.name).Dot(spec.name)
}
if _, ok := vars[varName]; !ok {
vars[varName] = struct{}{}
tp := varType
fnCallArgCode := Id(varName)
tp2, fnCallArgCode2, ok, err := ps.functionCallArgCode(varType, Id(varName))
if err != nil {
return fmt.Errorf("failed to get function call arg code for %s: %w", varName, err)
}
if ok {
tp = tp2
fnCallArgCode = fnCallArgCode2
}
statements = append(statements, Var().Id(varName).Id(renderNameOrStruct(tp)))
if spec.variadic {
fnCallArgs = append(fnCallArgs, fnCallArgCode.Op("..."))
} else {
fnCallArgs = append(fnCallArgs, fnCallArgCode)
}
}
statements = append(statements,
If(Id(inputArgsVar).Index(Lit(spec.name)).Op("!=").Nil()).Block(
Err().Op("=").Qual("json", "Unmarshal").Call(
Index().Byte().Parens(Id(inputArgsVar).Index(Lit(spec.name))),
Op("&").Add(target),
),
checkErrStatement("failed to unmarshal input arg "+spec.name),
))
}
results := sig.Results()
var callStatement *Statement
if sig.Recv() != nil {
callStatement = Parens(Op("*").Id(objName)).Dot(fnName).Call(fnCallArgs...)
} else {
callStatement = Id(fnName).Call(fnCallArgs...)
}
switch results.Len() {
case 2:
// assume second value is error
if results.At(1).Type().String() != errorTypeName {
// sanity check
return fmt.Errorf("second return value must be error, have %s", results.At(1).Type().String())
}
statements = append(statements, Return(callStatement))
cases[objName] = append(cases[objName], Case(Lit(caseName)).Block(statements...))
if err := ps.fillObjectFunctionCases(results.At(0).Type(), cases); err != nil {
return err
}
return nil
case 1:
if results.At(0).Type().String() == errorTypeName {
// void error return
statements = append(statements, Return(Nil(), callStatement))
cases[objName] = append(cases[objName], Case(Lit(caseName)).Block(statements...))
} else {
// non-error return
statements = append(statements, Return(callStatement, Nil()))
cases[objName] = append(cases[objName], Case(Lit(caseName)).Block(statements...))
if err := ps.fillObjectFunctionCases(results.At(0).Type(), cases); err != nil {
return err
}
}
return nil
case 0:
// void return
//
// NB(vito): it's really weird to have a fully void return (not even
// error), but we should still support it for completeness.
statements = append(statements,
callStatement,
Return(Nil(), Nil()))
cases[objName] = append(cases[objName], Case(Lit(caseName)).Block(statements...))
return nil
default:
return fmt.Errorf("unexpected number of results from function %s: %d", fnName, results.Len())
}
}
type parseState struct {
pkg *packages.Package
fset *token.FileSet
methods map[string][]method
moduleName string
// If it exists, constructor is the New func that returns the main module object
constructor *types.Func
// the DaggerObject interface type, used to check that user defined interfaces embed it
daggerObjectIfaceType *types.Interface
}
func (ps *parseState) isMainModuleObject(name string) bool {
return strcase.ToCamel(ps.moduleName) == strcase.ToCamel(name)
}
type method struct {
fn *types.Func
paramSpecs []paramSpec
}
// astSpecForNamedType returns the *ast* type spec for the given Named type. This is needed
// because the types.Named object does not have the comments associated with the type, which
// we want to parse.
func (ps *parseState) astSpecForNamedType(namedType *types.Named) (*ast.TypeSpec, error) {
tokenFile := ps.fset.File(namedType.Obj().Pos())
if tokenFile == nil {
return nil, fmt.Errorf("no file for %s", namedType.Obj().Name())
}
for _, f := range ps.pkg.Syntax {
if ps.fset.File(f.Pos()) != tokenFile {
continue
}
for _, decl := range f.Decls {
genDecl, ok := decl.(*ast.GenDecl)
if !ok {
continue
}
for _, spec := range genDecl.Specs {
typeSpec, ok := spec.(*ast.TypeSpec)
if !ok {
continue
}
if typeSpec.Name.Name == namedType.Obj().Name() {
if typeSpec.Doc == nil {
typeSpec.Doc = genDecl.Doc
}
return typeSpec, nil
}
}
}
}
return nil, fmt.Errorf("no decl for %s", namedType.Obj().Name())
}
// declForFunc returns the *ast* func decl for the given Func type. This is needed
// because the types.Func object does not have the comments associated with the type, which
// we want to parse.
func (ps *parseState) declForFunc(parentType *types.Named, fnType *types.Func) (*ast.FuncDecl, error) {
var recv *types.Named
if signature, ok := fnType.Type().(*types.Signature); ok && signature.Recv() != nil {
tp := signature.Recv().Type()
for {
if p, ok := tp.(*types.Pointer); ok {
tp = p.Elem()
continue
}
break
}
recv, _ = tp.(*types.Named)
}
var underlying types.Type
if parentType != nil {
underlying = parentType.Underlying()
}
tokenFile := ps.fset.File(fnType.Pos())
if tokenFile == nil {
return nil, fmt.Errorf("no file for %s", fnType.Name())
}
for _, f := range ps.pkg.Syntax {
if ps.fset.File(f.Pos()) != tokenFile {
continue
}
for _, decl := range f.Decls {
switch underlying.(type) {
case *types.Struct, nil:
// top-level func or method on object case
for _, decl := range f.Decls {
fnDecl, ok := decl.(*ast.FuncDecl)
if !ok {
continue
}
if fnDecl.Name.Name != fnType.Name() {
continue
}
if recv != nil {
if len(fnDecl.Recv.List) != 1 {
continue
}
tp := fnDecl.Recv.List[0].Type
for {
if star, ok := tp.(*ast.StarExpr); ok {
tp = star.X
continue
}
break
}
ident, ok := tp.(*ast.Ident)
if !ok {
continue
}
if ident.Name != recv.Obj().Name() {
continue
}
}
return fnDecl, nil
}
case *types.Interface:
// interface method case
genDecl, ok := decl.(*ast.GenDecl)
if !ok {
continue
}
for _, spec := range genDecl.Specs {
typeSpec, ok := spec.(*ast.TypeSpec)
if !ok {
continue
}
if typeSpec.Name.Name != parentType.Obj().Name() {
continue
}
iface, ok := typeSpec.Type.(*ast.InterfaceType)
if !ok {
continue
}
for _, ifaceField := range iface.Methods.List {
ifaceFieldFunc, ok := ifaceField.Type.(*ast.FuncType)
if !ok {
continue
}
ifaceFieldFuncName := ifaceField.Names[0].Name
if ifaceFieldFuncName != fnType.Name() {
continue
}
return &ast.FuncDecl{
Doc: ifaceField.Doc,
Type: ifaceFieldFunc,
}, nil
}
}
}
}
}
return nil, fmt.Errorf("no decl for %s", fnType.Name())
}
// commentForFuncField returns the *ast* comment group for the given position. This
// is needed because function args (despite being fields) don't have comments
// associated with them, so this is a neat little hack to get them out.
func (ps *parseState) commentForFuncField(fnDecl *ast.FuncDecl, unpackedParams []*ast.Field, i int) (docComment *ast.CommentGroup, lineComment *ast.CommentGroup) {
pos := unpackedParams[i].Pos()
tokenFile := ps.fset.File(pos)
if tokenFile == nil {
return nil, nil
}
line := tokenFile.Line(pos)
allowDocComment := true
allowLineComment := true
if i == 0 {
fieldStartLine := tokenFile.Line(fnDecl.Type.Params.Pos())
if fieldStartLine == line || fieldStartLine == line-1 {
// the argument is on the same (or next) line as the function
// declaration, so there is no doc comment to find
allowDocComment = false
}
} else {
prevArgLine := tokenFile.Line(unpackedParams[i-1].Pos())
if prevArgLine == line || prevArgLine == line-1 {
// the argument is on the same (or next) line as the previous
// argument, so again there is no doc comment to find
allowDocComment = false
}
}
if i+1 < len(fnDecl.Type.Params.List) {
nextArgLine := tokenFile.Line(unpackedParams[i+1].Pos())
if nextArgLine == line {
// the argument is on the same line as the next argument, so there is
// no line comment to find
allowLineComment = false
}
} else {
fieldEndLine := tokenFile.Line(fnDecl.Type.Params.End())
if fieldEndLine == line {
// the argument is on the same line as the end of the field list, so there
// is no line comment to find
allowLineComment = false
}
}
for _, f := range ps.pkg.Syntax {
if ps.fset.File(f.Pos()) != tokenFile {
continue
}
if allowDocComment {
// take the last position in the last line, and try and find a
// comment that contains it
npos := tokenFile.LineStart(tokenFile.Line(pos)) - 1
for _, comment := range f.Comments {
if comment.Pos() <= npos && npos <= comment.End() {
docComment = comment
break
}
}
}
if allowLineComment {
// take the last position in the current line, and try and find a
// comment that contains it
npos := tokenFile.LineStart(tokenFile.Line(pos)+1) - 1
for _, comment := range f.Comments {
if comment.Pos() <= npos && npos <= comment.End() {
lineComment = comment
break
}
}
}
}
return docComment, lineComment
}
func (ps *parseState) isDaggerGenerated(obj types.Object) bool {
tokenFile := ps.fset.File(obj.Pos())
return filepath.Base(tokenFile.Name()) == daggerGenFilename
}
// returns whether the given type is an Optional and, if so, the wrapped type
func (ps *parseState) isOptionalWrapper(typ types.Type) (types.Type, bool, error) {
named, ok := typ.(*types.Named)
if !ok {
return nil, false, nil
}
if named.Obj().Name() != "Optional" || !ps.isDaggerGenerated(named.Obj()) {
return nil, false, nil
}
typeArgs := named.TypeArgs()
if typeArgs.Len() != 1 {
return nil, false, fmt.Errorf("optional type must have exactly one type argument")
}
return typeArgs.At(0), true, nil
}
/*
functionCallArgCode takes a type and code for providing an arg of that type (just
the name of the arg variable as a base) and returns the type that should be used
to declare the arg as well as the code that should be used to provide the arg
variable to a function call
This is needed to handle various special cases:
* Function args that are various degrees of pointeriness (i.e. *string, **int, etc.)
* Concrete structs implementing an interface that will be provided as an arg
* Slices and Optional wrappers of the above
*/
func (ps *parseState) functionCallArgCode(t types.Type, access *Statement) (types.Type, *Statement, bool, error) {
switch t := t.(type) {
case *types.Pointer:
// taking the address of an address isn't allowed - so we use a ptr
// helper function
t2, access2, ok, err := ps.functionCallArgCode(t.Elem(), access)
if err != nil {
return nil, nil, false, err
}
if ok {
/*
Taking the address of an address isn't allowed - so we use a ptr helper
function. e.g.:
ptr(access)
*/
return t2, Id("ptr").Call(access2), true, nil
}
return nil, nil, false, nil
case *types.Named:
wrappedType, isOptionalType, err := ps.isOptionalWrapper(t)
if err != nil {
return nil, nil, false, err
}
if isOptionalType {
// Check if this is an Optional of an interface
wrappedNamed, ok := wrappedType.(*types.Named)
if !ok {
return t, access, true, nil
}
_, ok = wrappedNamed.Underlying().(*types.Interface)
if !ok {
return t, access, true, nil
}
/*
Need to convert concrete impl struct wrapped by Optional to interface wrapped
by Optional. e.g.:
convertOptionalVal(access, (*ifaceImpl).toIface)
*/
return t, Id("convertOptionalVal").Call(
access,
Parens(Op("*").Id(formatIfaceImplName(wrappedNamed.Obj().Name()))).Dot("toIface"),
), true, nil
}
if _, ok := t.Underlying().(*types.Interface); ok {
/*
Need to convert concrete impl struct interface. e.g.:
access.toIface
*/
return t, access.Dot("toIface").Call(), true, nil
}
return nil, nil, false, nil
case *types.Slice:
elemNamed, ok := t.Elem().(*types.Named)
if !ok {
return nil, nil, false, nil
}
_, ok = elemNamed.Underlying().(*types.Interface)
if !ok {
return nil, nil, false, nil
}
/*
Need to convert slice of concrete impl structs to slice of interface e.g.:
convertSlice(access, (*ifaceImpl).toIface)
*/
return t, Id("convertSlice").Call(
access,
Parens(Op("*").Id(formatIfaceImplName(elemNamed.Obj().Name()))).Dot("toIface"),
), true, nil
case *types.Struct:
// inline struct case
return t, access, true, nil
default:
return nil, nil, false, nil
}
}
var pragmaCommentRegexp = regexp.MustCompile(`\+\s*(\S+?)(?:=(.+))?(?:\n|$)`)
// parsePragmaComment parses a dagger "pragma", that is used to define additional metadata about a parameter.
func parsePragmaComment(comment string) (data map[string]string, rest string) {
data = map[string]string{}
lastEnd := 0
for _, v := range pragmaCommentRegexp.FindAllStringSubmatchIndex(comment, -1) {
var key, value string
if v[2] != -1 {
key = comment[v[2]:v[3]]
}
if v[4] != -1 {
value = comment[v[4]:v[5]]
}
data[key] = value
rest += comment[lastEnd:v[0]]
lastEnd = v[1]
}
rest += comment[lastEnd:]
return data, rest
}
func asInlineStruct(t types.Type) (*types.Struct, bool) {
switch t := t.(type) {
case *types.Pointer:
return asInlineStruct(t.Elem())
case *types.Struct:
return t, true
default:
return nil, false
}
}
func asInlineStructAst(t ast.Node) (*ast.StructType, bool) {
switch t := t.(type) {
case *ast.StarExpr:
return asInlineStructAst(t.X)
case *ast.StructType:
return t, true
default:
return nil, false
}
}
func unpackASTFields(fields *ast.FieldList) []*ast.Field {
var unpacked []*ast.Field
for _, field := range fields.List {
if len(field.Names) == 0 {
unpacked = append(unpacked, field)
continue
}
for i, name := range field.Names {
field := *field
field.Names = []*ast.Ident{name}
if i != 0 {
field.Doc = nil
field.Comment = nil
}
unpacked = append(unpacked, &field)
}
}
return unpacked
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,532 | 🐞 Confusing error message when `Context` is not the first parameter of a function | ### What is the issue?
Mostly what the title says. The error message I get from putting the `Context` in the wrong place is cryptic.
### Dagger version
dagger v0.9.7
### Steps to reproduce
Create any Zenith module function and put the `context.Context` in any location but the first parameter.
### Log output
```
Error: failed to automate vcs: failed to get vcs ignored paths: input: resolve: module: withSource: failed to get modified source directory for go module sdk codegen: process "/usr/local/bin/codegen --module . --propagate-logs=true --introspection-json-path /schema.json" did not complete successfully: exit code: 1
input: resolve: module: withSource: failed to get modified source directory for go module sdk codegen: process "/usr/local/bin/codegen --module . --propagate-logs=true --introspection-json-path /schema.json" did not complete successfully: exit code: 1
```
This was also in the output
```
Stderr:
internal error during module code generation: runtime error: invalid memory address or nil pointer dereference
``` | https://github.com/dagger/dagger/issues/6532 | https://github.com/dagger/dagger/pull/6551 | 5b273004464711d1efcf427da9cefa7dc389497d | dcee33ec84858610450ef30ddfcad60a9b9be053 | "2024-01-30T19:02:52Z" | go | "2024-02-07T17:20:29Z" | core/integration/module_test.go | package core
import (
"context"
_ "embed"
"encoding/json"
"fmt"
"go/format"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"time"
"github.com/MakeNowJust/heredoc/v2"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/dagql/idproto"
"github.com/iancoleman/strcase"
"github.com/moby/buildkit/identity"
"github.com/stretchr/testify/require"
"github.com/tidwall/gjson"
"golang.org/x/sync/errgroup"
"dagger.io/dagger"
"github.com/dagger/dagger/cmd/codegen/introspection"
)
func TestModuleGoInit(t *testing.T) {
t.Parallel()
t.Run("from scratch", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=bare", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("reserved go.mod name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=go", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{go{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"go":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("uses expected Go module name, camel-cases Dagger module name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=My-Module", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{myModule{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"myModule":{"containerEcho":{"stdout":"hello\n"}}}`, out)
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
t.Run("creates go.mod beneath an existing go.mod if root points beneath it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/go.mod", dagger.ContainerWithNewFileOpts{
Contents: "module example.com/test\n",
}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/ci").
With(daggerExec("init", "--name=beneathGoMod", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{beneathGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"beneathGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("names Go module after Dagger module", func(t *testing.T) {
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
})
t.Run("respects existing go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("preserves module name", func(t *testing.T) {
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module example.com/test")
})
})
t.Run("respects parent go.mod if root points to it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
With(daggerExec("init", "--name=child", "--sdk=go", "./child")).
WithWorkdir("/work/child").
// explicitly develop to see whether it makes a go.mod
With(daggerExec("develop")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
require.Equal(t, []string{"child", "dagger.json", "foo.go", "go.mod", "go.sum"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.NotContains(t, childEntries, "go.mod")
t.Run("preserves parent module name", func(t *testing.T) {
goMod, err := generated.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, goMod, "module example.com/test")
})
})
t.Run("respects existing go.mod even if root points to parent that has go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/child").
WithExec([]string{"go", "mod", "init", "my-mod"}).
WithWorkdir("/work").
With(daggerExec("init", "--name=child", "--sdk=go", "./child")).
WithWorkdir("/work/child").
// explicitly develop to see whether it makes a go.mod
With(daggerExec("develop")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
// no go.sum
require.Equal(t, []string{"child", "dagger.json", "foo.go", "go.mod"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.Contains(t, childEntries, "go.mod")
require.Contains(t, childEntries, "go.sum")
})
t.Run("respects existing main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasMainGo struct {}
func (m *HasMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("init", "--name=hasMainGo", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{hasMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("respects existing main.go even if it uses types not generated yet", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasDaggerTypes struct {}
func (m *HasDaggerTypes) Hello() *Container {
return dag.Container().
From("` + alpineImage + `").
WithExec([]string{"echo", "Hello, world!"})
}
`,
}).
With(daggerExec("init", "--name=hasDaggerTypes", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{hasDaggerTypes{hello{stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasDaggerTypes":{"hello":{"stdout":"Hello, world!\n"}}}`, out)
})
t.Run("respects existing package without creating main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/notmain.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type HasNotMainGo struct {}
func (m *HasNotMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("init", "--name=hasNotMainGo", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.
With(daggerQuery(`{hasNotMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasNotMainGo":{"hello":"Hello, world!"}}`, out)
})
}
func TestModuleInitLICENSE(t *testing.T) {
t.Run("bootstraps Apache-2.0 LICENSE file if none found", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("creates LICENSE file in the directory specified by arg", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "./mymod"))
content, err := modGen.File("mymod/LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("does not bootstrap LICENSE file if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go"))
_, err := modGen.File("LICENSE").Contents(ctx)
require.Error(t, err)
})
t.Run("bootstraps a LICENSE file when requested, even if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "--license=MIT"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "MIT License")
})
}
func TestModuleGit(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
gitGeneratedFiles []string
gitIgnoredFiles []string
}
for _, tc := range []testCase{
{
sdk: "go",
gitGeneratedFiles: []string{
"/dagger.gen.go",
"/querybuilder/**",
},
},
{
sdk: "python",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
{
sdk: "typescript",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
} {
tc := tc
t.Run(fmt.Sprintf("module %s git", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
With(daggerExec("init", "--name=bare", "--sdk="+tc.sdk))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("configures .gitattributes", func(t *testing.T) {
ignore, err := modGen.File(".gitattributes").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitGeneratedFiles {
require.Contains(t, ignore, fmt.Sprintf("%s linguist-generated\n", fileName))
}
})
if len(tc.gitIgnoredFiles) > 0 {
t.Run("configures .gitignore", func(t *testing.T) {
ignore, err := modGen.File(".gitignore").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitIgnoredFiles {
require.Contains(t, ignore, fileName)
}
})
}
})
}
}
//go:embed testdata/modules/go/minimal/main.go
var goSignatures string
func TestModuleGoSignatures(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("func Hello() string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello"}}`, out)
})
t.Run("func Echo(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echo(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echo":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointer(*string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointerPointer(**string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointerPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointerPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoOptional(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptional(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalPointer(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalPointer}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalSlice([]string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalSlice(msg: ["hello", "there"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"hello+there...hello+there...hello+there..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalSlice}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"foobar...foobar...foobar..."}}`, out)
})
t.Run("func Echoes([]string) []string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoes(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoes":["hello...hello...hello..."]}}`, out)
})
t.Run("func EchoesVariadic(...string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoesVariadic(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoesVariadic":"hello...hello...hello..."}}`, out)
})
t.Run("func HelloContext(context.Context) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloContext}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloContext":"hello context"}}`, out)
})
t.Run("func EchoContext(context.Context, string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoContext(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoContext":"ctx.hello...ctx.hello...ctx.hello..."}}`, out)
})
t.Run("func HelloStringError() (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloStringError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloStringError":"hello i worked"}}`, out)
})
t.Run("func HelloVoid()", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoid}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoid":null}}`, out)
})
t.Run("func HelloVoidError() error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoidError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoidError":null}}`, out)
})
t.Run("func EchoOpts(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInline(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlinePointer(*struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineCtx(ctx, struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineTags(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsPragmas(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsPragmas(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsPragmas":"hi...hi...hi..."}}`, out)
})
}
func TestModuleGoSignaturesBuiltinTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Minimal struct {}
func (m *Minimal) Read(ctx context.Context, dir Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadPointer(ctx context.Context, dir *Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadSlice(ctx context.Context, dir []Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadVariadic(ctx context.Context, dir ...Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadOptional(ctx context.Context, dir Optional[Directory]) (string, error) {
d, ok := dir.Get()
if ok {
return d.File("foo").Contents(ctx)
}
return "", nil
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(daggerQuery(`{directory{withNewFile(path: "foo", contents: "bar"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
dirID := gjson.Get(out, "directory.withNewFile.id").String()
t.Run("func Read(ctx, Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{read(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"read":"bar"}}`, out)
})
t.Run("func ReadPointer(ctx, *Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readPointer(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readPointer":"bar"}}`, out)
})
t.Run("func ReadSlice(ctx, []Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readSlice(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readSlice":"bar"}}`, out)
})
t.Run("func ReadVariadic(ctx, ...Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readVariadic(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readVariadic":"bar"}}`, out)
})
t.Run("func ReadOptional(ctx, Optional[Directory]) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readOptional(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":"bar"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{readOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":""}}`, out)
})
}
func TestModuleGoSignaturesUnexported(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) string {
return name
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
logGen(ctx, t, modGen.Directory("."))
objs := inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 1, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
logGen(ctx, t, modGen.Directory("."))
objs = inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 2, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
require.Equal(t, "MinimalFoo", objs.Get("1.name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {
Bar bar
}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
logGen(ctx, t, modGen.Directory("."))
_, err := modGen.With(moduleIntrospection).Stderr(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "cannot code-generate unexported type bar")
}
func TestModuleGoSignaturesMixMatch(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
func (m *Minimal) Hello(name string, opts struct{}, opts2 struct{}) string {
return name
}
`,
})
logGen(ctx, t, modGen.Directory("."))
_, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "nested structs are not supported")
}
func TestModuleGoSignaturesNameConflict(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {
Foo Foo
Bar Bar
Baz Baz
}
type Foo struct {}
type Bar struct {}
type Baz struct {}
func (m *Foo) Hello(name string) string {
return name
}
func (f *Bar) Hello(name string, name2 string) string {
return name + name2
}
func (b *Baz) Hello() (string, error) {
return "", nil
}
`,
})
logGen(ctx, t, modGen.Directory("."))
objs := inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 4, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
require.Equal(t, "MinimalFoo", objs.Get("1.name").String())
require.Equal(t, "MinimalBar", objs.Get("2.name").String())
require.Equal(t, "MinimalBaz", objs.Get("3.name").String())
}
func TestModuleGoDocs(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
logGen(ctx, t, modGen.Directory("."))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Empty(t, hello.Get("description").String())
require.Empty(t, hello.Get("args").Array())
// test the args-based form
echoOpts := obj.Get(`functions.#(name="echoOpts")`)
require.Equal(t, "echoOpts", echoOpts.Get("name").String())
require.Equal(t, "EchoOpts does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the inline struct form
echoOpts = obj.Get(`functions.#(name="echoOptsInline")`)
require.Equal(t, "echoOptsInline", echoOpts.Get("name").String())
require.Equal(t, "EchoOptsInline does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the arg-based form (with pragmas)
echoOpts = obj.Get(`functions.#(name="echoOptsPragmas")`)
require.Equal(t, "echoOptsPragmas", echoOpts.Get("name").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "", echoOpts.Get("args.0.defaultValue").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "\"...\"", echoOpts.Get("args.1.defaultValue").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "3", echoOpts.Get("args.2.defaultValue").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
}
func TestModuleGoDocsEdgeCases(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
// Minimal is a thing
type Minimal struct {
// X is this
X, Y string // Y is not this
// +private
Z string
}
// some docs
func (m *Minimal) Hello(foo string, bar string,
// hello
baz string, qux string, x string, // lol
) string {
return foo + bar
}
func (m *Minimal) HelloMore(
// foo here
foo,
// bar here
bar string,
) string {
return foo + bar
}
func (m *Minimal) HelloMoreInline(opts struct{
// foo here
foo, bar string
}) string {
return opts.foo + opts.bar
}
func (m *Minimal) HelloAgain( // docs for helloagain
foo string,
bar string, // docs for bar
baz string,
) string {
return foo + bar
}
func (m *Minimal) HelloFinal(
foo string) string { // woops
return foo
}
`,
})
logGen(ctx, t, modGen.Directory("."))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Equal(t, "Minimal is a thing", obj.Get("description").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 5)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "hello", hello.Get("args.2.description").String())
require.Equal(t, "qux", hello.Get("args.3.name").String())
require.Equal(t, "", hello.Get("args.3.description").String())
require.Equal(t, "x", hello.Get("args.4.name").String())
require.Equal(t, "lol", hello.Get("args.4.description").String())
hello = obj.Get(`functions.#(name="helloMore")`)
require.Equal(t, "helloMore", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "bar here", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloMoreInline")`)
require.Equal(t, "helloMoreInline", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloAgain")`)
require.Equal(t, "helloAgain", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 3)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "docs for bar", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "", hello.Get("args.2.description").String())
hello = obj.Get(`functions.#(name="helloFinal")`)
require.Equal(t, "helloFinal", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 1)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Len(t, obj.Get(`fields`).Array(), 2)
prop := obj.Get(`fields.#(name="x")`)
require.Equal(t, "x", prop.Get("name").String())
require.Equal(t, "X is this", prop.Get("description").String())
prop = obj.Get(`fields.#(name="y")`)
require.Equal(t, "y", prop.Get("name").String())
require.Equal(t, "", prop.Get("description").String())
}
func TestModuleGoWeirdFields(t *testing.T) {
// these are all cases that used to panic due to the disparity in the type spec and the ast
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Z string
type Minimal struct {
// field with single (normal) name
W string
// field with multiple names
X, Y string
// field with no names
Z
}
func New() Minimal {
return Minimal{
W: "-",
X: "-",
Y: "-",
Z: Z("-"),
}
}
// struct with no fields
type Bar struct{}
func (m *Minimal) Say(
// field with single (normal) name
a string,
// field with multiple names
b, c string,
// field with no names (not included, mixed names not allowed)
// string
) string {
return a + " " + b + " " + c
}
func (m *Minimal) Hello(
// field with no names
string,
) string {
return "hello"
}
func (m *Minimal) SayOpts(opts struct{
// field with single (normal) name
A string
// field with multiple names
B, C string
// field with no names (not included because of above)
// string
}) string {
return opts.A + " " + opts.B + " " + opts.C
}
func (m *Minimal) HelloOpts(opts struct{
// field with no names
string
}) string {
return "hello"
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(daggerQuery(`{minimal{w, x, y, z}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"w": "-", "x": "-", "y": "-", "z": "-"}}`, out)
for _, name := range []string{"say", "sayOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(a: "hello", b: "world", c: "!")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello world !"}}`, name), out)
}
for _, name := range []string{"hello", "helloOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(string: "")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello"}}`, name), out)
}
}
func TestModuleGoOptionalMustBeNil(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
func (m *Minimal) Foo(x *Optional[*string]) string {
if v, _ := x.Get(); v != nil {
panic("uh oh")
}
return ""
}
func (m *Minimal) Bar(opts struct {
x *Optional[*string]
}) string {
if v, _ := opts.x.Get(); v != nil {
panic("uh oh")
}
return ""
}
func (m *Minimal) Baz(
// +optional
x *string,
) string {
if x != nil {
panic("uh oh")
}
return ""
}
func (m *Minimal) Qux(opts struct {
// +optional
x *string
}) string {
if opts.x != nil {
panic("uh oh")
}
return ""
}
`,
})
logGen(ctx, t, modGen.Directory("."))
for _, name := range []string{"foo", "bar", "baz", "qux"} {
out, err := modGen.With(daggerQuery(`{minimal{%s}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": ""}}`, name), out)
}
}
func TestModuleGoFieldMustBeNil(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "fmt"
type Minimal struct {
Src *Directory
Name *string
}
func New() *Minimal {
return &Minimal{}
}
func (m *Minimal) IsEmpty() bool {
if m.Name != nil {
panic(fmt.Sprintf("name should be nil but is %v", m.Name))
}
if m.Src != nil {
panic(fmt.Sprintf("src should be nil but is %v", m.Src))
}
return true
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{isEmpty}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"isEmpty": true}}`, out)
}
func TestModuleDescription(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
sdk string
source string
}{
{
sdk: "python",
source: `"""Test module, short description
Long description, with full sentences.
"""
from dagger import field, function, object_type
@object_type
class Test:
"""Test object, short description"""
foo: str = field(default="foo")
`,
},
{
sdk: "typescript",
source: `
/**
* Test module, short description
*
* Long description, with full sentences.
*/
import { object, field } from '@dagger.io/dagger'
/**
* Test object, short description
*/
@object()
class Test {
@field()
foo: string = "foo"
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mod := inspectModule(ctx, t, modInit(ctx, t, c, tc.sdk, tc.source))
require.Equal(t,
"Test module, short description\n\nLong description, with full sentences.",
mod.Get("description").String(),
)
require.Equal(t,
"Test object, short description",
mod.Get("objects.0.asObject.description").String(),
)
})
}
}
func TestModulePrivateField(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
sdk string
source string
}{
{
sdk: "go",
source: `package main
type Minimal struct {
Foo string
Bar string // +private
}
func (m *Minimal) Set(foo string, bar string) *Minimal {
m.Foo = foo
m.Bar = bar
return m
}
func (m *Minimal) Hello() string {
return m.Foo + m.Bar
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Minimal:
foo: str = field(default="")
bar: str = ""
@function
def set(self, foo: str, bar: str) -> "Minimal":
self.foo = foo
self.bar = bar
return self
@function
def hello(self) -> str:
return self.foo + self.bar
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Minimal {
@field()
foo: string
bar?: string
constructor(foo?: string, bar?: string) {
this.foo = foo
this.bar = bar
}
@func()
set(foo: string, bar: string): Minimal {
this.foo = foo
this.bar = bar
return this
}
@func()
hello(): string {
return this.foo + this.bar
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Len(t, obj.Get(`fields`).Array(), 1)
prop := obj.Get(`fields.#(name="foo")`)
require.Equal(t, "foo", prop.Get("name").String())
out, err := modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){hello}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"hello": "abcxyz"}}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){foo}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"foo": "abc"}}}`, out)
_, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){bar}}}`)).Stdout(ctx)
require.ErrorContains(t, err, `Minimal has no such field: "bar"`)
})
}
}
// this is no longer allowed, but verify the SDK errors out
func TestModuleGoExtendCore(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=container", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
func (c *Container) Echo(ctx context.Context, msg string) (string, error) {
return c.WithExec([]string{"echo", msg}).Stdout(ctx)
}
`,
}).
With(daggerQuery(`{container{from(address:"` + alpineImage + `"){echo(msg:"echo!"){stdout}}}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "cannot define methods on objects from outside this module")
}
func TestModuleCustomTypes(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Test struct{}
func (m *Test) Repeater(msg string, times int) *Repeater {
return &Repeater{
Message: msg,
Times: times,
}
}
type Repeater struct {
Message string
Times int
}
func (t *Repeater) Render() string {
return strings.Repeat(t.Message, t.Times)
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Repeater:
message: str = field(default="")
times: int = field(default=0)
@function
def render(self) -> str:
return self.message * self.times
@function
def repeater(msg: str, times: int) -> Repeater:
return Repeater(message=msg, times=times)
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Repeater {
@field()
message: string
@field()
times: number
constructor(message: string, times: number) {
this.message = message
this.times = times
}
@func()
render(): string {
return this.message.repeat(this.times)
}
}
@object()
class Test {
@func()
repeater(msg: string, times: number): Repeater {
return new Repeater(msg, times)
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("custom %s types", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := modInit(ctx, t, c, tc.sdk, tc.source).
With(daggerQuery(`{test{repeater(msg:"echo!", times: 3){render}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"repeater":{"render":"echo!echo!echo!"}}}`, out)
})
}
}
func TestModuleReturnTypeDetection(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
}
func (m *Foo) MyFunction() X {
return X{Message: "foo"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
@function
def my_function() -> X:
return X(message="foo")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class X {
@field()
message: string
constructor(message: string) {
this.message = message;
}
}
@object()
class Foo {
@func()
myFunction(): X {
return new X("foo");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{foo{myFunction{message}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo"}}}`, out)
})
}
}
func TestModuleReturnObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
When string ` + "`json:\"Timestamp\"`" + `
To string ` + "`json:\"recipient\"`" + `
From string
}
func (m *Foo) MyFunction() X {
return X{Message: "foo", When: "now", To: "user", From: "admin"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
when: str = field(default="", name="Timestamp")
to: str = field(default="", name="recipient")
from_: str = field(default="", name="from")
@object_type
class Foo:
@function
def my_function(self) -> X:
return X(message="foo", when="now", to="user", from_="admin")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class X {
@field()
message: string
@field()
timestamp: string
@field()
recipient: string
@field()
from: string
constructor(message: string, timestamp: string, recipient: string, from: string) {
this.message = message;
this.timestamp = timestamp;
this.recipient = recipient;
this.from = from;
}
}
@object()
class Foo {
@func()
myFunction(): X {
return new X("foo", "now", "user", "admin");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{foo{myFunction{message, recipient, from, timestamp}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo", "recipient":"user", "from":"admin", "timestamp":"now"}}}`, out)
})
}
}
func TestModuleReturnNestedObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type Foo struct {
MsgContainer Bar
}
type Bar struct {
Msg string
}
func (m *Playground) MyFunction() Foo {
return Foo{MsgContainer: Bar{Msg: "hello world"}}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Bar:
msg: str = field()
@object_type
class Foo:
msg_container: Bar = field()
@object_type
class Playground:
@function
def my_function(self) -> Foo:
return Foo(msg_container=Bar(msg="hello world"))
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Bar {
@field()
msg: string;
constructor(msg: string) {
this.msg = msg;
}
}
@object()
class Foo {
@field()
msgContainer: Bar;
constructor(msgContainer: Bar) {
this.msgContainer = msgContainer;
}
}
@object()
class Playground {
@func()
myFunction(): Foo {
return new Foo(new Bar("hello world"));
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{playground{myFunction{msgContainer{msg}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myFunction":{"msgContainer":{"msg": "hello world"}}}}`, out)
})
}
}
func TestModuleReturnCompositeCore(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
func (m *Playground) MySlice() []*Container {
return []*Container{dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"})}
}
type Foo struct {
Con *Container
// verify fields can remain nil w/out error too
UnsetFile *File
}
func (m *Playground) MyStruct() *Foo {
return &Foo{Con: dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"})}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class Foo:
con: dagger.Container = field()
unset_file: dagger.File | None = field(default=None)
@object_type
class Playground:
@function
def my_slice(self) -> list[dagger.Container]:
return [dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"])]
@function
def my_struct(self) -> Foo:
return Foo(con=dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"]))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, File, object, func, field } from "@dagger.io/dagger"
@object()
class Foo {
@field()
con: Container
@field()
unsetFile?: File
constructor(con: Container, usetFile?: File) {
this.con = con
this.usetFile = usetFile
}
}
@object()
class Playground {
@func()
mySlice(): Container[] {
return [
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
]
}
@func()
myStruct(): Foo {
return new Foo(
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{playground{mySlice{stdout}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"mySlice":[{"stdout":"hello world\n"}]}}`, out)
out, err = modGen.With(daggerQuery(`{playground{myStruct{con{stdout}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myStruct":{"con":{"stdout":"hello world\n"}}}}`, out)
})
}
}
func TestModuleReturnComplexThing(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type ScanResult struct {
Containers []*Container ` + "`json:\"targets\"`" + `
Report ScanReport
}
type ScanReport struct {
Contents string ` + "`json:\"contents\"`" + `
Authors []string ` + "`json:\"Authors\"`" + `
}
func (m *Playground) Scan() ScanResult {
return ScanResult{
Containers: []*Container{
dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"}),
},
Report: ScanReport{
Contents: "hello world",
Authors: []string{"foo", "bar"},
},
}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class ScanReport:
contents: str = field()
authors: list[str] = field()
@object_type
class ScanResult:
containers: list[dagger.Container] = field(name="targets")
report: ScanReport = field()
@object_type
class Playground:
@function
def scan(self) -> ScanResult:
return ScanResult(
containers=[
dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"]),
],
report=ScanReport(
contents="hello world",
authors=["foo", "bar"],
),
)
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object()
class ScanReport {
@field()
contents: string
@field()
authors: string[]
constructor(contents: string, authors: string[]) {
this.contents = contents
this.authors = authors
}
}
@object()
class ScanResult {
@field("targets")
containers: Container[]
@field()
report: ScanReport
constructor(containers: Container[], report: ScanReport) {
this.containers = containers
this.report = report
}
}
@object()
class Playground {
@func()
async scan(): Promise<ScanResult> {
return new ScanResult(
[
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
],
new ScanReport("hello world", ["foo", "bar"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{playground{scan{targets{stdout},report{contents,authors}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"scan":{"targets":[{"stdout":"hello world\n"}],"report":{"contents":"hello world","authors":["foo","bar"]}}}}`, out)
})
}
}
func TestModuleGlobalVarDAG(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
type Foo struct {}
var someDefault = dag.Container().From("` + alpineImage + `")
func (m *Foo) Fn(ctx context.Context) (string, error) {
return someDefault.WithExec([]string{"echo", "foo"}).Stdout(ctx)
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function, object_type
SOME_DEFAULT = dag.container().from_("` + alpineImage + `")
@object_type
class Foo:
@function
async def fn(self) -> str:
return await SOME_DEFAULT.with_exec(["echo", "foo"]).stdout()
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from "@dagger.io/dagger"
var someDefault = dag.container().from("` + alpineImage + `")
@object()
class Foo {
@func()
async fn(): Promise<string> {
return someDefault.withExec(["echo", "foo"]).stdout()
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{foo{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"fn":"foo\n"}}`, out)
})
}
}
func TestModuleIDableType(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {
Data string
}
func (m *Foo) Set(data string) *Foo {
m.Data = data
return m
}
func (m *Foo) Get() string {
return m.Data
}
`,
},
{
sdk: "python",
source: `from typing import Self
from dagger import field, function, object_type
@object_type
class Foo:
data: str = ""
@function
def set(self, data: str) -> Self:
self.data = data
return self
@function
def get(self) -> str:
return self.data
`,
},
{
sdk: "typescript",
source: `
import { object, func } from "@dagger.io/dagger"
@object()
class Foo {
data: string = ""
@func()
set(data: string): Foo {
this.data = data
return this
}
@func()
get(): string {
return this.data
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
// sanity check
out, err := modGen.With(daggerQuery(`{foo{set(data: "abc"){get}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"set":{"get": "abc"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{set(data: "abc"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.set.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.set(data: "abc"): Foo!`)
out, err = modGen.With(daggerQuery(`{loadFooFromID(id: "%s"){get}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"loadFooFromID":{"get": "abc"}}`, out)
})
}
}
func TestModuleArgOwnType(t *testing.T) {
// Verify use of a module's own object as an argument type.
// The server needs to specifically decode the input type from an ID into
// the raw JSON, since the module doesn't understand it's own types as IDs
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Foo struct{}
type Message struct {
Content string
}
func (m *Foo) SayHello(name string) Message {
return Message{Content: "hello " + name}
}
func (m *Foo) Upper(msg Message) Message {
msg.Content = strings.ToUpper(msg.Content)
return msg
}
func (m *Foo) Uppers(msg []Message) []Message {
for i := range msg {
msg[i].Content = strings.ToUpper(msg[i].Content)
}
return msg
}`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Message:
content: str = field()
@object_type
class Foo:
@function
def say_hello(self, name: str) -> Message:
return Message(content=f"hello {name}")
@function
def upper(self, msg: Message) -> Message:
msg.content = msg.content.upper()
return msg
@function
def uppers(self, msg: list[Message]) -> list[Message]:
for m in msg:
m.content = m.content.upper()
return msg
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Message {
@field()
content: string
constructor(content: string) {
this.content = content
}
}
@object()
class Foo {
@func()
sayHello(name: string): Message {
return new Message("hello " + name)
}
@func()
upper(msg: Message): Message {
msg.content = msg.content.toUpperCase()
return msg
}
@func()
uppers(msg: Message[]): Message[] {
for (let i = 0; i < msg.length; i++) {
msg[i].content = msg[i].content.toUpperCase()
}
return msg
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{foo{sayHello(name: "world"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.sayHello.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.sayHello(name: "world"): FooMessage!`)
out, err = modGen.With(daggerQuery(`{foo{upper(msg:"%s"){content}}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"upper":{"content": "HELLO WORLD"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{uppers(msg:["%s", "%s"]){content}}}`, id, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"uppers":[{"content": "HELLO WORLD"}, {"content": "HELLO WORLD"}]}}`, out)
})
}
}
func TestModuleConflictingSameNameDeps(t *testing.T) {
// A -> B -> Dint
// A -> C -> Dstr
// where Dint and Dstr are modules with the same name and same object names but conflicting types
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dstr").
With(daggerExec("init", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo string
}
func (m *D) Fn(foo string) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dint").
With(daggerExec("init", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo int
}
func (m *D) Fn(foo int) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--name=c", "--sdk=go", "c")).
WithWorkdir("/work/c").
With(daggerExec("install", "../dstr")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type C struct{}
func (m *C) Fn(ctx context.Context, foo string) (string, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--name=b", "--sdk=go", "b")).
With(daggerExec("install", "-m=b", "./dint")).
WithNewFile("/work/b/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type B struct{}
func (m *B) Fn(ctx context.Context, foo int) (int, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--name=a", "--sdk=go", "a")).
WithWorkdir("/work/a").
With(daggerExec("install", "../b")).
With(daggerExec("install", "../c")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"strconv"
)
type A struct{}
func (m *A) Fn(ctx context.Context) (string, error) {
fooStr, err := dag.C().Fn(ctx, "foo")
if err != nil {
return "", err
}
fooInt, err := dag.B().Fn(ctx, 123)
if err != nil {
return "", err
}
return fooStr + strconv.Itoa(fooInt), nil
}
`,
})
out, err := ctr.With(daggerQuery(`{a{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"a":{"fn": "foo123"}}`, out)
// verify that no types from (transitive) deps show up
types := currentSchema(ctx, t, ctr).Types
require.NotNil(t, types.Get("A"))
require.Nil(t, types.Get("B"))
require.Nil(t, types.Get("C"))
require.Nil(t, types.Get("D"))
}
func TestModuleSelfAPICall(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"github.com/Khan/genqlient/graphql"
)
type Test struct{}
func (m *Test) FnA(ctx context.Context) (string, error) {
resp := &graphql.Response{}
err := dag.c.MakeRequest(ctx, &graphql.Request{
Query: "{test{fnB}}",
}, resp)
if err != nil {
return "", err
}
return resp.Data.(map[string]any)["test"].(map[string]any)["fnB"].(string), nil
}
func (m *Test) FnB() string {
return "hi from b"
}
`,
}).
With(daggerQuery(`{test{fnA}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fnA": "hi from b"}}`, out)
}
func TestModuleGoWithOtherModuleTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Dep struct{}
type Obj struct {
Foo string
}
func (m *Dep) Fn() Obj {
return Obj{Foo: "foo"}
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk=go", "test")).
With(daggerExec("install", "-m=test", "./dep")).
WithWorkdir("/work/test")
t.Run("return as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() (*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() ([]*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
})
t.Run("arg as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj *DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj []*DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
})
t.Run("field as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo *DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo []*DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
})
}
var useInner = `package main
type Dep struct{}
func (m *Dep) Hello() string {
return "hello"
}
`
var useGoOuter = `package main
import "context"
type Use struct{}
func (m *Use) UseHello(ctx context.Context) (string, error) {
return dag.Dep().Hello(ctx)
}
`
var usePythonOuter = `from dagger import dag, function
@function
def use_hello() -> str:
return dag.dep().hello()
`
var useTSOuter = `
import { dag, object, func } from '@dagger.io/dagger'
@object()
class Use {
@func()
async useHello(): Promise<string> {
return dag.dep().hello()
}
}
`
func TestModuleUseLocal(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// cannot use transitive dependency directly
_, err = modGen.With(daggerQuery(`{dep{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, `Query has no such field: "dep"`)
})
}
}
func TestModuleCodegenOnDepChange(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
changed string
expected string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
expected: "Hellov2",
changed: strings.ReplaceAll(useGoOuter, `Hello(ctx)`, `Hellov2(ctx)`),
},
{
sdk: "python",
source: usePythonOuter,
expected: "hellov2",
changed: strings.ReplaceAll(usePythonOuter, `.hello()`, `.hellov2()`),
},
{
sdk: "typescript",
source: useTSOuter,
expected: "hellov2",
changed: strings.ReplaceAll(useTSOuter, `.hello()`, `.hellov2()`),
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// make back-incompatible change to dep
newInner := strings.ReplaceAll(useInner, `Hello()`, `Hellov2()`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("develop"))
codegenContents, err := modGen.File(sdkCodegenFile(t, tc.sdk)).Contents(ctx)
require.NoError(t, err)
require.Contains(t, codegenContents, tc.expected)
modGen = modGen.With(sdkSource(tc.sdk, tc.changed))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
})
}
}
func TestModuleSyncDeps(t *testing.T) {
// verify that changes to deps result in a develop to the depender module
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
modGen = modGen.With(daggerQuery(`{use{useHello}}`))
out, err := modGen.Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
newInner := strings.ReplaceAll(useInner, `"hello"`, `"goodbye"`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("develop"))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"goodbye"}}`, out)
})
}
}
func TestModuleUseLocalMulti(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
import "fmt"
type Use struct {}
func (m *Use) Names(ctx context.Context) ([]string, error) {
fooName, err := dag.Foo().Name(ctx)
if err != nil {
return nil, fmt.Errorf("foo.name: %w", err)
}
barName, err := dag.Bar().Name(ctx)
if err != nil {
return nil, fmt.Errorf("bar.name: %w", err)
}
return []string{fooName, barName}, nil
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function
@function
async def names() -> list[str]:
return [
await dag.foo().name(),
await dag.bar().name(),
]
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from '@dagger.io/dagger'
@object()
class Use {
@func()
async names(): Promise<string[]> {
return [await dag.foo().name(), await dag.bar().name()]
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/foo").
WithNewFile("/work/foo/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Foo struct {}
func (m *Foo) Name() string { return "foo" }
`,
}).
With(daggerExec("init", "--name=foo", "--sdk=go")).
WithWorkdir("/work/bar").
WithNewFile("/work/bar/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Bar struct {}
func (m *Bar) Name() string { return "bar" }
`,
}).
With(daggerExec("init", "--name=bar", "--sdk=go")).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(daggerExec("install", "./foo")).
With(daggerExec("install", "./bar")).
With(sdkSource(tc.sdk, tc.source)).
WithEnvVariable("BUST", identity.NewID()) // NB(vito): hmm...
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
out, err := modGen.With(daggerQuery(`{use{names}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"names":["foo", "bar"]}}`, out)
})
}
}
func TestModuleConstructor(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("basic", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(
ctx context.Context,
foo string,
bar Optional[int],
baz []string,
dir *Directory,
) *Test {
return &Test{
Foo: foo,
Bar: bar.GetOr(42),
Baz: baz,
Dir: dir,
}
}
type Test struct {
Foo string
Bar int
Baz []string
Dir *Directory
NeverSetDir *Directory
}
func (m *Test) GimmeFoo() string {
return m.Foo
}
func (m *Test) GimmeBar() int {
return m.Bar
}
func (m *Test) GimmeBaz() []string {
return m.Baz
}
func (m *Test) GimmeDirEnts(ctx context.Context) ([]string, error) {
return m.Dir.Entries(ctx)
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import field, function, object_type
@object_type
class Test:
foo: str = field()
dir: dagger.Directory = field()
bar: int = field(default=42)
baz: list[str] = field(default=list)
never_set_dir: dagger.Directory | None = field(default=None)
@function
def gimme_foo(self) -> str:
return self.foo
@function
def gimme_bar(self) -> int:
return self.bar
@function
def gimme_baz(self) -> list[str]:
return self.baz
@function
async def gimme_dir_ents(self) -> list[str]:
return await self.dir.entries()
`,
},
{
sdk: "typescript",
source: `
import { Directory, object, func, field } from '@dagger.io/dagger';
@object()
class Test {
@field()
foo: string
@field()
dir: Directory
@field()
bar: number
@field()
baz: string[]
@field()
neverSetDir?: Directory
constructor(foo: string, dir: Directory, bar = 42, baz: string[] = []) {
this.foo = foo;
this.dir = dir;
this.bar = bar;
this.baz = baz;
}
@func()
gimmeFoo(): string {
return this.foo;
}
@func()
gimmeBar(): number {
return this.bar;
}
@func()
gimmeBaz(): string[] {
return this.baz;
}
@func()
async gimmeDirEnts(): Promise<string[]> {
return this.dir.entries();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := modInit(ctx, t, c, tc.sdk, tc.source)
out, err := ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-dir-ents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, strings.TrimSpace(out), "dagger.json")
})
}
})
t.Run("fields only", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(ctx context.Context) (Test, error) {
v, err := dag.Container().From("alpine:3.18.4").File("/etc/alpine-release").Contents(ctx)
if err != nil {
return Test{}, err
}
return Test{
AlpineVersion: v,
}, nil
}
type Test struct {
AlpineVersion string
}
`,
},
{
sdk: "python",
source: `from dagger import dag, field, function, object_type
@object_type
class Test:
alpine_version: str = field()
@classmethod
async def create(cls) -> "Test":
return cls(alpine_version=await (
dag.container()
.from_("alpine:3.18.4")
.file("/etc/alpine-release")
.contents()
))
`,
},
{
sdk: "typescript",
source: `
import { dag, object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
alpineVersion: string
// NOTE: this is not standard to do async operations in the constructor.
// This is only for testing purpose but it shouldn't be done in real usage.
constructor() {
return (async () => {
this.alpineVersion = await dag.container().from("alpine:3.18.4").file("/etc/alpine-release").contents()
return this; // Return the newly-created instance
})();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := ctr.With(daggerCall("alpine-version")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "3.18.4")
})
}
})
t.Run("return error", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"fmt"
)
func New() (*Test, error) {
return nil, fmt.Errorf("too bad")
}
type Test struct {
Foo string
}
`,
},
{
sdk: "python",
source: `from dagger import object_type, field
@object_type
class Test:
foo: str = field()
def __init__(self):
raise ValueError("too bad")
`,
},
{
sdk: "typescript",
source: `
import { object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
foo: string
constructor() {
throw new Error("too bad")
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
_, err := ctr.With(daggerCall("foo")).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "too bad")
})
}
})
t.Run("python: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=python")).
With(sdkSource("python", fmt.Sprintf(`import dagger
from dagger import dag, object_type, field
@object_type
class Test:
foo: dagger.File = field(default=lambda: (
dag.directory()
.with_new_file("foo.txt", contents="%s")
.file("foo.txt")
))
bar: list[str] = field(default=list)
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "python"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
t.Run("typescript: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=typescript")).
With(sdkSource("typescript", fmt.Sprintf(`
import { dag, File, object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
foo: File = dag.directory().withNewFile("foo.txt", "%s").file("foo.txt")
@field()
bar: string[] = []
// Allow foo to be set through the constructor
constructor(foo?: File) {
if (foo) {
this.foo = foo
}
}
}
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "typescript"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
}
func TestModuleWrapping(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Wrapper struct{}
func (m *Wrapper) Container() *WrappedContainer {
return &WrappedContainer{
dag.Container().From("` + alpineImage + `"),
}
}
type WrappedContainer struct {
Unwrap *Container` + "`" + `json:"unwrap"` + "`" + `
}
func (c *WrappedContainer) Echo(msg string) *WrappedContainer {
return &WrappedContainer{
c.Unwrap.WithExec([]string{"echo", "-n", msg}),
}
}
`,
},
{
sdk: "python",
source: `from typing import Self
import dagger
from dagger import dag, field, function, object_type
@object_type
class WrappedContainer:
unwrap: dagger.Container = field()
@function
def echo(self, msg: str) -> Self:
return WrappedContainer(unwrap=self.unwrap.with_exec(["echo", "-n", msg]))
@object_type
class Wrapper:
@function
def container(self) -> WrappedContainer:
return WrappedContainer(unwrap=dag.container().from_("` + alpineImage + `"))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object()
class WrappedContainer {
@field()
unwrap: Container
constructor(unwrap: Container) {
this.unwrap = unwrap
}
@func()
echo(msg: string): WrappedContainer {
return new WrappedContainer(this.unwrap.withExec(["echo", "-n", msg]))
}
}
@object()
class Wrapper {
@func()
container(): WrappedContainer {
return new WrappedContainer(dag.container().from("` + alpineImage + `"))
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=wrapper", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
if tc.sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
id := identity.NewID()
out, err := modGen.With(daggerQuery(
fmt.Sprintf(`{wrapper{container{echo(msg:%q){unwrap{stdout}}}}}`, id),
)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t,
fmt.Sprintf(`{"wrapper":{"container":{"echo":{"unwrap":{"stdout":%q}}}}}`, id),
out)
})
}
}
func TestModuleLotsOfFunctions(t *testing.T) {
t.Parallel()
const funcCount = 100
t.Run("go sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
package main
type PotatoSack struct {}
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
func (m *PotatoSack) Potato%d() string {
return "potato #%d"
}
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("init", "--name=potatoSack", "--sdk=go"))
logGen(ctx, t, modGen.Directory("."))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("python sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `from dagger import function
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@function
def potato_%d() -> str:
return "potato #%d"
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("./src/main.py", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("init", "--name=potatoSack", "--sdk=python"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("typescript sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
import { object, func } from "@dagger.io/dagger"
@object()
class PotatoSack {
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@func()
potato_%d(): string {
return "potato #%d"
}
`, i, i)
}
mainSrc += "\n}"
modGen := c.
Container().
From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(sdkSource("typescript", mainSrc)).
With(daggerExec("init", "--name=potatoSack", "--sdk=typescript"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
}
func TestModuleLotsOfDeps(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
modCount := 0
getModMainSrc := func(name string, depNames []string) string {
t.Helper()
mainSrc := fmt.Sprintf(`package main
import "context"
type %s struct {}
func (m *%s) Fn(ctx context.Context) (string, error) {
s := "%s"
var depS string
_ = depS
var err error
_ = err
`, strcase.ToCamel(name), strcase.ToCamel(name), name)
for _, depName := range depNames {
mainSrc += fmt.Sprintf(`
depS, err = dag.%s().Fn(ctx)
if err != nil {
return "", err
}
s += depS
`, strcase.ToCamel(depName))
}
mainSrc += "return s, nil\n}\n"
fmted, err := format.Source([]byte(mainSrc))
require.NoError(t, err)
return string(fmted)
}
// need to construct dagger.json directly in order to avoid excessive
// `dagger mod use` calls while constructing the huge DAG of deps
var rootCfg modules.ModuleConfig
addModulesWithDeps := func(newMods int, depNames []string) []string {
t.Helper()
var newModNames []string
for i := 0; i < newMods; i++ {
name := fmt.Sprintf("mod%d", modCount)
modCount++
newModNames = append(newModNames, name)
modGen = modGen.
WithWorkdir("/work/"+name).
WithNewFile("./main.go", dagger.ContainerWithNewFileOpts{
Contents: getModMainSrc(name, depNames),
})
var depCfgs []*modules.ModuleConfigDependency
for _, depName := range depNames {
depCfgs = append(depCfgs, &modules.ModuleConfigDependency{
Name: depName,
Source: filepath.Join("..", depName),
})
}
modGen = modGen.With(configFile(".", &modules.ModuleConfig{
Name: name,
SDK: "go",
Dependencies: depCfgs,
}))
rootCfg.RootFor = append(rootCfg.RootFor, &modules.ModuleConfigRootFor{
Source: name,
})
}
return newModNames
}
// Create a base module, then add 6 layers of deps, where each layer has one more module
// than the previous layer and each module within the layer has a dep on each module
// from the previous layer. Finally add a single module at the top that depends on all
// modules from the last layer and call that.
// Basically, this creates a quadratically growing DAG of modules and verifies we
// handle it efficiently enough to be callable.
curDeps := addModulesWithDeps(1, nil)
for i := 0; i < 6; i++ {
curDeps = addModulesWithDeps(len(curDeps)+1, curDeps)
}
addModulesWithDeps(1, curDeps)
modGen = modGen.With(configFile("..", &rootCfg))
_, err := modGen.With(daggerCall("fn")).Sync(ctx)
require.NoError(t, err)
}
func TestModuleNamespacing(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
moduleSrcPath, err := filepath.Abs("./testdata/modules/go/namespacing")
require.NoError(t, err)
ctr := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithMountedDirectory("/work", c.Host().Directory(moduleSrcPath)).
WithWorkdir("/work")
out, err := ctr.
With(daggerQuery(`{test{fn(s:"yo")}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fn":["*main.Sub1Obj made 1:yo", "*main.Sub2Obj made 2:yo"]}}`, out)
}
func TestModuleLoops(t *testing.T) {
// verify circular module dependencies result in an error
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
With(daggerExec("init", "--name=depA", "--sdk=go", "depA")).
With(daggerExec("init", "--name=depB", "--sdk=go", "depB")).
With(daggerExec("init", "--name=depC", "--sdk=go", "depC")).
With(daggerExec("install", "-m=depC", "./depB")).
With(daggerExec("install", "-m=depB", "./depA")).
With(daggerExec("install", "-m=depA", "./depC")).
Sync(ctx)
require.ErrorContains(t, err, "module depA has a circular dependency")
}
//go:embed testdata/modules/go/id/arg/main.go
var badIDArgGoSrc string
//go:embed testdata/modules/python/id/arg/main.py
var badIDArgPySrc string
//go:embed testdata/modules/typescript/id/arg/index.ts
var badIDArgTSSrc string
//go:embed testdata/modules/go/id/field/main.go
var badIDFieldGoSrc string
//go:embed testdata/modules/typescript/id/field/index.ts
var badIDFieldTSSrc string
//go:embed testdata/modules/go/id/fn/main.go
var badIDFnGoSrc string
//go:embed testdata/modules/python/id/fn/main.py
var badIDFnPySrc string
//go:embed testdata/modules/typescript/id/fn/index.ts
var badIDFnTSSrc string
func TestModuleReservedWords(t *testing.T) {
// verify disallowed names are rejected
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("id", func(t *testing.T) {
t.Parallel()
t.Run("arg", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDArgGoSrc,
},
{
sdk: "python",
source: badIDArgPySrc,
},
{
sdk: "typescript",
source: badIDArgTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := modInit(ctx, t, c, tc.sdk, tc.source).
With(daggerQuery(`{test{fn(id:"no")}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define argument with reserved name \"id\"")
})
}
})
t.Run("field", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFieldGoSrc,
},
{
sdk: "typescript",
source: badIDFieldTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{fn{id}}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define field with reserved name \"id\"")
})
}
})
t.Run("fn", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFnGoSrc,
},
{
sdk: "python",
source: badIDFnPySrc,
},
{
sdk: "typescript",
source: badIDFnTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{id}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define function with reserved name \"id\"")
})
}
})
})
}
func TestModuleExecError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
import (
"context"
"errors"
)
type Playground struct{}
func (p *Playground) DoThing(ctx context.Context) error {
_, err := dag.Container().From("` + alpineImage + `").WithExec([]string{"sh", "-c", "exit 5"}).Sync(ctx)
var e *ExecError
if errors.As(err, &e) {
if e.ExitCode == 5 {
return nil
}
}
panic("yikes")
}
`})
logGen(ctx, t, modGen.Directory("."))
_, err := modGen.
With(daggerQuery(`{playground{doThing}}`)).
Stdout(ctx)
require.NoError(t, err)
}
func TestModuleCurrentModuleAPI(t *testing.T) {
t.Parallel()
t.Run("name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=WaCkY", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type WaCkY struct {}
func (m *WaCkY) Fn(ctx context.Context) (string, error) {
return dag.CurrentModule().Name(ctx)
}
`,
}).
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "WaCkY", strings.TrimSpace(out))
})
t.Run("source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk=go")).
WithNewFile("/work/subdir/coolfile.txt", dagger.ContainerWithNewFileOpts{
Contents: "nice",
}).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) *File {
return dag.CurrentModule().Source().File("subdir/coolfile.txt")
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("workdir", func(t *testing.T) {
t.Parallel()
t.Run("dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*Directory, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().Workdir("subdir/moresubdir"), nil
}
`,
}).
With(daggerCall("fn", "file", "--path=coolfile.txt", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("file", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*File, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().WorkdirFile("subdir/moresubdir/coolfile.txt"), nil
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("error on escape", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
func New() (*Test, error) {
if err := os.WriteFile("/rootfile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
if err := os.MkdirAll("/foo", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("/foo/foofile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
return &Test{}, nil
}
type Test struct {}
func (m *Test) EscapeFile(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("../rootfile.txt")
}
func (m *Test) EscapeFileAbs(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("/rootfile.txt")
}
func (m *Test) EscapeDir(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("../foo")
}
func (m *Test) EscapeDirAbs(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("/foo")
}
`,
})
_, err := ctr.
With(daggerCall("escape-file", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-file-abs", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../foo" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir-abs", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/foo" escapes workdir`)
})
})
}
func TestModuleCustomSDK(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/coolsdk").
With(daggerExec("init", "--name=cool-sdk", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type CoolSdk struct {}
func (m *CoolSdk) ModuleRuntime(modSource *ModuleSource, introspectionJson string) *Container {
return modSource.AsModule().WithSDK("go").Initialize().Runtime().WithEnvVariable("COOL", "true")
}
func (m *CoolSdk) Codegen(modSource *ModuleSource, introspectionJson string) *GeneratedCode {
existingConfig := modSource.Directory("/").File("dagger.json")
return dag.GeneratedCode(modSource.
Directory("/").
WithoutFile("dagger.json").
AsModule().
WithSDK("go").
GeneratedSourceRootDirectory().
WithFile("dagger.json", existingConfig),
)
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk=coolsdk")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "os"
type Test struct {}
func (m *Test) Fn() string {
return os.Getenv("COOL")
}
`,
})
out, err := ctr.
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "true", strings.TrimSpace(out))
}
// TestModuleHostError verifies the host api is not exposed to modules
func TestModuleHostError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) *Directory {
return dag.Host().Directory(".")
}
`,
}).
With(daggerCall("fn")).
Sync(ctx)
require.ErrorContains(t, err, "dag.Host undefined")
}
func daggerExec(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerQuery(query string, args ...any) dagger.WithContainerFunc {
return daggerQueryAt("", query, args...)
}
func daggerQueryAt(modPath string, query string, args ...any) dagger.WithContainerFunc {
query = fmt.Sprintf(query, args...)
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "query"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(execArgs, dagger.ContainerWithExecOpts{
Stdin: query,
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerCall(args ...string) dagger.WithContainerFunc {
return daggerCallAt("", args...)
}
func daggerCallAt(modPath string, args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "call"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(append(execArgs, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerFunctions(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug", "functions"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func configFile(dirPath string, cfg *modules.ModuleConfig) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
cfgPath := filepath.Join(dirPath, "dagger.json")
cfgBytes, err := json.Marshal(cfg)
if err != nil {
panic(err)
}
return c.WithNewFile(cfgPath, dagger.ContainerWithNewFileOpts{
Contents: string(cfgBytes),
})
}
}
// command for a dagger cli call direct on the host
func hostDaggerCommand(ctx context.Context, t testing.TB, workdir string, args ...string) *exec.Cmd {
t.Helper()
cmd := exec.CommandContext(ctx, daggerCliPath(t), args...)
cmd.Dir = workdir
return cmd
}
// runs a dagger cli command directly on the host, rather than in an exec
func hostDaggerExec(ctx context.Context, t testing.TB, workdir string, args ...string) ([]byte, error) {
t.Helper()
cmd := hostDaggerCommand(ctx, t, workdir, args...)
output, err := cmd.CombinedOutput()
if err != nil {
err = fmt.Errorf("%s: %w", string(output), err)
}
return output, err
}
func sdkSource(sdk, contents string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
var sourcePath string
switch sdk {
case "go":
sourcePath = "main.go"
case "python":
sourcePath = "src/main.py"
case "typescript":
sourcePath = "src/index.ts"
default:
return c
}
return c.WithNewFile(sourcePath, dagger.ContainerWithNewFileOpts{
Contents: heredoc.Doc(contents),
})
}
}
func sdkCodegenFile(t *testing.T, sdk string) string {
t.Helper()
switch sdk {
case "go":
return "dagger.gen.go"
case "python":
return "sdk/src/dagger/client/gen.py"
case "typescript":
return "sdk/api/client.gen.ts"
default:
return ""
}
}
func modInit(ctx context.Context, t *testing.T, c *dagger.Client, sdk, contents string) *dagger.Container {
t.Helper()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+sdk)).
With(sdkSource(sdk, contents))
if sdk == "go" {
logGen(ctx, t, modGen.Directory("."))
}
return modGen
}
func currentSchema(ctx context.Context, t *testing.T, ctr *dagger.Container) *introspection.Schema {
t.Helper()
out, err := ctr.With(daggerQuery(introspection.Query)).Stdout(ctx)
require.NoError(t, err)
var schemaResp introspection.Response
err = json.Unmarshal([]byte(out), &schemaResp)
require.NoError(t, err)
return schemaResp.Schema
}
var moduleIntrospection = daggerQuery(`
query { host { directory(path: ".") { asModule { initialize {
description
objects {
asObject {
name
description
constructor {
description
args {
name
description
defaultValue
}
}
functions {
name
description
args {
name
description
defaultValue
}
}
fields {
name
description
}
}
}
} } } } }
`)
func inspectModule(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
t.Helper()
out, err := ctr.With(moduleIntrospection).Stdout(ctx)
require.NoError(t, err)
result := gjson.Get(out, "host.directory.asModule.initialize")
t.Logf("module introspection:\n%v", result.Raw)
return result
}
func inspectModuleObjects(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
t.Helper()
return inspectModule(ctx, t, ctr).Get("objects.#.asObject")
}
func goGitBase(t *testing.T, c *dagger.Client) *dagger.Container {
t.Helper()
return c.Container().From(golangImage).
WithExec([]string{"apk", "add", "git"}).
WithExec([]string{"git", "config", "--global", "user.email", "dagger@example.com"}).
WithExec([]string{"git", "config", "--global", "user.name", "Dagger Tests"}).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"})
}
func logGen(ctx context.Context, t *testing.T, modSrc *dagger.Directory) {
t.Helper()
generated, err := modSrc.File("dagger.gen.go").Contents(ctx)
require.NoError(t, err)
t.Cleanup(func() {
t.Name()
fileName := filepath.Join(
os.TempDir(),
t.Name(),
fmt.Sprintf("dagger.gen.%d.go", time.Now().Unix()),
)
if err := os.MkdirAll(filepath.Dir(fileName), 0o755); err != nil {
t.Logf("failed to create temp dir for generated code: %v", err)
return
}
if err := os.WriteFile(fileName, []byte(generated), 0644); err != nil {
t.Logf("failed to write generated code to %s: %v", fileName, err)
} else {
t.Logf("wrote generated code to %s", fileName)
}
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,303 | Bug: `bind: address already in use` when using `dagger up --port` | Hit this while backfilling integ test coverage for `dagger up` as part of CLI changes. Repro below.
Module code:
```go
package main
import "context"
func New(ctx context.Context) *Test {
return &Test{
Ctr: dag.Container().
From("python").
WithMountedDirectory(
"/srv/www",
dag.Directory().WithNewFile("index.html", "hey there"),
).
WithWorkdir("/srv/www").
WithExposedPort(8000).
WithExec([]string{"python", "-m", "http.server"}),
}
}
type Test struct {
Ctr *Container
}
```
Everything works when using `--native`:
```console
sipsma@dagger_dev:~/repo/github.com/sipsma/daggerverse/test$ dagger up --native ctr
∅ dagger up ctr CANCELED [10.17s]
┃ 8000/TCP: tunnel 0.0.0.0:8000 -> cpi9mli1o4u78.b7d44b699trss.dagger.local:8000
┃ Error: context canceled
• Cloud URL: https://dagger.cloud/runs/fc1afa30-d2e8-473c-ade3-3910adbfb046
• Engine: 3b84e1257d0d (version v0.9.4)
⧗ 11.78s ✔ 46 ∅ 8
```
But if I run anything with `--port` I get bind errors, including with `--port 8000:8000` which I thought would have been the same as `--native`:
```console
sipsma@dagger_dev:~/repo/github.com/sipsma/daggerverse/test$ dagger up --port 23456:8000 ctr
✘ dagger up ctr ERROR [1.62s]
┃ Error: failed to start tunnel: input:1: host.tunnel.start host to container: failed to receive listen response: rpc error: code = Unknown desc = listen tcp 0.0.0.0:23456: bind: address already in use
✘ start ERROR [0.39s]
• Cloud URL: https://dagger.cloud/runs/849eceaf-86f3-4f1d-b8db-b23a31fb69b1
• Engine: 3b84e1257d0d (version v0.9.4)
⧗ 2.77s ✔ 44 ∅ 8 ✘ 2
sipsma@dagger_dev:~/repo/github.com/sipsma/daggerverse/test$ dagger up --port 8000:8000 ctr
✘ dagger up ctr ERROR [1.76s]
┃ Error: failed to start tunnel: input:1: host.tunnel.start host to container: failed to receive listen response: rpc error: code = Unknown desc = listen tcp 0.0.0.0:8000: bind: address already in use
✘ start ERROR [0.43s]
• Cloud URL: https://dagger.cloud/runs/bcd2c12b-66cb-4a0d-abcd-4236201617e5
• Engine: 3b84e1257d0d (version v0.9.4)
⧗ 3.08s ✔ 44 ∅ 8 ✘ 2
```
---
Not sure if specific to the CLI somehow or more general, but the fact that `--native` works and `--port 8000:8000` doesn't is quite mysterious. | https://github.com/dagger/dagger/issues/6303 | https://github.com/dagger/dagger/pull/6626 | 7f31f89b7e121368199403ff36cbbece3b31a6cb | 5ee49b9e9a955432d688157893b299f8a6180b1d | "2023-12-20T21:23:29Z" | go | "2024-02-08T20:42:59Z" | core/integration/module_up_test.go | package core
import (
"context"
"io"
"net/http"
"os"
"path/filepath"
"testing"
"time"
"github.com/creack/pty"
"github.com/stretchr/testify/require"
)
func TestModuleDaggerUp(t *testing.T) {
ctx := context.Background()
modDir := t.TempDir()
err := os.WriteFile(filepath.Join(modDir, "main.go"), []byte(`package main
import "context"
func New(ctx context.Context) *Test {
return &Test{
Ctr: dag.Container().
From("python").
WithMountedDirectory(
"/srv/www",
dag.Directory().WithNewFile("index.html", "hey there"),
).
WithWorkdir("/srv/www").
WithExposedPort(23457).
WithExec([]string{"python", "-m", "http.server", "23457"}),
}
}
type Test struct {
Ctr *Container
}
`), 0644)
require.NoError(t, err)
_, err = hostDaggerExec(ctx, t, modDir, "--debug", "init", "--source=.", "--name=test", "--sdk=go")
require.NoError(t, err)
// cache the module load itself so there's less to wait for below
_, err = hostDaggerExec(ctx, t, modDir, "--debug", "functions")
require.NoError(t, err)
ctx, cancel := context.WithTimeout(ctx, 3*time.Minute)
defer cancel()
t.Run("native", func(t *testing.T) {
cmd := hostDaggerCommand(ctx, t, modDir, "call", "ctr", "as-service", "up")
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err = cmd.Start()
require.NoError(t, err)
defer cmd.Process.Kill()
for {
select {
case <-ctx.Done():
require.FailNow(t, "timed out waiting for container to start")
default:
}
resp, err := http.Get("http://127.0.0.1:23457")
if err != nil {
t.Logf("waiting for container to start: %s", err)
time.Sleep(time.Second)
continue
}
defer resp.Body.Close()
require.Equal(t, http.StatusOK, resp.StatusCode)
body, err := io.ReadAll(resp.Body)
require.NoError(t, err)
require.Equal(t, "hey there", string(body))
break
}
})
t.Run("random", func(t *testing.T) {
console, err := newTUIConsole(t, time.Minute)
require.NoError(t, err)
tty := console.Tty()
err = pty.Setsize(tty, &pty.Winsize{Rows: 10, Cols: 28})
require.NoError(t, err)
cmd := hostDaggerCommand(ctx, t, modDir, "call", "ctr", "as-service", "up", "--random")
cmd.Stdin = nil
cmd.Stdout = tty
cmd.Stderr = tty
err = cmd.Start()
require.NoError(t, err)
defer cmd.Process.Kill()
_, matches, err := console.MatchLine(ctx, `(\d+)/TCP:`)
require.NoError(t, err)
port := matches[1]
t.Logf("random port: %s", port)
for {
select {
case <-ctx.Done():
require.FailNow(t, "timed out waiting for container to start")
default:
}
resp, err := http.Get("http://127.0.0.1:" + port)
if err != nil {
t.Logf("waiting for container to start: %s", err)
time.Sleep(time.Second)
continue
}
defer resp.Body.Close()
require.Equal(t, http.StatusOK, resp.StatusCode)
body, err := io.ReadAll(resp.Body)
require.NoError(t, err)
require.Equal(t, "hey there", string(body))
break
}
})
t.Run("port map", func(t *testing.T) {
cmd := hostDaggerCommand(ctx, t, modDir, "call", "ctr", "as-service", "up", "--ports", "23458:23457")
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err = cmd.Start()
require.NoError(t, err)
defer cmd.Process.Kill()
for {
select {
case <-ctx.Done():
require.FailNow(t, "timed out waiting for container to start")
default:
}
resp, err := http.Get("http://127.0.0.1:23458")
if err != nil {
t.Logf("waiting for container to start: %s", err)
time.Sleep(time.Second)
continue
}
defer resp.Body.Close()
require.Equal(t, http.StatusOK, resp.StatusCode)
body, err := io.ReadAll(resp.Body)
require.NoError(t, err)
require.Equal(t, "hey there", string(body))
break
}
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,303 | Bug: `bind: address already in use` when using `dagger up --port` | Hit this while backfilling integ test coverage for `dagger up` as part of CLI changes. Repro below.
Module code:
```go
package main
import "context"
func New(ctx context.Context) *Test {
return &Test{
Ctr: dag.Container().
From("python").
WithMountedDirectory(
"/srv/www",
dag.Directory().WithNewFile("index.html", "hey there"),
).
WithWorkdir("/srv/www").
WithExposedPort(8000).
WithExec([]string{"python", "-m", "http.server"}),
}
}
type Test struct {
Ctr *Container
}
```
Everything works when using `--native`:
```console
sipsma@dagger_dev:~/repo/github.com/sipsma/daggerverse/test$ dagger up --native ctr
∅ dagger up ctr CANCELED [10.17s]
┃ 8000/TCP: tunnel 0.0.0.0:8000 -> cpi9mli1o4u78.b7d44b699trss.dagger.local:8000
┃ Error: context canceled
• Cloud URL: https://dagger.cloud/runs/fc1afa30-d2e8-473c-ade3-3910adbfb046
• Engine: 3b84e1257d0d (version v0.9.4)
⧗ 11.78s ✔ 46 ∅ 8
```
But if I run anything with `--port` I get bind errors, including with `--port 8000:8000` which I thought would have been the same as `--native`:
```console
sipsma@dagger_dev:~/repo/github.com/sipsma/daggerverse/test$ dagger up --port 23456:8000 ctr
✘ dagger up ctr ERROR [1.62s]
┃ Error: failed to start tunnel: input:1: host.tunnel.start host to container: failed to receive listen response: rpc error: code = Unknown desc = listen tcp 0.0.0.0:23456: bind: address already in use
✘ start ERROR [0.39s]
• Cloud URL: https://dagger.cloud/runs/849eceaf-86f3-4f1d-b8db-b23a31fb69b1
• Engine: 3b84e1257d0d (version v0.9.4)
⧗ 2.77s ✔ 44 ∅ 8 ✘ 2
sipsma@dagger_dev:~/repo/github.com/sipsma/daggerverse/test$ dagger up --port 8000:8000 ctr
✘ dagger up ctr ERROR [1.76s]
┃ Error: failed to start tunnel: input:1: host.tunnel.start host to container: failed to receive listen response: rpc error: code = Unknown desc = listen tcp 0.0.0.0:8000: bind: address already in use
✘ start ERROR [0.43s]
• Cloud URL: https://dagger.cloud/runs/bcd2c12b-66cb-4a0d-abcd-4236201617e5
• Engine: 3b84e1257d0d (version v0.9.4)
⧗ 3.08s ✔ 44 ∅ 8 ✘ 2
```
---
Not sure if specific to the CLI somehow or more general, but the fact that `--native` works and `--port 8000:8000` doesn't is quite mysterious. | https://github.com/dagger/dagger/issues/6303 | https://github.com/dagger/dagger/pull/6626 | 7f31f89b7e121368199403ff36cbbece3b31a6cb | 5ee49b9e9a955432d688157893b299f8a6180b1d | "2023-12-20T21:23:29Z" | go | "2024-02-08T20:42:59Z" | core/schema/service.go | package schema
import (
"context"
"fmt"
"runtime/debug"
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/dagql"
"github.com/dagger/dagger/dagql/ioctx"
)
type serviceSchema struct {
srv *dagql.Server
}
var _ SchemaResolvers = &serviceSchema{}
func (s *serviceSchema) Install() {
dagql.Fields[*core.Container]{
dagql.Func("asService", s.containerAsService).
Doc(`Turn the container into a Service.`,
`Be sure to set any exposed ports before this conversion.`),
}.Install(s.srv)
dagql.Fields[*core.Service]{
dagql.NodeFunc("hostname", s.hostname).
Doc(`Retrieves a hostname which can be used by clients to reach this container.`),
dagql.NodeFunc("ports", s.ports).
Impure("A tunnel service's ports can change each time it is restarted.").
Doc(`Retrieves the list of ports provided by the service.`),
dagql.NodeFunc("endpoint", s.endpoint).
Impure("A tunnel service's endpoint can change if tunnel service is restarted.").
Doc(`Retrieves an endpoint that clients can use to reach this container.`,
`If no port is specified, the first exposed port is used. If none exist an error is returned.`,
`If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.`).
ArgDoc("port", `The exposed port number for the endpoint`).
ArgDoc("scheme", `Return a URL with the given scheme, eg. http for http://`),
dagql.NodeFunc("start", s.start).
Impure("Imperatively mutates runtime state.").
Doc(`Start the service and wait for its health checks to succeed.`,
`Services bound to a Container do not need to be manually started.`),
dagql.NodeFunc("up", s.up).
Impure("Starts a host tunnel, possibly with ports that change each time it's started.").
Doc(`Creates a tunnel that forwards traffic from the caller's network to this service.`).
ArgDoc("random", `Bind each tunnel port to a random port on the host.`).
ArgDoc("ports", `List of frontend/backend port mappings to forward.`,
`Frontend is the port accepting traffic on the host, backend is the service port.`),
dagql.NodeFunc("stop", s.stop).
Impure("Imperatively mutates runtime state.").
Doc(`Stop the service.`).
ArgDoc("kill", `Immediately kill the service without waiting for a graceful exit`),
}.Install(s.srv)
}
func (s *serviceSchema) containerAsService(ctx context.Context, parent *core.Container, args struct{}) (*core.Service, error) {
return parent.Service(ctx)
}
func (s *serviceSchema) hostname(ctx context.Context, parent dagql.Instance[*core.Service], args struct{}) (dagql.String, error) {
hn, err := parent.Self.Hostname(ctx, parent.ID())
if err != nil {
return "", err
}
return dagql.NewString(hn), nil
}
func (s *serviceSchema) ports(ctx context.Context, parent dagql.Instance[*core.Service], args struct{}) (dagql.Array[core.Port], error) {
return parent.Self.Ports(ctx, parent.ID())
}
type serviceEndpointArgs struct {
Port dagql.Optional[dagql.Int]
Scheme string `default:""`
}
func (s *serviceSchema) endpoint(ctx context.Context, parent dagql.Instance[*core.Service], args serviceEndpointArgs) (dagql.String, error) {
str, err := parent.Self.Endpoint(ctx, parent.ID(), args.Port.Value.Int(), args.Scheme)
if err != nil {
return "", err
}
return dagql.NewString(str), nil
}
func (s *serviceSchema) start(ctx context.Context, parent dagql.Instance[*core.Service], args struct{}) (core.ServiceID, error) {
defer func() {
if err := recover(); err != nil {
debug.PrintStack()
panic(err)
}
}()
if err := parent.Self.StartAndTrack(ctx, parent.ID()); err != nil {
return core.ServiceID{}, err
}
return dagql.NewID[*core.Service](parent.ID()), nil
}
type serviceStopArgs struct {
Kill bool `default:"false"`
}
func (s *serviceSchema) stop(ctx context.Context, parent dagql.Instance[*core.Service], args serviceStopArgs) (core.ServiceID, error) {
if err := parent.Self.Stop(ctx, parent.ID(), args.Kill); err != nil {
return core.ServiceID{}, err
}
return dagql.NewID[*core.Service](parent.ID()), nil
}
type upArgs struct {
Ports []dagql.InputObject[core.PortForward] `default:"[]"`
Random bool `default:"false"`
}
func (s *serviceSchema) up(ctx context.Context, svc dagql.Instance[*core.Service], args upArgs) (dagql.Nullable[core.Void], error) {
void := dagql.Null[core.Void]()
var hostSvc dagql.Instance[*core.Service]
err := s.srv.Select(ctx, s.srv.Root(), &hostSvc,
dagql.Selector{
Field: "host",
},
dagql.Selector{
Field: "tunnel",
Args: []dagql.NamedInput{
{Name: "service", Value: dagql.NewID[*core.Service](svc.ID())},
{Name: "ports", Value: dagql.ArrayInput[dagql.InputObject[core.PortForward]](args.Ports)},
{Name: "native", Value: dagql.Boolean(!args.Random)},
},
},
)
if err != nil {
return void, fmt.Errorf("failed to select host service: %w", err)
}
runningSvc, err := hostSvc.Self.Query.Services.Start(ctx, hostSvc.ID(), hostSvc.Self)
if err != nil {
return void, fmt.Errorf("failed to start host service: %w", err)
}
ioctxOut := ioctx.Stdout(ctx)
for _, port := range runningSvc.Ports {
portStr := fmt.Sprintf("%d/%s", port.Port, port.Protocol)
if port.Description != nil {
portStr += ": " + *port.Description
}
portStr += "\n"
ioctxOut.Write([]byte(portStr))
}
// wait for the request to be canceled
<-ctx.Done()
return void, nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,630 | `slice bounds out of range [1:0]` panic in shim secret scrubbing | Hit this while testing publish things in my fork: https://github.com/sipsma/dagger/actions/runs/7837271347/job/21386972933#step:4:2866
Stack:
```
62: [0.09s] panic: runtime error: slice bounds out of range [1:0] goroutine 1 [running, locked to thread]:
62: [0.09s] runtime/debug.Stack()
62: [0.09s] /usr/local/go/src/runtime/debug/stack.go:24 +0x5e
62: [0.09s] main.main.func1()
62: [0.09s] /app/cmd/shim/main.go:63 +0x38
62: [0.09s] panic({0x1105620?, 0xc000044c78?})
62: [0.09s] /usr/local/go/src/runtime/panic.go:914 +0x21f
62: [0.09s] main.(*Trie).Insert(0xc00008b020?, {0xc0001a2b90, 0x4e, 0x50}, {0x1b18a8e, 0x3, 0x3})
62: [0.09s] /app/cmd/shim/secret_scrub.go:230 +0x351
62: [0.09s] main.NewSecretScrubReader({0x13307a0?, 0xc000126938}, {0x1329160, 0x1}, {0x1330820, 0xc0005a2780}, {0xc0003a28c0?, 0x2?, 0x2?}, {{0xc0005b7500, ...}, ...})
62: [0.09s] /app/cmd/shim/secret_scrub.go:39 +0x345
62: [0.09s] main.shim()
62: [0.09s] /app/cmd/shim/main.go:259 +0xc52
62: [0.09s] main.main()
62: [0.09s] /app/cmd/shim/main.go:76 +0x74
62: [0.09s]
```
[Relevant line of code](https://github.com/sipsma/dagger/blob/d71867c127f6970113221c57fc03d2c8084b6c0a/cmd/shim/secret_scrub.go#L230-L230)
Not 100% sure but suspect I may have somehow set a secret value to `""`? That seems like a plausible explanation, but haven't looked at this in depth.
cc @jedevc | https://github.com/dagger/dagger/issues/6630 | https://github.com/dagger/dagger/pull/6641 | 794e3b3d298c7ca77dfedf5bf3d98d143ed05095 | 0c0de6b23b0151a9d1debfa8cbc879fd30391ab5 | "2024-02-08T23:51:48Z" | go | "2024-02-12T14:41:35Z" | cmd/shim/secret_scrub.go | package main
import (
"fmt"
"io"
"io/fs"
"path/filepath"
"strings"
"github.com/dagger/dagger/core"
"golang.org/x/text/transform"
)
var (
// scrubString will be used as replacement for found secrets:
scrubString = []byte("***")
)
func NewSecretScrubReader(r io.Reader, currentDirPath string, fsys fs.FS, env []string, secretsToScrub core.SecretToScrubInfo) (io.Reader, error) {
secrets := loadSecretsToScrubFromEnv(env, secretsToScrub.Envs)
fileSecrets, err := loadSecretsToScrubFromFiles(currentDirPath, fsys, secretsToScrub.Files)
if err != nil {
return nil, fmt.Errorf("could not load secrets from file: %w", err)
}
secrets = append(secrets, fileSecrets...)
secretAsBytes := make([][]byte, 0)
for _, v := range secrets {
// Skip empty env:
if len(v) == 0 {
continue
}
secretAsBytes = append(secretAsBytes, []byte(v))
}
trie := &Trie{}
for _, s := range secretAsBytes {
trie.Insert([]byte(s), scrubString)
}
transformer := &censor{
trie: trie,
trieRoot: trie,
// NOTE: keep these sizes the same as the default transform sizes
srcBuf: make([]byte, 0, 4096),
dstBuf: make([]byte, 0, 4096),
}
return transform.NewReader(r, transformer), nil
}
// loadSecretsToScrubFromEnv loads secrets value from env if they are in secretsToScrub.
func loadSecretsToScrubFromEnv(env []string, secretsToScrub []string) []string {
secrets := []string{}
for _, envKV := range env {
envName, envValue, ok := strings.Cut(envKV, "=")
// no env value for this secret
if !ok {
continue
}
for _, envToScrub := range secretsToScrub {
if envName == envToScrub {
secrets = append(secrets, envValue)
}
}
}
return secrets
}
// loadSecretsToScrubFromFiles loads secrets from file path in secretFilePathsToScrub from the fsys, accessed from the absolute currentDirPathAbs.
// It will attempt to make any file path as absolute file path by joining it with the currentDirPathAbs if need be.
func loadSecretsToScrubFromFiles(currentDirPathAbs string, fsys fs.FS, secretFilePathsToScrub []string) ([]string, error) {
secrets := make([]string, 0, len(secretFilePathsToScrub))
for _, fileToScrub := range secretFilePathsToScrub {
absFileToScrub := fileToScrub
if !filepath.IsAbs(fileToScrub) {
absFileToScrub = filepath.Join("/", fileToScrub)
}
if strings.HasPrefix(fileToScrub, currentDirPathAbs) || strings.HasPrefix(fileToScrub, currentDirPathAbs[1:]) {
absFileToScrub = strings.TrimPrefix(fileToScrub, currentDirPathAbs)
absFileToScrub = filepath.Join("/", absFileToScrub)
}
// we remove the first `/` from the absolute path to fileToScrub to work with fs.ReadFile
secret, err := fs.ReadFile(fsys, absFileToScrub[1:])
if err != nil {
return nil, fmt.Errorf("secret value not available for: %w", err)
}
secrets = append(secrets, string(secret))
}
return secrets, nil
}
// censor is a custom Transformer for replacing all keys in a target trie with
// their values.
type censor struct {
// trieRoot is the root of the trie
trieRoot *Trie
// trie is the current node we are at in the trie
trie *Trie
// srcBuf is the source buffer, which contains bytes read from the src that
// are partial matches against the trie
srcBuf []byte
// destBuf is the destination buffer, which contains bytes that have been
// sanitized by the censor and are ready to be copied out
dstBuf []byte
}
// Transform ingests src bytes, and outputs sanitized bytes to dst.
//
// Unlike some other secret scrubbing implementations, this aims to sanitize
// bytes *as soon as possible*. The moment that we know a byte is not part of a
// secret, we should ouput it into dst - even if this would break up a provided
// src into multiple dsts over multiple calls to Transform.
func (c *censor) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
for {
// flush the destination buffer
k := copy(dst[nDst:], c.dstBuf)
nDst += k
if nDst == len(dst) {
c.dstBuf = c.dstBuf[k:]
return nDst, nSrc, transform.ErrShortDst
}
c.dstBuf = c.dstBuf[:0]
if !atEOF && nSrc == len(src) {
// no more source bytes, we're done!
return nDst, nSrc, nil
}
if atEOF && nSrc == len(src) && len(c.srcBuf) == 0 {
// no more source bytes, or buffered source bytes, we're done!
// (when atEOF, we won't get called again, so we need to make sure
// to flush everything)
return nDst, nSrc, nil
}
// read more source bytes, until either we've read all the source
// bytes, or we've filled the destination buffer
for ; nSrc < len(src) && nDst+len(c.dstBuf) < len(dst); nSrc++ {
ch := src[nSrc]
c.trie = c.trie.Step(ch)
if c.trie == nil {
// no match possible, so flush the source buffer into the
// destination buffer, and process the current byte again.
//
// we do this because this *might* cause us to try to flush
// more than len(dst) - nDst bytes into the destination buffer,
// so we should avoid consuming the next byte in this case.
if len(c.srcBuf) != 0 {
c.trie = c.trieRoot
c.dstBuf = append(c.dstBuf, c.srcBuf...)
c.srcBuf = c.srcBuf[:0]
nSrc--
continue
}
// put the current byte either into the destination buffer, or
// the source buffer, depending on whether it's a partial match
c.trie = c.trieRoot.Step(ch)
if c.trie == nil {
c.trie = c.trieRoot
c.dstBuf = append(c.dstBuf, ch)
} else if replace := c.trie.Value(); replace != nil {
c.trie = c.trieRoot
c.dstBuf = append(c.dstBuf, replace...)
} else {
c.srcBuf = append(c.srcBuf, ch)
}
} else if replace := c.trie.Value(); replace != nil {
// aha, we made a match, so replace the source buffer with the
// censored string, and flush into the destination buffer
c.trie = c.trieRoot
c.dstBuf = append(c.dstBuf, replace...)
c.srcBuf = c.srcBuf[:0]
} else {
// we're in the middle of a match
c.srcBuf = append(c.srcBuf, ch)
}
}
// at this point, no more matches are possible, so flush
if atEOF {
c.dstBuf = append(c.dstBuf, c.srcBuf...)
c.srcBuf = c.srcBuf[:0]
}
}
}
func (c *censor) Reset() {
c.trie = c.trieRoot
c.srcBuf = c.srcBuf[:0]
c.dstBuf = c.dstBuf[:0]
}
// Trie is a simple implementation of a compressed trie (or radix tree). In
// essence, it's a key-value store that allows easily selecting all entries
// that have a given prefix.
//
// Why not an off-the-shelf implementation? Well, most of those don't allow
// navigating character-by-character through the tree, like we do with Step.
type Trie struct {
Children []*Trie
Direct []byte
value []byte
}
func (t *Trie) Insert(key []byte, value []byte) {
node := t
for i, ch := range key {
if node.Children == nil {
if len(node.Direct) == 0 {
node.Direct = key[i:]
break
}
// why a slice instead of a map? surely it uses more space?
// well, doing a lookup on a slice like this is *super* quick, but
// doing so on a map is *much* slower - since this is in the
// hotpath, it makes sense to waste the memory here (and since the
// trie is compressed, it doesn't seem to be that much in practice)
node.Children = make([]*Trie, 256)
node.Children[node.Direct[0]] = &Trie{
Direct: node.Direct[1:],
value: node.value,
}
node.Direct = nil
node.value = nil
}
if node.Children[ch] == nil {
node.Children[ch] = &Trie{}
}
node = node.Children[ch]
}
node.value = value
}
func (t *Trie) Step(ch byte) *Trie {
if t.Children != nil {
return t.Children[ch]
}
if len(t.Direct) > 0 && t.Direct[0] == ch {
return &Trie{
Direct: t.Direct[1:],
value: t.value,
}
}
return nil
}
func (t *Trie) Value() []byte {
if len(t.Direct) == 0 {
return t.value
}
return nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,630 | `slice bounds out of range [1:0]` panic in shim secret scrubbing | Hit this while testing publish things in my fork: https://github.com/sipsma/dagger/actions/runs/7837271347/job/21386972933#step:4:2866
Stack:
```
62: [0.09s] panic: runtime error: slice bounds out of range [1:0] goroutine 1 [running, locked to thread]:
62: [0.09s] runtime/debug.Stack()
62: [0.09s] /usr/local/go/src/runtime/debug/stack.go:24 +0x5e
62: [0.09s] main.main.func1()
62: [0.09s] /app/cmd/shim/main.go:63 +0x38
62: [0.09s] panic({0x1105620?, 0xc000044c78?})
62: [0.09s] /usr/local/go/src/runtime/panic.go:914 +0x21f
62: [0.09s] main.(*Trie).Insert(0xc00008b020?, {0xc0001a2b90, 0x4e, 0x50}, {0x1b18a8e, 0x3, 0x3})
62: [0.09s] /app/cmd/shim/secret_scrub.go:230 +0x351
62: [0.09s] main.NewSecretScrubReader({0x13307a0?, 0xc000126938}, {0x1329160, 0x1}, {0x1330820, 0xc0005a2780}, {0xc0003a28c0?, 0x2?, 0x2?}, {{0xc0005b7500, ...}, ...})
62: [0.09s] /app/cmd/shim/secret_scrub.go:39 +0x345
62: [0.09s] main.shim()
62: [0.09s] /app/cmd/shim/main.go:259 +0xc52
62: [0.09s] main.main()
62: [0.09s] /app/cmd/shim/main.go:76 +0x74
62: [0.09s]
```
[Relevant line of code](https://github.com/sipsma/dagger/blob/d71867c127f6970113221c57fc03d2c8084b6c0a/cmd/shim/secret_scrub.go#L230-L230)
Not 100% sure but suspect I may have somehow set a secret value to `""`? That seems like a plausible explanation, but haven't looked at this in depth.
cc @jedevc | https://github.com/dagger/dagger/issues/6630 | https://github.com/dagger/dagger/pull/6641 | 794e3b3d298c7ca77dfedf5bf3d98d143ed05095 | 0c0de6b23b0151a9d1debfa8cbc879fd30391ab5 | "2024-02-08T23:51:48Z" | go | "2024-02-12T14:41:35Z" | cmd/shim/secret_scrub_test.go | package main
import (
"bufio"
"bytes"
_ "embed"
"fmt"
"io"
"math/rand"
"strings"
"sync"
"testing"
"testing/fstest"
"github.com/stretchr/testify/require"
"github.com/dagger/dagger/core"
)
var (
//nolint:typecheck
//go:embed testdata/id_ed25519
sshSecretKey string
//nolint:typecheck
//go:embed testdata/id_ed25519.pub
sshPublicKey string
)
func TestSecretScrubWriterWrite(t *testing.T) {
t.Parallel()
fsys := fstest.MapFS{
"mysecret": &fstest.MapFile{
Data: []byte("my secret file"),
},
"subdir/alsosecret": &fstest.MapFile{
Data: []byte("a subdir secret file \nwith line feed"),
},
}
env := []string{
"MY_SECRET_ID=my secret value",
}
t.Run("scrub files and env", func(t *testing.T) {
var buf bytes.Buffer
buf.WriteString("I love to share my secret value to my close ones. But I keep my secret file to myself. As well as a subdir secret file \nwith line feed.")
currentDirPath := "/"
r, err := NewSecretScrubReader(&buf, currentDirPath, fsys, env, core.SecretToScrubInfo{
Envs: []string{"MY_SECRET_ID"},
Files: []string{"/mysecret", "/subdir/alsosecret"},
})
require.NoError(t, err)
out, err := io.ReadAll(r)
require.NoError(t, err)
want := "I love to share *** to my close ones. But I keep *** to myself. As well as ***."
require.Equal(t, want, string(out))
})
t.Run("do not scrub empty env", func(t *testing.T) {
env := append(env, "EMPTY_SECRET_ID=")
currentDirPath := "/"
fsys := fstest.MapFS{
"emptysecret": &fstest.MapFile{
Data: []byte(""),
},
}
var buf bytes.Buffer
buf.WriteString("I love to share my secret value to my close ones. But I keep my secret file to myself.")
r, err := NewSecretScrubReader(&buf, currentDirPath, fsys, env, core.SecretToScrubInfo{
Envs: []string{"EMPTY_SECRET_ID"},
Files: []string{"/emptysecret"},
})
require.NoError(t, err)
out, err := io.ReadAll(r)
require.NoError(t, err)
want := "I love to share my secret value to my close ones. But I keep my secret file to myself."
require.Equal(t, want, string(out))
})
}
func TestLoadSecretsToScrubFromEnv(t *testing.T) {
t.Parallel()
secretValue := "my secret value"
env := []string{
fmt.Sprintf("MY_SECRET_ID=%s", secretValue),
"PUBLIC_STUFF=so public",
}
secretToScrub := core.SecretToScrubInfo{
Envs: []string{
"MY_SECRET_ID",
},
}
secrets := loadSecretsToScrubFromEnv(env, secretToScrub.Envs)
require.NotContains(t, secrets, "PUBLIC_STUFF")
require.Contains(t, secrets, secretValue)
}
func TestLoadSecretsToScrubFromFiles(t *testing.T) {
t.Parallel()
const currentDirPath = "/mnt"
t.Run("/mnt, fs relative, secret absolute", func(t *testing.T) {
fsys := fstest.MapFS{
"mysecret": &fstest.MapFile{
Data: []byte("my secret file"),
},
"subdir/alsosecret": &fstest.MapFile{
Data: []byte("a subdir secret file"),
},
}
secretFilePathsToScrub := []string{"/mnt/mysecret", "/mnt/subdir/alsosecret"}
secrets, err := loadSecretsToScrubFromFiles(currentDirPath, fsys, secretFilePathsToScrub)
require.NoError(t, err)
require.Contains(t, secrets, "my secret file")
require.Contains(t, secrets, "a subdir secret file")
})
t.Run("/mnt, fs relative, secret relative", func(t *testing.T) {
fsys := fstest.MapFS{
"mysecret": &fstest.MapFile{
Data: []byte("my secret file"),
},
"subdir/alsosecret": &fstest.MapFile{
Data: []byte("a subdir secret file"),
},
}
secretFilePathsToScrub := []string{"mysecret", "subdir/alsosecret"}
secrets, err := loadSecretsToScrubFromFiles(currentDirPath, fsys, secretFilePathsToScrub)
require.NoError(t, err)
require.Contains(t, secrets, "my secret file")
require.Contains(t, secrets, "a subdir secret file")
})
t.Run("/mnt, fs absolute, secret relative", func(t *testing.T) {
fsys := fstest.MapFS{
"mnt/mysecret": &fstest.MapFile{
Data: []byte("my secret file"),
},
"mnt/subdir/alsosecret": &fstest.MapFile{
Data: []byte("a subdir secret file"),
},
}
secretFilePathsToScrub := []string{"mnt/mysecret", "mnt/subdir/alsosecret"}
secrets, err := loadSecretsToScrubFromFiles(currentDirPath, fsys, secretFilePathsToScrub)
require.NoError(t, err)
require.Contains(t, secrets, "my secret file")
require.Contains(t, secrets, "a subdir secret file")
})
}
func TestScrubSecretWrite(t *testing.T) {
t.Parallel()
envMap := map[string]string{
"secret1": "secret1 value",
"secret2": "secret2",
"sshSecretKey": sshSecretKey,
"sshPublicKey": sshPublicKey,
}
env := []string{}
for k, v := range envMap {
env = append(env, fmt.Sprintf("%s=%s", k, v))
}
envNames := []string{
"secret1",
"secret2",
"sshSecretKey",
"sshPublicKey",
}
secretToScrubInfo := core.SecretToScrubInfo{
Envs: envNames,
Files: []string{},
}
t.Run("multiline secret", func(t *testing.T) {
for input, expectedOutput := range map[string]string{
"aaa\n" + sshSecretKey + "\nbbb\nccc": "aaa\n***\nbbb\nccc",
"aaa" + sshSecretKey + "bbb\nccc": "aaa***bbb\nccc",
sshSecretKey: "***",
} {
var buf bytes.Buffer
r, err := NewSecretScrubReader(&buf, "/", fstest.MapFS{}, env, secretToScrubInfo)
require.NoError(t, err)
_, err = buf.WriteString(input)
require.NoError(t, err)
out, err := io.ReadAll(r)
require.NoError(t, err)
require.Equal(t, expectedOutput, string(out))
}
})
t.Run("single line secret", func(t *testing.T) {
var buf bytes.Buffer
r, err := NewSecretScrubReader(&buf, "/", fstest.MapFS{}, env, secretToScrubInfo)
require.NoError(t, err)
input := "aaa\nsecret1 value\nno secret\n"
_, err = buf.WriteString(input)
require.NoError(t, err)
out, err := io.ReadAll(r)
require.NoError(t, err)
require.Equal(t, "aaa\n***\nno secret\n", string(out))
})
t.Run("multi write", func(t *testing.T) {
var buf bytes.Buffer
r, err := NewSecretScrubReader(&buf, "/", fstest.MapFS{}, env, secretToScrubInfo)
require.NoError(t, err)
inputLines := []string{
"secret1 value",
"secret2",
"nonsecret",
}
outputLines := []string{
"***",
"***",
"nonsecret",
}
// Do multi write:
for _, s := range inputLines {
buf.WriteString(s)
buf.WriteRune('\n')
}
// Scan through SecretScrubReader and validate output:
scanner := bufio.NewScanner(r)
var i int
for scanner.Scan() {
out := scanner.Text()
expected := outputLines[i]
require.Equal(t, expected, out)
i++
}
require.Equal(t, len(outputLines), i)
})
}
func TestScrubSecretLogLatency(t *testing.T) {
t.Parallel()
envMap := map[string]string{
"foo": "TOP_SECRET",
"bar": strings.Repeat("a", 10_000),
"baz": "x",
"qux": "yyy",
}
env := []string{}
envNames := []string{}
for k, v := range envMap {
env = append(env, fmt.Sprintf("%s=%s", k, v))
envNames = append(envNames, k)
}
secretToScrubInfo := core.SecretToScrubInfo{
Envs: envNames,
Files: []string{},
}
t.Run("plain", func(t *testing.T) {
in, out := io.Pipe()
r, err := NewSecretScrubReader(in, "/", fstest.MapFS{}, env, secretToScrubInfo)
require.NoError(t, err)
wg := sync.WaitGroup{}
wg.Add(2)
go func() {
_, err := out.Write([]byte("hello world\n"))
require.NoError(t, err)
wg.Done()
}()
go func() {
buf := make([]byte, 1024)
n, err := r.Read(buf)
require.NoError(t, err)
require.Equal(t, "hello world\n", string(buf[:n]))
wg.Done()
}()
wg.Wait()
})
t.Run("secret", func(t *testing.T) {
in, out := io.Pipe()
r, err := NewSecretScrubReader(in, "/", fstest.MapFS{}, env, secretToScrubInfo)
require.NoError(t, err)
wg := sync.WaitGroup{}
wg.Add(2)
go func() {
_, err := out.Write([]byte("hello TOP_SECRET\n"))
require.NoError(t, err)
wg.Done()
}()
go func() {
buf := make([]byte, 1024)
n, err := r.Read(buf)
require.NoError(t, err)
require.Equal(t, "hello ***\n", string(buf[:n]))
wg.Done()
}()
wg.Wait()
})
t.Run("secret double", func(t *testing.T) {
in, out := io.Pipe()
r, err := NewSecretScrubReader(in, "/", fstest.MapFS{}, env, secretToScrubInfo)
require.NoError(t, err)
wg := sync.WaitGroup{}
wg.Add(2)
go func() {
_, err := out.Write([]byte("hello TOP_TOP_SECRETTOP_SECRETTOP_\n"))
require.NoError(t, err)
wg.Done()
}()
go func() {
buf := make([]byte, 1024)
n, err := r.Read(buf)
require.NoError(t, err)
require.Equal(t, "hello TOP_******TOP_\n", string(buf[:n]))
wg.Done()
}()
wg.Wait()
})
t.Run("secret one byte", func(t *testing.T) {
in, out := io.Pipe()
r, err := NewSecretScrubReader(in, "/", fstest.MapFS{}, env, secretToScrubInfo)
require.NoError(t, err)
wg := sync.WaitGroup{}
wg.Add(2)
go func() {
_, err := out.Write([]byte("yyx\n"))
require.NoError(t, err)
wg.Done()
}()
go func() {
buf := make([]byte, 1024)
n, err := r.Read(buf)
require.NoError(t, err)
require.Equal(t, "yy***\n", string(buf[:n]))
wg.Done()
}()
wg.Wait()
})
t.Run("secret half", func(t *testing.T) {
in, out := io.Pipe()
r, err := NewSecretScrubReader(in, "/", fstest.MapFS{}, env, secretToScrubInfo)
require.NoError(t, err)
wg := sync.WaitGroup{}
wg.Add(2)
go func() {
_, err := out.Write([]byte("hello TOP_"))
require.NoError(t, err)
_, err = out.Write([]byte("SECRET!\n"))
require.NoError(t, err)
wg.Done()
}()
go func() {
buf := make([]byte, 1024)
n, err := r.Read(buf)
require.NoError(t, err)
require.Equal(t, "hello ", string(buf[:n]))
n, err = r.Read(buf)
require.NoError(t, err)
require.Equal(t, "***!\n", string(buf[:n]))
wg.Done()
}()
wg.Wait()
})
t.Run("eof", func(t *testing.T) {
in, out := io.Pipe()
r, err := NewSecretScrubReader(in, "/", fstest.MapFS{}, env, secretToScrubInfo)
require.NoError(t, err)
wg := sync.WaitGroup{}
wg.Add(2)
go func() {
_, err := out.Write([]byte("hello TOP_"))
require.NoError(t, err)
err = out.Close()
require.NoError(t, err)
wg.Done()
}()
go func() {
buf := make([]byte, 1024)
n, err := r.Read(buf)
require.NoError(t, err)
require.Equal(t, "hello ", string(buf[:n]))
n, err = r.Read(buf)
require.ErrorIs(t, err, io.EOF)
require.Equal(t, "TOP_", string(buf[:n]))
wg.Done()
}()
wg.Wait()
})
t.Run("massive", func(t *testing.T) {
in, out := io.Pipe()
r, err := NewSecretScrubReader(in, "/", fstest.MapFS{}, env, secretToScrubInfo)
require.NoError(t, err)
wg := sync.WaitGroup{}
wg.Add(2)
go func() {
_, err := out.Write([]byte("hello\n" + strings.Repeat("a", 7000)))
require.NoError(t, err)
_, err = out.Write([]byte(strings.Repeat("a", 3001) + "\n"))
require.NoError(t, err)
_, err = out.Write([]byte("hello\n" + strings.Repeat("a", 7000)))
require.NoError(t, err)
_, err = out.Write([]byte(strings.Repeat("a", 2999) + "\n"))
require.NoError(t, err)
wg.Done()
}()
go func() {
buf := make([]byte, 4096)
n, err := r.Read(buf)
require.NoError(t, err)
require.Equal(t, "hello\n", string(buf[:n]))
n, err = r.Read(buf)
require.NoError(t, err)
require.Equal(t, "***a\n", string(buf[:n]))
n, err = r.Read(buf)
require.NoError(t, err)
require.Equal(t, "hello\n", string(buf[:n]))
n, err = r.Read(buf)
require.NoError(t, err)
require.Equal(t, strings.Repeat("a", 4096), string(buf[:n]))
n, err = r.Read(buf)
require.NoError(t, err)
require.Equal(t, strings.Repeat("a", 4096), string(buf[:n]))
n, err = r.Read(buf)
require.NoError(t, err)
require.Equal(t, strings.Repeat("a", 1807)+"\n", string(buf[:n]))
wg.Done()
}()
wg.Wait()
})
t.Run("massive_eof", func(t *testing.T) {
in, out := io.Pipe()
r, err := NewSecretScrubReader(in, "/", fstest.MapFS{}, env, secretToScrubInfo)
require.NoError(t, err)
wg := sync.WaitGroup{}
wg.Add(2)
go func() {
_, err := out.Write([]byte(strings.Repeat("a", 9999)))
require.NoError(t, err)
err = out.Close()
require.NoError(t, err)
wg.Done()
}()
go func() {
buf := make([]byte, 4096)
n, err := r.Read(buf)
require.NoError(t, err)
require.Equal(t, strings.Repeat("a", 4096), string(buf[:n]))
n, err = r.Read(buf)
require.NoError(t, err)
require.Equal(t, strings.Repeat("a", 4096), string(buf[:n]))
n, err = r.Read(buf)
require.ErrorIs(t, err, io.EOF)
require.Equal(t, strings.Repeat("a", 1807), string(buf[:n]))
wg.Done()
}()
wg.Wait()
})
}
func BenchmarkScrubSecret(b *testing.B) {
envMap := map[string]string{
"foo": strings.Repeat("a", 50),
"bar": strings.Repeat("b", 50),
"baz": strings.Repeat("c", 50),
"qux": strings.Repeat("d", 50),
"quu": strings.Repeat("e", 50),
"quv": strings.Repeat("f", 50),
"quw": strings.Repeat("g", 50),
"quy": strings.Repeat("i", 50),
"quz": strings.Repeat("j", 50),
}
env := []string{}
envNames := []string{}
for k, v := range envMap {
env = append(env, fmt.Sprintf("%s=%s", k, v))
envNames = append(envNames, k)
}
secretToScrubInfo := core.SecretToScrubInfo{
Envs: envNames,
Files: []string{},
}
in, out := io.Pipe()
r, err := NewSecretScrubReader(in, "/", fstest.MapFS{}, env, secretToScrubInfo)
require.NoError(b, err)
wg := sync.WaitGroup{}
wg.Add(2)
// randomly generate data to feed in
go func() {
for i := 0; i < b.N; i++ {
// generate random data
data := make([]byte, 4096)
for i := range data {
data[i] = byte(rand.Intn(256))
}
// insert some secret-like thing to the random data
secret := []byte(strings.Repeat("a", rand.Intn(50)+25))
idx := rand.Intn(len(data) - len(secret))
copy(data[idx:], secret)
// write to the pipe
_, err := out.Write(data)
require.NoError(b, err)
}
err := out.Close()
require.NoError(b, err)
wg.Done()
}()
go func() {
data, err := io.ReadAll(r)
require.NoError(b, err)
require.NotContains(b, string(data), strings.Repeat("a", 50))
wg.Done()
}()
wg.Wait()
}
func TestTrie(t *testing.T) {
trie := Trie{}
trie.Insert([]byte("foo"), []byte("bar"))
require.Equal(t, []byte("bar"), trie.Step('f').Step('o').Step('o').Value())
require.Nil(t, trie.Step('f').Step('o').Value())
trie.Insert([]byte("fox"), []byte("bax"))
require.Equal(t, []byte("bar"), trie.Step('f').Step('o').Step('o').Value())
require.Equal(t, []byte("bax"), trie.Step('f').Step('o').Step('x').Value())
trie.Insert([]byte("fax"), []byte("brx"))
require.Equal(t, []byte("bar"), trie.Step('f').Step('o').Step('o').Value())
require.Equal(t, []byte("bax"), trie.Step('f').Step('o').Step('x').Value())
require.Equal(t, []byte("brx"), trie.Step('f').Step('a').Step('x').Value())
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,659 | Error running `dagger init`: `package name is empty` | To reproduce this, try initializing a dagger module in a directory that already contains a `go.work`. For example:
```
$ git clone https://github.com/dagger/dagger.git
$ go work init
$ dagger init --sdk=go
✘ ModuleSource.asModule: Module! 2.0s
✘ Module.withSource(
source: ✔ ModuleSource.resolveFromCaller: ModuleSource! 0.0s
): Module! 2.0s
✘ Container.directory(path: "/src"): Directory! 1.4s
✔ rm /dagger/dagger.gen.go 0.4s
✘ exec /usr/local/bin/codegen --module-context /src --module-name dagger --propagate-logs=true --introspection-json-path /schema.json 0.9s
┃ Error: load package ".": package name is empty
✘ generating go module: dagger 0.4s
┃ writing dagger.gen.go
┃ writing go.mod
┃ writing go.sum
┃ writing main.go
┃ creating directory querybuilder
┃ writing querybuilder/marshal.go
┃ writing querybuilder/querybuilder.go
┃ needs another pass...
Error: failed to generate code: input: resolve: moduleSource: withName: withSDK: withSourceSubpath: resolveFromCaller: asModule: failed to create module: failed to update codegen and runtime: failed to generate code: failed to get modified source directory for go module sdk codegen: process "/usr/local/bin/codegen --module-context /src --module-name dagger --propagate-logs=true --introspection-json-path /schema.json" did not complete successfully: exit code: 1
Stderr:
Error: load package ".": package name is empty
```
Originally reported by @nipuna-perera on discord: <https://discord.com/channels/707636530424053791/1206727343918293042>
(reproduced in dagger v0.9.10) | https://github.com/dagger/dagger/issues/6659 | https://github.com/dagger/dagger/pull/6678 | b1afa431038bc0a96e4783b30d34b5c8f67f6488 | 31ddf2787ec1e05fb4ad00c33df767796063705f | "2024-02-13T13:35:20Z" | go | "2024-02-18T23:23:31Z" | cmd/codegen/generator/go/generator.go | package gogenerator
import (
"bytes"
"context"
"fmt"
"go/format"
"go/token"
"os"
"os/exec"
"path"
"path/filepath"
"text/template"
"github.com/dschmidt/go-layerfs"
"github.com/iancoleman/strcase"
"github.com/psanford/memfs"
"golang.org/x/mod/modfile"
"golang.org/x/tools/go/packages"
"golang.org/x/tools/imports"
"dagger.io/dagger"
"github.com/dagger/dagger/cmd/codegen/generator"
"github.com/dagger/dagger/cmd/codegen/generator/go/templates"
"github.com/dagger/dagger/cmd/codegen/introspection"
)
const (
// ClientGenFile is the path to write the codegen for the dagger API
ClientGenFile = "dagger.gen.go"
// StarterTemplateFile is the path to write the default module code
StarterTemplateFile = "main.go"
)
type GoGenerator struct {
Config generator.Config
}
func (g *GoGenerator) Generate(ctx context.Context, schema *introspection.Schema) (*generator.GeneratedState, error) {
generator.SetSchema(schema)
// 1. if no go.mod, generate go.mod
// 2. if no .go files, bootstrap package main
// 2a. generate dagger.gen.go from base client,
// 2b. add stub main.go
// 3. load package, generate dagger.gen.go (possibly again)
mfs := memfs.New()
genSt := &generator.GeneratedState{
Overlay: layerfs.New(mfs, dagger.QueryBuilder),
PostCommands: []*exec.Cmd{
// run 'go mod tidy' after generating to fix and prune dependencies
exec.Command("go", "mod", "tidy"),
},
}
pkgInfo, partial, err := g.bootstrapMod(ctx, mfs)
if err != nil {
return nil, fmt.Errorf("bootstrap package: %w", err)
}
outDir := g.Config.OutputDir
initialGoFiles, err := filepath.Glob(filepath.Join(outDir, "*.go"))
if err != nil {
return nil, fmt.Errorf("glob go files: %w", err)
}
genFile := filepath.Join(outDir, ClientGenFile)
if _, err := os.Stat(genFile); err != nil {
// assume package main, default for modules
pkgInfo.PackageName = "main"
// generate an initial dagger.gen.go from the base Dagger API
baseCfg := g.Config
baseCfg.ModuleName = ""
if err := generateCode(ctx, baseCfg, schema, mfs, pkgInfo, nil, nil, 0); err != nil {
return nil, fmt.Errorf("generate code: %w", err)
}
partial = true
}
if len(initialGoFiles) == 0 {
// write an initial main.go if no main pkg exists yet
if err := mfs.WriteFile(StarterTemplateFile, []byte(g.baseModuleSource()), 0600); err != nil {
return nil, err
}
// main.go is actually an input to codegen, so this requires another pass
partial = true
}
if partial {
genSt.NeedRegenerate = true
return genSt, nil
}
pkg, fset, err := loadPackage(ctx, outDir)
if err != nil {
return nil, fmt.Errorf("load package %q: %w", outDir, err)
}
// respect existing package name
pkgInfo.PackageName = pkg.Name
if err := generateCode(ctx, g.Config, schema, mfs, pkgInfo, pkg, fset, 1); err != nil {
return nil, fmt.Errorf("generate code: %w", err)
}
return genSt, nil
}
type PackageInfo struct {
PackageName string // Go package name, typically "main"
PackageImport string // import path of package in which this file appears
}
func (g *GoGenerator) bootstrapMod(ctx context.Context, mfs *memfs.FS) (*PackageInfo, bool, error) {
var needsRegen bool
outDir := g.Config.OutputDir
info := &PackageInfo{}
// use embedded go.mod as basis for pinning versions
sdkMod, err := modfile.Parse("go.mod", dagger.GoMod, nil)
if err != nil {
return nil, false, fmt.Errorf("parse embedded go.mod: %w", err)
}
newMod := new(modfile.File)
if content, err := os.ReadFile(filepath.Join(outDir, "go.mod")); err == nil {
// respect existing go.mod
currentMod, err := modfile.Parse("go.mod", content, nil)
if err != nil {
return nil, false, fmt.Errorf("parse go.mod: %w", err)
}
newMod = currentMod
for _, req := range sdkMod.Require {
newMod.AddRequire(req.Mod.Path, req.Mod.Version)
}
info.PackageImport = currentMod.Module.Mod.Path
} else {
if g.Config.ModuleName != "" {
outDir, err := filepath.Abs(outDir)
if err != nil {
return nil, false, fmt.Errorf("get absolute path: %w", err)
}
rootDir := g.Config.ModuleContextPath
subdirRelPath, err := filepath.Rel(rootDir, outDir)
if err != nil {
return nil, false, fmt.Errorf("failed to get output dir rel path: %w", err)
}
// when a module is configured, look for a go.mod in its root dir instead
//
// this is a necessary part of bootstrapping: SDKs such as the Go SDK
// will want to have a runtime module that lives in the same Go module as
// the generated client, which typically lives in the parent directory.
if pkg, _, err := loadPackage(ctx, rootDir); err == nil {
return &PackageInfo{
// leave package name blank
// TODO: maybe we don't even need to return it?
PackageImport: path.Join(pkg.Module.Path, subdirRelPath),
}, false, nil
}
// bootstrap go.mod using dependencies from the embedded Go SDK
newModName := "main" // use a safe default, not going to be a reserved word. User is free to modify
newMod.AddModuleStmt(newModName)
newMod.SetRequire(sdkMod.Require)
info.PackageImport = newModName
needsRegen = true
} else {
// no module; assume client-only codegen
if pkg, _, err := loadPackage(ctx, outDir); err == nil {
return &PackageInfo{
PackageName: pkg.Name,
PackageImport: pkg.Module.Path,
}, false, nil
}
return nil, false, fmt.Errorf("no module name configured and no existing package found")
}
}
modBody, err := newMod.Format()
if err != nil {
return nil, false, fmt.Errorf("format go.mod: %w", err)
}
if err := mfs.WriteFile("go.mod", modBody, 0600); err != nil {
return nil, false, err
}
if err := mfs.WriteFile("go.sum", dagger.GoSum, 0600); err != nil {
return nil, false, err
}
return info, needsRegen, nil
}
func generateCode(
ctx context.Context,
cfg generator.Config,
schema *introspection.Schema,
mfs *memfs.FS,
pkgInfo *PackageInfo,
pkg *packages.Package,
fset *token.FileSet,
pass int,
) error {
funcs := templates.GoTemplateFuncs(ctx, schema, cfg.ModuleName, pkg, fset, pass)
tmpls := templates.Templates(funcs)
for k, tmpl := range tmpls {
dt, err := renderFile(ctx, cfg, schema, pkgInfo, tmpl)
if err != nil {
return err
}
if dt == nil {
// no contents, skip
continue
}
if err := mfs.MkdirAll(filepath.Dir(k), 0o755); err != nil {
return err
}
if err := mfs.WriteFile(k, dt, 0600); err != nil {
return err
}
}
return nil
}
func renderFile(
ctx context.Context,
cfg generator.Config,
schema *introspection.Schema,
pkgInfo *PackageInfo,
tmpl *template.Template,
) ([]byte, error) {
data := struct {
*PackageInfo
Schema *introspection.Schema
Types []*introspection.Type
}{
PackageInfo: pkgInfo,
Schema: schema,
Types: schema.Visit(),
}
var render bytes.Buffer
if err := tmpl.Execute(&render, data); err != nil {
return nil, err
}
source := render.Bytes()
source = bytes.TrimSpace(source)
if len(source) == 0 {
return nil, nil
}
formatted, err := format.Source(source)
if err != nil {
return nil, fmt.Errorf("error formatting generated code: %T %+v %w\nsource:\n%s", err, err, err, string(source))
}
formatted, err = imports.Process(filepath.Join(cfg.OutputDir, "dummy.go"), formatted, nil)
if err != nil {
return nil, fmt.Errorf("error formatting generated code: %T %+v %w\nsource:\n%s", err, err, err, string(source))
}
return formatted, nil
}
func loadPackage(ctx context.Context, dir string) (*packages.Package, *token.FileSet, error) {
fset := token.NewFileSet()
pkgs, err := packages.Load(&packages.Config{
Context: ctx,
Dir: dir,
Tests: false,
Fset: fset,
Mode: packages.NeedName |
packages.NeedTypes |
packages.NeedSyntax |
packages.NeedTypesInfo |
packages.NeedModule,
}, ".")
if err != nil {
return nil, nil, err
}
switch len(pkgs) {
case 0:
return nil, nil, fmt.Errorf("no packages found in %s", dir)
case 1:
if pkgs[0].Name == "" {
// this happens when loading an empty dir within an existing Go module
return nil, nil, fmt.Errorf("package name is empty")
}
return pkgs[0], fset, nil
default:
// this would mean I don't understand how loading '.' works
return nil, nil, fmt.Errorf("expected 1 package, got %d", len(pkgs))
}
}
func (g *GoGenerator) baseModuleSource() string {
moduleStructName := strcase.ToCamel(g.Config.ModuleName)
return fmt.Sprintf(`package main
import (
"context"
)
type %s struct {}
// example usage: "dagger call container-echo --string-arg yo stdout"
func (m *%s) ContainerEcho(stringArg string) *Container {
return dag.Container().From("alpine:latest").WithExec([]string{"echo", stringArg})
}
// example usage: "dagger call grep-dir --directory-arg . --pattern GrepDir"
func (m *%s) GrepDir(ctx context.Context, directoryArg *Directory, pattern string) (string, error) {
return dag.Container().
From("alpine:latest").
WithMountedDirectory("/mnt", directoryArg).
WithWorkdir("/mnt").
WithExec([]string{"grep", "-R", pattern, "."}).
Stdout(ctx)
}
`, moduleStructName, moduleStructName, moduleStructName)
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,659 | Error running `dagger init`: `package name is empty` | To reproduce this, try initializing a dagger module in a directory that already contains a `go.work`. For example:
```
$ git clone https://github.com/dagger/dagger.git
$ go work init
$ dagger init --sdk=go
✘ ModuleSource.asModule: Module! 2.0s
✘ Module.withSource(
source: ✔ ModuleSource.resolveFromCaller: ModuleSource! 0.0s
): Module! 2.0s
✘ Container.directory(path: "/src"): Directory! 1.4s
✔ rm /dagger/dagger.gen.go 0.4s
✘ exec /usr/local/bin/codegen --module-context /src --module-name dagger --propagate-logs=true --introspection-json-path /schema.json 0.9s
┃ Error: load package ".": package name is empty
✘ generating go module: dagger 0.4s
┃ writing dagger.gen.go
┃ writing go.mod
┃ writing go.sum
┃ writing main.go
┃ creating directory querybuilder
┃ writing querybuilder/marshal.go
┃ writing querybuilder/querybuilder.go
┃ needs another pass...
Error: failed to generate code: input: resolve: moduleSource: withName: withSDK: withSourceSubpath: resolveFromCaller: asModule: failed to create module: failed to update codegen and runtime: failed to generate code: failed to get modified source directory for go module sdk codegen: process "/usr/local/bin/codegen --module-context /src --module-name dagger --propagate-logs=true --introspection-json-path /schema.json" did not complete successfully: exit code: 1
Stderr:
Error: load package ".": package name is empty
```
Originally reported by @nipuna-perera on discord: <https://discord.com/channels/707636530424053791/1206727343918293042>
(reproduced in dagger v0.9.10) | https://github.com/dagger/dagger/issues/6659 | https://github.com/dagger/dagger/pull/6678 | b1afa431038bc0a96e4783b30d34b5c8f67f6488 | 31ddf2787ec1e05fb4ad00c33df767796063705f | "2024-02-13T13:35:20Z" | go | "2024-02-18T23:23:31Z" | core/integration/module_test.go | package core
import (
"context"
_ "embed"
"encoding/json"
"fmt"
"go/format"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"time"
"github.com/MakeNowJust/heredoc/v2"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/dagql/idproto"
"github.com/iancoleman/strcase"
"github.com/moby/buildkit/identity"
"github.com/stretchr/testify/require"
"github.com/tidwall/gjson"
"golang.org/x/sync/errgroup"
"dagger.io/dagger"
"github.com/dagger/dagger/cmd/codegen/introspection"
)
func TestModuleGoInit(t *testing.T) {
t.Parallel()
t.Run("from scratch", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=bare", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("reserved go.mod name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=go", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{go{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"go":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("uses expected Go module name, camel-cases Dagger module name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=My-Module", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{myModule{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"myModule":{"containerEcho":{"stdout":"hello\n"}}}`, out)
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
t.Run("creates go.mod beneath an existing go.mod if context is beneath it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
// don't use .git under /work so the context ends up being /work/ci
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/go.mod", dagger.ContainerWithNewFileOpts{
Contents: "module example.com/test\n",
}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/ci").
With(daggerExec("init", "--name=beneathGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{beneathGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"beneathGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("names Go module after Dagger module", func(t *testing.T) {
generated, err := modGen.Directory("dagger").File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
})
t.Run("respects existing go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("preserves module name", func(t *testing.T) {
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module example.com/test")
})
})
t.Run("respects parent go.mod if root points to it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
With(daggerExec("init", "--name=child", "--sdk=go", "./child")).
WithWorkdir("/work/child").
// explicitly develop to see whether it makes a go.mod
With(daggerExec("develop")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
require.Equal(t, []string{".git", "child", "foo.go", "go.mod", "go.sum"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.NotContains(t, childEntries, "go.mod")
t.Run("preserves parent module name", func(t *testing.T) {
goMod, err := generated.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, goMod, "module example.com/test")
})
})
t.Run("respects existing go.mod even if root points to parent that has go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"}).
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/child").
WithExec([]string{"go", "mod", "init", "my-mod"}).
WithWorkdir("/work").
With(daggerExec("init", "--source=./child", "--name=child", "--sdk=go", "./child")).
WithWorkdir("/work/child").
// explicitly develop to see whether it makes a go.mod
With(daggerExec("develop")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
// no go.sum
require.Equal(t, []string{".git", "child", "foo.go", "go.mod"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.Contains(t, childEntries, "go.mod")
require.Contains(t, childEntries, "go.sum")
})
t.Run("respects existing main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasMainGo struct {}
func (m *HasMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("init", "--name=hasMainGo", "--sdk=go", "--source=."))
out, err := modGen.
With(daggerQuery(`{hasMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("respects existing main.go even if it uses types not generated yet", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasDaggerTypes struct {}
func (m *HasDaggerTypes) Hello() *Container {
return dag.Container().
From("` + alpineImage + `").
WithExec([]string{"echo", "Hello, world!"})
}
`,
}).
With(daggerExec("init", "--source=.", "--name=hasDaggerTypes", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasDaggerTypes{hello{stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasDaggerTypes":{"hello":{"stdout":"Hello, world!\n"}}}`, out)
})
t.Run("respects existing package without creating main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/notmain.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type HasNotMainGo struct {}
func (m *HasNotMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("init", "--source=.", "--name=hasNotMainGo", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasNotMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasNotMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("with source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=bare", "--sdk=go", "--source=some/subdir"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
sourceSubdirEnts, err := modGen.Directory("/work/some/subdir").Entries(ctx)
require.NoError(t, err)
require.Contains(t, sourceSubdirEnts, "main.go")
sourceRootEnts, err := modGen.Directory("/work").Entries(ctx)
require.NoError(t, err)
require.NotContains(t, sourceRootEnts, "main.go")
})
}
func TestModuleInitLICENSE(t *testing.T) {
t.Run("bootstraps Apache-2.0 LICENSE file if none found", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("creates LICENSE file in the directory specified by arg", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "./mymod"))
content, err := modGen.File("mymod/LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("does not bootstrap LICENSE file if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go"))
_, err := modGen.File("LICENSE").Contents(ctx)
require.Error(t, err)
})
t.Run("bootstraps a LICENSE file when requested, even if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "--license=MIT"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "MIT License")
})
}
func TestModuleGit(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
gitGeneratedFiles []string
gitIgnoredFiles []string
}
for _, tc := range []testCase{
{
sdk: "go",
gitGeneratedFiles: []string{
"/dagger.gen.go",
"/querybuilder/**",
},
},
{
sdk: "python",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
{
sdk: "typescript",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
} {
tc := tc
t.Run(fmt.Sprintf("module %s git", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
With(daggerExec("init", "--name=bare", "--sdk="+tc.sdk))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("configures .gitattributes", func(t *testing.T) {
ignore, err := modGen.File(".gitattributes").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitGeneratedFiles {
require.Contains(t, ignore, fmt.Sprintf("%s linguist-generated\n", fileName))
}
})
if len(tc.gitIgnoredFiles) > 0 {
t.Run("configures .gitignore", func(t *testing.T) {
ignore, err := modGen.File(".gitignore").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitIgnoredFiles {
require.Contains(t, ignore, fileName)
}
})
}
})
}
}
//go:embed testdata/modules/go/minimal/main.go
var goSignatures string
func TestModuleGoSignatures(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
t.Run("func Hello() string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello"}}`, out)
})
t.Run("func Echo(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echo(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echo":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointer(*string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointerPointer(**string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointerPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointerPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoOptional(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptional(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalPointer(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalPointer}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalSlice([]string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalSlice(msg: ["hello", "there"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"hello+there...hello+there...hello+there..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalSlice}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"foobar...foobar...foobar..."}}`, out)
})
t.Run("func Echoes([]string) []string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoes(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoes":["hello...hello...hello..."]}}`, out)
})
t.Run("func EchoesVariadic(...string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoesVariadic(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoesVariadic":"hello...hello...hello..."}}`, out)
})
t.Run("func HelloContext(context.Context) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloContext}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloContext":"hello context"}}`, out)
})
t.Run("func EchoContext(context.Context, string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoContext(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoContext":"ctx.hello...ctx.hello...ctx.hello..."}}`, out)
})
t.Run("func HelloStringError() (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloStringError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloStringError":"hello i worked"}}`, out)
})
t.Run("func HelloVoid()", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoid}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoid":null}}`, out)
})
t.Run("func HelloVoidError() error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoidError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoidError":null}}`, out)
})
t.Run("func EchoOpts(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInline(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlinePointer(*struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineCtx(ctx, struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineTags(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsPragmas(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsPragmas(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsPragmas":"hi...hi...hi..."}}`, out)
})
}
func TestModuleGoSignaturesBuiltinTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("dagger/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Minimal struct {}
func (m *Minimal) Read(ctx context.Context, dir Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadPointer(ctx context.Context, dir *Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadSlice(ctx context.Context, dir []Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadVariadic(ctx context.Context, dir ...Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadOptional(
ctx context.Context,
dir *Directory, // +optional
) (string, error) {
if dir != nil {
return dir.File("foo").Contents(ctx)
}
return "", nil
}
`,
})
out, err := modGen.With(daggerQuery(`{directory{withNewFile(path: "foo", contents: "bar"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
dirID := gjson.Get(out, "directory.withNewFile.id").String()
t.Run("func Read(ctx, Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{read(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"read":"bar"}}`, out)
})
t.Run("func ReadPointer(ctx, *Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readPointer(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readPointer":"bar"}}`, out)
})
t.Run("func ReadSlice(ctx, []Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readSlice(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readSlice":"bar"}}`, out)
})
t.Run("func ReadVariadic(ctx, ...Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readVariadic(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readVariadic":"bar"}}`, out)
})
t.Run("func ReadOptional(ctx, Optional[Directory]) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readOptional(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":"bar"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{readOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":""}}`, out)
})
}
func TestModuleGoSignaturesUnexported(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) string {
return name
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
objs := inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 1, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
objs = inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 2, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
require.Equal(t, "MinimalFoo", objs.Get("1.name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {
Bar bar
}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
_, err := modGen.With(moduleIntrospection).Stderr(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "cannot code-generate unexported type bar")
}
func TestModuleGoSignaturesMixMatch(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
func (m *Minimal) Hello(name string, opts struct{}, opts2 struct{}) string {
return name
}
`,
})
_, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "nested structs are not supported")
}
func TestModuleGoSignaturesNameConflict(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {
Foo Foo
Bar Bar
Baz Baz
}
type Foo struct {}
type Bar struct {}
type Baz struct {}
func (m *Foo) Hello(name string) string {
return name
}
func (f *Bar) Hello(name string, name2 string) string {
return name + name2
}
func (b *Baz) Hello() (string, error) {
return "", nil
}
`,
})
objs := inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 4, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
require.Equal(t, "MinimalFoo", objs.Get("1.name").String())
require.Equal(t, "MinimalBar", objs.Get("2.name").String())
require.Equal(t, "MinimalBaz", objs.Get("3.name").String())
}
func TestModuleGoDocs(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
logGen(ctx, t, modGen.Directory("."))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Empty(t, hello.Get("description").String())
require.Empty(t, hello.Get("args").Array())
// test the args-based form
echoOpts := obj.Get(`functions.#(name="echoOpts")`)
require.Equal(t, "echoOpts", echoOpts.Get("name").String())
require.Equal(t, "EchoOpts does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the inline struct form
echoOpts = obj.Get(`functions.#(name="echoOptsInline")`)
require.Equal(t, "echoOptsInline", echoOpts.Get("name").String())
require.Equal(t, "EchoOptsInline does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the arg-based form (with pragmas)
echoOpts = obj.Get(`functions.#(name="echoOptsPragmas")`)
require.Equal(t, "echoOptsPragmas", echoOpts.Get("name").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "", echoOpts.Get("args.0.defaultValue").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "\"...\"", echoOpts.Get("args.1.defaultValue").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "3", echoOpts.Get("args.2.defaultValue").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
}
func TestModuleGoDocsEdgeCases(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
// Minimal is a thing
type Minimal struct {
// X is this
X, Y string // Y is not this
// +private
Z string
}
// some docs
func (m *Minimal) Hello(foo string, bar string,
// hello
baz string, qux string, x string, // lol
) string {
return foo + bar
}
func (m *Minimal) HelloMore(
// foo here
foo,
// bar here
bar string,
) string {
return foo + bar
}
func (m *Minimal) HelloMoreInline(opts struct{
// foo here
foo, bar string
}) string {
return opts.foo + opts.bar
}
func (m *Minimal) HelloAgain( // docs for helloagain
foo string,
bar string, // docs for bar
baz string,
) string {
return foo + bar
}
func (m *Minimal) HelloFinal(
foo string) string { // woops
return foo
}
`,
})
logGen(ctx, t, modGen.Directory("."))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Equal(t, "Minimal is a thing", obj.Get("description").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 5)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "hello", hello.Get("args.2.description").String())
require.Equal(t, "qux", hello.Get("args.3.name").String())
require.Equal(t, "", hello.Get("args.3.description").String())
require.Equal(t, "x", hello.Get("args.4.name").String())
require.Equal(t, "lol", hello.Get("args.4.description").String())
hello = obj.Get(`functions.#(name="helloMore")`)
require.Equal(t, "helloMore", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "bar here", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloMoreInline")`)
require.Equal(t, "helloMoreInline", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloAgain")`)
require.Equal(t, "helloAgain", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 3)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "docs for bar", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "", hello.Get("args.2.description").String())
hello = obj.Get(`functions.#(name="helloFinal")`)
require.Equal(t, "helloFinal", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 1)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Len(t, obj.Get(`fields`).Array(), 2)
prop := obj.Get(`fields.#(name="x")`)
require.Equal(t, "x", prop.Get("name").String())
require.Equal(t, "X is this", prop.Get("description").String())
prop = obj.Get(`fields.#(name="y")`)
require.Equal(t, "y", prop.Get("name").String())
require.Equal(t, "", prop.Get("description").String())
}
func TestModuleGoWeirdFields(t *testing.T) {
// these are all cases that used to panic due to the disparity in the type spec and the ast
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Z string
type Minimal struct {
// field with single (normal) name
W string
// field with multiple names
X, Y string
// field with no names
Z
}
func New() Minimal {
return Minimal{
W: "-",
X: "-",
Y: "-",
Z: Z("-"),
}
}
// struct with no fields
type Bar struct{}
func (m *Minimal) Say(
// field with single (normal) name
a string,
// field with multiple names
b, c string,
// field with no names (not included, mixed names not allowed)
// string
) string {
return a + " " + b + " " + c
}
func (m *Minimal) Hello(
// field with no names
string,
) string {
return "hello"
}
func (m *Minimal) SayOpts(opts struct{
// field with single (normal) name
A string
// field with multiple names
B, C string
// field with no names (not included because of above)
// string
}) string {
return opts.A + " " + opts.B + " " + opts.C
}
func (m *Minimal) HelloOpts(opts struct{
// field with no names
string
}) string {
return "hello"
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{w, x, y, z}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"w": "-", "x": "-", "y": "-", "z": "-"}}`, out)
for _, name := range []string{"say", "sayOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(a: "hello", b: "world", c: "!")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello world !"}}`, name), out)
}
for _, name := range []string{"hello", "helloOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(string: "")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello"}}`, name), out)
}
}
func TestModuleGoFieldMustBeNil(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "fmt"
type Minimal struct {
Src *Directory
Name *string
}
func New() *Minimal {
return &Minimal{}
}
func (m *Minimal) IsEmpty() bool {
if m.Name != nil {
panic(fmt.Sprintf("name should be nil but is %v", m.Name))
}
if m.Src != nil {
panic(fmt.Sprintf("src should be nil but is %v", m.Src))
}
return true
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{isEmpty}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"isEmpty": true}}`, out)
}
func TestModuleDescription(t *testing.T) {
t.Parallel()
type source struct {
file string
contents string
}
for _, tc := range []struct {
sdk string
sources []source
}{
{
sdk: "go",
sources: []source{
{
file: "main.go",
contents: `
// Test module, short description
//
// Long description, with full sentences.
package main
// Test object, short description
type Test struct {
// +default="foo"
Foo string
}
`,
},
},
},
{
sdk: "go",
sources: []source{
{
file: "a.go",
contents: `
// First, but not main
package main
type Foo struct {}
`,
},
{
file: "z.go",
contents: `
// Test module, short description
//
// Long description, with full sentences.
package main
// Test object, short description
type Test struct {
}
func (*Test) Foo() Foo {
return Foo{}
}
`,
},
},
},
{
sdk: "python",
sources: []source{
{
file: "src/main.py",
contents: `
"""Test module, short description
Long description, with full sentences.
"""
from dagger import field, object_type
@object_type
class Test:
"""Test object, short description"""
foo: str = field(default="foo")
`,
},
},
},
{
sdk: "python",
sources: []source{
{
file: "src/main/foo.py",
contents: `
"""Not the main file"""
from dagger import field, object_type
@object_type
class Foo:
bar: str = field(default="bar")
`,
},
{
file: "src/main/__init__.py",
contents: `
"""Test module, short description
Long description, with full sentences.
"""
from dagger import function, object_type
from .foo import Foo
@object_type
class Test:
"""Test object, short description"""
foo = function(Foo)
`,
},
},
},
{
sdk: "typescript",
sources: []source{
{
file: "src/index.ts",
contents: `
/**
* Test module, short description
*
* Long description, with full sentences.
*/
import { object, field } from '@dagger.io/dagger'
/**
* Test object, short description
*/
@object()
class Test {
@field()
foo: string = "foo"
}
`,
},
},
},
{
sdk: "typescript",
sources: []source{
{
file: "src/foo.ts",
contents: `
/**
* Not the main file
*/
import { object, field } from '@dagger.io/dagger'
@object()
export class Foo {
@field()
bar = "bar"
}
`,
},
{
file: "src/index.ts",
contents: `
/**
* Test module, short description
*
* Long description, with full sentences.
*/
import { object, field } from '@dagger.io/dagger'
import { Foo } from "./foo"
/**
* Test object, short description
*/
@object()
class Test {
@func()
foo(): Foo {
return new Foo()
}
}
`,
},
},
},
} {
tc := tc
t.Run(fmt.Sprintf("%s with %d files", tc.sdk, len(tc.sources)), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
for _, src := range tc.sources {
src := src
modGen = modGen.WithNewFile(src.file, dagger.ContainerWithNewFileOpts{
Contents: heredoc.Doc(src.contents),
})
}
mod := inspectModule(ctx, t,
modGen.With(daggerExec("init", "--source=.", "--name=test", "--sdk="+tc.sdk)))
require.Equal(t,
"Test module, short description\n\nLong description, with full sentences.",
mod.Get("description").String(),
)
require.Equal(t,
"Test object, short description",
mod.Get("objects.#.asObject|#(name=Test).description").String(),
)
})
}
}
func TestModulePrivateField(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
sdk string
source string
}{
{
sdk: "go",
source: `package main
type Minimal struct {
Foo string
Bar string // +private
}
func (m *Minimal) Set(foo string, bar string) *Minimal {
m.Foo = foo
m.Bar = bar
return m
}
func (m *Minimal) Hello() string {
return m.Foo + m.Bar
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Minimal:
foo: str = field(default="")
bar: str = ""
@function
def set(self, foo: str, bar: str) -> "Minimal":
self.foo = foo
self.bar = bar
return self
@function
def hello(self) -> str:
return self.foo + self.bar
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Minimal {
@field()
foo: string
bar?: string
constructor(foo?: string, bar?: string) {
this.foo = foo
this.bar = bar
}
@func()
set(foo: string, bar: string): Minimal {
this.foo = foo
this.bar = bar
return this
}
@func()
hello(): string {
return this.foo + this.bar
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Len(t, obj.Get(`fields`).Array(), 1)
prop := obj.Get(`fields.#(name="foo")`)
require.Equal(t, "foo", prop.Get("name").String())
out, err := modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){hello}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"hello": "abcxyz"}}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){foo}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"foo": "abc"}}}`, out)
_, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){bar}}}`)).Stdout(ctx)
require.ErrorContains(t, err, `Minimal has no such field: "bar"`)
})
}
}
// this is no longer allowed, but verify the SDK errors out
func TestModuleGoExtendCore(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=container", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
func (c *Container) Echo(ctx context.Context, msg string) (string, error) {
return c.WithExec([]string{"echo", msg}).Stdout(ctx)
}
`,
}).
With(daggerQuery(`{container{from(address:"` + alpineImage + `"){echo(msg:"echo!"){stdout}}}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "cannot define methods on objects from outside this module")
}
func TestModuleGoBadCtx(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=foo", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Foo struct {}
func (f *Foo) Echo(ctx context.Context, ctx2 context.Context) (string, error) {
return "", nil
}
`,
}).
With(daggerQuery(`{foo{echo}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "unexpected context type")
}
func TestModuleCustomTypes(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Test struct{}
func (m *Test) Repeater(msg string, times int) *Repeater {
return &Repeater{
Message: msg,
Times: times,
}
}
type Repeater struct {
Message string
Times int
}
func (t *Repeater) Render() string {
return strings.Repeat(t.Message, t.Times)
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Repeater:
message: str = field(default="")
times: int = field(default=0)
@function
def render(self) -> str:
return self.message * self.times
@function
def repeater(msg: str, times: int) -> Repeater:
return Repeater(message=msg, times=times)
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Repeater {
@field()
message: string
@field()
times: number
constructor(message: string, times: number) {
this.message = message
this.times = times
}
@func()
render(): string {
return this.message.repeat(this.times)
}
}
@object()
class Test {
@func()
repeater(msg: string, times: number): Repeater {
return new Repeater(msg, times)
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("custom %s types", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := modInit(ctx, t, c, tc.sdk, tc.source).
With(daggerQuery(`{test{repeater(msg:"echo!", times: 3){render}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"repeater":{"render":"echo!echo!echo!"}}}`, out)
})
}
}
func TestModuleReturnTypeDetection(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
}
func (m *Foo) MyFunction() X {
return X{Message: "foo"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
@function
def my_function() -> X:
return X(message="foo")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class X {
@field()
message: string
constructor(message: string) {
this.message = message;
}
}
@object()
class Foo {
@func()
myFunction(): X {
return new X("foo");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{myFunction{message}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo"}}}`, out)
})
}
}
func TestModuleReturnObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
When string ` + "`json:\"Timestamp\"`" + `
To string ` + "`json:\"recipient\"`" + `
From string
}
func (m *Foo) MyFunction() X {
return X{Message: "foo", When: "now", To: "user", From: "admin"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
when: str = field(default="", name="Timestamp")
to: str = field(default="", name="recipient")
from_: str = field(default="", name="from")
@object_type
class Foo:
@function
def my_function(self) -> X:
return X(message="foo", when="now", to="user", from_="admin")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class X {
@field()
message: string
@field()
timestamp: string
@field()
recipient: string
@field()
from: string
constructor(message: string, timestamp: string, recipient: string, from: string) {
this.message = message;
this.timestamp = timestamp;
this.recipient = recipient;
this.from = from;
}
}
@object()
class Foo {
@func()
myFunction(): X {
return new X("foo", "now", "user", "admin");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{myFunction{message, recipient, from, timestamp}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo", "recipient":"user", "from":"admin", "timestamp":"now"}}}`, out)
})
}
}
func TestModuleReturnNestedObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type Foo struct {
MsgContainer Bar
}
type Bar struct {
Msg string
}
func (m *Playground) MyFunction() Foo {
return Foo{MsgContainer: Bar{Msg: "hello world"}}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Bar:
msg: str = field()
@object_type
class Foo:
msg_container: Bar = field()
@object_type
class Playground:
@function
def my_function(self) -> Foo:
return Foo(msg_container=Bar(msg="hello world"))
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Bar {
@field()
msg: string;
constructor(msg: string) {
this.msg = msg;
}
}
@object()
class Foo {
@field()
msgContainer: Bar;
constructor(msgContainer: Bar) {
this.msgContainer = msgContainer;
}
}
@object()
class Playground {
@func()
myFunction(): Foo {
return new Foo(new Bar("hello world"));
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{myFunction{msgContainer{msg}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myFunction":{"msgContainer":{"msg": "hello world"}}}}`, out)
})
}
}
func TestModuleReturnCompositeCore(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
func (m *Playground) MySlice() []*Container {
return []*Container{dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"})}
}
type Foo struct {
Con *Container
// verify fields can remain nil w/out error too
UnsetFile *File
}
func (m *Playground) MyStruct() *Foo {
return &Foo{Con: dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"})}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class Foo:
con: dagger.Container = field()
unset_file: dagger.File | None = field(default=None)
@object_type
class Playground:
@function
def my_slice(self) -> list[dagger.Container]:
return [dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"])]
@function
def my_struct(self) -> Foo:
return Foo(con=dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"]))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, File, object, func, field } from "@dagger.io/dagger"
@object()
class Foo {
@field()
con: Container
@field()
unsetFile?: File
constructor(con: Container, usetFile?: File) {
this.con = con
this.usetFile = usetFile
}
}
@object()
class Playground {
@func()
mySlice(): Container[] {
return [
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
]
}
@func()
myStruct(): Foo {
return new Foo(
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{mySlice{stdout}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"mySlice":[{"stdout":"hello world\n"}]}}`, out)
out, err = modGen.With(daggerQuery(`{playground{myStruct{con{stdout}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myStruct":{"con":{"stdout":"hello world\n"}}}}`, out)
})
}
}
func TestModuleReturnComplexThing(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type ScanResult struct {
Containers []*Container ` + "`json:\"targets\"`" + `
Report ScanReport
}
type ScanReport struct {
Contents string ` + "`json:\"contents\"`" + `
Authors []string ` + "`json:\"Authors\"`" + `
}
func (m *Playground) Scan() ScanResult {
return ScanResult{
Containers: []*Container{
dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"}),
},
Report: ScanReport{
Contents: "hello world",
Authors: []string{"foo", "bar"},
},
}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class ScanReport:
contents: str = field()
authors: list[str] = field()
@object_type
class ScanResult:
containers: list[dagger.Container] = field(name="targets")
report: ScanReport = field()
@object_type
class Playground:
@function
def scan(self) -> ScanResult:
return ScanResult(
containers=[
dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"]),
],
report=ScanReport(
contents="hello world",
authors=["foo", "bar"],
),
)
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object()
class ScanReport {
@field()
contents: string
@field()
authors: string[]
constructor(contents: string, authors: string[]) {
this.contents = contents
this.authors = authors
}
}
@object()
class ScanResult {
@field("targets")
containers: Container[]
@field()
report: ScanReport
constructor(containers: Container[], report: ScanReport) {
this.containers = containers
this.report = report
}
}
@object()
class Playground {
@func()
async scan(): Promise<ScanResult> {
return new ScanResult(
[
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
],
new ScanReport("hello world", ["foo", "bar"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{scan{targets{stdout},report{contents,authors}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"scan":{"targets":[{"stdout":"hello world\n"}],"report":{"contents":"hello world","authors":["foo","bar"]}}}}`, out)
})
}
}
func TestModuleGlobalVarDAG(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
type Foo struct {}
var someDefault = dag.Container().From("` + alpineImage + `")
func (m *Foo) Fn(ctx context.Context) (string, error) {
return someDefault.WithExec([]string{"echo", "foo"}).Stdout(ctx)
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function, object_type
SOME_DEFAULT = dag.container().from_("` + alpineImage + `")
@object_type
class Foo:
@function
async def fn(self) -> str:
return await SOME_DEFAULT.with_exec(["echo", "foo"]).stdout()
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from "@dagger.io/dagger"
var someDefault = dag.container().from("` + alpineImage + `")
@object()
class Foo {
@func()
async fn(): Promise<string> {
return someDefault.withExec(["echo", "foo"]).stdout()
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"fn":"foo\n"}}`, out)
})
}
}
func TestModuleIDableType(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {
Data string
}
func (m *Foo) Set(data string) *Foo {
m.Data = data
return m
}
func (m *Foo) Get() string {
return m.Data
}
`,
},
{
sdk: "python",
source: `from typing import Self
from dagger import field, function, object_type
@object_type
class Foo:
data: str = ""
@function
def set(self, data: str) -> Self:
self.data = data
return self
@function
def get(self) -> str:
return self.data
`,
},
{
sdk: "typescript",
source: `
import { object, func } from "@dagger.io/dagger"
@object()
class Foo {
data: string = ""
@func()
set(data: string): Foo {
this.data = data
return this
}
@func()
get(): string {
return this.data
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
// sanity check
out, err := modGen.With(daggerQuery(`{foo{set(data: "abc"){get}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"set":{"get": "abc"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{set(data: "abc"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.set.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.set(data: "abc"): Foo!`)
out, err = modGen.With(daggerQuery(`{loadFooFromID(id: "%s"){get}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"loadFooFromID":{"get": "abc"}}`, out)
})
}
}
func TestModuleArgOwnType(t *testing.T) {
// Verify use of a module's own object as an argument type.
// The server needs to specifically decode the input type from an ID into
// the raw JSON, since the module doesn't understand it's own types as IDs
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Foo struct{}
type Message struct {
Content string
}
func (m *Foo) SayHello(name string) Message {
return Message{Content: "hello " + name}
}
func (m *Foo) Upper(msg Message) Message {
msg.Content = strings.ToUpper(msg.Content)
return msg
}
func (m *Foo) Uppers(msg []Message) []Message {
for i := range msg {
msg[i].Content = strings.ToUpper(msg[i].Content)
}
return msg
}`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Message:
content: str = field()
@object_type
class Foo:
@function
def say_hello(self, name: str) -> Message:
return Message(content=f"hello {name}")
@function
def upper(self, msg: Message) -> Message:
msg.content = msg.content.upper()
return msg
@function
def uppers(self, msg: list[Message]) -> list[Message]:
for m in msg:
m.content = m.content.upper()
return msg
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Message {
@field()
content: string
constructor(content: string) {
this.content = content
}
}
@object()
class Foo {
@func()
sayHello(name: string): Message {
return new Message("hello " + name)
}
@func()
upper(msg: Message): Message {
msg.content = msg.content.toUpperCase()
return msg
}
@func()
uppers(msg: Message[]): Message[] {
for (let i = 0; i < msg.length; i++) {
msg[i].content = msg[i].content.toUpperCase()
}
return msg
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{sayHello(name: "world"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.sayHello.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.sayHello(name: "world"): FooMessage!`)
out, err = modGen.With(daggerQuery(`{foo{upper(msg:"%s"){content}}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"upper":{"content": "HELLO WORLD"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{uppers(msg:["%s", "%s"]){content}}}`, id, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"uppers":[{"content": "HELLO WORLD"}, {"content": "HELLO WORLD"}]}}`, out)
})
}
}
func TestModuleConflictingSameNameDeps(t *testing.T) {
// A -> B -> Dint
// A -> C -> Dstr
// where Dint and Dstr are modules with the same name and same object names but conflicting types
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dstr").
With(daggerExec("init", "--source=.", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo string
}
func (m *D) Fn(foo string) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dint").
With(daggerExec("init", "--source=.", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo int
}
func (m *D) Fn(foo int) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=c", "--name=c", "--sdk=go", "c")).
WithWorkdir("/work/c").
With(daggerExec("install", "../dstr")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type C struct{}
func (m *C) Fn(ctx context.Context, foo string) (string, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=b", "--name=b", "--sdk=go", "b")).
With(daggerExec("install", "-m=b", "./dint")).
WithNewFile("/work/b/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type B struct{}
func (m *B) Fn(ctx context.Context, foo int) (int, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=a", "--name=a", "--sdk=go", "a")).
WithWorkdir("/work/a").
With(daggerExec("install", "../b")).
With(daggerExec("install", "../c")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"strconv"
)
type A struct{}
func (m *A) Fn(ctx context.Context) (string, error) {
fooStr, err := dag.C().Fn(ctx, "foo")
if err != nil {
return "", err
}
fooInt, err := dag.B().Fn(ctx, 123)
if err != nil {
return "", err
}
return fooStr + strconv.Itoa(fooInt), nil
}
`,
})
out, err := ctr.With(daggerQuery(`{a{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"a":{"fn": "foo123"}}`, out)
// verify that no types from (transitive) deps show up
types := currentSchema(ctx, t, ctr).Types
require.NotNil(t, types.Get("A"))
require.Nil(t, types.Get("B"))
require.Nil(t, types.Get("C"))
require.Nil(t, types.Get("D"))
}
func TestModuleSelfAPICall(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"github.com/Khan/genqlient/graphql"
)
type Test struct{}
func (m *Test) FnA(ctx context.Context) (string, error) {
resp := &graphql.Response{}
err := dag.c.MakeRequest(ctx, &graphql.Request{
Query: "{test{fnB}}",
}, resp)
if err != nil {
return "", err
}
return resp.Data.(map[string]any)["test"].(map[string]any)["fnB"].(string), nil
}
func (m *Test) FnB() string {
return "hi from b"
}
`,
}).
With(daggerQuery(`{test{fnA}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fnA": "hi from b"}}`, out)
}
func TestModuleGoWithOtherModuleTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Dep struct{}
type Obj struct {
Foo string
}
func (m *Dep) Fn() Obj {
return Obj{Foo: "foo"}
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=test", "--name=test", "--sdk=go", "test")).
With(daggerExec("install", "-m=test", "./dep")).
WithWorkdir("/work/test")
t.Run("return as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() (*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() ([]*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
})
t.Run("arg as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj *DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj []*DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
})
t.Run("field as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo *DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo []*DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
})
}
var useInner = `package main
type Dep struct{}
func (m *Dep) Hello() string {
return "hello"
}
`
var useGoOuter = `package main
import "context"
type Use struct{}
func (m *Use) UseHello(ctx context.Context) (string, error) {
return dag.Dep().Hello(ctx)
}
`
var usePythonOuter = `from dagger import dag, function
@function
def use_hello() -> str:
return dag.dep().hello()
`
var useTSOuter = `
import { dag, object, func } from '@dagger.io/dagger'
@object()
class Use {
@func()
async useHello(): Promise<string> {
return dag.dep().hello()
}
}
`
func TestModuleUseLocal(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// cannot use transitive dependency directly
_, err = modGen.With(daggerQuery(`{dep{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, `Query has no such field: "dep"`)
})
}
}
func TestModuleCodegenOnDepChange(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
changed string
expected string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
expected: "Hellov2",
changed: strings.ReplaceAll(useGoOuter, `Hello(ctx)`, `Hellov2(ctx)`),
},
{
sdk: "python",
source: usePythonOuter,
expected: "hellov2",
changed: strings.ReplaceAll(usePythonOuter, `.hello()`, `.hellov2()`),
},
{
sdk: "typescript",
source: useTSOuter,
expected: "hellov2",
changed: strings.ReplaceAll(useTSOuter, `.hello()`, `.hellov2()`),
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// make back-incompatible change to dep
newInner := strings.ReplaceAll(useInner, `Hello()`, `Hellov2()`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("develop"))
codegenContents, err := modGen.File(sdkCodegenFile(t, tc.sdk)).Contents(ctx)
require.NoError(t, err)
require.Contains(t, codegenContents, tc.expected)
modGen = modGen.With(sdkSource(tc.sdk, tc.changed))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
})
}
}
func TestModuleSyncDeps(t *testing.T) {
// verify that changes to deps result in a develop to the depender module
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
modGen = modGen.With(daggerQuery(`{use{useHello}}`))
out, err := modGen.Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
newInner := strings.ReplaceAll(useInner, `"hello"`, `"goodbye"`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("develop"))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"goodbye"}}`, out)
})
}
}
func TestModuleUseLocalMulti(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
import "fmt"
type Use struct {}
func (m *Use) Names(ctx context.Context) ([]string, error) {
fooName, err := dag.Foo().Name(ctx)
if err != nil {
return nil, fmt.Errorf("foo.name: %w", err)
}
barName, err := dag.Bar().Name(ctx)
if err != nil {
return nil, fmt.Errorf("bar.name: %w", err)
}
return []string{fooName, barName}, nil
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function
@function
async def names() -> list[str]:
return [
await dag.foo().name(),
await dag.bar().name(),
]
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from '@dagger.io/dagger'
@object()
class Use {
@func()
async names(): Promise<string[]> {
return [await dag.foo().name(), await dag.bar().name()]
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/foo").
WithNewFile("/work/foo/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Foo struct {}
func (m *Foo) Name() string { return "foo" }
`,
}).
With(daggerExec("init", "--source=.", "--name=foo", "--sdk=go")).
WithWorkdir("/work/bar").
WithNewFile("/work/bar/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Bar struct {}
func (m *Bar) Name() string { return "bar" }
`,
}).
With(daggerExec("init", "--source=.", "--name=bar", "--sdk=go")).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(daggerExec("install", "./foo")).
With(daggerExec("install", "./bar")).
With(sdkSource(tc.sdk, tc.source)).
WithEnvVariable("BUST", identity.NewID()) // NB(vito): hmm...
out, err := modGen.With(daggerQuery(`{use{names}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"names":["foo", "bar"]}}`, out)
})
}
}
func TestModuleConstructor(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("basic", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(
ctx context.Context,
foo string,
bar *int, // +optional
baz []string,
dir *Directory,
) *Test {
bar2 := 42
if bar != nil {
bar2 = *bar
}
return &Test{
Foo: foo,
Bar: bar2,
Baz: baz,
Dir: dir,
}
}
type Test struct {
Foo string
Bar int
Baz []string
Dir *Directory
NeverSetDir *Directory
}
func (m *Test) GimmeFoo() string {
return m.Foo
}
func (m *Test) GimmeBar() int {
return m.Bar
}
func (m *Test) GimmeBaz() []string {
return m.Baz
}
func (m *Test) GimmeDirEnts(ctx context.Context) ([]string, error) {
return m.Dir.Entries(ctx)
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import field, function, object_type
@object_type
class Test:
foo: str = field()
dir: dagger.Directory = field()
bar: int = field(default=42)
baz: list[str] = field(default=list)
never_set_dir: dagger.Directory | None = field(default=None)
@function
def gimme_foo(self) -> str:
return self.foo
@function
def gimme_bar(self) -> int:
return self.bar
@function
def gimme_baz(self) -> list[str]:
return self.baz
@function
async def gimme_dir_ents(self) -> list[str]:
return await self.dir.entries()
`,
},
{
sdk: "typescript",
source: `
import { Directory, object, func, field } from '@dagger.io/dagger';
@object()
class Test {
@field()
foo: string
@field()
dir: Directory
@field()
bar: number
@field()
baz: string[]
@field()
neverSetDir?: Directory
constructor(foo: string, dir: Directory, bar = 42, baz: string[] = []) {
this.foo = foo;
this.dir = dir;
this.bar = bar;
this.baz = baz;
}
@func()
gimmeFoo(): string {
return this.foo;
}
@func()
gimmeBar(): number {
return this.bar;
}
@func()
gimmeBaz(): string[] {
return this.baz;
}
@func()
async gimmeDirEnts(): Promise<string[]> {
return this.dir.entries();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := modInit(ctx, t, c, tc.sdk, tc.source)
out, err := ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-dir-ents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, strings.TrimSpace(out), "dagger.json")
})
}
})
t.Run("fields only", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(ctx context.Context) (Test, error) {
v, err := dag.Container().From("alpine:3.18.4").File("/etc/alpine-release").Contents(ctx)
if err != nil {
return Test{}, err
}
return Test{
AlpineVersion: v,
}, nil
}
type Test struct {
AlpineVersion string
}
`,
},
{
sdk: "python",
source: `from dagger import dag, field, function, object_type
@object_type
class Test:
alpine_version: str = field()
@classmethod
async def create(cls) -> "Test":
return cls(alpine_version=await (
dag.container()
.from_("alpine:3.18.4")
.file("/etc/alpine-release")
.contents()
))
`,
},
{
sdk: "typescript",
source: `
import { dag, object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
alpineVersion: string
// NOTE: this is not standard to do async operations in the constructor.
// This is only for testing purpose but it shouldn't be done in real usage.
constructor() {
return (async () => {
this.alpineVersion = await dag.container().from("alpine:3.18.4").file("/etc/alpine-release").contents()
return this; // Return the newly-created instance
})();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := ctr.With(daggerCall("alpine-version")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "3.18.4")
})
}
})
t.Run("return error", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"fmt"
)
func New() (*Test, error) {
return nil, fmt.Errorf("too bad")
}
type Test struct {
Foo string
}
`,
},
{
sdk: "python",
source: `from dagger import object_type, field
@object_type
class Test:
foo: str = field()
def __init__(self):
raise ValueError("too bad")
`,
},
{
sdk: "typescript",
source: `
import { object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
foo: string
constructor() {
throw new Error("too bad")
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
_, err := ctr.With(daggerCall("foo")).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "too bad")
})
}
})
t.Run("python: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=python")).
With(sdkSource("python", fmt.Sprintf(`import dagger
from dagger import dag, object_type, field
@object_type
class Test:
foo: dagger.File = field(default=lambda: (
dag.directory()
.with_new_file("foo.txt", contents="%s")
.file("foo.txt")
))
bar: list[str] = field(default=list)
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "python"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
t.Run("typescript: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=typescript")).
With(sdkSource("typescript", fmt.Sprintf(`
import { dag, File, object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
foo: File = dag.directory().withNewFile("foo.txt", "%s").file("foo.txt")
@field()
bar: string[] = []
// Allow foo to be set through the constructor
constructor(foo?: File) {
if (foo) {
this.foo = foo
}
}
}
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "typescript"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
}
func TestModuleWrapping(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Wrapper struct{}
func (m *Wrapper) Container() *WrappedContainer {
return &WrappedContainer{
dag.Container().From("` + alpineImage + `"),
}
}
type WrappedContainer struct {
Unwrap *Container` + "`" + `json:"unwrap"` + "`" + `
}
func (c *WrappedContainer) Echo(msg string) *WrappedContainer {
return &WrappedContainer{
c.Unwrap.WithExec([]string{"echo", "-n", msg}),
}
}
`,
},
{
sdk: "python",
source: `from typing import Self
import dagger
from dagger import dag, field, function, object_type
@object_type
class WrappedContainer:
unwrap: dagger.Container = field()
@function
def echo(self, msg: str) -> Self:
return WrappedContainer(unwrap=self.unwrap.with_exec(["echo", "-n", msg]))
@object_type
class Wrapper:
@function
def container(self) -> WrappedContainer:
return WrappedContainer(unwrap=dag.container().from_("` + alpineImage + `"))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object()
class WrappedContainer {
@field()
unwrap: Container
constructor(unwrap: Container) {
this.unwrap = unwrap
}
@func()
echo(msg: string): WrappedContainer {
return new WrappedContainer(this.unwrap.withExec(["echo", "-n", msg]))
}
}
@object()
class Wrapper {
@func()
container(): WrappedContainer {
return new WrappedContainer(dag.container().from("` + alpineImage + `"))
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=wrapper", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
id := identity.NewID()
out, err := modGen.With(daggerQuery(
fmt.Sprintf(`{wrapper{container{echo(msg:%q){unwrap{stdout}}}}}`, id),
)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t,
fmt.Sprintf(`{"wrapper":{"container":{"echo":{"unwrap":{"stdout":%q}}}}}`, id),
out)
})
}
}
func TestModuleLotsOfFunctions(t *testing.T) {
t.Parallel()
const funcCount = 100
t.Run("go sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
package main
type PotatoSack struct {}
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
func (m *PotatoSack) Potato%d() string {
return "potato #%d"
}
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("init", "--source=.", "--name=potatoSack", "--sdk=go"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("python sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `from dagger import function
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@function
def potato_%d() -> str:
return "potato #%d"
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("./src/main.py", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("init", "--source=.", "--name=potatoSack", "--sdk=python"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("typescript sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
import { object, func } from "@dagger.io/dagger"
@object()
class PotatoSack {
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@func()
potato_%d(): string {
return "potato #%d"
}
`, i, i)
}
mainSrc += "\n}"
modGen := c.
Container().
From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(sdkSource("typescript", mainSrc)).
With(daggerExec("init", "--name=potatoSack", "--sdk=typescript"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
}
func TestModuleLotsOfDeps(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
modCount := 0
getModMainSrc := func(name string, depNames []string) string {
t.Helper()
mainSrc := fmt.Sprintf(`package main
import "context"
type %s struct {}
func (m *%s) Fn(ctx context.Context) (string, error) {
s := "%s"
var depS string
_ = depS
var err error
_ = err
`, strcase.ToCamel(name), strcase.ToCamel(name), name)
for _, depName := range depNames {
mainSrc += fmt.Sprintf(`
depS, err = dag.%s().Fn(ctx)
if err != nil {
return "", err
}
s += depS
`, strcase.ToCamel(depName))
}
mainSrc += "return s, nil\n}\n"
fmted, err := format.Source([]byte(mainSrc))
require.NoError(t, err)
return string(fmted)
}
// need to construct dagger.json directly in order to avoid excessive
// `dagger mod use` calls while constructing the huge DAG of deps
var rootCfg modules.ModuleConfig
addModulesWithDeps := func(newMods int, depNames []string) []string {
t.Helper()
var newModNames []string
for i := 0; i < newMods; i++ {
name := fmt.Sprintf("mod%d", modCount)
modCount++
newModNames = append(newModNames, name)
modGen = modGen.
WithWorkdir("/work/"+name).
WithNewFile("./main.go", dagger.ContainerWithNewFileOpts{
Contents: getModMainSrc(name, depNames),
})
var depCfgs []*modules.ModuleConfigDependency
for _, depName := range depNames {
depCfgs = append(depCfgs, &modules.ModuleConfigDependency{
Name: depName,
Source: filepath.Join("..", depName),
})
}
modGen = modGen.With(configFile(".", &modules.ModuleConfig{
Name: name,
SDK: "go",
Dependencies: depCfgs,
}))
}
return newModNames
}
// Create a base module, then add 6 layers of deps, where each layer has one more module
// than the previous layer and each module within the layer has a dep on each module
// from the previous layer. Finally add a single module at the top that depends on all
// modules from the last layer and call that.
// Basically, this creates a quadratically growing DAG of modules and verifies we
// handle it efficiently enough to be callable.
curDeps := addModulesWithDeps(1, nil)
for i := 0; i < 6; i++ {
curDeps = addModulesWithDeps(len(curDeps)+1, curDeps)
}
addModulesWithDeps(1, curDeps)
modGen = modGen.With(configFile("..", &rootCfg))
_, err := modGen.With(daggerCall("fn")).Sync(ctx)
require.NoError(t, err)
}
func TestModuleNamespacing(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
moduleSrcPath, err := filepath.Abs("./testdata/modules/go/namespacing")
require.NoError(t, err)
ctr := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithMountedDirectory("/work", c.Host().Directory(moduleSrcPath)).
WithWorkdir("/work")
out, err := ctr.
With(daggerQuery(`{test{fn(s:"yo")}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fn":["*main.Sub1Obj made 1:yo", "*main.Sub2Obj made 2:yo"]}}`, out)
}
func TestModuleLoops(t *testing.T) {
// verify circular module dependencies result in an error
t.Parallel()
c, ctx := connect(t)
_, err := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
With(daggerExec("init", "--name=depA", "--sdk=go", "depA")).
With(daggerExec("init", "--name=depB", "--sdk=go", "depB")).
With(daggerExec("init", "--name=depC", "--sdk=go", "depC")).
With(daggerExec("install", "-m=depC", "./depB")).
With(daggerExec("install", "-m=depB", "./depA")).
With(daggerExec("install", "-m=depA", "./depC")).
Sync(ctx)
require.ErrorContains(t, err, `local module at "/work/depA" has a circular dependency`)
}
//go:embed testdata/modules/go/id/arg/main.go
var badIDArgGoSrc string
//go:embed testdata/modules/python/id/arg/main.py
var badIDArgPySrc string
//go:embed testdata/modules/typescript/id/arg/index.ts
var badIDArgTSSrc string
//go:embed testdata/modules/go/id/field/main.go
var badIDFieldGoSrc string
//go:embed testdata/modules/typescript/id/field/index.ts
var badIDFieldTSSrc string
//go:embed testdata/modules/go/id/fn/main.go
var badIDFnGoSrc string
//go:embed testdata/modules/python/id/fn/main.py
var badIDFnPySrc string
//go:embed testdata/modules/typescript/id/fn/index.ts
var badIDFnTSSrc string
func TestModuleReservedWords(t *testing.T) {
// verify disallowed names are rejected
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("id", func(t *testing.T) {
t.Parallel()
t.Run("arg", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDArgGoSrc,
},
{
sdk: "python",
source: badIDArgPySrc,
},
{
sdk: "typescript",
source: badIDArgTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := modInit(ctx, t, c, tc.sdk, tc.source).
With(daggerQuery(`{test{fn(id:"no")}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define argument with reserved name \"id\"")
})
}
})
t.Run("field", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFieldGoSrc,
},
{
sdk: "typescript",
source: badIDFieldTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{fn{id}}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define field with reserved name \"id\"")
})
}
})
t.Run("fn", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFnGoSrc,
},
{
sdk: "python",
source: badIDFnPySrc,
},
{
sdk: "typescript",
source: badIDFnTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{id}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define function with reserved name \"id\"")
})
}
})
})
}
func TestModuleExecError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=playground", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
import (
"context"
"errors"
)
type Playground struct{}
func (p *Playground) DoThing(ctx context.Context) error {
_, err := dag.Container().From("` + alpineImage + `").WithExec([]string{"sh", "-c", "exit 5"}).Sync(ctx)
var e *ExecError
if errors.As(err, &e) {
if e.ExitCode == 5 {
return nil
}
}
panic("yikes")
}
`})
_, err := modGen.
With(daggerQuery(`{playground{doThing}}`)).
Stdout(ctx)
require.NoError(t, err)
}
func TestModuleCurrentModuleAPI(t *testing.T) {
t.Parallel()
t.Run("name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=WaCkY", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type WaCkY struct {}
func (m *WaCkY) Fn(ctx context.Context) (string, error) {
return dag.CurrentModule().Name(ctx)
}
`,
}).
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "WaCkY", strings.TrimSpace(out))
})
t.Run("source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/subdir/coolfile.txt", dagger.ContainerWithNewFileOpts{
Contents: "nice",
}).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) *File {
return dag.CurrentModule().Source().File("subdir/coolfile.txt")
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("workdir", func(t *testing.T) {
t.Parallel()
t.Run("dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*Directory, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().Workdir("subdir/moresubdir"), nil
}
`,
}).
With(daggerCall("fn", "file", "--path=coolfile.txt", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("file", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*File, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().WorkdirFile("subdir/moresubdir/coolfile.txt"), nil
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("error on escape", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
func New() (*Test, error) {
if err := os.WriteFile("/rootfile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
if err := os.MkdirAll("/foo", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("/foo/foofile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
return &Test{}, nil
}
type Test struct {}
func (m *Test) EscapeFile(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("../rootfile.txt")
}
func (m *Test) EscapeFileAbs(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("/rootfile.txt")
}
func (m *Test) EscapeDir(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("../foo")
}
func (m *Test) EscapeDirAbs(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("/foo")
}
`,
})
_, err := ctr.
With(daggerCall("escape-file", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-file-abs", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../foo" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir-abs", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/foo" escapes workdir`)
})
})
}
func TestModuleCustomSDK(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/coolsdk").
With(daggerExec("init", "--source=.", "--name=cool-sdk", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type CoolSdk struct {}
func (m *CoolSdk) ModuleRuntime(modSource *ModuleSource, introspectionJson string) *Container {
return modSource.WithSDK("go").AsModule().Runtime().WithEnvVariable("COOL", "true")
}
func (m *CoolSdk) Codegen(modSource *ModuleSource, introspectionJson string) *GeneratedCode {
return dag.GeneratedCode(modSource.WithSDK("go").AsModule().GeneratedContextDirectory())
}
func (m *CoolSdk) RequiredPaths() []string {
return []string{
"**/go.mod",
"**/go.sum",
"**/go.work",
"**/go.work.sum",
"**/vendor/",
"**/*.go",
}
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=coolsdk")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "os"
type Test struct {}
func (m *Test) Fn() string {
return os.Getenv("COOL")
}
`,
})
out, err := ctr.
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "true", strings.TrimSpace(out))
}
// TestModuleHostError verifies the host api is not exposed to modules
func TestModuleHostError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) *Directory {
return dag.Host().Directory(".")
}
`,
}).
With(daggerCall("fn")).
Sync(ctx)
require.ErrorContains(t, err, "dag.Host undefined")
}
func daggerExec(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerQuery(query string, args ...any) dagger.WithContainerFunc {
return daggerQueryAt("", query, args...)
}
func daggerQueryAt(modPath string, query string, args ...any) dagger.WithContainerFunc {
query = fmt.Sprintf(query, args...)
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "query"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(execArgs, dagger.ContainerWithExecOpts{
Stdin: query,
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerCall(args ...string) dagger.WithContainerFunc {
return daggerCallAt("", args...)
}
func daggerCallAt(modPath string, args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "call"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(append(execArgs, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerFunctions(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug", "functions"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func configFile(dirPath string, cfg *modules.ModuleConfig) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
cfgPath := filepath.Join(dirPath, "dagger.json")
cfgBytes, err := json.Marshal(cfg)
if err != nil {
panic(err)
}
return c.WithNewFile(cfgPath, dagger.ContainerWithNewFileOpts{
Contents: string(cfgBytes),
})
}
}
// command for a dagger cli call direct on the host
func hostDaggerCommand(ctx context.Context, t testing.TB, workdir string, args ...string) *exec.Cmd {
t.Helper()
cmd := exec.CommandContext(ctx, daggerCliPath(t), args...)
cmd.Dir = workdir
return cmd
}
// runs a dagger cli command directly on the host, rather than in an exec
func hostDaggerExec(ctx context.Context, t testing.TB, workdir string, args ...string) ([]byte, error) {
t.Helper()
cmd := hostDaggerCommand(ctx, t, workdir, args...)
output, err := cmd.CombinedOutput()
if err != nil {
err = fmt.Errorf("%s: %w", string(output), err)
}
return output, err
}
func sdkSource(sdk, contents string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
sourcePath := sdkSourceFile(sdk)
if sourcePath == "" {
return c
}
return c.WithNewFile(sourcePath, dagger.ContainerWithNewFileOpts{
Contents: heredoc.Doc(contents),
})
}
}
func sdkSourceFile(sdk string) string {
switch sdk {
case "go":
return "dagger/main.go"
case "python":
return "dagger/src/main.py"
case "typescript":
return "dagger/src/index.ts"
default:
return ""
}
}
func sdkCodegenFile(t *testing.T, sdk string) string {
t.Helper()
switch sdk {
case "go":
return "dagger/dagger.gen.go"
case "python":
return "dagger/sdk/src/dagger/client/gen.py"
case "typescript":
return "dagger/sdk/api/client.gen.ts"
default:
return ""
}
}
func modInit(ctx context.Context, t *testing.T, c *dagger.Client, sdk, contents string) *dagger.Container {
t.Helper()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+sdk)).
With(sdkSource(sdk, contents))
return modGen
}
func currentSchema(ctx context.Context, t *testing.T, ctr *dagger.Container) *introspection.Schema {
t.Helper()
out, err := ctr.With(daggerQuery(introspection.Query)).Stdout(ctx)
require.NoError(t, err)
var schemaResp introspection.Response
err = json.Unmarshal([]byte(out), &schemaResp)
require.NoError(t, err)
return schemaResp.Schema
}
var moduleIntrospection = daggerQuery(`
query { host { directory(path: ".") { asModule { initialize {
description
objects {
asObject {
name
description
constructor {
description
args {
name
description
defaultValue
}
}
functions {
name
description
args {
name
description
defaultValue
}
}
fields {
name
description
}
}
}
} } } } }
`)
func inspectModule(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
t.Helper()
out, err := ctr.With(moduleIntrospection).Stdout(ctx)
require.NoError(t, err)
result := gjson.Get(out, "host.directory.asModule.initialize")
t.Logf("module introspection:\n%v", result.Raw)
return result
}
func inspectModuleObjects(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
t.Helper()
return inspectModule(ctx, t, ctr).Get("objects.#.asObject")
}
func goGitBase(t *testing.T, c *dagger.Client) *dagger.Container {
t.Helper()
return c.Container().From(golangImage).
WithExec([]string{"apk", "add", "git"}).
WithExec([]string{"git", "config", "--global", "user.email", "dagger@example.com"}).
WithExec([]string{"git", "config", "--global", "user.name", "Dagger Tests"}).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"})
}
func logGen(ctx context.Context, t *testing.T, modSrc *dagger.Directory) {
t.Helper()
generated, err := modSrc.File("dagger.gen.go").Contents(ctx)
require.NoError(t, err)
t.Cleanup(func() {
t.Name()
fileName := filepath.Join(
os.TempDir(),
t.Name(),
fmt.Sprintf("dagger.gen.%d.go", time.Now().Unix()),
)
if err := os.MkdirAll(filepath.Dir(fileName), 0o755); err != nil {
t.Logf("failed to create temp dir for generated code: %v", err)
return
}
if err := os.WriteFile(fileName, []byte(generated), 0644); err != nil {
t.Logf("failed to write generated code to %s: %v", fileName, err)
} else {
t.Logf("wrote generated code to %s", fileName)
}
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,664 | Unable to reference remote modules by short name | Version: 0.9.10
What I expect to work:
```sh
dagger init
dagger install github.com/shykes/daggerverse/hello
dagger -m hello functions
```
What I get:
`Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: cannot resolve non-local module source from caller`
Additionally, when I run `dagger -m hello functions`, I get local files created mimicking the module's remote ref:
```sh
$ tree github.com
github.com
└── shykes
└── daggerverse
└── hello@ac880927d5368eaf2e5d94450e587732753df1a6
3 directories, 0 files
``` | https://github.com/dagger/dagger/issues/6664 | https://github.com/dagger/dagger/pull/6668 | 430ea3a7fec9f4e88584e1aa352a7e43c083e518 | 41a311347e4d8539b2206903a5e93acaf1108d34 | "2024-02-13T17:43:20Z" | go | "2024-02-19T17:06:53Z" | cmd/dagger/module.go | package main
import (
"context"
"encoding/json"
"fmt"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"dagger.io/dagger"
"github.com/dagger/dagger/analytics"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/dagql/idtui"
"github.com/dagger/dagger/engine/client"
"github.com/go-git/go-git/v5"
"github.com/iancoleman/strcase"
"github.com/juju/ansiterm/tabwriter"
"github.com/moby/buildkit/util/gitutil"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/vito/progrock"
)
var (
moduleGroup = &cobra.Group{
ID: "module",
Title: "Dagger Module Commands (Experimental)",
}
moduleURL string
moduleFlags = pflag.NewFlagSet("module", pflag.ContinueOnError)
sdk string
licenseID string
moduleName string
moduleSourcePath string
installName string
developSDK string
developSourcePath string
force bool
)
const (
moduleURLDefault = "."
defaultModuleSourceDirName = "dagger"
)
func init() {
moduleFlags.StringVarP(&moduleURL, "mod", "m", "", "Path to dagger.json config file for the module or a directory containing that file. Either local path (e.g. \"/path/to/some/dir\") or a github repo (e.g. \"github.com/dagger/dagger/path/to/some/subdir\")")
moduleFlags.BoolVar(&focus, "focus", true, "Only show output for focused commands")
listenCmd.PersistentFlags().AddFlagSet(moduleFlags)
queryCmd.PersistentFlags().AddFlagSet(moduleFlags)
funcCmds.AddFlagSet(moduleFlags)
moduleInitCmd.Flags().StringVar(&sdk, "sdk", "", "Optionally initialize module for development in the given SDK")
moduleInitCmd.Flags().StringVar(&moduleName, "name", "", "Name of the new module (defaults to parent directory name)")
moduleInitCmd.Flags().StringVar(&moduleSourcePath, "source", "", "Directory to store the module implementation source code in (defaults to \"dagger/ if \"--sdk\" is provided)")
moduleInitCmd.Flags().StringVar(&licenseID, "license", "", "License identifier to generate - see https://spdx.org/licenses/")
modulePublishCmd.Flags().BoolVarP(&force, "force", "f", false, "Force publish even if the git repository is not clean")
modulePublishCmd.Flags().AddFlagSet(moduleFlags)
moduleInstallCmd.Flags().StringVarP(&installName, "name", "n", "", "Name to use for the dependency in the module. Defaults to the name of the module being installed.")
moduleInstallCmd.Flags().AddFlagSet(moduleFlags)
moduleDevelopCmd.Flags().StringVar(&developSDK, "sdk", "", "New SDK for the module")
moduleDevelopCmd.Flags().StringVar(&developSourcePath, "source", "", "Directory to store the module implementation source code in")
moduleDevelopCmd.PersistentFlags().AddFlagSet(moduleFlags)
configCmd.PersistentFlags().AddFlagSet(moduleFlags)
configCmd.AddCommand(oldInitCmd, oldInstallCmd, oldSyncCmd)
configCmd.AddGroup(moduleGroup)
}
var oldInitCmd = &cobra.Command{
Use: "init",
Short: "Initialize a new Dagger module",
Hidden: true,
SilenceUsage: true,
DisableFlagParsing: true,
Args: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf(`"dagger mod init" has been replaced by "dagger init"`)
},
Run: func(cmd *cobra.Command, args []string) {
// do nothing
},
}
var oldInstallCmd = &cobra.Command{
Use: "install",
Short: "Add a new dependency to a Dagger module",
Hidden: true,
SilenceUsage: true,
DisableFlagParsing: true,
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
Args: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf(`"dagger mod install" has been replaced by "dagger install"`)
},
Run: func(cmd *cobra.Command, args []string) {
// do nothing
},
}
var oldSyncCmd = &cobra.Command{
Use: "sync",
Short: "Setup or update all the resources needed to develop on a module locally",
Hidden: true,
SilenceUsage: true,
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
DisableFlagParsing: true,
Args: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf(`"dagger mod sync" has been replaced by "dagger develop"`)
},
Run: func(cmd *cobra.Command, args []string) {
// do nothing
},
}
var configCmd = &cobra.Command{
Use: "config",
Aliases: []string{"mod"},
Short: "Get or set the configuration of a Dagger module",
Long: "Get or set the configuration of a Dagger module. By default, print the configuration of the specified module.",
Example: strings.TrimSpace(`
dagger config -m /path/to/some/dir
dagger config -m github.com/dagger/hello-dagger
`,
),
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
cmd.SetContext(ctx)
vtx := progrock.FromContext(ctx).Vertex(idtui.PrimaryVertex, cmd.CommandPath())
defer func() { vtx.Done(err) }()
setCmdOutput(cmd, vtx)
modConf, err := getDefaultModuleConfiguration(ctx, engineClient.Dagger(), true)
if err != nil {
return fmt.Errorf("failed to load module: %w", err)
}
if !modConf.FullyInitialized() {
return fmt.Errorf("module must be fully initialized")
}
mod := modConf.Source.AsModule()
name, err := mod.Name(ctx)
if err != nil {
return fmt.Errorf("failed to get module name: %w", err)
}
sdk, err := mod.SDK(ctx)
if err != nil {
return fmt.Errorf("failed to get module SDK: %w", err)
}
tw := tabwriter.NewWriter(cmd.OutOrStdout(), 0, 0, 3, ' ', tabwriter.DiscardEmptyColumns)
fmt.Fprintf(tw, "%s\t%s\n",
"Name:",
name,
)
fmt.Fprintf(tw, "%s\t%s\n",
"SDK:",
sdk,
)
fmt.Fprintf(tw, "%s\t%s\n",
"Root Directory:",
modConf.LocalContextPath,
)
fmt.Fprintf(tw, "%s\t%s\n",
"Source Directory:",
modConf.LocalRootSourcePath,
)
return tw.Flush()
})
},
}
var moduleInitCmd = &cobra.Command{
Use: "init [flags] [PATH]",
Short: "Initialize a new Dagger module",
Long: `Initialize a new Dagger module in a local directory.
By default, create a new dagger.json configuration in the current working directory. If the positional argument PATH is provided, create the module in that directory instead.
The configuration will default the name of the module to the parent directory name, unless specified with --name.
Any module can be installed to via "dagger install".
A module can only be called once it has been initialized with an SDK though. The "--sdk" flag can be provided to init here, but if it's not the configuration can be updated later via "dagger develop".
The "--source" flag allows controlling the directory in which the actual module source code is stored. By default, it will be stored in a directory named "dagger".
`,
Example: "dagger init --name=hello --sdk=python --source=some/subdir",
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
dag := engineClient.Dagger()
vtx := progrock.FromContext(ctx).Vertex(idtui.PrimaryVertex, cmd.CommandPath())
defer func() { vtx.Done(err) }()
setCmdOutput(cmd, vtx)
// default the module source root to the current working directory if it doesn't exist yet
cwd, err := os.Getwd()
if err != nil {
return fmt.Errorf("failed to get current working directory: %w", err)
}
srcRootPath := cwd
if len(extraArgs) > 0 {
srcRootPath = extraArgs[0]
}
if filepath.IsAbs(srcRootPath) {
srcRootPath, err = filepath.Rel(cwd, srcRootPath)
if err != nil {
return fmt.Errorf("failed to get relative path: %w", err)
}
}
modConf, err := getModuleConfigurationForSourceRef(ctx, dag, srcRootPath, false)
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
if modConf.SourceKind != dagger.LocalSource {
return fmt.Errorf("module must be local")
}
if modConf.ModuleSourceConfigExists {
return fmt.Errorf("module already exists")
}
// default module name to directory of source root
if moduleName == "" {
moduleName = filepath.Base(modConf.LocalRootSourcePath)
}
// only bother setting source path if there's an sdk at this time
if sdk != "" {
if moduleSourcePath == "" {
moduleSourcePath = filepath.Join(modConf.LocalRootSourcePath, defaultModuleSourceDirName)
}
// ensure source path is relative to the source root
sourceAbsPath, err := filepath.Abs(moduleSourcePath)
if err != nil {
return fmt.Errorf("failed to get absolute source path for %s: %w", moduleSourcePath, err)
}
moduleSourcePath, err = filepath.Rel(modConf.LocalRootSourcePath, sourceAbsPath)
if err != nil {
return fmt.Errorf("failed to get relative source path: %w", err)
}
}
_, err = modConf.Source.
WithName(moduleName).
WithSDK(sdk).
WithSourceSubpath(moduleSourcePath).
ResolveFromCaller().
AsModule().
GeneratedContextDiff().
Export(ctx, modConf.LocalContextPath)
if err != nil {
return fmt.Errorf("failed to generate code: %w", err)
}
if err := findOrCreateLicense(ctx, modConf.LocalRootSourcePath); err != nil {
return err
}
fmt.Fprintln(cmd.OutOrStdout(), "Initialized module", moduleName, "in", srcRootPath)
return nil
})
},
}
var moduleInstallCmd = &cobra.Command{
Use: "install [flags] MODULE",
Aliases: []string{"use"},
Short: "Add a new dependency to a Dagger module",
Long: "Add a Dagger module as a dependency of a local module.",
// TODO: use example from a reference module, using a tag instead of commit
Example: "dagger install github.com/shykes/daggerverse/ttlsh@16e40ec244966e55e36a13cb6e1ff8023e1e1473",
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
dag := engineClient.Dagger()
modConf, err := getDefaultModuleConfiguration(ctx, dag, false)
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
if modConf.SourceKind != dagger.LocalSource {
return fmt.Errorf("module must be local")
}
if !modConf.FullyInitialized() {
return fmt.Errorf("module must be fully initialized")
}
depRefStr := extraArgs[0]
depSrc := dag.ModuleSource(depRefStr)
depSrcKind, err := depSrc.Kind(ctx)
if err != nil {
return fmt.Errorf("failed to get module ref kind: %w", err)
}
if depSrcKind == dagger.LocalSource {
// need to ensure that local dep paths are relative to the parent root source
depAbsPath, err := filepath.Abs(depRefStr)
if err != nil {
return fmt.Errorf("failed to get dep absolute path for %s: %w", depRefStr, err)
}
depRelPath, err := filepath.Rel(modConf.LocalRootSourcePath, depAbsPath)
if err != nil {
return fmt.Errorf("failed to get dep relative path: %w", err)
}
depSrc = dag.ModuleSource(depRelPath)
}
dep := dag.ModuleDependency(depSrc, dagger.ModuleDependencyOpts{
Name: installName,
})
modSrc := modConf.Source.
WithDependencies([]*dagger.ModuleDependency{dep}).
ResolveFromCaller()
_, err = modSrc.
AsModule().
GeneratedContextDiff().
Export(ctx, modConf.LocalContextPath)
if err != nil {
return fmt.Errorf("failed to generate code: %w", err)
}
depSrc = modSrc.ResolveDependency(depSrc)
name, err := depSrc.ModuleName(ctx)
if err != nil {
return err
}
sdk, err := depSrc.AsModule().SDK(ctx)
if err != nil {
return err
}
depRootSubpath, err := depSrc.SourceRootSubpath(ctx)
if err != nil {
return err
}
if depSrcKind == dagger.GitSource {
git := depSrc.AsGitSource()
gitURL, err := git.CloneURL(ctx)
if err != nil {
return err
}
gitVersion, err := git.Version(ctx)
if err != nil {
return err
}
gitCommit, err := git.Commit(ctx)
if err != nil {
return err
}
analytics.Ctx(ctx).Capture(ctx, "module_install", map[string]string{
"module_name": name,
"install_name": installName,
"module_sdk": sdk,
"source_kind": "git",
"git_symbolic": filepath.Join(gitURL, depRootSubpath),
"git_clone_url": gitURL,
"git_subpath": depRootSubpath,
"git_version": gitVersion,
"git_commit": gitCommit,
})
} else if depSrcKind == dagger.LocalSource {
analytics.Ctx(ctx).Capture(ctx, "module_install", map[string]string{
"module_name": name,
"install_name": installName,
"module_sdk": sdk,
"source_kind": "local",
"local_subpath": depRootSubpath,
})
}
return nil
})
},
}
var moduleDevelopCmd = &cobra.Command{
Use: "develop",
Short: "Setup or update all the resources needed to develop on a module locally",
Long: `Setup or update all the resources needed to develop on a module locally.
This command re-regerates the module's generated code based on dependencies
and the current state of the module's source code.
If --sdk is set, the config file and generated code will be updated with those values reflected. It currently can only be used to set the SDK of a module that does not have one already.
--source allows controlling the directory in which the actual module source code is stored. By default, it will be stored in a directory named "dagger".
:::note
If not updating source or SDK, this is only required for IDE auto-completion/LSP purposes.
:::
`,
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
dag := engineClient.Dagger()
modConf, err := getDefaultModuleConfiguration(ctx, dag, false)
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
if modConf.SourceKind != dagger.LocalSource {
return fmt.Errorf("module must be local")
}
src := modConf.Source
// use this one to read sdk/source path since they require the host filesystem be loaded.
// this is kind of inefficient, could update the engine to support these APIs without a full
// ResolveFromCaller call first
modConf.Source = modConf.Source.ResolveFromCaller()
modSDK, err := modConf.Source.AsModule().SDK(ctx)
if err != nil {
return fmt.Errorf("failed to get module SDK: %w", err)
}
if developSDK != "" {
if modSDK != "" && modSDK != developSDK {
return fmt.Errorf("cannot update module SDK that has already been set to %q", modSDK)
}
modSDK = developSDK
src = src.WithSDK(modSDK)
}
modSourcePath, err := modConf.Source.SourceSubpath(ctx)
if err != nil {
return fmt.Errorf("failed to get module source subpath: %w", err)
}
// if SDK is set but source path isn't and the user didn't provide --source, we'll use the default source path
if modSDK != "" && modSourcePath == "" && developSourcePath == "" {
developSourcePath = filepath.Join(modConf.LocalRootSourcePath, defaultModuleSourceDirName)
}
// if there's no SDK and the user isn't changing the source path, there's nothing to do.
// error out rather than silently doing nothing.
if modSDK == "" && developSourcePath == "" {
return fmt.Errorf("dagger develop on a module without an SDK requires either --sdk or --source")
}
if developSourcePath != "" {
// ensure source path is relative to the source root
sourceAbsPath, err := filepath.Abs(developSourcePath)
if err != nil {
return fmt.Errorf("failed to get absolute source path for %s: %w", developSourcePath, err)
}
developSourcePath, err = filepath.Rel(modConf.LocalRootSourcePath, sourceAbsPath)
if err != nil {
return fmt.Errorf("failed to get relative source path: %w", err)
}
if modSourcePath != "" && modSourcePath != developSourcePath {
return fmt.Errorf("cannot update module source path that has already been set to %q", modSourcePath)
}
modSourcePath = developSourcePath
src = src.WithSourceSubpath(modSourcePath)
}
_, err = src.ResolveFromCaller().
AsModule().
GeneratedContextDiff().
Export(ctx, modConf.LocalContextPath)
if err != nil {
return fmt.Errorf("failed to generate code: %w", err)
}
return nil
})
},
}
const daDaggerverse = "https://daggerverse.dev"
var modulePublishCmd = &cobra.Command{
Use: "publish",
Hidden: true, // Hide while we finalize publishing workflow
Short: "Publish a Dagger module to the Daggerverse",
Long: fmt.Sprintf(`Publish a local module to the Daggerverse (%s).
The module needs to be committed to a git repository and have a remote
configured with name "origin". The git repository must be clean (unless
forced), to avoid mistakingly depending on uncommitted files.
`,
daDaggerverse,
),
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
rec := progrock.FromContext(ctx)
vtx := rec.Vertex(idtui.PrimaryVertex, cmd.CommandPath())
defer func() { vtx.Done(err) }()
setCmdOutput(cmd, vtx)
dag := engineClient.Dagger()
modConf, err := getDefaultModuleConfiguration(ctx, dag, true)
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
if modConf.SourceKind != dagger.LocalSource {
return fmt.Errorf("module must be local")
}
if !modConf.FullyInitialized() {
return fmt.Errorf("module must be fully initialized")
}
repo, err := git.PlainOpenWithOptions(modConf.LocalRootSourcePath, &git.PlainOpenOptions{
DetectDotGit: true,
})
if err != nil {
return fmt.Errorf("failed to open git repo: %w", err)
}
wt, err := repo.Worktree()
if err != nil {
return fmt.Errorf("failed to get git worktree: %w", err)
}
st, err := wt.Status()
if err != nil {
return fmt.Errorf("failed to get git status: %w", err)
}
head, err := repo.Head()
if err != nil {
return fmt.Errorf("failed to get git HEAD: %w", err)
}
commit := head.Hash()
rec.Debug("git commit", progrock.Labelf("commit", commit.String()))
orig, err := repo.Remote("origin")
if err != nil {
return fmt.Errorf("failed to get git remote: %w", err)
}
refPath, err := originToPath(orig.Config().URLs[0])
if err != nil {
return fmt.Errorf("failed to get module path: %w", err)
}
// calculate path relative to repo root
gitRoot := wt.Filesystem.Root()
pathFromRoot, err := filepath.Rel(gitRoot, modConf.LocalRootSourcePath)
if err != nil {
return fmt.Errorf("failed to get path from git root: %w", err)
}
// NB: you might think to ignore changes to files outside of the module,
// but we should probably play it safe. in a monorepo for example this
// could mean publishing a broken module because it depends on
// uncommitted code in a dependent module.
//
// TODO: the proper fix here might be to check for dependent code, too.
// Specifically I should be able to publish a dependency before
// committing + pushing its dependers. but in the end it doesn't really
// matter; just commit everything and _then_ publish.
if !st.IsClean() && !force {
cmd.Println(st)
return fmt.Errorf("git repository is not clean; run with --force to ignore")
}
refStr := fmt.Sprintf("%s@%s", path.Join(refPath, pathFromRoot), commit)
crawlURL, err := url.JoinPath(daDaggerverse, "crawl")
if err != nil {
return fmt.Errorf("failed to get module URL: %w", err)
}
data := url.Values{}
data.Add("ref", refStr)
req, err := http.NewRequest(http.MethodPut, crawlURL, strings.NewReader(data.Encode()))
if err != nil {
return fmt.Errorf("failed to create request: %w", err)
}
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := http.DefaultClient.Do(req)
if err != nil {
return fmt.Errorf("failed to get module: %w", err)
}
// TODO(vito): inspect response and/or poll, would be nice to surface errors here
cmd.Println("Publishing", refStr, "to", daDaggerverse+"...")
cmd.Println()
cmd.Println("You can check on the crawling status here:")
cmd.Println()
cmd.Println(" " + res.Request.URL.String())
modURL, err := url.JoinPath(daDaggerverse, "mod", refStr)
if err != nil {
return fmt.Errorf("failed to get module URL: %w", err)
}
cmd.Println()
cmd.Println("Once the crawl is complete, you can view your module here:")
cmd.Println()
cmd.Println(" " + modURL)
return res.Body.Close()
})
},
}
func originToPath(origin string) (string, error) {
url, err := gitutil.ParseURL(origin)
if err != nil {
return "", fmt.Errorf("failed to parse git remote origin URL: %w", err)
}
return strings.TrimSuffix(path.Join(url.Host, url.Path), ".git"), nil
}
type configuredModule struct {
Source *dagger.ModuleSource
SourceKind dagger.ModuleSourceKind
LocalContextPath string
LocalRootSourcePath string
// whether the dagger.json in the module source dir exists yet
ModuleSourceConfigExists bool
}
func (c *configuredModule) FullyInitialized() bool {
return c.ModuleSourceConfigExists
}
func getDefaultModuleConfiguration(
ctx context.Context,
dag *dagger.Client,
// if true, will resolve local sources from the caller
// before returning the source. This should be set false
// if the caller wants to mutate configuration (sdk/dependency/etc.)
// since those changes require the source be resolved after
// they are made (due to the fact that they may result in more
// files needing to be loaded).
resolveFromCaller bool,
) (*configuredModule, error) {
srcRefStr := moduleURL
if srcRefStr == "" {
// it's unset or default value, use mod if present
if v, ok := os.LookupEnv("DAGGER_MODULE"); ok {
srcRefStr = v
}
// it's still unset, set to the default
if srcRefStr == "" {
srcRefStr = moduleURLDefault
}
}
return getModuleConfigurationForSourceRef(ctx, dag, srcRefStr, resolveFromCaller)
}
func getModuleConfigurationForSourceRef(
ctx context.Context,
dag *dagger.Client,
srcRefStr string,
resolveFromCaller bool,
) (*configuredModule, error) {
conf := &configuredModule{}
conf.Source = dag.ModuleSource(srcRefStr)
var err error
conf.SourceKind, err = conf.Source.Kind(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get module ref kind: %w", err)
}
if conf.SourceKind == dagger.LocalSource {
// first check if this is a named module from the default find-up dagger.json
// TODO: can move this to engine now?
cwd, err := os.Getwd()
if err != nil {
return nil, fmt.Errorf("failed to get current working directory: %w", err)
}
defaultConfigDir, foundDefaultConfig, err := findUp(cwd)
if err != nil {
return nil, fmt.Errorf("error trying to find config path for %s: %s", cwd, err)
}
if foundDefaultConfig {
configPath := filepath.Join(defaultConfigDir, modules.Filename)
contents, err := os.ReadFile(configPath)
if err != nil {
return nil, fmt.Errorf("failed to read %s: %w", configPath, err)
}
var modCfg modules.ModuleConfig
if err := json.Unmarshal(contents, &modCfg); err != nil {
return nil, fmt.Errorf("failed to unmarshal %s: %s", configPath, err)
}
if namedDep, ok := modCfg.DependencyByName(srcRefStr); ok {
depPath := filepath.Join(defaultConfigDir, namedDep.Source)
srcRefStr = depPath
}
}
conf.LocalRootSourcePath, err = filepath.Abs(srcRefStr)
if err != nil {
return nil, fmt.Errorf("failed to get absolute path for %s: %w", srcRefStr, err)
}
if filepath.IsAbs(srcRefStr) {
srcRefStr, err = filepath.Rel(cwd, srcRefStr)
if err != nil {
return nil, fmt.Errorf("failed to get relative path for %s: %w", srcRefStr, err)
}
}
if err := os.MkdirAll(srcRefStr, 0755); err != nil {
return nil, fmt.Errorf("failed to create directory for %s: %w", srcRefStr, err)
}
conf.Source = dag.ModuleSource(srcRefStr)
conf.LocalContextPath, err = conf.Source.ResolveContextPathFromCaller(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get local root path: %w", err)
}
_, err = os.Lstat(filepath.Join(conf.LocalRootSourcePath, modules.Filename))
conf.ModuleSourceConfigExists = err == nil
if resolveFromCaller {
conf.Source = conf.Source.ResolveFromCaller()
}
} else {
conf.ModuleSourceConfigExists, err = conf.Source.ConfigExists(ctx)
if err != nil {
return nil, fmt.Errorf("failed to check if module config exists: %w", err)
}
}
return conf, nil
}
func findUp(curDirPath string) (string, bool, error) {
if !filepath.IsAbs(curDirPath) {
return "", false, fmt.Errorf("path is not absolute: %s", curDirPath)
}
configPath := filepath.Join(curDirPath, modules.Filename)
stat, err := os.Lstat(configPath)
switch {
case os.IsNotExist(err):
case err == nil:
// make sure it's a file
if !stat.Mode().IsRegular() {
return "", false, fmt.Errorf("expected %s to be a file", configPath)
}
return curDirPath, true, nil
default:
return "", false, fmt.Errorf("failed to lstat %s: %s", configPath, err)
}
// didn't exist, try parent unless we've hit "/" or a git repo checkout root
if curDirPath == "/" {
return curDirPath, false, nil
}
_, err = os.Lstat(filepath.Join(curDirPath, ".git"))
if err == nil {
return curDirPath, false, nil
}
parentDirPath := filepath.Dir(curDirPath)
return findUp(parentDirPath)
}
// Wraps a command with optional module loading. If a module was explicitly specified by the user,
// it will try to load it and error out if it's not found or invalid. If no module was specified,
// it will try the current directory as a module but provide a nil module if it's not found, not
// erroring out.
func optionalModCmdWrapper(
fn func(context.Context, *client.Client, *dagger.Module, *cobra.Command, []string) error,
presetSecretToken string,
) func(*cobra.Command, []string) error {
return func(cmd *cobra.Command, cmdArgs []string) error {
return withEngineAndTUI(cmd.Context(), client.Params{
SecretToken: presetSecretToken,
}, func(ctx context.Context, engineClient *client.Client) (err error) {
modConf, err := getDefaultModuleConfiguration(ctx, engineClient.Dagger(), true)
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
var loadedMod *dagger.Module
if modConf.FullyInitialized() {
loadedMod = modConf.Source.AsModule().Initialize()
_, err := loadedMod.Serve(ctx)
if err != nil {
return fmt.Errorf("failed to serve module: %w", err)
}
}
return fn(ctx, engineClient, loadedMod, cmd, cmdArgs)
})
}
}
// loadModTypeDefs loads the objects defined by the given module in an easier to use data structure.
func loadModTypeDefs(ctx context.Context, dag *dagger.Client, mod *dagger.Module) (*moduleDef, error) {
var res struct {
TypeDefs []*modTypeDef
}
const query = `
fragment TypeDefRefParts on TypeDef {
kind
optional
asObject {
name
}
asInterface {
name
}
asInput {
name
}
asList {
elementTypeDef {
kind
asObject {
name
}
asInterface {
name
}
asInput {
name
}
}
}
}
fragment FunctionParts on Function {
name
description
returnType {
...TypeDefRefParts
}
args {
name
description
defaultValue
typeDef {
...TypeDefRefParts
}
}
}
fragment FieldParts on FieldTypeDef {
name
description
typeDef {
...TypeDefRefParts
}
}
query TypeDefs($module: ModuleID!) {
typeDefs: currentTypeDefs {
kind
optional
asObject {
name
sourceModuleName
constructor {
...FunctionParts
}
functions {
...FunctionParts
}
fields {
...FieldParts
}
}
asInterface {
name
sourceModuleName
functions {
...FunctionParts
}
}
asInput {
name
fields {
...FieldParts
}
}
}
}
`
err := dag.Do(ctx, &dagger.Request{
Query: query,
Variables: map[string]interface{}{
"module": mod,
},
}, &dagger.Response{
Data: &res,
})
if err != nil {
return nil, fmt.Errorf("query module objects: %w", err)
}
name, err := mod.Name(ctx)
if err != nil {
return nil, fmt.Errorf("get module name: %w", err)
}
modDef := &moduleDef{Name: name}
for _, typeDef := range res.TypeDefs {
switch typeDef.Kind {
case dagger.ObjectKind:
modDef.Objects = append(modDef.Objects, typeDef)
case dagger.InterfaceKind:
modDef.Interfaces = append(modDef.Interfaces, typeDef)
case dagger.InputKind:
modDef.Inputs = append(modDef.Inputs, typeDef)
}
}
return modDef, nil
}
// moduleDef is a representation of dagger.Module.
type moduleDef struct {
Name string
Objects []*modTypeDef
Interfaces []*modTypeDef
Inputs []*modTypeDef
}
func (m *moduleDef) AsFunctionProviders() []functionProvider {
providers := make([]functionProvider, 0, len(m.Objects)+len(m.Interfaces))
for _, obj := range m.AsObjects() {
providers = append(providers, obj)
}
for _, iface := range m.AsInterfaces() {
providers = append(providers, iface)
}
return providers
}
// AsObjects returns the module's object type definitions.
func (m *moduleDef) AsObjects() []*modObject {
var defs []*modObject
for _, typeDef := range m.Objects {
if typeDef.AsObject != nil {
defs = append(defs, typeDef.AsObject)
}
}
return defs
}
func (m *moduleDef) AsInterfaces() []*modInterface {
var defs []*modInterface
for _, typeDef := range m.Interfaces {
if typeDef.AsInterface != nil {
defs = append(defs, typeDef.AsInterface)
}
}
return defs
}
func (m *moduleDef) AsInputs() []*modInput {
var defs []*modInput
for _, typeDef := range m.Inputs {
if typeDef.AsInput != nil {
defs = append(defs, typeDef.AsInput)
}
}
return defs
}
// GetObject retrieves a saved object type definition from the module.
func (m *moduleDef) GetObject(name string) *modObject {
for _, obj := range m.AsObjects() {
// Normalize name in case an SDK uses a different convention for object names.
if gqlObjectName(obj.Name) == gqlObjectName(name) {
return obj
}
}
return nil
}
// GetInterface retrieves a saved interface type definition from the module.
func (m *moduleDef) GetInterface(name string) *modInterface {
for _, iface := range m.AsInterfaces() {
// Normalize name in case an SDK uses a different convention for interface names.
if gqlObjectName(iface.Name) == gqlObjectName(name) {
return iface
}
}
return nil
}
// GetInterface retrieves a saved object or interface type definition from the module as a functionProvider.
func (m *moduleDef) GetFunctionProvider(name string) functionProvider {
if obj := m.GetObject(name); obj != nil {
return obj
}
if iface := m.GetInterface(name); iface != nil {
return iface
}
return nil
}
// GetInput retrieves a saved interface type definition from the module.
func (m *moduleDef) GetInput(name string) *modInput {
for _, input := range m.AsInputs() {
// Normalize name in case an SDK uses a different convention for input names.
if gqlObjectName(input.Name) == gqlObjectName(name) {
return input
}
}
return nil
}
func (m *moduleDef) GetMainObject() *modObject {
return m.GetObject(m.Name)
}
// LoadTypeDef attempts to replace a function's return object type or argument's
// object type with with one from the module's object type definitions, to
// recover missing function definitions in those places when chaining functions.
func (m *moduleDef) LoadTypeDef(typeDef *modTypeDef) {
if typeDef.AsObject != nil && typeDef.AsObject.Functions == nil && typeDef.AsObject.Fields == nil {
obj := m.GetObject(typeDef.AsObject.Name)
if obj != nil {
typeDef.AsObject = obj
}
}
if typeDef.AsInterface != nil && typeDef.AsInterface.Functions == nil {
iface := m.GetInterface(typeDef.AsInterface.Name)
if iface != nil {
typeDef.AsInterface = iface
}
}
if typeDef.AsInput != nil && typeDef.AsInput.Fields == nil {
input := m.GetInput(typeDef.AsInput.Name)
if input != nil {
typeDef.AsInput = input
}
}
if typeDef.AsList != nil {
m.LoadTypeDef(typeDef.AsList.ElementTypeDef)
}
}
// modTypeDef is a representation of dagger.TypeDef.
type modTypeDef struct {
Kind dagger.TypeDefKind
Optional bool
AsObject *modObject
AsInterface *modInterface
AsInput *modInput
AsList *modList
}
type functionProvider interface {
ProviderName() string
GetFunctions() []*modFunction
GetFunction(name string) (*modFunction, error)
}
func (t *modTypeDef) Name() string {
if t.AsObject != nil {
return t.AsObject.Name
}
if t.AsInterface != nil {
return t.AsInterface.Name
}
return ""
}
func (t *modTypeDef) AsFunctionProvider() functionProvider {
if t.AsObject != nil {
return t.AsObject
}
if t.AsInterface != nil {
return t.AsInterface
}
return nil
}
// modObject is a representation of dagger.ObjectTypeDef.
type modObject struct {
Name string
Functions []*modFunction
Fields []*modField
Constructor *modFunction
SourceModuleName string
}
var _ functionProvider = (*modObject)(nil)
func (o *modObject) ProviderName() string {
return o.Name
}
// GetFunctions returns the object's function definitions as well as the fields,
// which are treated as functions with no arguments.
func (o *modObject) GetFunctions() []*modFunction {
fns := make([]*modFunction, 0, len(o.Functions)+len(o.Fields))
for _, f := range o.Fields {
fns = append(fns, &modFunction{
Name: f.Name,
Description: f.Description,
ReturnType: f.TypeDef,
})
}
fns = append(fns, o.Functions...)
return fns
}
func (o *modObject) GetFunction(name string) (*modFunction, error) {
for _, fn := range o.Functions {
if fn.Name == name || cliName(fn.Name) == name {
return fn, nil
}
}
for _, f := range o.Fields {
if f.Name == name || cliName(f.Name) == name {
return &modFunction{
Name: f.Name,
Description: f.Description,
ReturnType: f.TypeDef,
}, nil
}
}
return nil, fmt.Errorf("no function '%s' in object type '%s'", name, o.Name)
}
type modInterface struct {
Name string
Functions []*modFunction
}
var _ functionProvider = (*modInterface)(nil)
func (o *modInterface) ProviderName() string {
return o.Name
}
func (o *modInterface) GetFunctions() []*modFunction {
fns := make([]*modFunction, 0, len(o.Functions))
fns = append(fns, o.Functions...)
return fns
}
func (o *modInterface) GetFunction(name string) (*modFunction, error) {
for _, fn := range o.Functions {
if fn.Name == name || cliName(fn.Name) == name {
return fn, nil
}
}
return nil, fmt.Errorf("no function '%s' in interface type '%s'", name, o.Name)
}
type modInput struct {
Name string
Fields []*modField
}
// modList is a representation of dagger.ListTypeDef.
type modList struct {
ElementTypeDef *modTypeDef
}
// modField is a representation of dagger.FieldTypeDef.
type modField struct {
Name string
Description string
TypeDef *modTypeDef
}
// modFunction is a representation of dagger.Function.
type modFunction struct {
Name string
Description string
ReturnType *modTypeDef
Args []*modFunctionArg
}
// modFunctionArg is a representation of dagger.FunctionArg.
type modFunctionArg struct {
Name string
Description string
TypeDef *modTypeDef
DefaultValue dagger.JSON
flagName string
}
// FlagName returns the name of the argument using CLI naming conventions.
func (r *modFunctionArg) FlagName() string {
if r.flagName == "" {
r.flagName = cliName(r.Name)
}
return r.flagName
}
func getDefaultValue[T any](r *modFunctionArg) (T, error) {
var val T
err := json.Unmarshal([]byte(r.DefaultValue), &val)
return val, err
}
// gqlObjectName converts casing to a GraphQL object name
func gqlObjectName(name string) string {
return strcase.ToCamel(name)
}
// gqlFieldName converts casing to a GraphQL object field name
func gqlFieldName(name string) string {
return strcase.ToLowerCamel(name)
}
// gqlArgName converts casing to a GraphQL field argument name
func gqlArgName(name string) string {
return strcase.ToLowerCamel(name)
}
// cliName converts casing to the CLI convention (kebab)
func cliName(name string) string {
return strcase.ToKebab(name)
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,664 | Unable to reference remote modules by short name | Version: 0.9.10
What I expect to work:
```sh
dagger init
dagger install github.com/shykes/daggerverse/hello
dagger -m hello functions
```
What I get:
`Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: cannot resolve non-local module source from caller`
Additionally, when I run `dagger -m hello functions`, I get local files created mimicking the module's remote ref:
```sh
$ tree github.com
github.com
└── shykes
└── daggerverse
└── hello@ac880927d5368eaf2e5d94450e587732753df1a6
3 directories, 0 files
``` | https://github.com/dagger/dagger/issues/6664 | https://github.com/dagger/dagger/pull/6668 | 430ea3a7fec9f4e88584e1aa352a7e43c083e518 | 41a311347e4d8539b2206903a5e93acaf1108d34 | "2024-02-13T17:43:20Z" | go | "2024-02-19T17:06:53Z" | core/integration/module_config_test.go | package core
import (
"encoding/json"
"strings"
"testing"
"dagger.io/dagger"
"github.com/dagger/dagger/core/modules"
"github.com/stretchr/testify/require"
)
func TestModuleConfigs(t *testing.T) {
// test dagger.json source configs that aren't inherently covered in other tests
t.Parallel()
t.Run("upgrade from old config", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
baseWithOldConfig := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/foo").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct {}
func (m *Test) Fn() string { return "wowzas" }
`,
}).
WithNewFile("/work/dagger.json", dagger.ContainerWithNewFileOpts{
Contents: `{"name": "test", "sdk": "go", "include": ["foo"], "exclude": ["blah"], "dependencies": ["foo"]}`,
})
// verify develop updates config to new format
baseWithNewConfig := baseWithOldConfig.With(daggerExec("develop"))
confContents, err := baseWithNewConfig.File("dagger.json").Contents(ctx)
require.NoError(t, err)
var modCfg modules.ModuleConfig
require.NoError(t, json.Unmarshal([]byte(confContents), &modCfg))
require.Equal(t, "test", modCfg.Name)
require.Equal(t, "go", modCfg.SDK)
require.Equal(t, []string{"foo"}, modCfg.Include)
require.Equal(t, []string{"blah"}, modCfg.Exclude)
require.Len(t, modCfg.Dependencies, 1)
require.Equal(t, "foo", modCfg.Dependencies[0].Source)
require.Equal(t, "dep", modCfg.Dependencies[0].Name)
require.Equal(t, ".", modCfg.Source)
require.NotEmpty(t, modCfg.EngineVersion) // version changes with any engine change
// verify develop didn't overwrite main.go
out, err := baseWithNewConfig.With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "wowzas", strings.TrimSpace(out))
// verify call works seamlessly even without explicit sync yet
out, err = baseWithOldConfig.With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "wowzas", strings.TrimSpace(out))
})
t.Run("dep has separate config", func(t *testing.T) {
// Verify that if a local dep has its own dagger.json, that's used to load it correctly.
t.Parallel()
c, ctx := connect(t)
base := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/subdir/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("/work/subdir/dep/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) DepFn(ctx context.Context, str string) string { return str }
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=test", "--name=test", "--sdk=go", "test")).
With(daggerExec("install", "-m=test", "./subdir/dep")).
WithNewFile("/work/test/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) (string, error) { return dag.Dep().DepFn(ctx, "hi dep") }
`,
})
// try invoking it from a few different paths, just for more corner case coverage
t.Run("from src dir", func(t *testing.T) {
t.Parallel()
out, err := base.WithWorkdir("test").With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
t.Run("from src root", func(t *testing.T) {
t.Parallel()
out, err := base.With(daggerCallAt("test", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
t.Run("from root", func(t *testing.T) {
t.Parallel()
out, err := base.WithWorkdir("/").With(daggerCallAt("work/test", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
t.Run("from dep parent", func(t *testing.T) {
t.Parallel()
out, err := base.WithWorkdir("/work/subdir").With(daggerCallAt("../test", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
t.Run("from dep dir", func(t *testing.T) {
t.Parallel()
out, err := base.WithWorkdir("/work/subdir/dep").With(daggerCallAt("../../test", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
})
t.Run("install dep from weird places", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
base := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=subdir/dep", "--name=dep", "--sdk=go", "subdir/dep")).
WithNewFile("/work/subdir/dep/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) DepFn(ctx context.Context, str string) string { return str }
`,
}).
With(daggerExec("init", "--source=test", "--name=test", "--sdk=go", "test")).
WithNewFile("/work/test/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) (string, error) { return dag.Dep().DepFn(ctx, "hi dep") }
`,
})
t.Run("from src dir", func(t *testing.T) {
// sanity test normal case
t.Parallel()
out, err := base.
WithWorkdir("/work/test").
With(daggerExec("install", "../subdir/dep")).
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
t.Run("from root", func(t *testing.T) {
t.Parallel()
out, err := base.
WithWorkdir("/").
With(daggerExec("install", "-m=./work/test", "./work/subdir/dep")).
WithWorkdir("/work/test").
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
t.Run("from dep", func(t *testing.T) {
t.Parallel()
out, err := base.
WithWorkdir("/work/subdir/dep").
With(daggerExec("install", "-m=../../test", ".")).
WithWorkdir("/work/test").
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
t.Run("from random place", func(t *testing.T) {
t.Parallel()
out, err := base.
WithWorkdir("/var").
With(daggerExec("install", "-m=../work/test", "../work/subdir/dep")).
WithWorkdir("/work/test").
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
})
t.Run("install out of tree dep fails", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
base := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/play/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=go"))
t.Run("from src dir", func(t *testing.T) {
t.Parallel()
_, err := base.
WithWorkdir("/work/test").
With(daggerExec("install", "../../play/dep")).
Sync(ctx)
require.ErrorContains(t, err, `local module dep source path "../play/dep" escapes context "/work"`)
})
t.Run("from dep dir", func(t *testing.T) {
t.Parallel()
_, err := base.
WithWorkdir("/play/dep").
With(daggerExec("install", "-m=../../work/test", ".")).
Sync(ctx)
require.ErrorContains(t, err, `module dep source path "../play/dep" escapes context "/work"`)
})
t.Run("from root", func(t *testing.T) {
t.Parallel()
_, err := base.
WithWorkdir("/").
With(daggerExec("install", "-m=work/test", "play/dep")).
Sync(ctx)
require.ErrorContains(t, err, `module dep source path "../play/dep" escapes context "/work"`)
})
})
t.Run("malicious config", func(t *testing.T) {
// verify a maliciously/incorrectly constructed dagger.json is still handled correctly
t.Parallel()
c, ctx := connect(t)
base := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("/work/dep/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) GetSource(ctx context.Context) *Directory {
return dag.CurrentModule().Source()
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go"))
t.Run("source points out of root", func(t *testing.T) {
t.Parallel()
base := base.
With(configFile(".", &modules.ModuleConfig{
Name: "evil",
SDK: "go",
Source: "..",
}))
_, err := base.With(daggerCall("container-echo", "--string-arg", "plz fail")).Sync(ctx)
require.ErrorContains(t, err, `local module source path ".." escapes context "/work"`)
_, err = base.With(daggerExec("develop")).Sync(ctx)
require.ErrorContains(t, err, `local module source path ".." escapes context "/work"`)
_, err = base.With(daggerExec("install", "./dep")).Sync(ctx)
require.ErrorContains(t, err, `local module source path ".." escapes context "/work"`)
})
t.Run("dep points out of root", func(t *testing.T) {
t.Parallel()
base := base.
With(configFile(".", &modules.ModuleConfig{
Name: "evil",
SDK: "go",
Dependencies: []*modules.ModuleConfigDependency{{
Name: "escape",
Source: "..",
}},
}))
_, err := base.With(daggerCall("container-echo", "--string-arg", "plz fail")).Sync(ctx)
require.ErrorContains(t, err, `local module dep source path ".." escapes context "/work"`)
_, err = base.With(daggerExec("develop")).Sync(ctx)
require.ErrorContains(t, err, `local module dep source path ".." escapes context "/work"`)
_, err = base.With(daggerExec("install", "./dep")).Sync(ctx)
require.ErrorContains(t, err, `local module dep source path ".." escapes context "/work"`)
})
})
}
func TestModuleCustomDepNames(t *testing.T) {
t.Parallel()
t.Run("basic", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("/work/dep/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) DepFn(ctx context.Context) string {
return "hi from dep"
}
func (m *Dep) GetDepObj(ctx context.Context) *DepObj {
return &DepObj{Str: "yo from dep"}
}
type DepObj struct {
Str string
}
func (m *Dep) GetOtherObj(ctx context.Context) *OtherObj {
return &OtherObj{Str: "hey from dep"}
}
type OtherObj struct {
Str string
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
With(daggerExec("install", "--name", "foo", "./dep")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) (string, error) {
return dag.Foo().DepFn(ctx)
}
func (m *Test) GetObj(ctx context.Context) (string, error) {
var obj *FooObj
obj = dag.Foo().GetDepObj()
return obj.Str(ctx)
}
func (m *Test) GetOtherObj(ctx context.Context) (string, error) {
var obj *FooOtherObj
obj = dag.Foo().GetOtherObj()
return obj.Str(ctx)
}
func (m *Test) GetConflictNameObj(ctx context.Context) *Dep {
return &Dep{Str: "it worked?"}
}
// should not be any name conflict with dep
type Dep struct {
Str string
}
`,
})
out, err := ctr.With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from dep", strings.TrimSpace(out))
out, err = ctr.With(daggerCall("get-obj")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "yo from dep", strings.TrimSpace(out))
out, err = ctr.With(daggerCall("get-other-obj")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hey from dep", strings.TrimSpace(out))
out, err = ctr.With(daggerCall("get-conflict-name-obj", "str")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "it worked?", strings.TrimSpace(out))
})
t.Run("same mod name as dep", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/dep/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) string {
return "hi from dep"
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
With(daggerExec("install", "--name", "foo", "./dep")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) (string, error) {
return dag.Foo().Fn(ctx)
}
`,
})
out, err := ctr.With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from dep", strings.TrimSpace(out))
})
t.Run("two deps with same name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep1").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("/work/dep1/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) Fn(ctx context.Context) string {
return "hi from dep1"
}
`,
}).
WithWorkdir("/work/dep2").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("/work/dep2/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) Fn(ctx context.Context) string {
return "hi from dep2"
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
With(daggerExec("install", "--name", "foo", "./dep1")).
With(daggerExec("install", "--name", "bar", "./dep2")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) (string, error) {
dep1, err := dag.Foo().Fn(ctx)
if err != nil {
return "", err
}
dep2, err := dag.Bar().Fn(ctx)
if err != nil {
return "", err
}
return dep1 + " " + dep2, nil
}
`,
})
out, err := ctr.With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from dep1 hi from dep2", strings.TrimSpace(out))
})
}
func TestModuleDaggerInit(t *testing.T) {
t.Parallel()
t.Run("name defaults to source root dir name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=coolmod", "--sdk=go", "coolmod")).
WithNewFile("/work/coolmod/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Coolmod struct {}
func (m *Coolmod) Fn(ctx context.Context) (string, error) {
return dag.CurrentModule().Name(ctx)
}
`,
}).
With(daggerCallAt("coolmod", "fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "coolmod", strings.TrimSpace(out))
})
t.Run("source dir default", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
for _, tc := range []struct {
sdk string
sourceDirEnt string
}{
{
sdk: "go",
sourceDirEnt: "main.go",
},
{
sdk: "python",
sourceDirEnt: "src",
},
{
sdk: "typescript",
sourceDirEnt: "src",
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
srcRootDir := ctr.
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
Directory(".")
srcRootEnts, err := srcRootDir.Entries(ctx)
require.NoError(t, err)
require.Contains(t, srcRootEnts, "dagger.json")
require.NotContains(t, srcRootEnts, tc.sourceDirEnt)
srcDirEnts, err := srcRootDir.Directory("dagger").Entries(ctx)
require.NoError(t, err)
require.Contains(t, srcDirEnts, tc.sourceDirEnt)
})
}
})
t.Run("source is made rel to source root by engine", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithWorkdir("/var").
With(daggerExec("init", "--source=../work/some/subdir", "--name=test", "--sdk=go", "../work")).
With(daggerCallAt("../work", "container-echo", "--string-arg", "yo", "stdout"))
out, err := ctr.Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "yo", strings.TrimSpace(out))
ents, err := ctr.Directory("/work/some/subdir").Entries(ctx)
require.NoError(t, err)
require.Contains(t, ents, "main.go")
})
}
func TestModuleDaggerDevelop(t *testing.T) {
t.Parallel()
t.Run("name and sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("/work/dep/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) Fn(ctx context.Context) string {
return "hi from dep"
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init")).
With(daggerExec("install", "./dep"))
// should be able to invoke dep without name+sdk set yet
out, err := ctr.With(daggerCallAt("dep", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from dep", strings.TrimSpace(out))
// now add an sdk+source
ctr = ctr.
With(daggerExec("develop", "--sdk", "go", "--source", "cool/subdir")).
WithNewFile("/work/cool/subdir/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Work struct {}
func (m *Work) Fn(ctx context.Context) (string, error) {
depStr, err := dag.Dep().Fn(ctx)
if err != nil {
return "", err
}
return "hi from work " + depStr, nil
}
`,
})
// should be able to invoke it directly now
out, err = ctr.With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from work hi from dep", strings.TrimSpace(out))
// currently, we don't support renaming or re-sdking a module, make sure that errors comprehensibly
_, err = ctr.With(daggerExec("develop", "--sdk", "python")).Sync(ctx)
require.ErrorContains(t, err, `cannot update module SDK that has already been set to "go"`)
_, err = ctr.With(daggerExec("develop", "--source", "blahblahblaha/blah")).Sync(ctx)
require.ErrorContains(t, err, `cannot update module source path that has already been set to "cool/subdir"`)
})
t.Run("source is made rel to source root by engine", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("/work/dep/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) Fn(ctx context.Context) string {
return "hi from dep"
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init")).
With(daggerExec("install", "./dep")).
WithWorkdir("/var").
With(daggerExec("develop", "-m", "../work", "--source=../work/some/subdir", "--sdk=go")).
WithNewFile("/work/some/subdir/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Work struct {}
func (m *Work) Fn(ctx context.Context) (string, error) {
depStr, err := dag.Dep().Fn(ctx)
if err != nil {
return "", err
}
return "hi from work " + depStr, nil
}
`,
})
out, err := ctr.With(daggerCallAt("../work", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from work hi from dep", strings.TrimSpace(out))
ents, err := ctr.Directory("/work/some/subdir").Entries(ctx)
require.NoError(t, err)
require.Contains(t, ents, "main.go")
})
}
func TestModuleDaggerConfig(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk=go", "test")).
With(daggerExec("config", "-m", "test")).
Stdout(ctx)
require.NoError(t, err)
require.Regexp(t, `Name:\s+test`, out)
require.Regexp(t, `SDK:\s+go`, out)
require.Regexp(t, `Root Directory:\s+/work`, out)
require.Regexp(t, `Source Directory:\s+/work/test`, out)
}
func TestModuleIncludeExclude(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
sdk string
mainSource string
customSDKSource string
customSDKUnderlyingSDK string
}{
{
sdk: "go",
mainSource: `package main
type Test struct {}
func (m *Test) Fn() *Directory {
return dag.CurrentModule().Source()
}
`,
},
{
sdk: "python",
mainSource: `import dagger
from dagger import dag, function, object_type
@object_type
class Test:
@function
def fn(self) -> dagger.Directory:
return dag.current_module().source()
`,
},
{
sdk: "typescript",
mainSource: `
import { dag, Directory, object, func } from "@dagger.io/dagger"
@object()
class Test {
@func()
fn(): Directory {
return dag.currentModule().source()
}
}`,
},
{
sdk: "coolsdk",
mainSource: `package main
type Test struct {}
func (m *Test) Fn() *Directory {
return dag.CurrentModule().Source()
}
`,
customSDKUnderlyingSDK: "go",
customSDKSource: `package main
type Coolsdk struct {}
func (m *Coolsdk) ModuleRuntime(modSource *ModuleSource, introspectionJson string) *Container {
return modSource.WithSDK("go").AsModule().Runtime().WithEnvVariable("COOL", "true")
}
func (m *Coolsdk) Codegen(modSource *ModuleSource, introspectionJson string) *GeneratedCode {
return dag.GeneratedCode(modSource.WithSDK("go").AsModule().GeneratedContextDirectory())
}
func (m *Coolsdk) RequiredPaths() []string {
return []string{
"**/go.mod",
"**/go.sum",
"**/go.work",
"**/go.work.sum",
"**/vendor/",
"**/*.go",
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
// special case custom sdk
if tc.customSDKSource != "" {
ctr = ctr.
WithWorkdir("/work/" + tc.sdk).
With(daggerExec("init", "--name="+tc.sdk, "--sdk="+tc.customSDKUnderlyingSDK)).
With(sdkSource(tc.customSDKUnderlyingSDK, tc.customSDKSource)).
WithWorkdir("/work")
}
ctr = ctr.With(daggerExec("init", "--name=test", "--sdk="+tc.sdk))
if tc.customSDKSource != "" {
// TODO: hardcoding that underlying sdk is go right now, could be generalized
ctr = ctr.WithNewFile("dagger/main.go", dagger.ContainerWithNewFileOpts{
Contents: tc.mainSource,
})
} else {
ctr = ctr.With(sdkSource(tc.sdk, tc.mainSource))
}
// TODO: use cli to configure include/exclude once supported
ctr = ctr.
With(configFile(".", &modules.ModuleConfig{
Name: "test",
SDK: tc.sdk,
Include: []string{"dagger/subdir/keepdir"},
Exclude: []string{"dagger/subdir/keepdir/rmdir"},
Source: "dagger",
})).
WithDirectory("dagger/subdir/keepdir/rmdir", c.Directory())
// call should work even though dagger.json and main source files weren't
// explicitly included
out, err := ctr.
With(daggerCall("fn", "directory", "--path", "subdir", "entries")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "keepdir", strings.TrimSpace(out))
out, err = ctr.
With(daggerCall("fn", "directory", "--path", "subdir/keepdir", "entries")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "", strings.TrimSpace(out))
// call should also work from other directories
out, err = ctr.
WithWorkdir("/mnt").
With(daggerCallAt("../work", "fn", "directory", "--path", "subdir", "entries")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "keepdir", strings.TrimSpace(out))
// call should still work after develop
ctr = ctr.With(daggerExec("develop"))
out, err = ctr.
With(daggerCall("fn", "directory", "--path", "subdir", "entries")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "keepdir", strings.TrimSpace(out))
out, err = ctr.
With(daggerCall("fn", "directory", "--path", "subdir/keepdir", "entries")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "", strings.TrimSpace(out))
})
}
}
// verify that if there is no local .git in parent dirs then the context defaults to the source root
func TestModuleContextDefaultsToSourceRoot(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/coolsdk").
With(daggerExec("init", "--source=.", "--name=cool-sdk", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type CoolSdk struct {}
func (m *CoolSdk) ModuleRuntime(modSource *ModuleSource, introspectionJson string) *Container {
return modSource.WithSDK("go").AsModule().Runtime().
WithMountedDirectory("/da-context", modSource.ContextDirectory())
}
func (m *CoolSdk) Codegen(modSource *ModuleSource, introspectionJson string) *GeneratedCode {
return dag.GeneratedCode(modSource.WithSDK("go").AsModule().GeneratedContextDirectory())
}
func (m *CoolSdk) RequiredPaths() []string {
return []string{
"**/go.mod",
"**/go.sum",
"**/go.work",
"**/go.work.sum",
"**/vendor/",
"**/*.go",
}
}
`,
}).
WithWorkdir("/work").
WithNewFile("random-file").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=coolsdk")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "os"
type Test struct {}
func (m *Test) Fn() ([]string, error) {
ents, err := os.ReadDir("/da-context")
if err != nil {
return nil, err
}
var names []string
for _, ent := range ents {
names = append(names, ent.Name())
}
return names, nil
}
`,
})
out, err := ctr.
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Contains(t, strings.TrimSpace(out), "random-file")
}
func TestModuleDaggerInstallGit(t *testing.T) {
/*
TODO: this is a stopgap test to get some basic coverage of installing modules
from git refs. Ideally it would rely on our own repo for of test fixtures but
those have not been setup yet: https://github.com/dagger/dagger/issues/6623
*/
t.Parallel()
c, ctx := connect(t)
_, err := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk=go")).
With(daggerExec("install", "github.com/sagikazarmark/daggerverse/archivist@bedfa0c8bdba7192c65c21b5e88a48b600666fcc")).
Sync(ctx)
require.NoError(t, err)
c.ModuleSource("github.com/sagikazarmark/daggerverse/archivist@bedfa0c8bdba7192c65c21b5e88a48b600666fcc").
AsGitSource().
HTMLURL(ctx)
}
func TestModuleDaggerGitRefs(t *testing.T) {
/*
TODO: this is a stopgap test to get some basic coverage of installing modules
from git refs. Ideally it would rely on our own repo for of test fixtures but
those have not been setup yet: https://github.com/dagger/dagger/issues/6623
*/
t.Parallel()
c, ctx := connect(t)
htmlURL, err := c.ModuleSource("github.com/sagikazarmark/daggerverse/archivist@bedfa0c8bdba7192c65c21b5e88a48b600666fcc").
AsGitSource().
HTMLURL(ctx)
require.NoError(t, err)
require.Equal(t, "https://github.com/sagikazarmark/daggerverse/tree/bedfa0c8bdba7192c65c21b5e88a48b600666fcc/archivist", htmlURL)
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,623 | Need integ tests for git modules | Right now all our integ tests only use local refs because git modules are locked into github repos and we've been trying to avoid tests depending on modules in an external git repo. However, I think we should just bite the bullet on that at this point since missing that test coverage is too big a gap. | https://github.com/dagger/dagger/issues/6623 | https://github.com/dagger/dagger/pull/6693 | 6a3689eeb680920fe5f830ac972be3dc1fa4f29b | a659c04b9982ef90a999dc20efb9485b11eda556 | "2024-02-08T18:15:16Z" | go | "2024-02-20T10:52:53Z" | core/integration/module_call_test.go | package core
import (
"fmt"
"strings"
"testing"
"dagger.io/dagger"
"github.com/moby/buildkit/identity"
"github.com/stretchr/testify/require"
)
func TestModuleDaggerCallArgTypes(t *testing.T) {
t.Parallel()
t.Run("service args", func(t *testing.T) {
t.Parallel()
t.Run("used as service binding", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context, svc *Service) (string, error) {
return dag.Container().From("alpine:3.18").WithExec([]string{"apk", "add", "curl"}).
WithServiceBinding("daserver", svc).
WithExec([]string{"curl", "http://daserver:8000"}).
Stdout(ctx)
}
`,
})
logGen(ctx, t, modGen.Directory("."))
httpServer, _ := httpService(ctx, t, c, "im up")
endpoint, err := httpServer.Endpoint(ctx)
require.NoError(t, err)
out, err := modGen.
WithServiceBinding("testserver", httpServer).
With(daggerCall("fn", "--svc", "tcp://"+endpoint)).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "im up", out)
})
t.Run("used directly", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"fmt"
"strings"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context, svc *Service) (string, error) {
ports, err := svc.Ports(ctx)
if err != nil {
return "", err
}
var out []string
out = append(out, fmt.Sprintf("%d exposed ports:", len(ports)))
for _, port := range ports {
number, err := port.Port(ctx)
if err != nil {
return "", err
}
out = append(out, fmt.Sprintf("- TCP/%d", number))
}
return strings.Join(out, "\n"), nil
}
`,
})
logGen(ctx, t, modGen.Directory("."))
httpServer, _ := httpService(ctx, t, c, "im up")
endpoint, err := httpServer.Endpoint(ctx)
require.NoError(t, err)
out, err := modGen.
WithServiceBinding("testserver", httpServer).
With(daggerCall("fn", "--svc", "tcp://"+endpoint)).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "1 exposed ports:\n- TCP/8000", out)
})
})
t.Run("list args", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("foo.txt", dagger.ContainerWithNewFileOpts{
Contents: "bar",
}).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"strings"
)
type Minimal struct {}
func (m *Minimal) Hello(msgs []string) string {
return strings.Join(msgs, "+")
}
func (m *Minimal) Reads(ctx context.Context, files []File) (string, error) {
var contents []string
for _, f := range files {
content, err := f.Contents(ctx)
if err != nil {
return "", err
}
contents = append(contents, content)
}
return strings.Join(contents, "+"), nil
}
`,
})
logGen(ctx, t, modGen.Directory("."))
out, err := modGen.With(daggerCall("hello", "--msgs", "yo", "--msgs", "my", "--msgs", "friend")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "yo+my+friend", out)
out, err = modGen.With(daggerCall("reads", "--files=foo.txt", "--files=foo.txt")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "bar+bar", out)
})
t.Run("directory arg inputs", func(t *testing.T) {
t.Parallel()
t.Run("local dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/dir/subdir/foo.txt", dagger.ContainerWithNewFileOpts{
Contents: "foo",
}).
WithNewFile("/dir/subdir/bar.txt", dagger.ContainerWithNewFileOpts{
Contents: "bar",
}).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct {}
func (m *Test) Fn(dir *Directory) *Directory {
return dir
}
`,
})
out, err := modGen.With(daggerCall("fn", "--dir", "/dir/subdir", "entries")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "bar.txt\nfoo.txt\n", out)
out, err = modGen.With(daggerCall("fn", "--dir", "file:///dir/subdir", "entries")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "bar.txt\nfoo.txt\n", out)
})
t.Run("git dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct {}
func (m *Test) Fn(
dir *Directory,
subpath string, // +optional
) *Directory {
if subpath == "" {
subpath = "."
}
return dir.Directory(subpath)
}
`,
})
for _, tc := range []struct {
baseURL string
subpath string
}{
{
baseURL: "https://github.com/dagger/dagger",
},
{
baseURL: "https://github.com/dagger/dagger",
subpath: ".changes",
},
{
baseURL: "https://github.com/dagger/dagger.git",
},
{
baseURL: "https://github.com/dagger/dagger.git",
subpath: ".changes",
},
} {
tc := tc
t.Run(fmt.Sprintf("%s:%s", tc.baseURL, tc.subpath), func(t *testing.T) {
url := tc.baseURL + "#v0.9.1"
if tc.subpath != "" {
url += ":" + tc.subpath
}
args := []string{"fn", "--dir", url}
if tc.subpath == "" {
args = append(args, "--subpath", ".changes")
}
args = append(args, "entries")
out, err := modGen.With(daggerCall(args...)).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, "v0.9.1.md")
require.NotContains(t, out, "v0.9.2.md")
})
}
})
})
t.Run("secret args", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Insecure(ctx context.Context, token *Secret) (string, error) {
return token.Plaintext(ctx)
}
`,
}).
WithEnvVariable("TOPSECRET", "shhh").
WithNewFile("/mysupersecret", dagger.ContainerWithNewFileOpts{Contents: "file shhh"})
t.Run("explicit env", func(t *testing.T) {
t.Run("happy", func(t *testing.T) {
out, err := modGen.With(daggerCall("insecure", "--token", "env:TOPSECRET")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "shhh", out)
})
t.Run("sad", func(t *testing.T) {
_, err := modGen.With(daggerCall("insecure", "--token", "env:NOWHERETOBEFOUND")).Stdout(ctx)
require.ErrorContains(t, err, `secret env var not found: "NOW..."`)
})
})
t.Run("implicit env", func(t *testing.T) {
t.Parallel()
t.Run("happy", func(t *testing.T) {
out, err := modGen.With(daggerCall("insecure", "--token", "TOPSECRET")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "shhh", out)
})
t.Run("sad", func(t *testing.T) {
_, err := modGen.With(daggerCall("insecure", "--token", "NOWHERETOBEFOUND")).Stdout(ctx)
require.ErrorContains(t, err, `secret env var not found: "NOW..."`)
})
})
t.Run("file", func(t *testing.T) {
t.Run("happy", func(t *testing.T) {
out, err := modGen.With(daggerCall("insecure", "--token", "file:/mysupersecret")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "file shhh", out)
})
t.Run("sad", func(t *testing.T) {
_, err := modGen.With(daggerCall("insecure", "--token", "file:/nowheretobefound")).Stdout(ctx)
require.ErrorContains(t, err, `failed to read secret file "/nowheretobefound": open /nowheretobefound: no such file or directory`)
})
})
t.Run("cmd", func(t *testing.T) {
t.Run("happy", func(t *testing.T) {
out, err := modGen.With(daggerCall("insecure", "--token", "cmd:echo -n cmd shhh")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "cmd shhh", out)
})
t.Run("sad", func(t *testing.T) {
_, err := modGen.With(daggerCall("insecure", "--token", "cmd:exit 1")).Stdout(ctx)
require.ErrorContains(t, err, `failed to run secret command "exit 1": exit status 1`)
})
})
t.Run("invalid source", func(t *testing.T) {
_, err := modGen.With(daggerCall("insecure", "--token", "wtf:HUH")).Stdout(ctx)
require.ErrorContains(t, err, `unsupported secret arg source: "wtf"`)
})
})
t.Run("cache volume args", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
volName := identity.NewID()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type Test struct {}
func (m *Test) Cacher(ctx context.Context, cache *CacheVolume, val string) (string, error) {
return dag.Container().
From("` + alpineImage + `").
WithMountedCache("/cache", cache).
WithExec([]string{"sh", "-c", "echo $0 >> /cache/vals", val}).
WithExec([]string{"cat", "/cache/vals"}).
Stdout(ctx)
}
`,
})
out, err := modGen.With(daggerCall("cacher", "--cache", volName, "--val", "foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "foo\n", out)
out, err = modGen.With(daggerCall("cacher", "--cache", volName, "--val", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "foo\nbar\n", out)
})
}
func TestModuleDaggerCallReturnTypes(t *testing.T) {
t.Parallel()
t.Run("return list objects", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {
Bar int ` + "`" + `json:"bar"` + "`" + `
}
func (m *Minimal) Fn() []*Foo {
var foos []*Foo
for i := 0; i < 3; i++ {
foos = append(foos, &Foo{Bar: i})
}
return foos
}
`,
})
logGen(ctx, t, modGen.Directory("."))
expected := "0\n1\n2\n"
t.Run("print", func(t *testing.T) {
out, err := modGen.With(daggerCall("fn", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, expected, out)
})
t.Run("output", func(t *testing.T) {
out, err := modGen.
With(daggerCall("fn", "bar", "-o", "./outfile")).
File("./outfile").
Contents(ctx)
require.NoError(t, err)
require.Equal(t, expected, out)
})
t.Run("json", func(t *testing.T) {
out, err := modGen.
With(daggerCall("fn", "bar", "--json")).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `[{"bar": 0}, {"bar": 1}, {"bar": 2}]`, out)
})
})
t.Run("return container", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{Ctr: dag.Container().From("alpine:3.18").WithExec([]string{"echo", "hello", "world"})}
}
type Test struct {
Ctr *Container
}
`,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("default", func(t *testing.T) {
ctr := modGen.With(daggerCall("ctr"))
out, err := ctr.Stdout(ctx)
require.NoError(t, err)
require.Empty(t, out)
out, err = ctr.Stderr(ctx)
require.NoError(t, err)
require.Contains(t, out, "Container evaluated")
})
t.Run("output", func(t *testing.T) {
modGen, err := modGen.With(daggerCall("ctr", "-o", "./container.tar")).Sync(ctx)
require.NoError(t, err)
size, err := modGen.File("./container.tar").Size(ctx)
require.NoError(t, err)
require.Greater(t, size, 0)
_, err = modGen.WithExec([]string{"tar", "tf", "./container.tar", "oci-layout"}).Sync(ctx)
require.NoError(t, err)
})
})
t.Run("return directory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
Dir: dag.Directory().WithNewFile("foo.txt", "foo").WithNewFile("bar.txt", "bar"),
}
}
type Test struct {
Dir *Directory
}
`,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("default", func(t *testing.T) {
ctr := modGen.With(daggerCall("dir"))
out, err := ctr.Stdout(ctx)
require.NoError(t, err)
require.Empty(t, out)
out, err = ctr.Stderr(ctx)
require.NoError(t, err)
require.Contains(t, out, "Directory evaluated")
})
t.Run("output", func(t *testing.T) {
modGen, err := modGen.With(daggerCall("dir", "-o", "./outdir")).Sync(ctx)
require.NoError(t, err)
entries, err := modGen.Directory("./outdir").Entries(ctx)
require.NoError(t, err)
require.Equal(t, "bar.txt\nfoo.txt", strings.Join(entries, "\n"))
foo, err := modGen.Directory("./outdir").File("foo.txt").Contents(ctx)
require.NoError(t, err)
require.Equal(t, "foo", foo)
bar, err := modGen.Directory("./outdir").File("bar.txt").Contents(ctx)
require.NoError(t, err)
require.Equal(t, "bar", bar)
})
})
t.Run("return file", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
File: dag.Directory().WithNewFile("foo.txt", "foo").File("foo.txt"),
}
}
type Test struct {
File *File
}
`,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("default", func(t *testing.T) {
ctr := modGen.With(daggerCall("file"))
out, err := ctr.Stdout(ctx)
require.NoError(t, err)
require.Empty(t, out)
out, err = ctr.Stderr(ctx)
require.NoError(t, err)
require.Contains(t, out, "File evaluated")
})
t.Run("output", func(t *testing.T) {
out, err := modGen.
With(daggerCall("file", "-o", "./outfile")).
File("./outfile").
Contents(ctx)
require.NoError(t, err)
require.Equal(t, "foo", out)
})
})
t.Run("sync", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{Ctr: dag.Container().From("alpine:3.18").WithExec([]string{"echo", "hello", "world"})}
}
type Test struct {
Ctr *Container
}
`,
})
// adding sync disables the default behavior of **not** printing the ID
// just verify it works without error for now
_, err := modGen.With(daggerCall("ctr", "sync")).Stdout(ctx)
require.NoError(t, err)
})
}
func TestModuleDaggerCallCoreChaining(t *testing.T) {
t.Parallel()
t.Run("container", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{Ctr: dag.Container().From("alpine:3.18.5")}
}
type Test struct {
Ctr *Container
}
`,
})
t.Run("file", func(t *testing.T) {
out, err := modGen.With(daggerCall("ctr", "file", "--path=/etc/alpine-release", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "3.18.5\n", out)
})
t.Run("export", func(t *testing.T) {
modGen, err := modGen.With(daggerCall("ctr", "export", "--path=./container.tar.gz")).Sync(ctx)
require.NoError(t, err)
size, err := modGen.File("./container.tar.gz").Size(ctx)
require.NoError(t, err)
require.Greater(t, size, 0)
})
})
t.Run("directory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
Dir: dag.Directory().WithNewFile("foo.txt", "foo").WithNewFile("bar.txt", "bar"),
}
}
type Test struct {
Dir *Directory
}
`,
})
t.Run("file", func(t *testing.T) {
out, err := modGen.With(daggerCall("dir", "file", "--path=foo.txt", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "foo", out)
})
t.Run("export", func(t *testing.T) {
modGen, err := modGen.With(daggerCall("dir", "export", "--path=./outdir")).Sync(ctx)
require.NoError(t, err)
ents, err := modGen.Directory("./outdir").Entries(ctx)
require.NoError(t, err)
require.Equal(t, []string{"bar.txt", "foo.txt"}, ents)
})
})
t.Run("return file", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
func New() *Test {
return &Test{
File: dag.Directory().WithNewFile("foo.txt", "foo").File("foo.txt"),
}
}
type Test struct {
File *File
}
`,
})
t.Run("size", func(t *testing.T) {
out, err := modGen.With(daggerCall("file", "size")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "3", out)
})
t.Run("export", func(t *testing.T) {
modGen, err := modGen.With(daggerCall("file", "export", "--path=./outfile")).Sync(ctx)
require.NoError(t, err)
contents, err := modGen.File("./outfile").Contents(ctx)
require.NoError(t, err)
require.Equal(t, "foo", contents)
})
})
}
func TestModuleDaggerCallSaveOutput(t *testing.T) {
// NB: Normal usage is tested in TestModuleDaggerCallReturnTypes.
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct {
}
func (t *Test) Hello() string {
return "hello"
}
func (t *Test) File() *File {
return dag.Directory().WithNewFile("foo.txt", "foo").File("foo.txt")
}
`,
})
logGen(ctx, t, modGen.Directory("."))
t.Run("truncate file", func(t *testing.T) {
out, err := modGen.
WithNewFile("foo.txt", dagger.ContainerWithNewFileOpts{
Contents: "foobar",
}).
With(daggerCall("hello", "-o", "foo.txt")).
File("foo.txt").
Contents(ctx)
require.NoError(t, err)
require.Equal(t, "hello", out)
})
t.Run("not a file", func(t *testing.T) {
_, err := modGen.With(daggerCall("hello", "-o", ".")).Sync(ctx)
require.ErrorContains(t, err, "is a directory")
})
t.Run("allow dir for file", func(t *testing.T) {
out, err := modGen.
With(daggerCall("file", "-o", ".")).
File("foo.txt").
Contents(ctx)
require.NoError(t, err)
require.Equal(t, "foo", out)
})
t.Run("create parent dirs", func(t *testing.T) {
ctr, err := modGen.With(daggerCall("hello", "-o", "foo/bar.txt")).Sync(ctx)
require.NoError(t, err)
t.Run("print success", func(t *testing.T) {
// should print success to stderr so it doesn't interfere with piping output
out, err := ctr.Stderr(ctx)
require.NoError(t, err)
require.Contains(t, out, `Saved output to "/work/foo/bar.txt"`)
})
t.Run("check directory permissions", func(t *testing.T) {
out, err := ctr.WithExec([]string{"stat", "-c", "%a", "foo"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "755\n", out)
})
t.Run("check file permissions", func(t *testing.T) {
out, err := ctr.WithExec([]string{"stat", "-c", "%a", "foo/bar.txt"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "644\n", out)
})
})
t.Run("check umask", func(t *testing.T) {
ctr, err := modGen.
WithNewFile("/entrypoint.sh", dagger.ContainerWithNewFileOpts{
Contents: `#!/bin/sh
umask 027
exec "$@"
`,
Permissions: 0o750,
}).
WithEntrypoint([]string{"/entrypoint.sh"}).
With(daggerCall("hello", "-o", "/tmp/foo/bar.txt")).
Sync(ctx)
require.NoError(t, err)
t.Run("directory", func(t *testing.T) {
out, err := ctr.WithExec([]string{"stat", "-c", "%a", "/tmp/foo"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "750\n", out)
})
t.Run("file", func(t *testing.T) {
out, err := ctr.WithExec([]string{"stat", "-c", "%a", "/tmp/foo/bar.txt"}).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "640\n", out)
})
})
}
func TestModuleCallByName(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/mod-a").
With(daggerExec("init", "--source=.", "--name=mod-a", "--sdk=go")).
WithNewFile("/work/mod-a/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type ModA struct {}
func (m *ModA) Fn(ctx context.Context) string {
return "hi from mod-a"
}
`,
}).
WithWorkdir("/work/mod-b").
With(daggerExec("init", "--source=.", "--name=mod-b", "--sdk=go")).
WithNewFile("/work/mod-b/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type ModB struct {}
func (m *ModB) Fn(ctx context.Context) string {
return "hi from mod-b"
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init")).
With(daggerExec("install", "--name", "foo", "./mod-a")).
With(daggerExec("install", "--name", "bar", "./mod-b"))
out, err := ctr.With(daggerCallAt("foo", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from mod-a", strings.TrimSpace(out))
out, err = ctr.With(daggerCallAt("bar", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from mod-b", strings.TrimSpace(out))
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,623 | Need integ tests for git modules | Right now all our integ tests only use local refs because git modules are locked into github repos and we've been trying to avoid tests depending on modules in an external git repo. However, I think we should just bite the bullet on that at this point since missing that test coverage is too big a gap. | https://github.com/dagger/dagger/issues/6623 | https://github.com/dagger/dagger/pull/6693 | 6a3689eeb680920fe5f830ac972be3dc1fa4f29b | a659c04b9982ef90a999dc20efb9485b11eda556 | "2024-02-08T18:15:16Z" | go | "2024-02-20T10:52:53Z" | core/integration/module_config_test.go | package core
import (
"encoding/json"
"strings"
"testing"
"dagger.io/dagger"
"github.com/dagger/dagger/core/modules"
"github.com/stretchr/testify/require"
)
func TestModuleConfigs(t *testing.T) {
// test dagger.json source configs that aren't inherently covered in other tests
t.Parallel()
t.Run("upgrade from old config", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
baseWithOldConfig := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/foo").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct {}
func (m *Test) Fn() string { return "wowzas" }
`,
}).
WithNewFile("/work/dagger.json", dagger.ContainerWithNewFileOpts{
Contents: `{"name": "test", "sdk": "go", "include": ["foo"], "exclude": ["blah"], "dependencies": ["foo"]}`,
})
// verify develop updates config to new format
baseWithNewConfig := baseWithOldConfig.With(daggerExec("develop"))
confContents, err := baseWithNewConfig.File("dagger.json").Contents(ctx)
require.NoError(t, err)
var modCfg modules.ModuleConfig
require.NoError(t, json.Unmarshal([]byte(confContents), &modCfg))
require.Equal(t, "test", modCfg.Name)
require.Equal(t, "go", modCfg.SDK)
require.Equal(t, []string{"foo"}, modCfg.Include)
require.Equal(t, []string{"blah"}, modCfg.Exclude)
require.Len(t, modCfg.Dependencies, 1)
require.Equal(t, "foo", modCfg.Dependencies[0].Source)
require.Equal(t, "dep", modCfg.Dependencies[0].Name)
require.Equal(t, ".", modCfg.Source)
require.NotEmpty(t, modCfg.EngineVersion) // version changes with any engine change
// verify develop didn't overwrite main.go
out, err := baseWithNewConfig.With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "wowzas", strings.TrimSpace(out))
// verify call works seamlessly even without explicit sync yet
out, err = baseWithOldConfig.With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "wowzas", strings.TrimSpace(out))
})
t.Run("dep has separate config", func(t *testing.T) {
// Verify that if a local dep has its own dagger.json, that's used to load it correctly.
t.Parallel()
c, ctx := connect(t)
base := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/subdir/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("/work/subdir/dep/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) DepFn(ctx context.Context, str string) string { return str }
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=test", "--name=test", "--sdk=go", "test")).
With(daggerExec("install", "-m=test", "./subdir/dep")).
WithNewFile("/work/test/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) (string, error) { return dag.Dep().DepFn(ctx, "hi dep") }
`,
})
// try invoking it from a few different paths, just for more corner case coverage
t.Run("from src dir", func(t *testing.T) {
t.Parallel()
out, err := base.WithWorkdir("test").With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
t.Run("from src root", func(t *testing.T) {
t.Parallel()
out, err := base.With(daggerCallAt("test", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
t.Run("from root", func(t *testing.T) {
t.Parallel()
out, err := base.WithWorkdir("/").With(daggerCallAt("work/test", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
t.Run("from dep parent", func(t *testing.T) {
t.Parallel()
out, err := base.WithWorkdir("/work/subdir").With(daggerCallAt("../test", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
t.Run("from dep dir", func(t *testing.T) {
t.Parallel()
out, err := base.WithWorkdir("/work/subdir/dep").With(daggerCallAt("../../test", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
})
t.Run("install dep from weird places", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
base := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=subdir/dep", "--name=dep", "--sdk=go", "subdir/dep")).
WithNewFile("/work/subdir/dep/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) DepFn(ctx context.Context, str string) string { return str }
`,
}).
With(daggerExec("init", "--source=test", "--name=test", "--sdk=go", "test")).
WithNewFile("/work/test/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) (string, error) { return dag.Dep().DepFn(ctx, "hi dep") }
`,
})
t.Run("from src dir", func(t *testing.T) {
// sanity test normal case
t.Parallel()
out, err := base.
WithWorkdir("/work/test").
With(daggerExec("install", "../subdir/dep")).
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
t.Run("from root", func(t *testing.T) {
t.Parallel()
out, err := base.
WithWorkdir("/").
With(daggerExec("install", "-m=./work/test", "./work/subdir/dep")).
WithWorkdir("/work/test").
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
t.Run("from dep", func(t *testing.T) {
t.Parallel()
out, err := base.
WithWorkdir("/work/subdir/dep").
With(daggerExec("install", "-m=../../test", ".")).
WithWorkdir("/work/test").
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
t.Run("from random place", func(t *testing.T) {
t.Parallel()
out, err := base.
WithWorkdir("/var").
With(daggerExec("install", "-m=../work/test", "../work/subdir/dep")).
WithWorkdir("/work/test").
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi dep", strings.TrimSpace(out))
})
})
t.Run("install out of tree dep fails", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
base := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/play/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=go"))
t.Run("from src dir", func(t *testing.T) {
t.Parallel()
_, err := base.
WithWorkdir("/work/test").
With(daggerExec("install", "../../play/dep")).
Sync(ctx)
require.ErrorContains(t, err, `local module dep source path "../play/dep" escapes context "/work"`)
})
t.Run("from dep dir", func(t *testing.T) {
t.Parallel()
_, err := base.
WithWorkdir("/play/dep").
With(daggerExec("install", "-m=../../work/test", ".")).
Sync(ctx)
require.ErrorContains(t, err, `module dep source path "../play/dep" escapes context "/work"`)
})
t.Run("from root", func(t *testing.T) {
t.Parallel()
_, err := base.
WithWorkdir("/").
With(daggerExec("install", "-m=work/test", "play/dep")).
Sync(ctx)
require.ErrorContains(t, err, `module dep source path "../play/dep" escapes context "/work"`)
})
})
t.Run("malicious config", func(t *testing.T) {
// verify a maliciously/incorrectly constructed dagger.json is still handled correctly
t.Parallel()
c, ctx := connect(t)
base := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("/work/dep/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) GetSource(ctx context.Context) *Directory {
return dag.CurrentModule().Source()
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go"))
t.Run("source points out of root", func(t *testing.T) {
t.Parallel()
base := base.
With(configFile(".", &modules.ModuleConfig{
Name: "evil",
SDK: "go",
Source: "..",
}))
_, err := base.With(daggerCall("container-echo", "--string-arg", "plz fail")).Sync(ctx)
require.ErrorContains(t, err, `local module source path ".." escapes context "/work"`)
_, err = base.With(daggerExec("develop")).Sync(ctx)
require.ErrorContains(t, err, `local module source path ".." escapes context "/work"`)
_, err = base.With(daggerExec("install", "./dep")).Sync(ctx)
require.ErrorContains(t, err, `local module source path ".." escapes context "/work"`)
})
t.Run("dep points out of root", func(t *testing.T) {
t.Parallel()
base := base.
With(configFile(".", &modules.ModuleConfig{
Name: "evil",
SDK: "go",
Dependencies: []*modules.ModuleConfigDependency{{
Name: "escape",
Source: "..",
}},
}))
_, err := base.With(daggerCall("container-echo", "--string-arg", "plz fail")).Sync(ctx)
require.ErrorContains(t, err, `local module dep source path ".." escapes context "/work"`)
_, err = base.With(daggerExec("develop")).Sync(ctx)
require.ErrorContains(t, err, `local module dep source path ".." escapes context "/work"`)
_, err = base.With(daggerExec("install", "./dep")).Sync(ctx)
require.ErrorContains(t, err, `local module dep source path ".." escapes context "/work"`)
})
})
}
func TestModuleCustomDepNames(t *testing.T) {
t.Parallel()
t.Run("basic", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("/work/dep/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) DepFn(ctx context.Context) string {
return "hi from dep"
}
func (m *Dep) GetDepObj(ctx context.Context) *DepObj {
return &DepObj{Str: "yo from dep"}
}
type DepObj struct {
Str string
}
func (m *Dep) GetOtherObj(ctx context.Context) *OtherObj {
return &OtherObj{Str: "hey from dep"}
}
type OtherObj struct {
Str string
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
With(daggerExec("install", "--name", "foo", "./dep")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) (string, error) {
return dag.Foo().DepFn(ctx)
}
func (m *Test) GetObj(ctx context.Context) (string, error) {
var obj *FooObj
obj = dag.Foo().GetDepObj()
return obj.Str(ctx)
}
func (m *Test) GetOtherObj(ctx context.Context) (string, error) {
var obj *FooOtherObj
obj = dag.Foo().GetOtherObj()
return obj.Str(ctx)
}
func (m *Test) GetConflictNameObj(ctx context.Context) *Dep {
return &Dep{Str: "it worked?"}
}
// should not be any name conflict with dep
type Dep struct {
Str string
}
`,
})
out, err := ctr.With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from dep", strings.TrimSpace(out))
out, err = ctr.With(daggerCall("get-obj")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "yo from dep", strings.TrimSpace(out))
out, err = ctr.With(daggerCall("get-other-obj")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hey from dep", strings.TrimSpace(out))
out, err = ctr.With(daggerCall("get-conflict-name-obj", "str")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "it worked?", strings.TrimSpace(out))
})
t.Run("same mod name as dep", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/dep/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) string {
return "hi from dep"
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
With(daggerExec("install", "--name", "foo", "./dep")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) (string, error) {
return dag.Foo().Fn(ctx)
}
`,
})
out, err := ctr.With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from dep", strings.TrimSpace(out))
})
t.Run("two deps with same name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep1").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("/work/dep1/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) Fn(ctx context.Context) string {
return "hi from dep1"
}
`,
}).
WithWorkdir("/work/dep2").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("/work/dep2/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) Fn(ctx context.Context) string {
return "hi from dep2"
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
With(daggerExec("install", "--name", "foo", "./dep1")).
With(daggerExec("install", "--name", "bar", "./dep2")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) (string, error) {
dep1, err := dag.Foo().Fn(ctx)
if err != nil {
return "", err
}
dep2, err := dag.Bar().Fn(ctx)
if err != nil {
return "", err
}
return dep1 + " " + dep2, nil
}
`,
})
out, err := ctr.With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from dep1 hi from dep2", strings.TrimSpace(out))
})
}
func TestModuleDaggerInit(t *testing.T) {
t.Parallel()
t.Run("name defaults to source root dir name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=coolmod", "--sdk=go", "coolmod")).
WithNewFile("/work/coolmod/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Coolmod struct {}
func (m *Coolmod) Fn(ctx context.Context) (string, error) {
return dag.CurrentModule().Name(ctx)
}
`,
}).
With(daggerCallAt("coolmod", "fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "coolmod", strings.TrimSpace(out))
})
t.Run("source dir default", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
for _, tc := range []struct {
sdk string
sourceDirEnt string
}{
{
sdk: "go",
sourceDirEnt: "main.go",
},
{
sdk: "python",
sourceDirEnt: "src",
},
{
sdk: "typescript",
sourceDirEnt: "src",
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
srcRootDir := ctr.
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
Directory(".")
srcRootEnts, err := srcRootDir.Entries(ctx)
require.NoError(t, err)
require.Contains(t, srcRootEnts, "dagger.json")
require.NotContains(t, srcRootEnts, tc.sourceDirEnt)
srcDirEnts, err := srcRootDir.Directory("dagger").Entries(ctx)
require.NoError(t, err)
require.Contains(t, srcDirEnts, tc.sourceDirEnt)
})
}
})
t.Run("source is made rel to source root by engine", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithWorkdir("/var").
With(daggerExec("init", "--source=../work/some/subdir", "--name=test", "--sdk=go", "../work")).
With(daggerCallAt("../work", "container-echo", "--string-arg", "yo", "stdout"))
out, err := ctr.Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "yo", strings.TrimSpace(out))
ents, err := ctr.Directory("/work/some/subdir").Entries(ctx)
require.NoError(t, err)
require.Contains(t, ents, "main.go")
})
}
func TestModuleDaggerDevelop(t *testing.T) {
t.Parallel()
t.Run("name and sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("/work/dep/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) Fn(ctx context.Context) string {
return "hi from dep"
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init")).
With(daggerExec("install", "./dep"))
// should be able to invoke dep without name+sdk set yet
out, err := ctr.With(daggerCallAt("dep", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from dep", strings.TrimSpace(out))
// now add an sdk+source
ctr = ctr.
With(daggerExec("develop", "--sdk", "go", "--source", "cool/subdir")).
WithNewFile("/work/cool/subdir/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Work struct {}
func (m *Work) Fn(ctx context.Context) (string, error) {
depStr, err := dag.Dep().Fn(ctx)
if err != nil {
return "", err
}
return "hi from work " + depStr, nil
}
`,
})
// should be able to invoke it directly now
out, err = ctr.With(daggerCall("fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from work hi from dep", strings.TrimSpace(out))
// currently, we don't support renaming or re-sdking a module, make sure that errors comprehensibly
_, err = ctr.With(daggerExec("develop", "--sdk", "python")).Sync(ctx)
require.ErrorContains(t, err, `cannot update module SDK that has already been set to "go"`)
_, err = ctr.With(daggerExec("develop", "--source", "blahblahblaha/blah")).Sync(ctx)
require.ErrorContains(t, err, `cannot update module source path that has already been set to "cool/subdir"`)
})
t.Run("source is made rel to source root by engine", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("/work/dep/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Dep struct {}
func (m *Dep) Fn(ctx context.Context) string {
return "hi from dep"
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init")).
With(daggerExec("install", "./dep")).
WithWorkdir("/var").
With(daggerExec("develop", "-m", "../work", "--source=../work/some/subdir", "--sdk=go")).
WithNewFile("/work/some/subdir/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Work struct {}
func (m *Work) Fn(ctx context.Context) (string, error) {
depStr, err := dag.Dep().Fn(ctx)
if err != nil {
return "", err
}
return "hi from work " + depStr, nil
}
`,
})
out, err := ctr.With(daggerCallAt("../work", "fn")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "hi from work hi from dep", strings.TrimSpace(out))
ents, err := ctr.Directory("/work/some/subdir").Entries(ctx)
require.NoError(t, err)
require.Contains(t, ents, "main.go")
})
}
func TestModuleDaggerConfig(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk=go", "test")).
With(daggerExec("config", "-m", "test")).
Stdout(ctx)
require.NoError(t, err)
require.Regexp(t, `Name:\s+test`, out)
require.Regexp(t, `SDK:\s+go`, out)
require.Regexp(t, `Root Directory:\s+/work`, out)
require.Regexp(t, `Source Directory:\s+/work/test`, out)
}
func TestModuleIncludeExclude(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
sdk string
mainSource string
customSDKSource string
customSDKUnderlyingSDK string
}{
{
sdk: "go",
mainSource: `package main
type Test struct {}
func (m *Test) Fn() *Directory {
return dag.CurrentModule().Source()
}
`,
},
{
sdk: "python",
mainSource: `import dagger
from dagger import dag, function, object_type
@object_type
class Test:
@function
def fn(self) -> dagger.Directory:
return dag.current_module().source()
`,
},
{
sdk: "typescript",
mainSource: `
import { dag, Directory, object, func } from "@dagger.io/dagger"
@object()
class Test {
@func()
fn(): Directory {
return dag.currentModule().source()
}
}`,
},
{
sdk: "coolsdk",
mainSource: `package main
type Test struct {}
func (m *Test) Fn() *Directory {
return dag.CurrentModule().Source()
}
`,
customSDKUnderlyingSDK: "go",
customSDKSource: `package main
type Coolsdk struct {}
func (m *Coolsdk) ModuleRuntime(modSource *ModuleSource, introspectionJson string) *Container {
return modSource.WithSDK("go").AsModule().Runtime().WithEnvVariable("COOL", "true")
}
func (m *Coolsdk) Codegen(modSource *ModuleSource, introspectionJson string) *GeneratedCode {
return dag.GeneratedCode(modSource.WithSDK("go").AsModule().GeneratedContextDirectory())
}
func (m *Coolsdk) RequiredPaths() []string {
return []string{
"**/go.mod",
"**/go.sum",
"**/go.work",
"**/go.work.sum",
"**/vendor/",
"**/*.go",
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
// special case custom sdk
if tc.customSDKSource != "" {
ctr = ctr.
WithWorkdir("/work/" + tc.sdk).
With(daggerExec("init", "--name="+tc.sdk, "--sdk="+tc.customSDKUnderlyingSDK)).
With(sdkSource(tc.customSDKUnderlyingSDK, tc.customSDKSource)).
WithWorkdir("/work")
}
ctr = ctr.With(daggerExec("init", "--name=test", "--sdk="+tc.sdk))
if tc.customSDKSource != "" {
// TODO: hardcoding that underlying sdk is go right now, could be generalized
ctr = ctr.WithNewFile("dagger/main.go", dagger.ContainerWithNewFileOpts{
Contents: tc.mainSource,
})
} else {
ctr = ctr.With(sdkSource(tc.sdk, tc.mainSource))
}
// TODO: use cli to configure include/exclude once supported
ctr = ctr.
With(configFile(".", &modules.ModuleConfig{
Name: "test",
SDK: tc.sdk,
Include: []string{"dagger/subdir/keepdir"},
Exclude: []string{"dagger/subdir/keepdir/rmdir"},
Source: "dagger",
})).
WithDirectory("dagger/subdir/keepdir/rmdir", c.Directory())
// call should work even though dagger.json and main source files weren't
// explicitly included
out, err := ctr.
With(daggerCall("fn", "directory", "--path", "subdir", "entries")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "keepdir", strings.TrimSpace(out))
out, err = ctr.
With(daggerCall("fn", "directory", "--path", "subdir/keepdir", "entries")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "", strings.TrimSpace(out))
// call should also work from other directories
out, err = ctr.
WithWorkdir("/mnt").
With(daggerCallAt("../work", "fn", "directory", "--path", "subdir", "entries")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "keepdir", strings.TrimSpace(out))
// call should still work after develop
ctr = ctr.With(daggerExec("develop"))
out, err = ctr.
With(daggerCall("fn", "directory", "--path", "subdir", "entries")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "keepdir", strings.TrimSpace(out))
out, err = ctr.
With(daggerCall("fn", "directory", "--path", "subdir/keepdir", "entries")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "", strings.TrimSpace(out))
})
}
}
// verify that if there is no local .git in parent dirs then the context defaults to the source root
func TestModuleContextDefaultsToSourceRoot(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/coolsdk").
With(daggerExec("init", "--source=.", "--name=cool-sdk", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type CoolSdk struct {}
func (m *CoolSdk) ModuleRuntime(modSource *ModuleSource, introspectionJson string) *Container {
return modSource.WithSDK("go").AsModule().Runtime().
WithMountedDirectory("/da-context", modSource.ContextDirectory())
}
func (m *CoolSdk) Codegen(modSource *ModuleSource, introspectionJson string) *GeneratedCode {
return dag.GeneratedCode(modSource.WithSDK("go").AsModule().GeneratedContextDirectory())
}
func (m *CoolSdk) RequiredPaths() []string {
return []string{
"**/go.mod",
"**/go.sum",
"**/go.work",
"**/go.work.sum",
"**/vendor/",
"**/*.go",
}
}
`,
}).
WithWorkdir("/work").
WithNewFile("random-file").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=coolsdk")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "os"
type Test struct {}
func (m *Test) Fn() ([]string, error) {
ents, err := os.ReadDir("/da-context")
if err != nil {
return nil, err
}
var names []string
for _, ent := range ents {
names = append(names, ent.Name())
}
return names, nil
}
`,
})
out, err := ctr.
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Contains(t, strings.TrimSpace(out), "random-file")
}
func TestModuleDaggerInstallGit(t *testing.T) {
/*
TODO: this is a stopgap test to get some basic coverage of installing modules
from git refs. Ideally it would rely on our own repo for of test fixtures but
those have not been setup yet: https://github.com/dagger/dagger/issues/6623
*/
t.Parallel()
c, ctx := connect(t)
_, err := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk=go")).
With(daggerExec("install", "github.com/sagikazarmark/daggerverse/archivist@bedfa0c8bdba7192c65c21b5e88a48b600666fcc")).
Sync(ctx)
require.NoError(t, err)
c.ModuleSource("github.com/sagikazarmark/daggerverse/archivist@bedfa0c8bdba7192c65c21b5e88a48b600666fcc").
AsGitSource().
HTMLURL(ctx)
}
func TestModuleDaggerGitRefs(t *testing.T) {
/*
TODO: this is a stopgap test to get some basic coverage of installing modules
from git refs. Ideally it would rely on our own repo for of test fixtures but
those have not been setup yet: https://github.com/dagger/dagger/issues/6623
*/
t.Parallel()
c, ctx := connect(t)
htmlURL, err := c.ModuleSource("github.com/sagikazarmark/daggerverse/archivist@bedfa0c8bdba7192c65c21b5e88a48b600666fcc").
AsGitSource().
HTMLURL(ctx)
require.NoError(t, err)
require.Equal(t, "https://github.com/sagikazarmark/daggerverse/tree/bedfa0c8bdba7192c65c21b5e88a48b600666fcc/archivist", htmlURL)
}
func TestModuleDaggerCallGit(t *testing.T) {
/*
TODO: this is a stopgap test to get some basic coverage of installing modules
from git refs. Ideally it would rely on our own repo for of test fixtures but
those have not been setup yet: https://github.com/dagger/dagger/issues/6623
*/
t.Parallel()
c, ctx := connect(t)
out, err := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk=go")).
With(daggerExec("install", "github.com/jedevc/shykes-daggerverse/hello@06e224b789a9c339e10e9fc46833ba96397dcc63")).
With(daggerExec("-m", "hello", "functions")).
Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, "hello")
require.Contains(t, out, "Say hello to the world!")
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,623 | Need integ tests for git modules | Right now all our integ tests only use local refs because git modules are locked into github repos and we've been trying to avoid tests depending on modules in an external git repo. However, I think we should just bite the bullet on that at this point since missing that test coverage is too big a gap. | https://github.com/dagger/dagger/issues/6623 | https://github.com/dagger/dagger/pull/6693 | 6a3689eeb680920fe5f830ac972be3dc1fa4f29b | a659c04b9982ef90a999dc20efb9485b11eda556 | "2024-02-08T18:15:16Z" | go | "2024-02-20T10:52:53Z" | core/integration/module_test.go | package core
import (
"context"
_ "embed"
"encoding/json"
"fmt"
"go/format"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"time"
"github.com/MakeNowJust/heredoc/v2"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/dagql/idproto"
"github.com/iancoleman/strcase"
"github.com/moby/buildkit/identity"
"github.com/stretchr/testify/require"
"github.com/tidwall/gjson"
"golang.org/x/sync/errgroup"
"dagger.io/dagger"
"github.com/dagger/dagger/cmd/codegen/introspection"
)
func TestModuleGoInit(t *testing.T) {
t.Parallel()
t.Run("from scratch", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=bare", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("reserved go.mod name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=go", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{go{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"go":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("uses expected Go module name, camel-cases Dagger module name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=My-Module", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{myModule{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"myModule":{"containerEcho":{"stdout":"hello\n"}}}`, out)
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
t.Run("creates go.mod beneath an existing go.mod if context is beneath it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
// don't use .git under /work so the context ends up being /work/ci
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/go.mod", dagger.ContainerWithNewFileOpts{
Contents: "module example.com/test\n",
}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/ci").
With(daggerExec("init", "--name=beneathGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{beneathGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"beneathGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("names Go module after Dagger module", func(t *testing.T) {
generated, err := modGen.Directory("dagger").File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
})
t.Run("respects existing go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("preserves module name", func(t *testing.T) {
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module example.com/test")
})
})
t.Run("respects existing go.work", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithExec([]string{"go", "work", "init"}).
WithExec([]string{"go", "work", "use", "."}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("go.work is edited", func(t *testing.T) {
generated, err := modGen.File("go.work").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "\t.\n")
require.Contains(t, generated, "\t./dagger\n")
})
})
t.Run("ignores go.work for subdir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithExec([]string{"go", "work", "init"}).
WithExec([]string{"go", "work", "use", "."}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go", "subdir"))
// we can't write to the go.work at the top-level so it should remain
// unedited, but we should still be able to execute the module as
// expected
out, err := modGen.
WithWorkdir("./subdir").
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("go.work is unedited", func(t *testing.T) {
generated, err := modGen.File("go.work").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "use .\n")
})
})
t.Run("respects parent go.mod if root points to it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
With(daggerExec("init", "--name=child", "--sdk=go", "./child")).
WithWorkdir("/work/child").
// explicitly develop to see whether it makes a go.mod
With(daggerExec("develop")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
require.Equal(t, []string{".git", "child", "foo.go", "go.mod", "go.sum"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.NotContains(t, childEntries, "go.mod")
t.Run("preserves parent module name", func(t *testing.T) {
goMod, err := generated.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, goMod, "module example.com/test")
})
})
t.Run("respects existing go.mod even if root points to parent that has go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"}).
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/child").
WithExec([]string{"go", "mod", "init", "my-mod"}).
WithWorkdir("/work").
With(daggerExec("init", "--source=./child", "--name=child", "--sdk=go", "./child")).
WithWorkdir("/work/child").
// explicitly develop to see whether it makes a go.mod
With(daggerExec("develop")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
// no go.sum
require.Equal(t, []string{".git", "child", "foo.go", "go.mod"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.Contains(t, childEntries, "go.mod")
require.Contains(t, childEntries, "go.sum")
})
t.Run("respects existing main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasMainGo struct {}
func (m *HasMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("init", "--name=hasMainGo", "--sdk=go", "--source=."))
out, err := modGen.
With(daggerQuery(`{hasMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("respects existing main.go even if it uses types not generated yet", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasDaggerTypes struct {}
func (m *HasDaggerTypes) Hello() *Container {
return dag.Container().
From("` + alpineImage + `").
WithExec([]string{"echo", "Hello, world!"})
}
`,
}).
With(daggerExec("init", "--source=.", "--name=hasDaggerTypes", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasDaggerTypes{hello{stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasDaggerTypes":{"hello":{"stdout":"Hello, world!\n"}}}`, out)
})
t.Run("respects existing package without creating main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/notmain.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type HasNotMainGo struct {}
func (m *HasNotMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("init", "--source=.", "--name=hasNotMainGo", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasNotMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasNotMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("with source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=bare", "--sdk=go", "--source=some/subdir"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
sourceSubdirEnts, err := modGen.Directory("/work/some/subdir").Entries(ctx)
require.NoError(t, err)
require.Contains(t, sourceSubdirEnts, "main.go")
sourceRootEnts, err := modGen.Directory("/work").Entries(ctx)
require.NoError(t, err)
require.NotContains(t, sourceRootEnts, "main.go")
})
}
func TestModuleInitLICENSE(t *testing.T) {
t.Run("bootstraps Apache-2.0 LICENSE file if none found", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("creates LICENSE file in the directory specified by arg", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "./mymod"))
content, err := modGen.File("mymod/LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("does not bootstrap LICENSE file if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go"))
_, err := modGen.File("LICENSE").Contents(ctx)
require.Error(t, err)
})
t.Run("bootstraps a LICENSE file when requested, even if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "--license=MIT"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "MIT License")
})
}
func TestModuleGit(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
gitGeneratedFiles []string
gitIgnoredFiles []string
}
for _, tc := range []testCase{
{
sdk: "go",
gitGeneratedFiles: []string{
"/dagger.gen.go",
"/querybuilder/**",
},
},
{
sdk: "python",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
{
sdk: "typescript",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
} {
tc := tc
t.Run(fmt.Sprintf("module %s git", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
With(daggerExec("init", "--name=bare", "--sdk="+tc.sdk))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("configures .gitattributes", func(t *testing.T) {
ignore, err := modGen.File(".gitattributes").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitGeneratedFiles {
require.Contains(t, ignore, fmt.Sprintf("%s linguist-generated\n", fileName))
}
})
if len(tc.gitIgnoredFiles) > 0 {
t.Run("configures .gitignore", func(t *testing.T) {
ignore, err := modGen.File(".gitignore").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitIgnoredFiles {
require.Contains(t, ignore, fileName)
}
})
}
})
}
}
//go:embed testdata/modules/go/minimal/main.go
var goSignatures string
func TestModuleGoSignatures(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
t.Run("func Hello() string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello"}}`, out)
})
t.Run("func Echo(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echo(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echo":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointer(*string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointerPointer(**string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointerPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointerPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoOptional(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptional(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalPointer(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalPointer}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalSlice([]string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalSlice(msg: ["hello", "there"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"hello+there...hello+there...hello+there..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalSlice}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"foobar...foobar...foobar..."}}`, out)
})
t.Run("func Echoes([]string) []string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoes(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoes":["hello...hello...hello..."]}}`, out)
})
t.Run("func EchoesVariadic(...string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoesVariadic(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoesVariadic":"hello...hello...hello..."}}`, out)
})
t.Run("func HelloContext(context.Context) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloContext}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloContext":"hello context"}}`, out)
})
t.Run("func EchoContext(context.Context, string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoContext(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoContext":"ctx.hello...ctx.hello...ctx.hello..."}}`, out)
})
t.Run("func HelloStringError() (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloStringError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloStringError":"hello i worked"}}`, out)
})
t.Run("func HelloVoid()", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoid}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoid":null}}`, out)
})
t.Run("func HelloVoidError() error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoidError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoidError":null}}`, out)
})
t.Run("func EchoOpts(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInline(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlinePointer(*struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineCtx(ctx, struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineTags(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsPragmas(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsPragmas(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsPragmas":"hi...hi...hi..."}}`, out)
})
}
func TestModuleGoSignaturesBuiltinTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("dagger/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Minimal struct {}
func (m *Minimal) Read(ctx context.Context, dir Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadPointer(ctx context.Context, dir *Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadSlice(ctx context.Context, dir []Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadVariadic(ctx context.Context, dir ...Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadOptional(
ctx context.Context,
dir *Directory, // +optional
) (string, error) {
if dir != nil {
return dir.File("foo").Contents(ctx)
}
return "", nil
}
`,
})
out, err := modGen.With(daggerQuery(`{directory{withNewFile(path: "foo", contents: "bar"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
dirID := gjson.Get(out, "directory.withNewFile.id").String()
t.Run("func Read(ctx, Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{read(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"read":"bar"}}`, out)
})
t.Run("func ReadPointer(ctx, *Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readPointer(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readPointer":"bar"}}`, out)
})
t.Run("func ReadSlice(ctx, []Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readSlice(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readSlice":"bar"}}`, out)
})
t.Run("func ReadVariadic(ctx, ...Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readVariadic(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readVariadic":"bar"}}`, out)
})
t.Run("func ReadOptional(ctx, Optional[Directory]) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readOptional(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":"bar"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{readOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":""}}`, out)
})
}
func TestModuleGoSignaturesUnexported(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) string {
return name
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
objs := inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 1, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
objs = inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 2, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
require.Equal(t, "MinimalFoo", objs.Get("1.name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {
Bar bar
}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
_, err := modGen.With(moduleIntrospection).Stderr(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "cannot code-generate unexported type bar")
}
func TestModuleGoSignaturesMixMatch(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
func (m *Minimal) Hello(name string, opts struct{}, opts2 struct{}) string {
return name
}
`,
})
_, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "nested structs are not supported")
}
func TestModuleGoSignaturesNameConflict(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {
Foo Foo
Bar Bar
Baz Baz
}
type Foo struct {}
type Bar struct {}
type Baz struct {}
func (m *Foo) Hello(name string) string {
return name
}
func (f *Bar) Hello(name string, name2 string) string {
return name + name2
}
func (b *Baz) Hello() (string, error) {
return "", nil
}
`,
})
objs := inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 4, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
require.Equal(t, "MinimalFoo", objs.Get("1.name").String())
require.Equal(t, "MinimalBar", objs.Get("2.name").String())
require.Equal(t, "MinimalBaz", objs.Get("3.name").String())
}
func TestModuleGoDocs(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
logGen(ctx, t, modGen.Directory("."))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Empty(t, hello.Get("description").String())
require.Empty(t, hello.Get("args").Array())
// test the args-based form
echoOpts := obj.Get(`functions.#(name="echoOpts")`)
require.Equal(t, "echoOpts", echoOpts.Get("name").String())
require.Equal(t, "EchoOpts does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the inline struct form
echoOpts = obj.Get(`functions.#(name="echoOptsInline")`)
require.Equal(t, "echoOptsInline", echoOpts.Get("name").String())
require.Equal(t, "EchoOptsInline does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the arg-based form (with pragmas)
echoOpts = obj.Get(`functions.#(name="echoOptsPragmas")`)
require.Equal(t, "echoOptsPragmas", echoOpts.Get("name").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "", echoOpts.Get("args.0.defaultValue").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "\"...\"", echoOpts.Get("args.1.defaultValue").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "3", echoOpts.Get("args.2.defaultValue").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
}
func TestModuleGoDocsEdgeCases(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
// Minimal is a thing
type Minimal struct {
// X is this
X, Y string // Y is not this
// +private
Z string
}
// some docs
func (m *Minimal) Hello(foo string, bar string,
// hello
baz string, qux string, x string, // lol
) string {
return foo + bar
}
func (m *Minimal) HelloMore(
// foo here
foo,
// bar here
bar string,
) string {
return foo + bar
}
func (m *Minimal) HelloMoreInline(opts struct{
// foo here
foo, bar string
}) string {
return opts.foo + opts.bar
}
func (m *Minimal) HelloAgain( // docs for helloagain
foo string,
bar string, // docs for bar
baz string,
) string {
return foo + bar
}
func (m *Minimal) HelloFinal(
foo string) string { // woops
return foo
}
`,
})
logGen(ctx, t, modGen.Directory("."))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Equal(t, "Minimal is a thing", obj.Get("description").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 5)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "hello", hello.Get("args.2.description").String())
require.Equal(t, "qux", hello.Get("args.3.name").String())
require.Equal(t, "", hello.Get("args.3.description").String())
require.Equal(t, "x", hello.Get("args.4.name").String())
require.Equal(t, "lol", hello.Get("args.4.description").String())
hello = obj.Get(`functions.#(name="helloMore")`)
require.Equal(t, "helloMore", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "bar here", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloMoreInline")`)
require.Equal(t, "helloMoreInline", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloAgain")`)
require.Equal(t, "helloAgain", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 3)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "docs for bar", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "", hello.Get("args.2.description").String())
hello = obj.Get(`functions.#(name="helloFinal")`)
require.Equal(t, "helloFinal", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 1)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Len(t, obj.Get(`fields`).Array(), 2)
prop := obj.Get(`fields.#(name="x")`)
require.Equal(t, "x", prop.Get("name").String())
require.Equal(t, "X is this", prop.Get("description").String())
prop = obj.Get(`fields.#(name="y")`)
require.Equal(t, "y", prop.Get("name").String())
require.Equal(t, "", prop.Get("description").String())
}
func TestModuleGoWeirdFields(t *testing.T) {
// these are all cases that used to panic due to the disparity in the type spec and the ast
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Z string
type Minimal struct {
// field with single (normal) name
W string
// field with multiple names
X, Y string
// field with no names
Z
}
func New() Minimal {
return Minimal{
W: "-",
X: "-",
Y: "-",
Z: Z("-"),
}
}
// struct with no fields
type Bar struct{}
func (m *Minimal) Say(
// field with single (normal) name
a string,
// field with multiple names
b, c string,
// field with no names (not included, mixed names not allowed)
// string
) string {
return a + " " + b + " " + c
}
func (m *Minimal) Hello(
// field with no names
string,
) string {
return "hello"
}
func (m *Minimal) SayOpts(opts struct{
// field with single (normal) name
A string
// field with multiple names
B, C string
// field with no names (not included because of above)
// string
}) string {
return opts.A + " " + opts.B + " " + opts.C
}
func (m *Minimal) HelloOpts(opts struct{
// field with no names
string
}) string {
return "hello"
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{w, x, y, z}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"w": "-", "x": "-", "y": "-", "z": "-"}}`, out)
for _, name := range []string{"say", "sayOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(a: "hello", b: "world", c: "!")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello world !"}}`, name), out)
}
for _, name := range []string{"hello", "helloOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(string: "")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello"}}`, name), out)
}
}
func TestModuleGoFieldMustBeNil(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "fmt"
type Minimal struct {
Src *Directory
Name *string
}
func New() *Minimal {
return &Minimal{}
}
func (m *Minimal) IsEmpty() bool {
if m.Name != nil {
panic(fmt.Sprintf("name should be nil but is %v", m.Name))
}
if m.Src != nil {
panic(fmt.Sprintf("src should be nil but is %v", m.Src))
}
return true
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{isEmpty}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"isEmpty": true}}`, out)
}
func TestModuleDescription(t *testing.T) {
t.Parallel()
type source struct {
file string
contents string
}
for _, tc := range []struct {
sdk string
sources []source
}{
{
sdk: "go",
sources: []source{
{
file: "main.go",
contents: `
// Test module, short description
//
// Long description, with full sentences.
package main
// Test object, short description
type Test struct {
// +default="foo"
Foo string
}
`,
},
},
},
{
sdk: "go",
sources: []source{
{
file: "a.go",
contents: `
// First, but not main
package main
type Foo struct {}
`,
},
{
file: "z.go",
contents: `
// Test module, short description
//
// Long description, with full sentences.
package main
// Test object, short description
type Test struct {
}
func (*Test) Foo() Foo {
return Foo{}
}
`,
},
},
},
{
sdk: "python",
sources: []source{
{
file: "src/main.py",
contents: `
"""Test module, short description
Long description, with full sentences.
"""
from dagger import field, object_type
@object_type
class Test:
"""Test object, short description"""
foo: str = field(default="foo")
`,
},
},
},
{
sdk: "python",
sources: []source{
{
file: "src/main/foo.py",
contents: `
"""Not the main file"""
from dagger import field, object_type
@object_type
class Foo:
bar: str = field(default="bar")
`,
},
{
file: "src/main/__init__.py",
contents: `
"""Test module, short description
Long description, with full sentences.
"""
from dagger import function, object_type
from .foo import Foo
@object_type
class Test:
"""Test object, short description"""
foo = function(Foo)
`,
},
},
},
{
sdk: "typescript",
sources: []source{
{
file: "src/index.ts",
contents: `
/**
* Test module, short description
*
* Long description, with full sentences.
*/
import { object, field } from '@dagger.io/dagger'
/**
* Test object, short description
*/
@object()
class Test {
@field()
foo: string = "foo"
}
`,
},
},
},
{
sdk: "typescript",
sources: []source{
{
file: "src/foo.ts",
contents: `
/**
* Not the main file
*/
import { object, field } from '@dagger.io/dagger'
@object()
export class Foo {
@field()
bar = "bar"
}
`,
},
{
file: "src/index.ts",
contents: `
/**
* Test module, short description
*
* Long description, with full sentences.
*/
import { object, field } from '@dagger.io/dagger'
import { Foo } from "./foo"
/**
* Test object, short description
*/
@object()
class Test {
@func()
foo(): Foo {
return new Foo()
}
}
`,
},
},
},
} {
tc := tc
t.Run(fmt.Sprintf("%s with %d files", tc.sdk, len(tc.sources)), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
for _, src := range tc.sources {
src := src
modGen = modGen.WithNewFile(src.file, dagger.ContainerWithNewFileOpts{
Contents: heredoc.Doc(src.contents),
})
}
mod := inspectModule(ctx, t,
modGen.With(daggerExec("init", "--source=.", "--name=test", "--sdk="+tc.sdk)))
require.Equal(t,
"Test module, short description\n\nLong description, with full sentences.",
mod.Get("description").String(),
)
require.Equal(t,
"Test object, short description",
mod.Get("objects.#.asObject|#(name=Test).description").String(),
)
})
}
}
func TestModulePrivateField(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
sdk string
source string
}{
{
sdk: "go",
source: `package main
type Minimal struct {
Foo string
Bar string // +private
}
func (m *Minimal) Set(foo string, bar string) *Minimal {
m.Foo = foo
m.Bar = bar
return m
}
func (m *Minimal) Hello() string {
return m.Foo + m.Bar
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Minimal:
foo: str = field(default="")
bar: str = ""
@function
def set(self, foo: str, bar: str) -> "Minimal":
self.foo = foo
self.bar = bar
return self
@function
def hello(self) -> str:
return self.foo + self.bar
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Minimal {
@field()
foo: string
bar?: string
constructor(foo?: string, bar?: string) {
this.foo = foo
this.bar = bar
}
@func()
set(foo: string, bar: string): Minimal {
this.foo = foo
this.bar = bar
return this
}
@func()
hello(): string {
return this.foo + this.bar
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Len(t, obj.Get(`fields`).Array(), 1)
prop := obj.Get(`fields.#(name="foo")`)
require.Equal(t, "foo", prop.Get("name").String())
out, err := modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){hello}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"hello": "abcxyz"}}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){foo}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"foo": "abc"}}}`, out)
_, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){bar}}}`)).Stdout(ctx)
require.ErrorContains(t, err, `Minimal has no such field: "bar"`)
})
}
}
// this is no longer allowed, but verify the SDK errors out
func TestModuleGoExtendCore(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=container", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
func (c *Container) Echo(ctx context.Context, msg string) (string, error) {
return c.WithExec([]string{"echo", msg}).Stdout(ctx)
}
`,
}).
With(daggerQuery(`{container{from(address:"` + alpineImage + `"){echo(msg:"echo!"){stdout}}}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "cannot define methods on objects from outside this module")
}
func TestModuleGoBadCtx(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=foo", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Foo struct {}
func (f *Foo) Echo(ctx context.Context, ctx2 context.Context) (string, error) {
return "", nil
}
`,
}).
With(daggerQuery(`{foo{echo}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "unexpected context type")
}
func TestModuleCustomTypes(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Test struct{}
func (m *Test) Repeater(msg string, times int) *Repeater {
return &Repeater{
Message: msg,
Times: times,
}
}
type Repeater struct {
Message string
Times int
}
func (t *Repeater) Render() string {
return strings.Repeat(t.Message, t.Times)
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Repeater:
message: str = field(default="")
times: int = field(default=0)
@function
def render(self) -> str:
return self.message * self.times
@function
def repeater(msg: str, times: int) -> Repeater:
return Repeater(message=msg, times=times)
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Repeater {
@field()
message: string
@field()
times: number
constructor(message: string, times: number) {
this.message = message
this.times = times
}
@func()
render(): string {
return this.message.repeat(this.times)
}
}
@object()
class Test {
@func()
repeater(msg: string, times: number): Repeater {
return new Repeater(msg, times)
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("custom %s types", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := modInit(ctx, t, c, tc.sdk, tc.source).
With(daggerQuery(`{test{repeater(msg:"echo!", times: 3){render}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"repeater":{"render":"echo!echo!echo!"}}}`, out)
})
}
}
func TestModuleReturnTypeDetection(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
}
func (m *Foo) MyFunction() X {
return X{Message: "foo"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
@function
def my_function() -> X:
return X(message="foo")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class X {
@field()
message: string
constructor(message: string) {
this.message = message;
}
}
@object()
class Foo {
@func()
myFunction(): X {
return new X("foo");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{myFunction{message}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo"}}}`, out)
})
}
}
func TestModuleReturnObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
When string ` + "`json:\"Timestamp\"`" + `
To string ` + "`json:\"recipient\"`" + `
From string
}
func (m *Foo) MyFunction() X {
return X{Message: "foo", When: "now", To: "user", From: "admin"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
when: str = field(default="", name="Timestamp")
to: str = field(default="", name="recipient")
from_: str = field(default="", name="from")
@object_type
class Foo:
@function
def my_function(self) -> X:
return X(message="foo", when="now", to="user", from_="admin")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class X {
@field()
message: string
@field()
timestamp: string
@field()
recipient: string
@field()
from: string
constructor(message: string, timestamp: string, recipient: string, from: string) {
this.message = message;
this.timestamp = timestamp;
this.recipient = recipient;
this.from = from;
}
}
@object()
class Foo {
@func()
myFunction(): X {
return new X("foo", "now", "user", "admin");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{myFunction{message, recipient, from, timestamp}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo", "recipient":"user", "from":"admin", "timestamp":"now"}}}`, out)
})
}
}
func TestModuleReturnNestedObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type Foo struct {
MsgContainer Bar
}
type Bar struct {
Msg string
}
func (m *Playground) MyFunction() Foo {
return Foo{MsgContainer: Bar{Msg: "hello world"}}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Bar:
msg: str = field()
@object_type
class Foo:
msg_container: Bar = field()
@object_type
class Playground:
@function
def my_function(self) -> Foo:
return Foo(msg_container=Bar(msg="hello world"))
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Bar {
@field()
msg: string;
constructor(msg: string) {
this.msg = msg;
}
}
@object()
class Foo {
@field()
msgContainer: Bar;
constructor(msgContainer: Bar) {
this.msgContainer = msgContainer;
}
}
@object()
class Playground {
@func()
myFunction(): Foo {
return new Foo(new Bar("hello world"));
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{myFunction{msgContainer{msg}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myFunction":{"msgContainer":{"msg": "hello world"}}}}`, out)
})
}
}
func TestModuleReturnCompositeCore(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
func (m *Playground) MySlice() []*Container {
return []*Container{dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"})}
}
type Foo struct {
Con *Container
// verify fields can remain nil w/out error too
UnsetFile *File
}
func (m *Playground) MyStruct() *Foo {
return &Foo{Con: dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"})}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class Foo:
con: dagger.Container = field()
unset_file: dagger.File | None = field(default=None)
@object_type
class Playground:
@function
def my_slice(self) -> list[dagger.Container]:
return [dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"])]
@function
def my_struct(self) -> Foo:
return Foo(con=dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"]))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, File, object, func, field } from "@dagger.io/dagger"
@object()
class Foo {
@field()
con: Container
@field()
unsetFile?: File
constructor(con: Container, usetFile?: File) {
this.con = con
this.usetFile = usetFile
}
}
@object()
class Playground {
@func()
mySlice(): Container[] {
return [
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
]
}
@func()
myStruct(): Foo {
return new Foo(
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{mySlice{stdout}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"mySlice":[{"stdout":"hello world\n"}]}}`, out)
out, err = modGen.With(daggerQuery(`{playground{myStruct{con{stdout}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myStruct":{"con":{"stdout":"hello world\n"}}}}`, out)
})
}
}
func TestModuleReturnComplexThing(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type ScanResult struct {
Containers []*Container ` + "`json:\"targets\"`" + `
Report ScanReport
}
type ScanReport struct {
Contents string ` + "`json:\"contents\"`" + `
Authors []string ` + "`json:\"Authors\"`" + `
}
func (m *Playground) Scan() ScanResult {
return ScanResult{
Containers: []*Container{
dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"}),
},
Report: ScanReport{
Contents: "hello world",
Authors: []string{"foo", "bar"},
},
}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class ScanReport:
contents: str = field()
authors: list[str] = field()
@object_type
class ScanResult:
containers: list[dagger.Container] = field(name="targets")
report: ScanReport = field()
@object_type
class Playground:
@function
def scan(self) -> ScanResult:
return ScanResult(
containers=[
dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"]),
],
report=ScanReport(
contents="hello world",
authors=["foo", "bar"],
),
)
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object()
class ScanReport {
@field()
contents: string
@field()
authors: string[]
constructor(contents: string, authors: string[]) {
this.contents = contents
this.authors = authors
}
}
@object()
class ScanResult {
@field("targets")
containers: Container[]
@field()
report: ScanReport
constructor(containers: Container[], report: ScanReport) {
this.containers = containers
this.report = report
}
}
@object()
class Playground {
@func()
async scan(): Promise<ScanResult> {
return new ScanResult(
[
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
],
new ScanReport("hello world", ["foo", "bar"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{scan{targets{stdout},report{contents,authors}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"scan":{"targets":[{"stdout":"hello world\n"}],"report":{"contents":"hello world","authors":["foo","bar"]}}}}`, out)
})
}
}
func TestModuleGlobalVarDAG(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
type Foo struct {}
var someDefault = dag.Container().From("` + alpineImage + `")
func (m *Foo) Fn(ctx context.Context) (string, error) {
return someDefault.WithExec([]string{"echo", "foo"}).Stdout(ctx)
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function, object_type
SOME_DEFAULT = dag.container().from_("` + alpineImage + `")
@object_type
class Foo:
@function
async def fn(self) -> str:
return await SOME_DEFAULT.with_exec(["echo", "foo"]).stdout()
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from "@dagger.io/dagger"
var someDefault = dag.container().from("` + alpineImage + `")
@object()
class Foo {
@func()
async fn(): Promise<string> {
return someDefault.withExec(["echo", "foo"]).stdout()
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"fn":"foo\n"}}`, out)
})
}
}
func TestModuleIDableType(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {
Data string
}
func (m *Foo) Set(data string) *Foo {
m.Data = data
return m
}
func (m *Foo) Get() string {
return m.Data
}
`,
},
{
sdk: "python",
source: `from typing import Self
from dagger import field, function, object_type
@object_type
class Foo:
data: str = ""
@function
def set(self, data: str) -> Self:
self.data = data
return self
@function
def get(self) -> str:
return self.data
`,
},
{
sdk: "typescript",
source: `
import { object, func } from "@dagger.io/dagger"
@object()
class Foo {
data: string = ""
@func()
set(data: string): Foo {
this.data = data
return this
}
@func()
get(): string {
return this.data
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
// sanity check
out, err := modGen.With(daggerQuery(`{foo{set(data: "abc"){get}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"set":{"get": "abc"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{set(data: "abc"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.set.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.set(data: "abc"): Foo!`)
out, err = modGen.With(daggerQuery(`{loadFooFromID(id: "%s"){get}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"loadFooFromID":{"get": "abc"}}`, out)
})
}
}
func TestModuleArgOwnType(t *testing.T) {
// Verify use of a module's own object as an argument type.
// The server needs to specifically decode the input type from an ID into
// the raw JSON, since the module doesn't understand it's own types as IDs
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Foo struct{}
type Message struct {
Content string
}
func (m *Foo) SayHello(name string) Message {
return Message{Content: "hello " + name}
}
func (m *Foo) Upper(msg Message) Message {
msg.Content = strings.ToUpper(msg.Content)
return msg
}
func (m *Foo) Uppers(msg []Message) []Message {
for i := range msg {
msg[i].Content = strings.ToUpper(msg[i].Content)
}
return msg
}`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Message:
content: str = field()
@object_type
class Foo:
@function
def say_hello(self, name: str) -> Message:
return Message(content=f"hello {name}")
@function
def upper(self, msg: Message) -> Message:
msg.content = msg.content.upper()
return msg
@function
def uppers(self, msg: list[Message]) -> list[Message]:
for m in msg:
m.content = m.content.upper()
return msg
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Message {
@field()
content: string
constructor(content: string) {
this.content = content
}
}
@object()
class Foo {
@func()
sayHello(name: string): Message {
return new Message("hello " + name)
}
@func()
upper(msg: Message): Message {
msg.content = msg.content.toUpperCase()
return msg
}
@func()
uppers(msg: Message[]): Message[] {
for (let i = 0; i < msg.length; i++) {
msg[i].content = msg[i].content.toUpperCase()
}
return msg
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{sayHello(name: "world"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.sayHello.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.sayHello(name: "world"): FooMessage!`)
out, err = modGen.With(daggerQuery(`{foo{upper(msg:"%s"){content}}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"upper":{"content": "HELLO WORLD"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{uppers(msg:["%s", "%s"]){content}}}`, id, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"uppers":[{"content": "HELLO WORLD"}, {"content": "HELLO WORLD"}]}}`, out)
})
}
}
func TestModuleConflictingSameNameDeps(t *testing.T) {
// A -> B -> Dint
// A -> C -> Dstr
// where Dint and Dstr are modules with the same name and same object names but conflicting types
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dstr").
With(daggerExec("init", "--source=.", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo string
}
func (m *D) Fn(foo string) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dint").
With(daggerExec("init", "--source=.", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo int
}
func (m *D) Fn(foo int) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=c", "--name=c", "--sdk=go", "c")).
WithWorkdir("/work/c").
With(daggerExec("install", "../dstr")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type C struct{}
func (m *C) Fn(ctx context.Context, foo string) (string, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=b", "--name=b", "--sdk=go", "b")).
With(daggerExec("install", "-m=b", "./dint")).
WithNewFile("/work/b/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type B struct{}
func (m *B) Fn(ctx context.Context, foo int) (int, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=a", "--name=a", "--sdk=go", "a")).
WithWorkdir("/work/a").
With(daggerExec("install", "../b")).
With(daggerExec("install", "../c")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"strconv"
)
type A struct{}
func (m *A) Fn(ctx context.Context) (string, error) {
fooStr, err := dag.C().Fn(ctx, "foo")
if err != nil {
return "", err
}
fooInt, err := dag.B().Fn(ctx, 123)
if err != nil {
return "", err
}
return fooStr + strconv.Itoa(fooInt), nil
}
`,
})
out, err := ctr.With(daggerQuery(`{a{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"a":{"fn": "foo123"}}`, out)
// verify that no types from (transitive) deps show up
types := currentSchema(ctx, t, ctr).Types
require.NotNil(t, types.Get("A"))
require.Nil(t, types.Get("B"))
require.Nil(t, types.Get("C"))
require.Nil(t, types.Get("D"))
}
func TestModuleSelfAPICall(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"github.com/Khan/genqlient/graphql"
)
type Test struct{}
func (m *Test) FnA(ctx context.Context) (string, error) {
resp := &graphql.Response{}
err := dag.Client.MakeRequest(ctx, &graphql.Request{
Query: "{test{fnB}}",
}, resp)
if err != nil {
return "", err
}
return resp.Data.(map[string]any)["test"].(map[string]any)["fnB"].(string), nil
}
func (m *Test) FnB() string {
return "hi from b"
}
`,
}).
With(daggerQuery(`{test{fnA}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fnA": "hi from b"}}`, out)
}
func TestModuleGoWithOtherModuleTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Dep struct{}
type Obj struct {
Foo string
}
func (m *Dep) Fn() Obj {
return Obj{Foo: "foo"}
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=test", "--name=test", "--sdk=go", "test")).
With(daggerExec("install", "-m=test", "./dep")).
WithWorkdir("/work/test")
t.Run("return as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() (*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() ([]*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
})
t.Run("arg as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj *DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj []*DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
})
t.Run("field as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo *DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo []*DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
})
}
func TestModuleGoUseDaggerTypesDirect(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "main/dagger"
type Minimal struct{}
func (m *Minimal) Foo(dir *Directory) (*dagger.Directory) {
return dir.WithNewFile("foo", "xxx")
}
func (m *Minimal) Bar(dir *dagger.Directory) (*Directory) {
return dir.WithNewFile("bar", "yyy")
}
`,
})
out, err := modGen.With(daggerQuery(`{directory{id}}`)).Stdout(ctx)
require.NoError(t, err)
dirID := gjson.Get(out, "directory.id").String()
out, err = modGen.With(daggerQuery(`{minimal{foo(dir: "%s"){file(path: "foo"){contents}}}}`, dirID)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"foo":{"file":{"contents": "xxx"}}}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{bar(dir: "%s"){file(path: "bar"){contents}}}}`, dirID)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"bar":{"file":{"contents": "yyy"}}}}`, out)
}
func TestModuleGoUtilsPkg(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"main/utils"
)
type Minimal struct{}
func (m *Minimal) Hello(ctx context.Context) (string, error) {
return utils.Foo().File("foo").Contents(ctx)
}
`,
}).
WithNewFile("utils/util.go", dagger.ContainerWithNewFileOpts{
Contents: `package utils
import "main/dagger"
func Foo() *dagger.Directory {
return dagger.Connect().Directory().WithNewFile("/foo", "hello world")
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello world"}}`, out)
}
var useInner = `package main
type Dep struct{}
func (m *Dep) Hello() string {
return "hello"
}
`
var useGoOuter = `package main
import "context"
type Use struct{}
func (m *Use) UseHello(ctx context.Context) (string, error) {
return dag.Dep().Hello(ctx)
}
`
var usePythonOuter = `from dagger import dag, function
@function
def use_hello() -> str:
return dag.dep().hello()
`
var useTSOuter = `
import { dag, object, func } from '@dagger.io/dagger'
@object()
class Use {
@func()
async useHello(): Promise<string> {
return dag.dep().hello()
}
}
`
func TestModuleUseLocal(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// cannot use transitive dependency directly
_, err = modGen.With(daggerQuery(`{dep{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, `Query has no such field: "dep"`)
})
}
}
func TestModuleCodegenOnDepChange(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
changed string
expected string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
expected: "Hellov2",
changed: strings.ReplaceAll(useGoOuter, `Hello(ctx)`, `Hellov2(ctx)`),
},
{
sdk: "python",
source: usePythonOuter,
expected: "hellov2",
changed: strings.ReplaceAll(usePythonOuter, `.hello()`, `.hellov2()`),
},
{
sdk: "typescript",
source: useTSOuter,
expected: "hellov2",
changed: strings.ReplaceAll(useTSOuter, `.hello()`, `.hellov2()`),
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// make back-incompatible change to dep
newInner := strings.ReplaceAll(useInner, `Hello()`, `Hellov2()`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("develop"))
codegenContents, err := modGen.File(sdkCodegenFile(t, tc.sdk)).Contents(ctx)
require.NoError(t, err)
require.Contains(t, codegenContents, tc.expected)
modGen = modGen.With(sdkSource(tc.sdk, tc.changed))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
})
}
}
func TestModuleSyncDeps(t *testing.T) {
// verify that changes to deps result in a develop to the depender module
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
modGen = modGen.With(daggerQuery(`{use{useHello}}`))
out, err := modGen.Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
newInner := strings.ReplaceAll(useInner, `"hello"`, `"goodbye"`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("develop"))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"goodbye"}}`, out)
})
}
}
func TestModuleUseLocalMulti(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
import "fmt"
type Use struct {}
func (m *Use) Names(ctx context.Context) ([]string, error) {
fooName, err := dag.Foo().Name(ctx)
if err != nil {
return nil, fmt.Errorf("foo.name: %w", err)
}
barName, err := dag.Bar().Name(ctx)
if err != nil {
return nil, fmt.Errorf("bar.name: %w", err)
}
return []string{fooName, barName}, nil
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function
@function
async def names() -> list[str]:
return [
await dag.foo().name(),
await dag.bar().name(),
]
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from '@dagger.io/dagger'
@object()
class Use {
@func()
async names(): Promise<string[]> {
return [await dag.foo().name(), await dag.bar().name()]
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/foo").
WithNewFile("/work/foo/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Foo struct {}
func (m *Foo) Name() string { return "foo" }
`,
}).
With(daggerExec("init", "--source=.", "--name=foo", "--sdk=go")).
WithWorkdir("/work/bar").
WithNewFile("/work/bar/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Bar struct {}
func (m *Bar) Name() string { return "bar" }
`,
}).
With(daggerExec("init", "--source=.", "--name=bar", "--sdk=go")).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(daggerExec("install", "./foo")).
With(daggerExec("install", "./bar")).
With(sdkSource(tc.sdk, tc.source)).
WithEnvVariable("BUST", identity.NewID()) // NB(vito): hmm...
out, err := modGen.With(daggerQuery(`{use{names}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"names":["foo", "bar"]}}`, out)
})
}
}
func TestModuleConstructor(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("basic", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(
ctx context.Context,
foo string,
bar *int, // +optional
baz []string,
dir *Directory,
) *Test {
bar2 := 42
if bar != nil {
bar2 = *bar
}
return &Test{
Foo: foo,
Bar: bar2,
Baz: baz,
Dir: dir,
}
}
type Test struct {
Foo string
Bar int
Baz []string
Dir *Directory
NeverSetDir *Directory
}
func (m *Test) GimmeFoo() string {
return m.Foo
}
func (m *Test) GimmeBar() int {
return m.Bar
}
func (m *Test) GimmeBaz() []string {
return m.Baz
}
func (m *Test) GimmeDirEnts(ctx context.Context) ([]string, error) {
return m.Dir.Entries(ctx)
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import field, function, object_type
@object_type
class Test:
foo: str = field()
dir: dagger.Directory = field()
bar: int = field(default=42)
baz: list[str] = field(default=list)
never_set_dir: dagger.Directory | None = field(default=None)
@function
def gimme_foo(self) -> str:
return self.foo
@function
def gimme_bar(self) -> int:
return self.bar
@function
def gimme_baz(self) -> list[str]:
return self.baz
@function
async def gimme_dir_ents(self) -> list[str]:
return await self.dir.entries()
`,
},
{
sdk: "typescript",
source: `
import { Directory, object, func, field } from '@dagger.io/dagger';
@object()
class Test {
@field()
foo: string
@field()
dir: Directory
@field()
bar: number
@field()
baz: string[]
@field()
neverSetDir?: Directory
constructor(foo: string, dir: Directory, bar = 42, baz: string[] = []) {
this.foo = foo;
this.dir = dir;
this.bar = bar;
this.baz = baz;
}
@func()
gimmeFoo(): string {
return this.foo;
}
@func()
gimmeBar(): number {
return this.bar;
}
@func()
gimmeBaz(): string[] {
return this.baz;
}
@func()
async gimmeDirEnts(): Promise<string[]> {
return this.dir.entries();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := modInit(ctx, t, c, tc.sdk, tc.source)
out, err := ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-dir-ents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, strings.TrimSpace(out), "dagger.json")
})
}
})
t.Run("fields only", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(ctx context.Context) (Test, error) {
v, err := dag.Container().From("alpine:3.18.4").File("/etc/alpine-release").Contents(ctx)
if err != nil {
return Test{}, err
}
return Test{
AlpineVersion: v,
}, nil
}
type Test struct {
AlpineVersion string
}
`,
},
{
sdk: "python",
source: `from dagger import dag, field, function, object_type
@object_type
class Test:
alpine_version: str = field()
@classmethod
async def create(cls) -> "Test":
return cls(alpine_version=await (
dag.container()
.from_("alpine:3.18.4")
.file("/etc/alpine-release")
.contents()
))
`,
},
{
sdk: "typescript",
source: `
import { dag, object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
alpineVersion: string
// NOTE: this is not standard to do async operations in the constructor.
// This is only for testing purpose but it shouldn't be done in real usage.
constructor() {
return (async () => {
this.alpineVersion = await dag.container().from("alpine:3.18.4").file("/etc/alpine-release").contents()
return this; // Return the newly-created instance
})();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := ctr.With(daggerCall("alpine-version")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "3.18.4")
})
}
})
t.Run("return error", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"fmt"
)
func New() (*Test, error) {
return nil, fmt.Errorf("too bad")
}
type Test struct {
Foo string
}
`,
},
{
sdk: "python",
source: `from dagger import object_type, field
@object_type
class Test:
foo: str = field()
def __init__(self):
raise ValueError("too bad")
`,
},
{
sdk: "typescript",
source: `
import { object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
foo: string
constructor() {
throw new Error("too bad")
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
_, err := ctr.With(daggerCall("foo")).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "too bad")
})
}
})
t.Run("python: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=python")).
With(sdkSource("python", fmt.Sprintf(`import dagger
from dagger import dag, object_type, field
@object_type
class Test:
foo: dagger.File = field(default=lambda: (
dag.directory()
.with_new_file("foo.txt", contents="%s")
.file("foo.txt")
))
bar: list[str] = field(default=list)
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "python"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
t.Run("typescript: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=typescript")).
With(sdkSource("typescript", fmt.Sprintf(`
import { dag, File, object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
foo: File = dag.directory().withNewFile("foo.txt", "%s").file("foo.txt")
@field()
bar: string[] = []
// Allow foo to be set through the constructor
constructor(foo?: File) {
if (foo) {
this.foo = foo
}
}
}
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "typescript"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
}
func TestModuleWrapping(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Wrapper struct{}
func (m *Wrapper) Container() *WrappedContainer {
return &WrappedContainer{
dag.Container().From("` + alpineImage + `"),
}
}
type WrappedContainer struct {
Unwrap *Container` + "`" + `json:"unwrap"` + "`" + `
}
func (c *WrappedContainer) Echo(msg string) *WrappedContainer {
return &WrappedContainer{
c.Unwrap.WithExec([]string{"echo", "-n", msg}),
}
}
`,
},
{
sdk: "python",
source: `from typing import Self
import dagger
from dagger import dag, field, function, object_type
@object_type
class WrappedContainer:
unwrap: dagger.Container = field()
@function
def echo(self, msg: str) -> Self:
return WrappedContainer(unwrap=self.unwrap.with_exec(["echo", "-n", msg]))
@object_type
class Wrapper:
@function
def container(self) -> WrappedContainer:
return WrappedContainer(unwrap=dag.container().from_("` + alpineImage + `"))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object()
class WrappedContainer {
@field()
unwrap: Container
constructor(unwrap: Container) {
this.unwrap = unwrap
}
@func()
echo(msg: string): WrappedContainer {
return new WrappedContainer(this.unwrap.withExec(["echo", "-n", msg]))
}
}
@object()
class Wrapper {
@func()
container(): WrappedContainer {
return new WrappedContainer(dag.container().from("` + alpineImage + `"))
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=wrapper", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
id := identity.NewID()
out, err := modGen.With(daggerQuery(
fmt.Sprintf(`{wrapper{container{echo(msg:%q){unwrap{stdout}}}}}`, id),
)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t,
fmt.Sprintf(`{"wrapper":{"container":{"echo":{"unwrap":{"stdout":%q}}}}}`, id),
out)
})
}
}
func TestModuleLotsOfFunctions(t *testing.T) {
t.Parallel()
const funcCount = 100
t.Run("go sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
package main
type PotatoSack struct {}
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
func (m *PotatoSack) Potato%d() string {
return "potato #%d"
}
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("init", "--source=.", "--name=potatoSack", "--sdk=go"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("python sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `from dagger import function
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@function
def potato_%d() -> str:
return "potato #%d"
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("./src/main.py", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("init", "--source=.", "--name=potatoSack", "--sdk=python"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("typescript sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
import { object, func } from "@dagger.io/dagger"
@object()
class PotatoSack {
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@func()
potato_%d(): string {
return "potato #%d"
}
`, i, i)
}
mainSrc += "\n}"
modGen := c.
Container().
From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(sdkSource("typescript", mainSrc)).
With(daggerExec("init", "--name=potatoSack", "--sdk=typescript"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
}
func TestModuleLotsOfDeps(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
modCount := 0
getModMainSrc := func(name string, depNames []string) string {
t.Helper()
mainSrc := fmt.Sprintf(`package main
import "context"
type %s struct {}
func (m *%s) Fn(ctx context.Context) (string, error) {
s := "%s"
var depS string
_ = depS
var err error
_ = err
`, strcase.ToCamel(name), strcase.ToCamel(name), name)
for _, depName := range depNames {
mainSrc += fmt.Sprintf(`
depS, err = dag.%s().Fn(ctx)
if err != nil {
return "", err
}
s += depS
`, strcase.ToCamel(depName))
}
mainSrc += "return s, nil\n}\n"
fmted, err := format.Source([]byte(mainSrc))
require.NoError(t, err)
return string(fmted)
}
// need to construct dagger.json directly in order to avoid excessive
// `dagger mod use` calls while constructing the huge DAG of deps
var rootCfg modules.ModuleConfig
addModulesWithDeps := func(newMods int, depNames []string) []string {
t.Helper()
var newModNames []string
for i := 0; i < newMods; i++ {
name := fmt.Sprintf("mod%d", modCount)
modCount++
newModNames = append(newModNames, name)
modGen = modGen.
WithWorkdir("/work/"+name).
WithNewFile("./main.go", dagger.ContainerWithNewFileOpts{
Contents: getModMainSrc(name, depNames),
})
var depCfgs []*modules.ModuleConfigDependency
for _, depName := range depNames {
depCfgs = append(depCfgs, &modules.ModuleConfigDependency{
Name: depName,
Source: filepath.Join("..", depName),
})
}
modGen = modGen.With(configFile(".", &modules.ModuleConfig{
Name: name,
SDK: "go",
Dependencies: depCfgs,
}))
}
return newModNames
}
// Create a base module, then add 6 layers of deps, where each layer has one more module
// than the previous layer and each module within the layer has a dep on each module
// from the previous layer. Finally add a single module at the top that depends on all
// modules from the last layer and call that.
// Basically, this creates a quadratically growing DAG of modules and verifies we
// handle it efficiently enough to be callable.
curDeps := addModulesWithDeps(1, nil)
for i := 0; i < 6; i++ {
curDeps = addModulesWithDeps(len(curDeps)+1, curDeps)
}
addModulesWithDeps(1, curDeps)
modGen = modGen.With(configFile("..", &rootCfg))
_, err := modGen.With(daggerCall("fn")).Sync(ctx)
require.NoError(t, err)
}
func TestModuleNamespacing(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
moduleSrcPath, err := filepath.Abs("./testdata/modules/go/namespacing")
require.NoError(t, err)
ctr := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithMountedDirectory("/work", c.Host().Directory(moduleSrcPath)).
WithWorkdir("/work")
out, err := ctr.
With(daggerQuery(`{test{fn(s:"yo")}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fn":["*dagger.Sub1Obj made 1:yo", "*dagger.Sub2Obj made 2:yo"]}}`, out)
}
func TestModuleLoops(t *testing.T) {
// verify circular module dependencies result in an error
t.Parallel()
c, ctx := connect(t)
_, err := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
With(daggerExec("init", "--name=depA", "--sdk=go", "depA")).
With(daggerExec("init", "--name=depB", "--sdk=go", "depB")).
With(daggerExec("init", "--name=depC", "--sdk=go", "depC")).
With(daggerExec("install", "-m=depC", "./depB")).
With(daggerExec("install", "-m=depB", "./depA")).
With(daggerExec("install", "-m=depA", "./depC")).
Sync(ctx)
require.ErrorContains(t, err, `local module at "/work/depA" has a circular dependency`)
}
//go:embed testdata/modules/go/id/arg/main.go
var badIDArgGoSrc string
//go:embed testdata/modules/python/id/arg/main.py
var badIDArgPySrc string
//go:embed testdata/modules/typescript/id/arg/index.ts
var badIDArgTSSrc string
//go:embed testdata/modules/go/id/field/main.go
var badIDFieldGoSrc string
//go:embed testdata/modules/typescript/id/field/index.ts
var badIDFieldTSSrc string
//go:embed testdata/modules/go/id/fn/main.go
var badIDFnGoSrc string
//go:embed testdata/modules/python/id/fn/main.py
var badIDFnPySrc string
//go:embed testdata/modules/typescript/id/fn/index.ts
var badIDFnTSSrc string
func TestModuleReservedWords(t *testing.T) {
// verify disallowed names are rejected
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("id", func(t *testing.T) {
t.Parallel()
t.Run("arg", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDArgGoSrc,
},
{
sdk: "python",
source: badIDArgPySrc,
},
{
sdk: "typescript",
source: badIDArgTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := modInit(ctx, t, c, tc.sdk, tc.source).
With(daggerQuery(`{test{fn(id:"no")}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define argument with reserved name \"id\"")
})
}
})
t.Run("field", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFieldGoSrc,
},
{
sdk: "typescript",
source: badIDFieldTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{fn{id}}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define field with reserved name \"id\"")
})
}
})
t.Run("fn", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFnGoSrc,
},
{
sdk: "python",
source: badIDFnPySrc,
},
{
sdk: "typescript",
source: badIDFnTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{id}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define function with reserved name \"id\"")
})
}
})
})
}
func TestModuleExecError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=playground", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
import (
"context"
"errors"
)
type Playground struct{}
func (p *Playground) DoThing(ctx context.Context) error {
_, err := dag.Container().From("` + alpineImage + `").WithExec([]string{"sh", "-c", "exit 5"}).Sync(ctx)
var e *ExecError
if errors.As(err, &e) {
if e.ExitCode == 5 {
return nil
}
}
panic("yikes")
}
`})
_, err := modGen.
With(daggerQuery(`{playground{doThing}}`)).
Stdout(ctx)
require.NoError(t, err)
}
func TestModuleCurrentModuleAPI(t *testing.T) {
t.Parallel()
t.Run("name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=WaCkY", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type WaCkY struct {}
func (m *WaCkY) Fn(ctx context.Context) (string, error) {
return dag.CurrentModule().Name(ctx)
}
`,
}).
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "WaCkY", strings.TrimSpace(out))
})
t.Run("source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/subdir/coolfile.txt", dagger.ContainerWithNewFileOpts{
Contents: "nice",
}).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) *File {
return dag.CurrentModule().Source().File("subdir/coolfile.txt")
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("workdir", func(t *testing.T) {
t.Parallel()
t.Run("dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*Directory, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().Workdir("subdir/moresubdir"), nil
}
`,
}).
With(daggerCall("fn", "file", "--path=coolfile.txt", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("file", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*File, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().WorkdirFile("subdir/moresubdir/coolfile.txt"), nil
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("error on escape", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
func New() (*Test, error) {
if err := os.WriteFile("/rootfile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
if err := os.MkdirAll("/foo", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("/foo/foofile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
return &Test{}, nil
}
type Test struct {}
func (m *Test) EscapeFile(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("../rootfile.txt")
}
func (m *Test) EscapeFileAbs(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("/rootfile.txt")
}
func (m *Test) EscapeDir(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("../foo")
}
func (m *Test) EscapeDirAbs(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("/foo")
}
`,
})
_, err := ctr.
With(daggerCall("escape-file", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-file-abs", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../foo" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir-abs", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/foo" escapes workdir`)
})
})
}
func TestModuleCustomSDK(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/coolsdk").
With(daggerExec("init", "--source=.", "--name=cool-sdk", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type CoolSdk struct {}
func (m *CoolSdk) ModuleRuntime(modSource *ModuleSource, introspectionJson string) *Container {
return modSource.WithSDK("go").AsModule().Runtime().WithEnvVariable("COOL", "true")
}
func (m *CoolSdk) Codegen(modSource *ModuleSource, introspectionJson string) *GeneratedCode {
return dag.GeneratedCode(modSource.WithSDK("go").AsModule().GeneratedContextDirectory())
}
func (m *CoolSdk) RequiredPaths() []string {
return []string{
"**/go.mod",
"**/go.sum",
"**/go.work",
"**/go.work.sum",
"**/vendor/",
"**/*.go",
}
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=coolsdk")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "os"
type Test struct {}
func (m *Test) Fn() string {
return os.Getenv("COOL")
}
`,
})
out, err := ctr.
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "true", strings.TrimSpace(out))
}
// TestModuleHostError verifies the host api is not exposed to modules
func TestModuleHostError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) *Directory {
return dag.Host().Directory(".")
}
`,
}).
With(daggerCall("fn")).
Sync(ctx)
require.ErrorContains(t, err, "dag.Host undefined")
}
func daggerExec(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerQuery(query string, args ...any) dagger.WithContainerFunc {
return daggerQueryAt("", query, args...)
}
func daggerQueryAt(modPath string, query string, args ...any) dagger.WithContainerFunc {
query = fmt.Sprintf(query, args...)
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "query"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(execArgs, dagger.ContainerWithExecOpts{
Stdin: query,
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerCall(args ...string) dagger.WithContainerFunc {
return daggerCallAt("", args...)
}
func daggerCallAt(modPath string, args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "call"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(append(execArgs, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerFunctions(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug", "functions"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func configFile(dirPath string, cfg *modules.ModuleConfig) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
cfgPath := filepath.Join(dirPath, "dagger.json")
cfgBytes, err := json.Marshal(cfg)
if err != nil {
panic(err)
}
return c.WithNewFile(cfgPath, dagger.ContainerWithNewFileOpts{
Contents: string(cfgBytes),
})
}
}
// command for a dagger cli call direct on the host
func hostDaggerCommand(ctx context.Context, t testing.TB, workdir string, args ...string) *exec.Cmd {
t.Helper()
cmd := exec.CommandContext(ctx, daggerCliPath(t), args...)
cmd.Dir = workdir
return cmd
}
// runs a dagger cli command directly on the host, rather than in an exec
func hostDaggerExec(ctx context.Context, t testing.TB, workdir string, args ...string) ([]byte, error) {
t.Helper()
cmd := hostDaggerCommand(ctx, t, workdir, args...)
output, err := cmd.CombinedOutput()
if err != nil {
err = fmt.Errorf("%s: %w", string(output), err)
}
return output, err
}
func sdkSource(sdk, contents string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
sourcePath := sdkSourceFile(sdk)
if sourcePath == "" {
return c
}
return c.WithNewFile(sourcePath, dagger.ContainerWithNewFileOpts{
Contents: heredoc.Doc(contents),
})
}
}
func sdkSourceFile(sdk string) string {
switch sdk {
case "go":
return "dagger/main.go"
case "python":
return "dagger/src/main.py"
case "typescript":
return "dagger/src/index.ts"
default:
return ""
}
}
func sdkCodegenFile(t *testing.T, sdk string) string {
t.Helper()
switch sdk {
case "go":
// FIXME: go codegen is split up into dagger/dagger.gen.go and
// dagger/dagger/dagger.gen.go
return "dagger/dagger/dagger.gen.go"
case "python":
return "dagger/sdk/src/dagger/client/gen.py"
case "typescript":
return "dagger/sdk/api/client.gen.ts"
default:
return ""
}
}
func modInit(ctx context.Context, t *testing.T, c *dagger.Client, sdk, contents string) *dagger.Container {
t.Helper()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+sdk)).
With(sdkSource(sdk, contents))
return modGen
}
func currentSchema(ctx context.Context, t *testing.T, ctr *dagger.Container) *introspection.Schema {
t.Helper()
out, err := ctr.With(daggerQuery(introspection.Query)).Stdout(ctx)
require.NoError(t, err)
var schemaResp introspection.Response
err = json.Unmarshal([]byte(out), &schemaResp)
require.NoError(t, err)
return schemaResp.Schema
}
var moduleIntrospection = daggerQuery(`
query { host { directory(path: ".") { asModule { initialize {
description
objects {
asObject {
name
description
constructor {
description
args {
name
description
defaultValue
}
}
functions {
name
description
args {
name
description
defaultValue
}
}
fields {
name
description
}
}
}
} } } } }
`)
func inspectModule(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
t.Helper()
out, err := ctr.With(moduleIntrospection).Stdout(ctx)
require.NoError(t, err)
result := gjson.Get(out, "host.directory.asModule.initialize")
t.Logf("module introspection:\n%v", result.Raw)
return result
}
func inspectModuleObjects(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
t.Helper()
return inspectModule(ctx, t, ctr).Get("objects.#.asObject")
}
func goGitBase(t *testing.T, c *dagger.Client) *dagger.Container {
t.Helper()
return c.Container().From(golangImage).
WithExec([]string{"apk", "add", "git"}).
WithExec([]string{"git", "config", "--global", "user.email", "dagger@example.com"}).
WithExec([]string{"git", "config", "--global", "user.name", "Dagger Tests"}).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"})
}
func logGen(ctx context.Context, t *testing.T, modSrc *dagger.Directory) {
t.Helper()
generated, err := modSrc.File("dagger.gen.go").Contents(ctx)
require.NoError(t, err)
t.Cleanup(func() {
t.Name()
fileName := filepath.Join(
os.TempDir(),
t.Name(),
fmt.Sprintf("dagger.gen.%d.go", time.Now().Unix()),
)
if err := os.MkdirAll(filepath.Dir(fileName), 0o755); err != nil {
t.Logf("failed to create temp dir for generated code: %v", err)
return
}
if err := os.WriteFile(fileName, []byte(generated), 0644); err != nil {
t.Logf("failed to write generated code to %s: %v", fileName, err)
} else {
t.Logf("wrote generated code to %s", fileName)
}
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,623 | Need integ tests for git modules | Right now all our integ tests only use local refs because git modules are locked into github repos and we've been trying to avoid tests depending on modules in an external git repo. However, I think we should just bite the bullet on that at this point since missing that test coverage is too big a gap. | https://github.com/dagger/dagger/issues/6623 | https://github.com/dagger/dagger/pull/6693 | 6a3689eeb680920fe5f830ac972be3dc1fa4f29b | a659c04b9982ef90a999dc20efb9485b11eda556 | "2024-02-08T18:15:16Z" | go | "2024-02-20T10:52:53Z" | core/modulesource.go | package core
import (
"context"
"encoding/json"
"fmt"
"path/filepath"
"strings"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/dagql"
"github.com/dagger/dagger/dagql/idproto"
"github.com/moby/buildkit/solver/pb"
"github.com/vektah/gqlparser/v2/ast"
)
type ModuleSourceKind string
var ModuleSourceKindEnum = dagql.NewEnum[ModuleSourceKind]()
var (
ModuleSourceKindLocal = ModuleSourceKindEnum.Register("LOCAL_SOURCE")
ModuleSourceKindGit = ModuleSourceKindEnum.Register("GIT_SOURCE")
)
func (proto ModuleSourceKind) Type() *ast.Type {
return &ast.Type{
NamedType: "ModuleSourceKind",
NonNull: true,
}
}
func (proto ModuleSourceKind) TypeDescription() string {
return "The kind of module source."
}
func (proto ModuleSourceKind) Decoder() dagql.InputDecoder {
return ModuleSourceKindEnum
}
func (proto ModuleSourceKind) ToLiteral() *idproto.Literal {
return ModuleSourceKindEnum.Literal(proto)
}
type ModuleSource struct {
Query *Query
Kind ModuleSourceKind `field:"true" name:"kind" doc:"The kind of source (e.g. local, git, etc.)"`
AsLocalSource dagql.Nullable[*LocalModuleSource] `field:"true" doc:"If the source is of kind local, the local source representation of it."`
AsGitSource dagql.Nullable[*GitModuleSource] `field:"true" doc:"If the source is a of kind git, the git source representation of it."`
// Settings that can be used to initialize or override the source's configuration
WithName string
WithDependencies []dagql.Instance[*ModuleDependency]
WithSDK string
WithSourceSubpath string
}
func (src *ModuleSource) Type() *ast.Type {
return &ast.Type{
NamedType: "ModuleSource",
NonNull: true,
}
}
func (src *ModuleSource) TypeDescription() string {
return "The source needed to load and run a module, along with any metadata about the source such as versions/urls/etc."
}
func (src ModuleSource) Clone() *ModuleSource {
cp := src
if src.Query != nil {
cp.Query = src.Query.Clone()
}
if src.AsLocalSource.Valid {
cp.AsLocalSource.Value = src.AsLocalSource.Value.Clone()
}
if src.AsGitSource.Valid {
cp.AsGitSource.Value = src.AsGitSource.Value.Clone()
}
if src.WithDependencies != nil {
cp.WithDependencies = make([]dagql.Instance[*ModuleDependency], len(src.WithDependencies))
copy(cp.WithDependencies, src.WithDependencies)
}
return &cp
}
func (src *ModuleSource) PBDefinitions(ctx context.Context) ([]*pb.Definition, error) {
switch src.Kind {
case ModuleSourceKindLocal:
return src.AsLocalSource.Value.PBDefinitions(ctx)
case ModuleSourceKindGit:
return src.AsGitSource.Value.PBDefinitions(ctx)
default:
return nil, fmt.Errorf("unknown module src kind: %q", src.Kind)
}
}
func (src *ModuleSource) RefString() (string, error) {
switch src.Kind {
case ModuleSourceKindLocal:
return src.AsLocalSource.Value.RefString(), nil
case ModuleSourceKindGit:
return src.AsGitSource.Value.RefString(), nil
default:
return "", fmt.Errorf("unknown module src kind: %q", src.Kind)
}
}
func (src *ModuleSource) Symbolic() (string, error) {
switch src.Kind {
case ModuleSourceKindLocal:
return src.AsLocalSource.Value.Symbolic(), nil
case ModuleSourceKindGit:
return src.AsGitSource.Value.Symbolic(), nil
default:
return "", fmt.Errorf("unknown module src kind: %q", src.Kind)
}
}
func (src *ModuleSource) SourceRootSubpath() (string, error) {
switch src.Kind {
case ModuleSourceKindLocal:
return src.AsLocalSource.Value.RootSubpath, nil
case ModuleSourceKindGit:
return src.AsGitSource.Value.RootSubpath, nil
default:
return "", fmt.Errorf("unknown module src kind: %q", src.Kind)
}
}
func (src *ModuleSource) SourceSubpath(ctx context.Context) (string, error) {
rootSubpath, err := src.SourceRootSubpath()
if err != nil {
return "", fmt.Errorf("failed to get source root subpath: %w", err)
}
if src.WithSourceSubpath != "" {
return filepath.Join(rootSubpath, src.WithSourceSubpath), nil
}
cfg, ok, err := src.ModuleConfig(ctx)
if err != nil {
return "", fmt.Errorf("module config: %w", err)
}
if !ok {
return "", nil
}
if cfg.Source == "" {
return "", nil
}
return filepath.Join(rootSubpath, cfg.Source), nil
}
// SourceSubpathWithDefault is the same as SourceSubpath, but it will default to the root subpath if the module has no configuration.
func (src *ModuleSource) SourceSubpathWithDefault(ctx context.Context) (string, error) {
sourceSubpath, err := src.SourceSubpath(ctx)
if err != nil {
return "", fmt.Errorf("source subpath: %w", err)
}
if sourceSubpath == "" {
return src.SourceRootSubpath()
}
return sourceSubpath, nil
}
func (src *ModuleSource) ModuleName(ctx context.Context) (string, error) {
if src.WithName != "" {
// use override name if set
return src.WithName, nil
}
cfg, ok, err := src.ModuleConfig(ctx)
if err != nil {
return "", fmt.Errorf("module config: %w", err)
}
if !ok {
return "", nil
}
return cfg.Name, nil
}
func (src *ModuleSource) ModuleOriginalName(ctx context.Context) (string, error) {
cfg, ok, err := src.ModuleConfig(ctx)
if err != nil {
return "", fmt.Errorf("module config: %w", err)
}
if !ok || cfg.Name == "" {
// no name for this module yet in static config, use the caller specified name if set
// since that is what will become the original name once configuration is generated
return src.WithName, nil
}
return cfg.Name, nil
}
func (src *ModuleSource) SDK(ctx context.Context) (string, error) {
if src.WithSDK != "" {
return src.WithSDK, nil
}
modCfg, ok, err := src.ModuleConfig(ctx)
if err != nil {
return "", fmt.Errorf("module config: %w", err)
}
if !ok {
return "", nil
}
return modCfg.SDK, nil
}
func (src *ModuleSource) ContextDirectory() (inst dagql.Instance[*Directory], err error) {
switch src.Kind {
case ModuleSourceKindLocal:
if !src.AsLocalSource.Valid {
return inst, fmt.Errorf("local src not set")
}
return src.AsLocalSource.Value.ContextDirectory, nil
case ModuleSourceKindGit:
if !src.AsGitSource.Valid {
return inst, fmt.Errorf("git src not set")
}
return src.AsGitSource.Value.ContextDirectory, nil
default:
return inst, fmt.Errorf("unknown module src kind: %q", src.Kind)
}
}
func (src *ModuleSource) ModuleConfig(ctx context.Context) (*modules.ModuleConfig, bool, error) {
contextDir, err := src.ContextDirectory()
if err != nil {
return nil, false, fmt.Errorf("failed to get context directory: %w", err)
}
if contextDir.Self == nil {
return nil, false, nil
}
rootSubpath, err := src.SourceRootSubpath()
if err != nil {
return nil, false, fmt.Errorf("failed to get source root subpath: %w", err)
}
var modCfg modules.ModuleConfig
configFile, err := contextDir.Self.File(ctx, filepath.Join(rootSubpath, modules.Filename))
if err != nil {
// no configuration for this module yet, so no name
return nil, false, nil
}
configBytes, err := configFile.Contents(ctx)
if err != nil {
return nil, false, fmt.Errorf("failed to read module config file: %w", err)
}
if err := json.Unmarshal(configBytes, &modCfg); err != nil {
return nil, false, fmt.Errorf("failed to decode module config: %w", err)
}
return &modCfg, true, nil
}
type LocalModuleSource struct {
RootSubpath string `field:"true" doc:"The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory)."`
ContextDirectory dagql.Instance[*Directory] `field:"true" doc:"The directory containing everything needed to load load and use the module."`
}
func (src *LocalModuleSource) Type() *ast.Type {
return &ast.Type{
NamedType: "LocalModuleSource",
NonNull: true,
}
}
func (src *LocalModuleSource) TypeDescription() string {
return "Module source that that originates from a path locally relative to an arbitrary directory."
}
func (src LocalModuleSource) Clone() *LocalModuleSource {
cp := src
if src.ContextDirectory.Self != nil {
cp.ContextDirectory.Self = src.ContextDirectory.Self.Clone()
}
return &cp
}
func (src *LocalModuleSource) PBDefinitions(ctx context.Context) ([]*pb.Definition, error) {
return src.ContextDirectory.Self.PBDefinitions(ctx)
}
func (src *LocalModuleSource) RefString() string {
srcPath := src.RootSubpath
if filepath.IsAbs(srcPath) {
srcPath = strings.TrimPrefix(filepath.Clean(srcPath), "/")
}
return srcPath
}
func (src *LocalModuleSource) Symbolic() string {
return src.RefString()
}
type GitModuleSource struct {
Version string `field:"true" doc:"The specified version of the git repo this source points to."`
Commit string `field:"true" doc:"The resolved commit of the git repo this source points to."`
URLParent string
RootSubpath string `field:"true" doc:"The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory)."`
ContextDirectory dagql.Instance[*Directory] `field:"true" doc:"The directory containing everything needed to load load and use the module."`
}
func (src *GitModuleSource) Type() *ast.Type {
return &ast.Type{
NamedType: "GitModuleSource",
NonNull: true,
}
}
func (src *GitModuleSource) TypeDescription() string {
return "Module source originating from a git repo."
}
func (src GitModuleSource) Clone() *GitModuleSource {
cp := src
if src.ContextDirectory.Self != nil {
cp.ContextDirectory.Self = src.ContextDirectory.Self.Clone()
}
return &src
}
func (src *GitModuleSource) PBDefinitions(ctx context.Context) ([]*pb.Definition, error) {
return src.ContextDirectory.Self.PBDefinitions(ctx)
}
func (src *GitModuleSource) RefString() string {
refPath := src.URLParent
subPath := filepath.Join("/", src.RootSubpath)
if subPath != "/" {
refPath += subPath
}
return fmt.Sprintf("%s@%s", refPath, src.Commit)
}
func (src *GitModuleSource) Symbolic() string {
return filepath.Join(src.CloneURL(), src.RootSubpath)
}
func (src *GitModuleSource) CloneURL() string {
return "https://" + src.URLParent
}
func (src *GitModuleSource) HTMLURL() string {
u := "https://" + src.URLParent + "/tree/" + src.Commit
if subPath := src.RootSubpath; subPath != "" {
u += "/" + subPath
}
return u
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,623 | Need integ tests for git modules | Right now all our integ tests only use local refs because git modules are locked into github repos and we've been trying to avoid tests depending on modules in an external git repo. However, I think we should just bite the bullet on that at this point since missing that test coverage is too big a gap. | https://github.com/dagger/dagger/issues/6623 | https://github.com/dagger/dagger/pull/6693 | 6a3689eeb680920fe5f830ac972be3dc1fa4f29b | a659c04b9982ef90a999dc20efb9485b11eda556 | "2024-02-08T18:15:16Z" | go | "2024-02-20T10:52:53Z" | core/schema/module.go | package schema
import (
"bytes"
"context"
"encoding/json"
"fmt"
"path/filepath"
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/dagql"
"github.com/dagger/dagger/engine"
"golang.org/x/sync/errgroup"
)
type moduleSchema struct {
dag *dagql.Server
}
var _ SchemaResolvers = &moduleSchema{}
func (s *moduleSchema) Install() {
dagql.Fields[*core.Query]{
dagql.Func("module", s.module).
Doc(`Create a new module.`),
dagql.Func("typeDef", s.typeDef).
Doc(`Create a new TypeDef.`),
dagql.Func("generatedCode", s.generatedCode).
Doc(`Create a code generation result, given a directory containing the generated code.`),
dagql.Func("moduleSource", s.moduleSource).
Doc(`Create a new module source instance from a source ref string.`).
ArgDoc("refString", `The string ref representation of the module source`).
ArgDoc("stable", `If true, enforce that the source is a stable version for source kinds that support versioning.`),
dagql.Func("moduleDependency", s.moduleDependency).
Doc(`Create a new module dependency configuration from a module source and name`).
ArgDoc("source", `The source of the dependency`).
ArgDoc("name", `If set, the name to use for the dependency. Otherwise, once installed to a parent module, the name of the dependency module will be used by default.`),
dagql.Func("function", s.function).
Doc(`Creates a function.`).
ArgDoc("name", `Name of the function, in its original format from the implementation language.`).
ArgDoc("returnType", `Return type of the function.`),
dagql.Func("currentModule", s.currentModule).
Impure(`Changes depending on which module is calling it.`).
Doc(`The module currently being served in the session, if any.`),
dagql.Func("currentTypeDefs", s.currentTypeDefs).
Impure(`Changes depending on which modules are currently installed.`).
Doc(`The TypeDef representations of the objects currently being served in the session.`),
dagql.Func("currentFunctionCall", s.currentFunctionCall).
Impure(`Changes depending on which function calls it.`).
Doc(`The FunctionCall context that the SDK caller is currently executing in.`,
`If the caller is not currently executing in a function, this will
return an error.`),
}.Install(s.dag)
dagql.Fields[*core.Directory]{
dagql.NodeFunc("asModule", s.directoryAsModule).
Doc(`Load the directory as a Dagger module`).
ArgDoc("sourceRootPath",
`An optional subpath of the directory which contains the module's configuration file.`,
`This is needed when the module code is in a subdirectory but requires
parent directories to be loaded in order to execute. For example, the
module source code may need a go.mod, project.toml, package.json, etc.
file from a parent directory.`,
`If not set, the module source code is loaded from the root of the directory.`),
}.Install(s.dag)
dagql.Fields[*core.FunctionCall]{
dagql.Func("returnValue", s.functionCallReturnValue).
Impure(`Updates internal engine state with the given value.`).
Doc(`Set the return value of the function call to the provided value.`).
ArgDoc("value", `JSON serialization of the return value.`),
}.Install(s.dag)
dagql.Fields[*core.ModuleSource]{
dagql.Func("contextDirectory", s.moduleSourceContextDirectory).
Doc(`The directory containing everything needed to load load and use the module.`),
dagql.Func("withContextDirectory", s.moduleSourceWithContextDirectory).
Doc(`Update the module source with a new context directory. Only valid for local sources.`).
ArgDoc("dir", `The directory to set as the context directory.`),
dagql.Func("directory", s.moduleSourceDirectory).
Doc(`The directory containing the module configuration and source code (source code may be in a subdir).`).
ArgDoc(`path`, `The path from the source directory to select.`),
dagql.Func("sourceRootSubpath", s.moduleSourceRootSubpath).
Doc(`The path relative to context of the root of the module source, which contains dagger.json. It also contains the module implementation source code, but that may or may not being a subdir of this root.`),
dagql.Func("sourceSubpath", s.moduleSourceSubpath).
Doc(`The path relative to context of the module implementation source code.`),
dagql.Func("withSourceSubpath", s.moduleSourceWithSourceSubpath).
Doc(`Update the module source with a new source subpath.`).
ArgDoc("path", `The path to set as the source subpath.`),
dagql.Func("moduleName", s.moduleSourceModuleName).
Doc(`If set, the name of the module this source references, including any overrides at runtime by callers.`),
dagql.Func("moduleOriginalName", s.moduleSourceModuleOriginalName).
Doc(`The original name of the module this source references, as defined in the module configuration.`),
dagql.Func("withName", s.moduleSourceWithName).
Doc(`Update the module source with a new name.`).
ArgDoc("name", `The name to set.`),
dagql.NodeFunc("dependencies", s.moduleSourceDependencies).
Doc(`The dependencies of the module source. Includes dependencies from the configuration and any extras from withDependencies calls.`),
dagql.Func("withDependencies", s.moduleSourceWithDependencies).
Doc(`Append the provided dependencies to the module source's dependency list.`).
ArgDoc("dependencies", `The dependencies to append.`),
dagql.Func("withSDK", s.moduleSourceWithSDK).
Doc(`Update the module source with a new SDK.`).
ArgDoc("sdk", `The SDK to set.`),
dagql.Func("configExists", s.moduleSourceConfigExists).
Doc(`Returns whether the module source has a configuration file.`),
dagql.Func("resolveDependency", s.moduleSourceResolveDependency).
Doc(`Resolve the provided module source arg as a dependency relative to this module source.`).
ArgDoc("dep", `The dependency module source to resolve.`),
dagql.Func("asString", s.moduleSourceAsString).
Doc(`A human readable ref string representation of this module source.`),
dagql.NodeFunc("asModule", s.moduleSourceAsModule).
Doc(`Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation`),
dagql.Func("resolveFromCaller", s.moduleSourceResolveFromCaller).
Impure(`Loads live caller-specific data from their filesystem.`).
Doc(`Load the source from its path on the caller's filesystem, including only needed+configured files and directories. Only valid for local sources.`),
dagql.Func("resolveContextPathFromCaller", s.moduleSourceResolveContextPathFromCaller).
Impure(`Queries live caller-specific data from their filesystem.`).
Doc(`The path to the module source's context directory on the caller's filesystem. Only valid for local sources.`),
}.Install(s.dag)
dagql.Fields[*core.LocalModuleSource]{}.Install(s.dag)
dagql.Fields[*core.GitModuleSource]{
dagql.Func("cloneURL", s.gitModuleSourceCloneURL).
Doc(`The URL from which the source's git repo can be cloned.`),
dagql.Func("htmlURL", s.gitModuleSourceHTMLURL).
Doc(`The URL to the source's git repo in a web browser`),
}.Install(s.dag)
dagql.Fields[*core.ModuleDependency]{}.Install(s.dag)
dagql.Fields[*core.Module]{
dagql.Func("withSource", s.moduleWithSource).
Doc(`Retrieves the module with basic configuration loaded if present.`).
ArgDoc("source", `The module source to initialize from.`),
dagql.Func("generatedContextDiff", s.moduleGeneratedContextDiff).
Doc(`The generated files and directories made on top of the module source's context directory.`),
dagql.NodeFunc("initialize", s.moduleInitialize).
Doc(`Retrieves the module with the objects loaded via its SDK.`),
dagql.Func("withDescription", s.moduleWithDescription).
Doc(`Retrieves the module with the given description`).
ArgDoc("description", `The description to set`),
dagql.Func("withObject", s.moduleWithObject).
Doc(`This module plus the given Object type and associated functions.`),
dagql.Func("withInterface", s.moduleWithInterface).
Doc(`This module plus the given Interface type and associated functions`),
dagql.NodeFunc("serve", s.moduleServe).
Impure(`Mutates the calling session's global schema.`).
Doc(`Serve a module's API in the current session.`,
`Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.`),
}.Install(s.dag)
dagql.Fields[*core.CurrentModule]{
dagql.Func("name", s.currentModuleName).
Doc(`The name of the module being executed in`),
dagql.Func("source", s.currentModuleSource).
Doc(`The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).`),
dagql.Func("workdir", s.currentModuleWorkdir).
Impure(`Loads live caller-specific data from their filesystem.`).
Doc(`Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.`).
ArgDoc("path", `Location of the directory to access (e.g., ".").`).
ArgDoc("exclude", `Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).`).
ArgDoc("include", `Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).`),
dagql.Func("workdirFile", s.currentModuleWorkdirFile).
Impure(`Loads live caller-specific data from their filesystem.`).
Doc(`Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.`).
ArgDoc("path", `Location of the file to retrieve (e.g., "README.md").`),
}.Install(s.dag)
dagql.Fields[*core.Function]{
dagql.Func("withDescription", s.functionWithDescription).
Doc(`Returns the function with the given doc string.`).
ArgDoc("description", `The doc string to set.`),
dagql.Func("withArg", s.functionWithArg).
Doc(`Returns the function with the provided argument`).
ArgDoc("name", `The name of the argument`).
ArgDoc("typeDef", `The type of the argument`).
ArgDoc("description", `A doc string for the argument, if any`).
ArgDoc("defaultValue", `A default value to use for this argument if not explicitly set by the caller, if any`),
}.Install(s.dag)
dagql.Fields[*core.FunctionArg]{}.Install(s.dag)
dagql.Fields[*core.FunctionCallArgValue]{}.Install(s.dag)
dagql.Fields[*core.TypeDef]{
dagql.Func("withOptional", s.typeDefWithOptional).
Doc(`Sets whether this type can be set to null.`),
dagql.Func("withKind", s.typeDefWithKind).
Doc(`Sets the kind of the type.`),
dagql.Func("withListOf", s.typeDefWithListOf).
Doc(`Returns a TypeDef of kind List with the provided type for its elements.`),
dagql.Func("withObject", s.typeDefWithObject).
Doc(`Returns a TypeDef of kind Object with the provided name.`,
`Note that an object's fields and functions may be omitted if the
intent is only to refer to an object. This is how functions are able to
return their own object, or any other circular reference.`),
dagql.Func("withInterface", s.typeDefWithInterface).
Doc(`Returns a TypeDef of kind Interface with the provided name.`),
dagql.Func("withField", s.typeDefWithObjectField).
Doc(`Adds a static field for an Object TypeDef, failing if the type is not an object.`).
ArgDoc("name", `The name of the field in the object`).
ArgDoc("typeDef", `The type of the field`).
ArgDoc("description", `A doc string for the field, if any`),
dagql.Func("withFunction", s.typeDefWithFunction).
Doc(`Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.`),
dagql.Func("withConstructor", s.typeDefWithObjectConstructor).
Doc(`Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.`),
}.Install(s.dag)
dagql.Fields[*core.ObjectTypeDef]{}.Install(s.dag)
dagql.Fields[*core.InterfaceTypeDef]{}.Install(s.dag)
dagql.Fields[*core.InputTypeDef]{}.Install(s.dag)
dagql.Fields[*core.FieldTypeDef]{}.Install(s.dag)
dagql.Fields[*core.ListTypeDef]{}.Install(s.dag)
dagql.Fields[*core.GeneratedCode]{
dagql.Func("withVCSGeneratedPaths", s.generatedCodeWithVCSGeneratedPaths).
Doc(`Set the list of paths to mark generated in version control.`),
dagql.Func("withVCSIgnoredPaths", s.generatedCodeWithVCSIgnoredPaths).
Doc(`Set the list of paths to ignore in version control.`),
}.Install(s.dag)
}
func (s *moduleSchema) typeDef(ctx context.Context, _ *core.Query, args struct{}) (*core.TypeDef, error) {
return &core.TypeDef{}, nil
}
func (s *moduleSchema) typeDefWithOptional(ctx context.Context, def *core.TypeDef, args struct {
Optional bool
}) (*core.TypeDef, error) {
return def.WithOptional(args.Optional), nil
}
func (s *moduleSchema) typeDefWithKind(ctx context.Context, def *core.TypeDef, args struct {
Kind core.TypeDefKind
}) (*core.TypeDef, error) {
return def.WithKind(args.Kind), nil
}
func (s *moduleSchema) typeDefWithListOf(ctx context.Context, def *core.TypeDef, args struct {
ElementType core.TypeDefID
}) (*core.TypeDef, error) {
elemType, err := args.ElementType.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode element type: %w", err)
}
return def.WithListOf(elemType.Self), nil
}
func (s *moduleSchema) typeDefWithObject(ctx context.Context, def *core.TypeDef, args struct {
Name string
Description string `default:""`
}) (*core.TypeDef, error) {
if args.Name == "" {
return nil, fmt.Errorf("object type def must have a name")
}
return def.WithObject(args.Name, args.Description), nil
}
func (s *moduleSchema) typeDefWithInterface(ctx context.Context, def *core.TypeDef, args struct {
Name string
Description string `default:""`
}) (*core.TypeDef, error) {
return def.WithInterface(args.Name, args.Description), nil
}
func (s *moduleSchema) typeDefWithObjectField(ctx context.Context, def *core.TypeDef, args struct {
Name string
TypeDef core.TypeDefID
Description string `default:""`
}) (*core.TypeDef, error) {
fieldType, err := args.TypeDef.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode element type: %w", err)
}
return def.WithObjectField(args.Name, fieldType.Self, args.Description)
}
func (s *moduleSchema) typeDefWithFunction(ctx context.Context, def *core.TypeDef, args struct {
Function core.FunctionID
}) (*core.TypeDef, error) {
fn, err := args.Function.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode element type: %w", err)
}
return def.WithFunction(fn.Self)
}
func (s *moduleSchema) typeDefWithObjectConstructor(ctx context.Context, def *core.TypeDef, args struct {
Function core.FunctionID
}) (*core.TypeDef, error) {
inst, err := args.Function.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode element type: %w", err)
}
fn := inst.Self.Clone()
// Constructors are invoked by setting the ObjectName to the name of the object its constructing and the
// FunctionName to "", so ignore the name of the function.
fn.Name = ""
fn.OriginalName = ""
return def.WithObjectConstructor(fn)
}
func (s *moduleSchema) generatedCode(ctx context.Context, _ *core.Query, args struct {
Code core.DirectoryID
}) (*core.GeneratedCode, error) {
dir, err := args.Code.Load(ctx, s.dag)
if err != nil {
return nil, err
}
return core.NewGeneratedCode(dir), nil
}
func (s *moduleSchema) generatedCodeWithVCSGeneratedPaths(ctx context.Context, code *core.GeneratedCode, args struct {
Paths []string
}) (*core.GeneratedCode, error) {
return code.WithVCSGeneratedPaths(args.Paths), nil
}
func (s *moduleSchema) generatedCodeWithVCSIgnoredPaths(ctx context.Context, code *core.GeneratedCode, args struct {
Paths []string
}) (*core.GeneratedCode, error) {
return code.WithVCSIgnoredPaths(args.Paths), nil
}
func (s *moduleSchema) module(ctx context.Context, query *core.Query, _ struct{}) (*core.Module, error) {
return query.NewModule(), nil
}
func (s *moduleSchema) function(ctx context.Context, _ *core.Query, args struct {
Name string
ReturnType core.TypeDefID
}) (*core.Function, error) {
returnType, err := args.ReturnType.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode return type: %w", err)
}
return core.NewFunction(args.Name, returnType.Self), nil
}
func (s *moduleSchema) functionWithDescription(ctx context.Context, fn *core.Function, args struct {
Description string
}) (*core.Function, error) {
return fn.WithDescription(args.Description), nil
}
func (s *moduleSchema) functionWithArg(ctx context.Context, fn *core.Function, args struct {
Name string
TypeDef core.TypeDefID
Description string `default:""`
DefaultValue core.JSON `default:""`
}) (*core.Function, error) {
argType, err := args.TypeDef.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode arg type: %w", err)
}
return fn.WithArg(args.Name, argType.Self, args.Description, args.DefaultValue), nil
}
func (s *moduleSchema) moduleDependency(
ctx context.Context,
query *core.Query,
args struct {
Source core.ModuleSourceID
Name string `default:""`
},
) (*core.ModuleDependency, error) {
src, err := args.Source.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode dependency source: %w", err)
}
return &core.ModuleDependency{
Source: src,
Name: args.Name,
}, nil
}
func (s *moduleSchema) currentModule(
ctx context.Context,
self *core.Query,
_ struct{},
) (*core.CurrentModule, error) {
mod, err := self.CurrentModule(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get current module: %w", err)
}
return &core.CurrentModule{Module: mod}, nil
}
func (s *moduleSchema) currentFunctionCall(ctx context.Context, self *core.Query, _ struct{}) (*core.FunctionCall, error) {
return self.CurrentFunctionCall(ctx)
}
func (s *moduleSchema) moduleServe(ctx context.Context, modMeta dagql.Instance[*core.Module], _ struct{}) (dagql.Nullable[core.Void], error) {
return dagql.Null[core.Void](), modMeta.Self.Query.ServeModuleToMainClient(ctx, modMeta)
}
func (s *moduleSchema) currentTypeDefs(ctx context.Context, self *core.Query, _ struct{}) ([]*core.TypeDef, error) {
deps, err := self.CurrentServedDeps(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get current module: %w", err)
}
return deps.TypeDefs(ctx)
}
func (s *moduleSchema) functionCallReturnValue(ctx context.Context, fnCall *core.FunctionCall, args struct {
Value core.JSON
}) (dagql.Nullable[core.Void], error) {
// TODO: error out if caller is not coming from a module
return dagql.Null[core.Void](), fnCall.ReturnValue(ctx, args.Value)
}
func (s *moduleSchema) moduleWithDescription(ctx context.Context, mod *core.Module, args struct {
Description string
}) (*core.Module, error) {
return mod.WithDescription(args.Description), nil
}
func (s *moduleSchema) moduleWithObject(ctx context.Context, mod *core.Module, args struct {
Object core.TypeDefID
}) (_ *core.Module, rerr error) {
def, err := args.Object.Load(ctx, s.dag)
if err != nil {
return nil, err
}
return mod.WithObject(ctx, def.Self)
}
func (s *moduleSchema) moduleWithInterface(ctx context.Context, mod *core.Module, args struct {
Iface core.TypeDefID
}) (_ *core.Module, rerr error) {
def, err := args.Iface.Load(ctx, s.dag)
if err != nil {
return nil, err
}
return mod.WithInterface(ctx, def.Self)
}
func (s *moduleSchema) currentModuleName(
ctx context.Context,
curMod *core.CurrentModule,
args struct{},
) (string, error) {
return curMod.Module.Name(), nil
}
func (s *moduleSchema) currentModuleSource(
ctx context.Context,
curMod *core.CurrentModule,
args struct{},
) (inst dagql.Instance[*core.Directory], err error) {
srcSubpath, err := curMod.Module.Source.Self.SourceSubpathWithDefault(ctx)
if err != nil {
return inst, fmt.Errorf("failed to get module source subpath: %w", err)
}
err = s.dag.Select(ctx, curMod.Module.GeneratedContextDirectory, &inst,
dagql.Selector{
Field: "directory",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(srcSubpath)},
},
},
)
return inst, err
}
func (s *moduleSchema) currentModuleWorkdir(
ctx context.Context,
curMod *core.CurrentModule,
args struct {
Path string
core.CopyFilter
},
) (inst dagql.Instance[*core.Directory], err error) {
if !filepath.IsLocal(args.Path) {
return inst, fmt.Errorf("workdir path %q escapes workdir", args.Path)
}
args.Path = filepath.Join(runtimeWorkdirPath, args.Path)
err = s.dag.Select(ctx, s.dag.Root(), &inst,
dagql.Selector{
Field: "host",
},
dagql.Selector{
Field: "directory",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(args.Path)},
{Name: "exclude", Value: asArrayInput(args.Exclude, dagql.NewString)},
{Name: "include", Value: asArrayInput(args.Include, dagql.NewString)},
},
},
)
return inst, err
}
func (s *moduleSchema) currentModuleWorkdirFile(
ctx context.Context,
curMod *core.CurrentModule,
args struct {
Path string
},
) (inst dagql.Instance[*core.File], err error) {
if !filepath.IsLocal(args.Path) {
return inst, fmt.Errorf("workdir path %q escapes workdir", args.Path)
}
args.Path = filepath.Join(runtimeWorkdirPath, args.Path)
err = s.dag.Select(ctx, s.dag.Root(), &inst,
dagql.Selector{
Field: "host",
},
dagql.Selector{
Field: "file",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(args.Path)},
},
},
)
return inst, err
}
type directoryAsModuleArgs struct {
SourceRootPath string `default:"."`
}
func (s *moduleSchema) directoryAsModule(ctx context.Context, contextDir dagql.Instance[*core.Directory], args directoryAsModuleArgs) (*core.Module, error) {
var inst dagql.Instance[*core.Module]
err := s.dag.Select(ctx, s.dag.Root(), &inst,
dagql.Selector{
Field: "moduleSource",
Args: []dagql.NamedInput{
{Name: "refString", Value: dagql.String(args.SourceRootPath)},
},
},
dagql.Selector{
Field: "withContextDirectory",
Args: []dagql.NamedInput{
{Name: "dir", Value: dagql.NewID[*core.Directory](contextDir.ID())},
},
},
dagql.Selector{
Field: "asModule",
},
)
if err != nil {
return nil, fmt.Errorf("failed to create module from directory: %w", err)
}
return inst.Self, nil
}
// TODO: initialize probably doesn't need to exist anymore, can just try to init in withSource
// and, if error, return that error in future calls that rely on the module being initialized
func (s *moduleSchema) moduleInitialize(
ctx context.Context,
inst dagql.Instance[*core.Module],
args struct{},
) (*core.Module, error) {
if inst.Self.NameField == "" || inst.Self.SDKConfig == "" {
return nil, fmt.Errorf("module name and SDK must be set")
}
mod, err := inst.Self.Initialize(ctx, inst, dagql.CurrentID(ctx))
if err != nil {
return nil, fmt.Errorf("failed to initialize module: %w", err)
}
return mod, nil
}
func (s *moduleSchema) moduleWithSource(ctx context.Context, mod *core.Module, args struct {
Source core.ModuleSourceID
}) (*core.Module, error) {
src, err := args.Source.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode module source: %w", err)
}
mod = mod.Clone()
mod.Source = src
mod.NameField, err = src.Self.ModuleName(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get module name: %w", err)
}
mod.OriginalName, err = src.Self.ModuleOriginalName(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get module original name: %w", err)
}
mod.SDKConfig, err = src.Self.SDK(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get module SDK: %w", err)
}
if err := s.updateDeps(ctx, mod, src); err != nil {
return nil, fmt.Errorf("failed to update module dependencies: %w", err)
}
if err := s.updateCodegenAndRuntime(ctx, mod, src); err != nil {
return nil, fmt.Errorf("failed to update codegen and runtime: %w", err)
}
// update dagger.json last so SDKs can't intentionally or unintentionally
// modify it during codegen in ways that would be hard to deal with
if err := s.updateDaggerConfig(ctx, mod, src); err != nil {
return nil, fmt.Errorf("failed to update dagger.json: %w", err)
}
return mod, nil
}
func (s *moduleSchema) moduleGeneratedContextDiff(
ctx context.Context,
mod *core.Module,
args struct{},
) (inst dagql.Instance[*core.Directory], err error) {
baseContext, err := mod.Source.Self.ContextDirectory()
if err != nil {
return inst, fmt.Errorf("failed to get base context directory: %w", err)
}
var diff dagql.Instance[*core.Directory]
err = s.dag.Select(ctx, baseContext, &diff,
dagql.Selector{
Field: "diff",
Args: []dagql.NamedInput{
{Name: "other", Value: dagql.NewID[*core.Directory](mod.GeneratedContextDirectory.ID())},
},
},
)
if err != nil {
return inst, fmt.Errorf("failed to diff generated context: %w", err)
}
return diff, nil
}
func (s *moduleSchema) updateDeps(
ctx context.Context,
mod *core.Module,
src dagql.Instance[*core.ModuleSource],
) error {
var deps []dagql.Instance[*core.ModuleDependency]
err := s.dag.Select(ctx, src, &deps, dagql.Selector{Field: "dependencies"})
if err != nil {
return fmt.Errorf("failed to load module dependencies: %w", err)
}
mod.DependencyConfig = make([]*core.ModuleDependency, len(deps))
for i, dep := range deps {
mod.DependencyConfig[i] = dep.Self
}
mod.DependenciesField = make([]dagql.Instance[*core.Module], len(deps))
var eg errgroup.Group
for i, dep := range deps {
i, dep := i, dep
eg.Go(func() error {
err := s.dag.Select(ctx, dep.Self.Source, &mod.DependenciesField[i],
dagql.Selector{
Field: "withName",
Args: []dagql.NamedInput{
{Name: "name", Value: dagql.String(dep.Self.Name)},
},
},
dagql.Selector{
Field: "asModule",
},
dagql.Selector{
Field: "initialize",
},
)
if err != nil {
return fmt.Errorf("failed to initialize dependency module: %w", err)
}
return nil
})
}
if err := eg.Wait(); err != nil {
return fmt.Errorf("failed to initialize dependency modules: %w", err)
}
mod.Deps = core.NewModDeps(src.Self.Query, src.Self.Query.DefaultDeps.Mods)
for _, dep := range mod.DependenciesField {
mod.Deps = mod.Deps.Append(dep.Self)
}
return nil
}
func (s *moduleSchema) updateCodegenAndRuntime(
ctx context.Context,
mod *core.Module,
src dagql.Instance[*core.ModuleSource],
) error {
if mod.NameField == "" || mod.SDKConfig == "" {
// can't codegen yet
return nil
}
baseContext, err := src.Self.ContextDirectory()
if err != nil {
return fmt.Errorf("failed to get base context directory: %w", err)
}
mod.GeneratedContextDirectory = baseContext
rootSubpath, err := src.Self.SourceRootSubpath()
if err != nil {
return fmt.Errorf("failed to get source root subpath: %w", err)
}
sdk, err := s.sdkForModule(ctx, src.Self.Query, mod.SDKConfig, src)
if err != nil {
return fmt.Errorf("failed to load sdk for module: %w", err)
}
generatedCode, err := sdk.Codegen(ctx, mod.Deps, src)
if err != nil {
return fmt.Errorf("failed to generate code: %w", err)
}
var diff dagql.Instance[*core.Directory]
err = s.dag.Select(ctx, baseContext, &diff,
dagql.Selector{
Field: "diff",
Args: []dagql.NamedInput{
{Name: "other", Value: dagql.NewID[*core.Directory](generatedCode.Code.ID())},
},
},
)
if err != nil {
return fmt.Errorf("failed to diff generated code: %w", err)
}
err = s.dag.Select(ctx, mod.GeneratedContextDirectory, &mod.GeneratedContextDirectory,
dagql.Selector{
Field: "withDirectory",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String("/")},
{Name: "directory", Value: dagql.NewID[*core.Directory](diff.ID())},
},
},
)
if err != nil {
return fmt.Errorf("failed to add codegen to module context directory: %w", err)
}
// update .gitattributes
// (linter thinks this chunk of code is too similar to the below, but not clear abstraction is worth it)
//nolint:dupl
if len(generatedCode.VCSGeneratedPaths) > 0 {
gitAttrsPath := filepath.Join(rootSubpath, ".gitattributes")
var gitAttrsContents []byte
gitAttrsFile, err := baseContext.Self.File(ctx, gitAttrsPath)
if err == nil {
gitAttrsContents, err = gitAttrsFile.Contents(ctx)
if err != nil {
return fmt.Errorf("failed to get git attributes file contents: %w", err)
}
if !bytes.HasSuffix(gitAttrsContents, []byte("\n")) {
gitAttrsContents = append(gitAttrsContents, []byte("\n")...)
}
}
for _, fileName := range generatedCode.VCSGeneratedPaths {
if bytes.Contains(gitAttrsContents, []byte(fileName)) {
// already has some config for the file
continue
}
gitAttrsContents = append(gitAttrsContents,
[]byte(fmt.Sprintf("/%s linguist-generated\n", fileName))...,
)
}
err = s.dag.Select(ctx, mod.GeneratedContextDirectory, &mod.GeneratedContextDirectory,
dagql.Selector{
Field: "withNewFile",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(gitAttrsPath)},
{Name: "contents", Value: dagql.String(gitAttrsContents)},
{Name: "permissions", Value: dagql.Int(0600)},
},
},
)
if err != nil {
return fmt.Errorf("failed to add vcs generated file: %w", err)
}
}
// update .gitignore
// (linter thinks this chunk of code is too similar to the above, but not clear abstraction is worth it)
//nolint:dupl
if len(generatedCode.VCSIgnoredPaths) > 0 {
gitIgnorePath := filepath.Join(rootSubpath, ".gitignore")
var gitIgnoreContents []byte
gitIgnoreFile, err := baseContext.Self.File(ctx, gitIgnorePath)
if err == nil {
gitIgnoreContents, err = gitIgnoreFile.Contents(ctx)
if err != nil {
return fmt.Errorf("failed to get .gitignore file contents: %w", err)
}
if !bytes.HasSuffix(gitIgnoreContents, []byte("\n")) {
gitIgnoreContents = append(gitIgnoreContents, []byte("\n")...)
}
}
for _, fileName := range generatedCode.VCSIgnoredPaths {
if bytes.Contains(gitIgnoreContents, []byte(fileName)) {
continue
}
gitIgnoreContents = append(gitIgnoreContents,
[]byte(fmt.Sprintf("/%s\n", fileName))...,
)
}
err = s.dag.Select(ctx, mod.GeneratedContextDirectory, &mod.GeneratedContextDirectory,
dagql.Selector{
Field: "withNewFile",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(gitIgnorePath)},
{Name: "contents", Value: dagql.String(gitIgnoreContents)},
{Name: "permissions", Value: dagql.Int(0600)},
},
},
)
if err != nil {
return fmt.Errorf("failed to add vcs ignore file: %w", err)
}
}
mod.Runtime, err = sdk.Runtime(ctx, mod.Deps, src)
if err != nil {
return fmt.Errorf("failed to get module runtime: %w", err)
}
return nil
}
func (s *moduleSchema) updateDaggerConfig(
ctx context.Context,
mod *core.Module,
src dagql.Instance[*core.ModuleSource],
) error {
modCfg, ok, err := src.Self.ModuleConfig(ctx)
if err != nil {
return fmt.Errorf("failed to get module config: %w", err)
}
if !ok {
modCfg = &modules.ModuleConfig{}
}
modCfg.Name = mod.OriginalName
modCfg.SDK = mod.SDKConfig
modCfg.EngineVersion = engine.Version
sourceRootSubpath, err := src.Self.SourceRootSubpath()
if err != nil {
return fmt.Errorf("failed to get source root subpath: %w", err)
}
sourceSubpath, err := src.Self.SourceSubpathWithDefault(ctx)
if err != nil {
return fmt.Errorf("failed to get source subpath: %w", err)
}
sourceRelSubpath, err := filepath.Rel(sourceRootSubpath, sourceSubpath)
if err != nil {
return fmt.Errorf("failed to get relative source subpath: %w", err)
}
if sourceRelSubpath != "." {
modCfg.Source = sourceRelSubpath
}
modCfg.Dependencies = make([]*modules.ModuleConfigDependency, len(mod.DependencyConfig))
for i, dep := range mod.DependencyConfig {
var srcStr string
switch dep.Source.Self.Kind {
case core.ModuleSourceKindLocal:
// make it relative to this module's source root
depRootSubpath, err := dep.Source.Self.SourceRootSubpath()
if err != nil {
return fmt.Errorf("failed to get source root subpath: %w", err)
}
depRelPath, err := filepath.Rel(sourceRootSubpath, depRootSubpath)
if err != nil {
return fmt.Errorf("failed to get relative path to dep: %w", err)
}
srcStr = depRelPath
case core.ModuleSourceKindGit:
srcStr = dep.Source.Self.AsGitSource.Value.RefString()
default:
return fmt.Errorf("unsupported dependency source kind: %s", dep.Source.Self.Kind)
}
depName := dep.Name
if dep.Name == "" {
// fill in default dep names if missing with the name of the module
depName = mod.DependenciesField[i].Self.Name()
}
modCfg.Dependencies[i] = &modules.ModuleConfigDependency{
Name: depName,
Source: srcStr,
}
}
rootSubpath, err := src.Self.SourceRootSubpath()
if err != nil {
return fmt.Errorf("failed to get source root subpath: %w", err)
}
modCfgPath := filepath.Join(rootSubpath, modules.Filename)
updatedModCfgBytes, err := json.MarshalIndent(modCfg, "", " ")
if err != nil {
return fmt.Errorf("failed to encode module config: %w", err)
}
updatedModCfgBytes = append(updatedModCfgBytes, '\n')
if mod.GeneratedContextDirectory.Self == nil {
// valid case for sdk-less modules (i.e. dep only), initialize as empty directory
err = s.dag.Select(ctx, s.dag.Root(), &mod.GeneratedContextDirectory,
dagql.Selector{Field: "directory"},
)
if err != nil {
return fmt.Errorf("failed to initialize module context directory: %w", err)
}
}
err = s.dag.Select(ctx, mod.GeneratedContextDirectory, &mod.GeneratedContextDirectory,
dagql.Selector{
Field: "withNewFile",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(modCfgPath)},
{Name: "contents", Value: dagql.String(updatedModCfgBytes)},
{Name: "permissions", Value: dagql.Int(0644)},
},
},
)
if err != nil {
return fmt.Errorf("failed to update module context directory config file: %w", err)
}
return nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,623 | Need integ tests for git modules | Right now all our integ tests only use local refs because git modules are locked into github repos and we've been trying to avoid tests depending on modules in an external git repo. However, I think we should just bite the bullet on that at this point since missing that test coverage is too big a gap. | https://github.com/dagger/dagger/issues/6623 | https://github.com/dagger/dagger/pull/6693 | 6a3689eeb680920fe5f830ac972be3dc1fa4f29b | a659c04b9982ef90a999dc20efb9485b11eda556 | "2024-02-08T18:15:16Z" | go | "2024-02-20T10:52:53Z" | core/schema/modulesource.go | package schema
import (
"context"
"encoding/json"
"errors"
"fmt"
"path/filepath"
"sort"
"strings"
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/dagql"
"github.com/dagger/dagger/engine/buildkit"
"github.com/vito/progrock"
"golang.org/x/sync/errgroup"
)
type moduleSourceArgs struct {
// avoiding name "ref" due to that being a reserved word in some SDKs (e.g. Rust)
RefString string
Stable bool `default:"false"`
}
func (s *moduleSchema) moduleSource(ctx context.Context, query *core.Query, args moduleSourceArgs) (*core.ModuleSource, error) {
parsed := parseRefString(args.RefString)
modPath, modVersion, hasVersion, isGitHub := parsed.modPath, parsed.modVersion, parsed.hasVersion, parsed.isGitHub
if !hasVersion && isGitHub && args.Stable {
return nil, fmt.Errorf("no version provided for stable remote ref: %s", args.RefString)
}
src := &core.ModuleSource{
Query: query,
Kind: parsed.kind,
}
switch src.Kind {
case core.ModuleSourceKindLocal:
if filepath.IsAbs(modPath) {
return nil, fmt.Errorf("local module source root path is absolute: %s", modPath)
}
src.AsLocalSource = dagql.NonNull(&core.LocalModuleSource{
RootSubpath: modPath,
})
case core.ModuleSourceKindGit:
if !isGitHub {
return nil, fmt.Errorf("for now, only github.com/ paths are supported: %q", args.RefString)
}
src.AsGitSource = dagql.NonNull(&core.GitModuleSource{})
segments := strings.SplitN(modPath, "/", 4)
if len(segments) < 3 {
return nil, fmt.Errorf("invalid github.com path: %s", modPath)
}
src.AsGitSource.Value.URLParent = segments[0] + "/" + segments[1] + "/" + segments[2]
cloneURL := src.AsGitSource.Value.CloneURL()
if !hasVersion {
if args.Stable {
return nil, fmt.Errorf("no version provided for stable remote ref: %s", args.RefString)
}
var err error
modVersion, err = defaultBranch(ctx, cloneURL)
if err != nil {
return nil, fmt.Errorf("determine default branch: %w", err)
}
}
src.AsGitSource.Value.Version = modVersion
var subPath string
if len(segments) == 4 {
subPath = segments[3]
} else {
subPath = "/"
}
commitRef := modVersion
if hasVersion && isSemver(modVersion) {
allTags, err := gitTags(ctx, cloneURL)
if err != nil {
return nil, fmt.Errorf("get git tags: %w", err)
}
matched, err := matchVersion(allTags, modVersion, subPath)
if err != nil {
return nil, fmt.Errorf("matching version to tags: %w", err)
}
// reassign modVersion to matched tag which could be subPath/tag
commitRef = matched
}
var gitRef dagql.Instance[*core.GitRef]
err := s.dag.Select(ctx, s.dag.Root(), &gitRef,
dagql.Selector{
Field: "git",
Args: []dagql.NamedInput{
{Name: "url", Value: dagql.String(cloneURL)},
},
},
dagql.Selector{
Field: "commit",
Args: []dagql.NamedInput{
{Name: "id", Value: dagql.String(commitRef)},
},
},
)
if err != nil {
return nil, fmt.Errorf("failed to resolve git src: %w", err)
}
gitCommit, err := gitRef.Self.Commit(ctx)
if err != nil {
return nil, fmt.Errorf("failed to resolve git src to commit: %w", err)
}
src.AsGitSource.Value.Commit = gitCommit
subPath = filepath.Clean(subPath)
if !filepath.IsAbs(subPath) && !filepath.IsLocal(subPath) {
return nil, fmt.Errorf("git module source subpath points out of root: %q", subPath)
}
if filepath.IsAbs(subPath) {
subPath = strings.TrimPrefix(subPath, "/")
}
// TODO:(sipsma) support sparse loading of git repos similar to how local dirs are loaded.
// Related: https://github.com/dagger/dagger/issues/6292
err = s.dag.Select(ctx, gitRef, &src.AsGitSource.Value.ContextDirectory,
dagql.Selector{Field: "tree"},
)
if err != nil {
return nil, fmt.Errorf("failed to load git dir: %w", err)
}
// git source needs rootpath on itself too for constructing urls
src.AsGitSource.Value.RootSubpath = subPath
}
return src, nil
}
type parsedRefString struct {
modPath string
modVersion string
hasVersion bool
isGitHub bool
kind core.ModuleSourceKind
}
func parseRefString(refString string) parsedRefString {
var parsed parsedRefString
parsed.modPath, parsed.modVersion, parsed.hasVersion = strings.Cut(refString, "@")
parsed.isGitHub = strings.HasPrefix(parsed.modPath, "github.com/")
if !parsed.hasVersion && !parsed.isGitHub {
parsed.kind = core.ModuleSourceKindLocal
return parsed
}
parsed.kind = core.ModuleSourceKindGit
return parsed
}
func (s *moduleSchema) moduleSourceAsModule(
ctx context.Context,
src dagql.Instance[*core.ModuleSource],
args struct{},
) (inst dagql.Instance[*core.Module], err error) {
err = s.dag.Select(ctx, s.dag.Root(), &inst,
dagql.Selector{
Field: "module",
},
dagql.Selector{
Field: "withSource",
Args: []dagql.NamedInput{
{Name: "source", Value: dagql.NewID[*core.ModuleSource](src.ID())},
},
},
)
if err != nil {
return inst, fmt.Errorf("failed to create module: %w", err)
}
return inst, err
}
func (s *moduleSchema) moduleSourceAsString(ctx context.Context, src *core.ModuleSource, args struct{}) (string, error) {
return src.RefString()
}
func (s *moduleSchema) gitModuleSourceCloneURL(
ctx context.Context,
ref *core.GitModuleSource,
args struct{},
) (string, error) {
return ref.CloneURL(), nil
}
func (s *moduleSchema) gitModuleSourceHTMLURL(
ctx context.Context,
ref *core.GitModuleSource,
args struct{},
) (string, error) {
return ref.HTMLURL(), nil
}
func (s *moduleSchema) moduleSourceConfigExists(
ctx context.Context,
src *core.ModuleSource,
args struct{},
) (bool, error) {
_, ok, err := src.ModuleConfig(ctx)
return ok, err
}
func (s *moduleSchema) moduleSourceSubpath(ctx context.Context, src *core.ModuleSource, args struct{}) (string, error) {
return src.SourceSubpath(ctx)
}
func (s *moduleSchema) moduleSourceWithSourceSubpath(
ctx context.Context,
src *core.ModuleSource,
args struct {
Path string
},
) (*core.ModuleSource, error) {
if args.Path == "" {
return src, nil
}
if !filepath.IsLocal(args.Path) {
return nil, fmt.Errorf("source subdir path %q escapes context", args.Path)
}
src = src.Clone()
src.WithSourceSubpath = args.Path
return src, nil
}
func (s *moduleSchema) moduleSourceRootSubpath(ctx context.Context, src *core.ModuleSource, args struct{}) (string, error) {
return src.SourceRootSubpath()
}
func (s *moduleSchema) moduleSourceModuleName(
ctx context.Context,
src *core.ModuleSource,
args struct{},
) (string, error) {
return src.ModuleName(ctx)
}
func (s *moduleSchema) moduleSourceModuleOriginalName(
ctx context.Context,
src *core.ModuleSource,
args struct{},
) (string, error) {
return src.ModuleOriginalName(ctx)
}
func (s *moduleSchema) moduleSourceWithName(
ctx context.Context,
src *core.ModuleSource,
args struct {
Name string
},
) (*core.ModuleSource, error) {
src = src.Clone()
src.WithName = args.Name
return src, nil
}
func (s *moduleSchema) moduleSourceDependencies(
ctx context.Context,
src dagql.Instance[*core.ModuleSource],
args struct{},
) ([]dagql.Instance[*core.ModuleDependency], error) {
modCfg, ok, err := src.Self.ModuleConfig(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get module config: %w", err)
}
var existingDeps []dagql.Instance[*core.ModuleDependency]
if ok && len(modCfg.Dependencies) > 0 {
existingDeps = make([]dagql.Instance[*core.ModuleDependency], len(modCfg.Dependencies))
var eg errgroup.Group
for i, depCfg := range modCfg.Dependencies {
i, depCfg := i, depCfg
eg.Go(func() error {
var depSrc dagql.Instance[*core.ModuleSource]
err := s.dag.Select(ctx, s.dag.Root(), &depSrc,
dagql.Selector{
Field: "moduleSource",
Args: []dagql.NamedInput{
{Name: "refString", Value: dagql.String(depCfg.Source)},
},
},
)
if err != nil {
return fmt.Errorf("failed to create module source from dependency: %w", err)
}
var resolvedDepSrc dagql.Instance[*core.ModuleSource]
err = s.dag.Select(ctx, src, &resolvedDepSrc,
dagql.Selector{
Field: "resolveDependency",
Args: []dagql.NamedInput{
{Name: "dep", Value: dagql.NewID[*core.ModuleSource](depSrc.ID())},
},
},
)
if err != nil {
return fmt.Errorf("failed to resolve dependency: %w", err)
}
err = s.dag.Select(ctx, s.dag.Root(), &existingDeps[i],
dagql.Selector{
Field: "moduleDependency",
Args: []dagql.NamedInput{
{Name: "source", Value: dagql.NewID[*core.ModuleSource](resolvedDepSrc.ID())},
{Name: "name", Value: dagql.String(depCfg.Name)},
},
},
)
if err != nil {
return fmt.Errorf("failed to create module dependency: %w", err)
}
return nil
})
}
if err := eg.Wait(); err != nil {
return nil, fmt.Errorf("failed to load pre-configured dependencies: %w", err)
}
}
newDeps := make([]dagql.Instance[*core.ModuleDependency], len(src.Self.WithDependencies))
var eg errgroup.Group
for i, dep := range src.Self.WithDependencies {
i, dep := i, dep
eg.Go(func() error {
var resolvedDepSrc dagql.Instance[*core.ModuleSource]
err := s.dag.Select(ctx, src, &resolvedDepSrc,
dagql.Selector{
Field: "resolveDependency",
Args: []dagql.NamedInput{
{Name: "dep", Value: dagql.NewID[*core.ModuleSource](dep.Self.Source.ID())},
},
},
)
if err != nil {
return fmt.Errorf("failed to resolve dependency: %w", err)
}
err = s.dag.Select(ctx, s.dag.Root(), &newDeps[i],
dagql.Selector{
Field: "moduleDependency",
Args: []dagql.NamedInput{
{Name: "source", Value: dagql.NewID[*core.ModuleSource](resolvedDepSrc.ID())},
{Name: "name", Value: dagql.String(dep.Self.Name)},
},
},
)
if err != nil {
return fmt.Errorf("failed to create module dependency: %w", err)
}
return nil
})
}
if err := eg.Wait(); err != nil {
return nil, fmt.Errorf("failed to resolve new dependencies: %w", err)
}
// figure out the set of deps, keyed by their symbolic ref string, which de-dupes
// equivalent sources at different versions, preferring the version provided
// in the dependencies arg here
depSet := make(map[string]dagql.Instance[*core.ModuleDependency])
for _, dep := range existingDeps {
symbolic, err := dep.Self.Source.Self.Symbolic()
if err != nil {
return nil, fmt.Errorf("failed to get symbolic source ref: %w", err)
}
depSet[symbolic] = dep
}
for _, dep := range newDeps {
symbolic, err := dep.Self.Source.Self.Symbolic()
if err != nil {
return nil, fmt.Errorf("failed to get symbolic source ref: %w", err)
}
depSet[symbolic] = dep
}
finalDeps := make([]dagql.Instance[*core.ModuleDependency], 0, len(depSet))
for _, dep := range depSet {
finalDeps = append(finalDeps, dep)
}
sort.Slice(finalDeps, func(i, j int) bool {
return finalDeps[i].Self.Name < finalDeps[j].Self.Name
})
return finalDeps, nil
}
func (s *moduleSchema) moduleSourceWithDependencies(
ctx context.Context,
src *core.ModuleSource,
args struct {
Dependencies []core.ModuleDependencyID
},
) (*core.ModuleSource, error) {
src = src.Clone()
newDeps, err := collectIDInstances(ctx, s.dag, args.Dependencies)
if err != nil {
return nil, fmt.Errorf("failed to load module source dependencies from ids: %w", err)
}
src.WithDependencies = append(src.WithDependencies, newDeps...)
return src, nil
}
func (s *moduleSchema) moduleSourceWithSDK(
ctx context.Context,
src *core.ModuleSource,
args struct {
SDK string
},
) (*core.ModuleSource, error) {
src = src.Clone()
src.WithSDK = args.SDK
return src, nil
}
func (s *moduleSchema) moduleSourceResolveDependency(
ctx context.Context,
src *core.ModuleSource,
args struct {
Dep core.ModuleSourceID
},
) (inst dagql.Instance[*core.ModuleSource], err error) {
depSrc, err := args.Dep.Load(ctx, s.dag)
if err != nil {
return inst, fmt.Errorf("failed to decode module source: %w", err)
}
if depSrc.Self.Kind == core.ModuleSourceKindGit {
// git deps stand on their own, no special handling needed
return depSrc, nil
}
contextDir, err := src.ContextDirectory()
if err != nil {
return inst, fmt.Errorf("failed to get context directory: %w", err)
}
srcRootSubpath, err := src.SourceRootSubpath()
if err != nil {
return inst, fmt.Errorf("failed to get source root subpath: %w", err)
}
depRootSubpath, err := depSrc.Self.SourceRootSubpath()
if err != nil {
return inst, fmt.Errorf("failed to get source root subpath: %w", err)
}
// This dep is a local path relative to a src, need to find the src's root
// and return a source that points to the full path to this dep
if contextDir.Self == nil {
return inst, fmt.Errorf("cannot resolve dependency for module source with no context directory")
}
// depSrc.RootSubpath is relative to the src.RootSubpath, i.e.
// if src.RootSubpath is foo/bar and its dagger.json has dep on ../baz, then
// depSrc.RootSubpath is ../baz and relative to foo/bar.
// depSubpath is the resolved path, i.e. foo/baz.
depSubpath := filepath.Join(srcRootSubpath, depRootSubpath)
if !filepath.IsLocal(depSubpath) {
return inst, fmt.Errorf("module dep source path %q escapes root", depSubpath)
}
switch src.Kind {
case core.ModuleSourceKindGit:
src = src.Clone()
src.AsGitSource.Value.RootSubpath = depSubpath
// preserve the git metadata by just constructing a modified git source ref string
// and using that to load the dep
newDepRefStr, err := src.RefString()
if err != nil {
return inst, fmt.Errorf("failed to get module source ref string: %w", err)
}
var newDepSrc dagql.Instance[*core.ModuleSource]
err = s.dag.Select(ctx, s.dag.Root(), &newDepSrc,
dagql.Selector{
Field: "moduleSource",
Args: []dagql.NamedInput{
{Name: "refString", Value: dagql.String(newDepRefStr)},
{Name: "stable", Value: dagql.Boolean(true)},
},
},
)
if err != nil {
return inst, fmt.Errorf("failed to load git dep: %w", err)
}
return newDepSrc, nil
case core.ModuleSourceKindLocal:
var newDepSrc dagql.Instance[*core.ModuleSource]
err = s.dag.Select(ctx, s.dag.Root(), &newDepSrc,
dagql.Selector{
Field: "moduleSource",
Args: []dagql.NamedInput{
{Name: "refString", Value: dagql.String(depSubpath)},
},
},
dagql.Selector{
Field: "withContextDirectory",
Args: []dagql.NamedInput{
{Name: "dir", Value: dagql.NewID[*core.Directory](contextDir.ID())},
},
},
)
if err != nil {
return inst, fmt.Errorf("failed to load local dep: %w", err)
}
return newDepSrc, nil
default:
return inst, fmt.Errorf("unsupported module source kind: %q", src.Kind)
}
}
func (s *moduleSchema) moduleSourceContextDirectory(
ctx context.Context,
src *core.ModuleSource,
args struct{},
) (inst dagql.Instance[*core.Directory], err error) {
return src.ContextDirectory()
}
func (s *moduleSchema) moduleSourceWithContextDirectory(
ctx context.Context,
src *core.ModuleSource,
args struct {
Dir dagql.ID[*core.Directory]
},
) (*core.ModuleSource, error) {
if src.Kind != core.ModuleSourceKindLocal {
return nil, fmt.Errorf("cannot set context directory for non-local module source")
}
src = src.Clone()
var err error
src.AsLocalSource.Value.ContextDirectory, err = args.Dir.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to load context directory: %w", err)
}
return src, nil
}
func (s *moduleSchema) moduleSourceDirectory(
ctx context.Context,
src *core.ModuleSource,
args struct {
Path string
},
) (dir dagql.Instance[*core.Directory], err error) {
rootSubpath, err := src.SourceRootSubpath()
if err != nil {
return dir, fmt.Errorf("failed to get source root subpath: %w", err)
}
fullSubpath := filepath.Join("/", rootSubpath, args.Path)
contextDir, err := src.ContextDirectory()
if err != nil {
return dir, fmt.Errorf("failed to get context directory: %w", err)
}
err = s.dag.Select(ctx, contextDir, &dir,
dagql.Selector{
Field: "directory",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(fullSubpath)},
},
},
)
return dir, err
}
func (s *moduleSchema) moduleSourceResolveContextPathFromCaller(
ctx context.Context,
src *core.ModuleSource,
args struct{},
) (string, error) {
contextAbsPath, _, err := s.resolveContextPathFromCaller(ctx, src)
return contextAbsPath, err
}
func (s *moduleSchema) resolveContextPathFromCaller(
ctx context.Context,
src *core.ModuleSource,
) (contextRootAbsPath, sourceRootAbsPath string, _ error) {
if src.Kind != core.ModuleSourceKindLocal {
return "", "", fmt.Errorf("cannot resolve non-local module source from caller")
}
rootSubpath, err := src.SourceRootSubpath()
if err != nil {
return "", "", fmt.Errorf("failed to get source root subpath: %w", err)
}
sourceRootStat, err := src.Query.Buildkit.StatCallerHostPath(ctx, rootSubpath, true)
if err != nil {
return "", "", fmt.Errorf("failed to stat source root: %w", err)
}
sourceRootAbsPath = sourceRootStat.Path
contextAbsPath, contextFound, err := callerHostFindUpContext(ctx, src.Query.Buildkit, sourceRootAbsPath)
if err != nil {
return "", "", fmt.Errorf("failed to find up root: %w", err)
}
if !contextFound {
// default to restricting to the source root dir, make it abs though for consistency
contextAbsPath = sourceRootAbsPath
}
return contextAbsPath, sourceRootAbsPath, nil
}
func (s *moduleSchema) moduleSourceResolveFromCaller(
ctx context.Context,
src *core.ModuleSource,
args struct{},
) (inst dagql.Instance[*core.ModuleSource], err error) {
contextAbsPath, sourceRootAbsPath, err := s.resolveContextPathFromCaller(ctx, src)
if err != nil {
return inst, err
}
sourceRootRelPath, err := filepath.Rel(contextAbsPath, sourceRootAbsPath)
if err != nil {
return inst, fmt.Errorf("failed to get source root relative path: %s", err)
}
collectedDeps := dagql.NewCacheMap[string, *callerLocalDep]()
if err := s.collectCallerLocalDeps(ctx, src.Query, contextAbsPath, sourceRootAbsPath, true, src, collectedDeps); err != nil {
return inst, fmt.Errorf("failed to collect local module source deps: %w", err)
}
includeSet := map[string]struct{}{}
excludeSet := map[string]struct{}{
// always exclude .git dirs, we don't need them and they tend to invalidate cache a lot
"**/.git": {},
}
sdkSet := map[string]core.SDK{}
sourceRootPaths := collectedDeps.Keys()
for _, rootPath := range sourceRootPaths {
rootRelPath, err := filepath.Rel(contextAbsPath, rootPath)
if err != nil {
return inst, fmt.Errorf("failed to get source root relative path: %s", err)
}
if !filepath.IsLocal(rootRelPath) {
return inst, fmt.Errorf("local module dep source path %q escapes context %q", rootRelPath, contextAbsPath)
}
localDep, err := collectedDeps.Get(ctx, rootPath)
if err != nil {
return inst, fmt.Errorf("failed to get collected local dep %s: %w", rootPath, err)
}
if rootPath == sourceRootAbsPath {
// only the top-level module source is allowed to be nameless/sdkless
if localDep.sdk != nil {
sdkSet[localDep.sdkKey] = localDep.sdk
}
if localDep.modCfg == nil {
// uninitialized top-level module source, include it's source root dir (otherwise
// we could load everything if no other includes end up being specified)
includeSet[sourceRootRelPath] = struct{}{}
continue
}
} else {
if localDep.modCfg == nil {
return inst, fmt.Errorf("local module source dep %s is not initialized", rootPath)
}
if localDep.sdk == nil {
return inst, fmt.Errorf("local module source dep %s has no sdk", rootPath)
}
sdkSet[localDep.sdkKey] = localDep.sdk
}
// rebase user defined include/exclude relative to context
for _, path := range localDep.modCfg.Include {
absPath := filepath.Join(sourceRootAbsPath, path)
relPath, err := filepath.Rel(contextAbsPath, absPath)
if err != nil {
return inst, fmt.Errorf("failed to get relative path of config include: %s", err)
}
if !filepath.IsLocal(relPath) {
return inst, fmt.Errorf("local module dep source include path %q escapes context %q", relPath, contextAbsPath)
}
includeSet[relPath] = struct{}{}
}
for _, path := range localDep.modCfg.Exclude {
absPath := filepath.Join(sourceRootAbsPath, path)
relPath, err := filepath.Rel(contextAbsPath, absPath)
if err != nil {
return inst, fmt.Errorf("failed to get relative path of config exclude: %s", err)
}
if !filepath.IsLocal(relPath) {
return inst, fmt.Errorf("local module dep source exclude path %q escapes context %q", relPath, contextAbsPath)
}
excludeSet[relPath] = struct{}{}
}
// always include the config file
configRelPath, err := filepath.Rel(contextAbsPath, filepath.Join(rootPath, modules.Filename))
if err != nil {
return inst, fmt.Errorf("failed to get relative path: %s", err)
}
includeSet[configRelPath] = struct{}{}
// always include the source dir
source := localDep.modCfg.Source
if source == "" {
source = "."
}
sourceAbsSubpath := filepath.Join(rootPath, source)
sourceRelSubpath, err := filepath.Rel(contextAbsPath, sourceAbsSubpath)
if err != nil {
return inst, fmt.Errorf("failed to get relative path: %s", err)
}
if !filepath.IsLocal(sourceRelSubpath) {
return inst, fmt.Errorf("local module source path %q escapes context %q", sourceRelSubpath, contextAbsPath)
}
includeSet[sourceRelSubpath+"/**/*"] = struct{}{}
}
for _, sdk := range sdkSet {
// NOTE: required paths are currently **-style globs that apply to the whole context subtree
// This is a bit of a delicate assumption, if need arises for including exact paths, this
// will need some adjustment.
requiredPaths, err := sdk.RequiredPaths(ctx)
if err != nil {
return inst, fmt.Errorf("failed to get sdk required paths: %w", err)
}
for _, path := range requiredPaths {
includeSet[path] = struct{}{}
}
}
includes := make([]string, 0, len(includeSet))
for include := range includeSet {
includes = append(includes, include)
}
excludes := make([]string, 0, len(excludeSet))
for exclude := range excludeSet {
excludes = append(excludes, exclude)
}
pipelineName := fmt.Sprintf("load local module context %s", contextAbsPath)
ctx, subRecorder := progrock.WithGroup(ctx, pipelineName, progrock.Weak())
_, desc, err := src.Query.Buildkit.LocalImport(
ctx, subRecorder, src.Query.Platform.Spec(),
contextAbsPath,
excludes,
includes,
)
if err != nil {
return inst, fmt.Errorf("failed to import local module source: %w", err)
}
loadedDir, err := core.LoadBlob(ctx, s.dag, desc)
if err != nil {
return inst, fmt.Errorf("failed to load local module source: %w", err)
}
return s.normalizeCallerLoadedSource(ctx, src, sourceRootRelPath, loadedDir)
}
// get an instance of ModuleSource with the context resolved from the caller that doesn't
// encode any instructions to actually reload from the caller if the ID is loaded later, which
// is possible due to blob-ifying the local import.
func (s *moduleSchema) normalizeCallerLoadedSource(
ctx context.Context,
src *core.ModuleSource,
sourceRootRelPath string,
loadedDir dagql.Instance[*core.Directory],
) (inst dagql.Instance[*core.ModuleSource], err error) {
err = s.dag.Select(ctx, s.dag.Root(), &inst,
dagql.Selector{
Field: "moduleSource",
Args: []dagql.NamedInput{
{Name: "refString", Value: dagql.String(sourceRootRelPath)},
},
},
dagql.Selector{
Field: "withContextDirectory",
Args: []dagql.NamedInput{
{Name: "dir", Value: dagql.NewID[*core.Directory](loadedDir.ID())},
},
},
)
if src.WithName != "" {
err = s.dag.Select(ctx, inst, &inst,
dagql.Selector{
Field: "withName",
Args: []dagql.NamedInput{
{Name: "name", Value: dagql.String(src.WithName)},
},
},
)
if err != nil {
return inst, fmt.Errorf("failed to set name: %w", err)
}
}
if src.WithSDK != "" {
err = s.dag.Select(ctx, inst, &inst,
dagql.Selector{
Field: "withSDK",
Args: []dagql.NamedInput{
{Name: "sdk", Value: dagql.String(src.WithSDK)},
},
},
)
if err != nil {
return inst, fmt.Errorf("failed to set sdk: %w", err)
}
}
if src.WithSourceSubpath != "" {
err = s.dag.Select(ctx, inst, &inst,
dagql.Selector{
Field: "withSourceSubpath",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(src.WithSourceSubpath)},
},
},
)
if err != nil {
return inst, fmt.Errorf("failed to set source subdir: %w", err)
}
}
if len(src.WithDependencies) > 0 {
depIDs := make([]core.ModuleDependencyID, len(src.WithDependencies))
for i, dep := range src.WithDependencies {
depIDs[i] = dagql.NewID[*core.ModuleDependency](dep.ID())
}
err = s.dag.Select(ctx, inst, &inst,
dagql.Selector{
Field: "withDependencies",
Args: []dagql.NamedInput{
{Name: "dependencies", Value: dagql.ArrayInput[core.ModuleDependencyID](depIDs)},
},
},
)
if err != nil {
return inst, fmt.Errorf("failed to set dependency: %w", err)
}
}
return inst, err
}
type callerLocalDep struct {
sourceRootAbsPath string
modCfg *modules.ModuleConfig
sdk core.SDK
// sdkKey is a unique identifier for the SDK, slightly different
// from the module ref for the SDK because custom local SDKs
// use their local path for sdkKey, which allows us to de-dupe
// loading them across the dag of local deps.
sdkKey string
}
func (s *moduleSchema) collectCallerLocalDeps(
ctx context.Context,
query *core.Query,
contextAbsPath string,
sourceRootAbsPath string,
// topLevel should only be true for the module source being operated on,
// everything else we collect is a (transitive) dep. The top level module
// is a bit special in that it is allowed to not be initialized yet and/or
// not have a name/sdk/etc.
topLevel bool,
src *core.ModuleSource,
// cache of sourceRootAbsPath -> *callerLocalDep
collectedDeps dagql.CacheMap[string, *callerLocalDep],
) error {
_, err := collectedDeps.GetOrInitialize(ctx, sourceRootAbsPath, func(ctx context.Context) (*callerLocalDep, error) {
sourceRootRelPath, err := filepath.Rel(contextAbsPath, sourceRootAbsPath)
if err != nil {
return nil, fmt.Errorf("failed to get source root relative path: %s", err)
}
if !filepath.IsLocal(sourceRootRelPath) {
return nil, fmt.Errorf("local module dep source path %q escapes context %q", sourceRootRelPath, contextAbsPath)
}
var modCfg modules.ModuleConfig
configPath := filepath.Join(sourceRootAbsPath, modules.Filename)
configBytes, err := query.Buildkit.ReadCallerHostFile(ctx, configPath)
switch {
case err == nil:
if err := json.Unmarshal(configBytes, &modCfg); err != nil {
return nil, fmt.Errorf("error unmarshaling config at %s: %s", configPath, err)
}
case strings.Contains(err.Error(), "no such file or directory"):
// This is only allowed for the top-level module (which may be in the process of being newly initialized).
// sentinel via nil modCfg unless there's WithSDK/WithDependencies/etc. to be applied
if !topLevel {
return nil, fmt.Errorf("missing config file %s", configPath)
}
if src.WithSDK == "" && len(src.WithDependencies) == 0 {
return &callerLocalDep{sourceRootAbsPath: sourceRootAbsPath}, nil
}
default:
return nil, fmt.Errorf("error reading config %s: %s", configPath, err)
}
if topLevel {
if src.WithName != "" {
modCfg.Name = src.WithName
}
if src.WithSDK != "" {
modCfg.SDK = src.WithSDK
}
for _, dep := range src.WithDependencies {
refString, err := dep.Self.Source.Self.RefString()
if err != nil {
return nil, fmt.Errorf("failed to get ref string for dependency: %w", err)
}
modCfg.Dependencies = append(modCfg.Dependencies, &modules.ModuleConfigDependency{
Name: dep.Self.Name,
Source: refString,
})
}
}
localDep := &callerLocalDep{
sourceRootAbsPath: sourceRootAbsPath,
modCfg: &modCfg,
}
for _, depCfg := range modCfg.Dependencies {
parsed := parseRefString(depCfg.Source)
if parsed.kind != core.ModuleSourceKindLocal {
continue
}
depAbsPath := filepath.Join(sourceRootAbsPath, parsed.modPath)
err = s.collectCallerLocalDeps(ctx, query, contextAbsPath, depAbsPath, false, src, collectedDeps)
if err != nil {
return nil, fmt.Errorf("failed to collect local module source dep: %w", err)
}
}
if modCfg.SDK == "" {
return localDep, nil
}
localDep.sdkKey = modCfg.SDK
localDep.sdk, err = s.builtinSDK(ctx, query, modCfg.SDK)
switch {
case err == nil:
case errors.Is(err, errUnknownBuiltinSDK):
parsed := parseRefString(modCfg.SDK)
switch parsed.kind {
case core.ModuleSourceKindLocal:
// SDK is a local custom one, it needs to be included
sdkPath := filepath.Join(sourceRootAbsPath, parsed.modPath)
err = s.collectCallerLocalDeps(ctx, query, contextAbsPath, sdkPath, false, src, collectedDeps)
if err != nil {
return nil, fmt.Errorf("failed to collect local sdk: %w", err)
}
// TODO: this is inefficient, leads to extra local loads, but only for case
// of local custom SDK.
callerCwdStat, err := query.Buildkit.StatCallerHostPath(ctx, ".", true)
if err != nil {
return nil, fmt.Errorf("failed to stat caller cwd: %w", err)
}
callerCwd := callerCwdStat.Path
sdkCallerRelPath, err := filepath.Rel(callerCwd, sdkPath)
if err != nil {
return nil, fmt.Errorf("failed to get relative path of local sdk: %s", err)
}
var sdkMod dagql.Instance[*core.Module]
err = s.dag.Select(ctx, s.dag.Root(), &sdkMod,
dagql.Selector{
Field: "moduleSource",
Args: []dagql.NamedInput{
{Name: "refString", Value: dagql.String(sdkCallerRelPath)},
},
},
dagql.Selector{
Field: "resolveFromCaller",
},
dagql.Selector{
Field: "asModule",
},
dagql.Selector{
Field: "initialize",
},
)
if err != nil {
return nil, fmt.Errorf("failed to load local sdk module source: %w", err)
}
localDep.sdk, err = s.newModuleSDK(ctx, query, sdkMod, dagql.Instance[*core.Directory]{})
if err != nil {
return nil, fmt.Errorf("failed to get local sdk: %w", err)
}
localDep.sdkKey = sdkPath
case core.ModuleSourceKindGit:
// TODO: this codepath is completely untested atm
localDep.sdk, err = s.sdkForModule(ctx, query, modCfg.SDK, dagql.Instance[*core.ModuleSource]{})
if err != nil {
return nil, fmt.Errorf("failed to get git module sdk: %w", err)
}
}
default:
return nil, fmt.Errorf("failed to load sdk: %w", err)
}
return localDep, nil
})
if errors.Is(err, dagql.ErrCacheMapRecursiveCall) {
return fmt.Errorf("local module at %q has a circular dependency", sourceRootAbsPath)
}
return err
}
// context path is the parent dir containing .git
func callerHostFindUpContext(
ctx context.Context,
bk *buildkit.Client,
curDirPath string,
) (string, bool, error) {
if !filepath.IsAbs(curDirPath) {
return "", false, fmt.Errorf("path is not absolute: %s", curDirPath)
}
_, err := bk.StatCallerHostPath(ctx, filepath.Join(curDirPath, ".git"), false)
if err == nil {
return curDirPath, true, nil
}
if !strings.Contains(err.Error(), "no such file or directory") {
return "", false, fmt.Errorf("failed to lstat .git: %s", err)
}
if curDirPath == "/" {
return "", false, nil
}
return callerHostFindUpContext(ctx, bk, filepath.Dir(curDirPath))
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,623 | Need integ tests for git modules | Right now all our integ tests only use local refs because git modules are locked into github repos and we've been trying to avoid tests depending on modules in an external git repo. However, I think we should just bite the bullet on that at this point since missing that test coverage is too big a gap. | https://github.com/dagger/dagger/issues/6623 | https://github.com/dagger/dagger/pull/6693 | 6a3689eeb680920fe5f830ac972be3dc1fa4f29b | a659c04b9982ef90a999dc20efb9485b11eda556 | "2024-02-08T18:15:16Z" | go | "2024-02-20T10:52:53Z" | core/schema/sdk.go | package schema
import (
"context"
"errors"
"fmt"
"path/filepath"
"github.com/dagger/dagger/analytics"
"github.com/dagger/dagger/dagql"
"github.com/vito/progrock"
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/internal/distconsts"
)
const (
runtimeWorkdirPath = "/scratch"
)
// load the SDK implementation with the given name for the module at the given source dir + subpath.
func (s *moduleSchema) sdkForModule(
ctx context.Context,
query *core.Query,
sdk string,
parentSrc dagql.Instance[*core.ModuleSource],
) (core.SDK, error) {
if sdk == "" {
return nil, errors.New("sdk ref is required")
}
builtinSDK, err := s.builtinSDK(ctx, query, sdk)
if err == nil {
return builtinSDK, nil
} else if !errors.Is(err, errUnknownBuiltinSDK) {
return nil, err
}
var sdkSource dagql.Instance[*core.ModuleSource]
err = s.dag.Select(ctx, s.dag.Root(), &sdkSource,
dagql.Selector{
Field: "moduleSource",
Args: []dagql.NamedInput{
{Name: "refString", Value: dagql.String(sdk)},
},
},
)
if err != nil {
return nil, fmt.Errorf("failed to get sdk source for %s: %w", sdk, err)
}
var sdkMod dagql.Instance[*core.Module]
err = s.dag.Select(ctx, parentSrc, &sdkMod,
dagql.Selector{
Field: "resolveDependency",
Args: []dagql.NamedInput{
{Name: "dep", Value: dagql.NewID[*core.ModuleSource](sdkSource.ID())},
},
},
dagql.Selector{
Field: "asModule",
},
dagql.Selector{
Field: "initialize",
},
)
if err != nil {
return nil, fmt.Errorf("failed to load sdk module %s: %w", sdk, err)
}
// TODO: include sdk source dir from module config dagger.json once we support default-args/scripts
return s.newModuleSDK(ctx, query, sdkMod, dagql.Instance[*core.Directory]{})
}
var errUnknownBuiltinSDK = fmt.Errorf("unknown builtin sdk")
// return a builtin SDK implementation with the given name
func (s *moduleSchema) builtinSDK(ctx context.Context, root *core.Query, sdkName string) (core.SDK, error) {
switch sdkName {
case "go":
return &goSDK{root: root, dag: s.dag}, nil
case "python":
return s.loadBuiltinSDK(ctx, root, sdkName, distconsts.PythonSDKEngineContainerModulePath)
case "typescript":
return s.loadBuiltinSDK(ctx, root, sdkName, distconsts.TypescriptSDKEngineContainerModulePath)
default:
return nil, fmt.Errorf("%s: %w", sdkName, errUnknownBuiltinSDK)
}
}
// moduleSDK is an SDK implemented as module; i.e. every module besides the special case go sdk.
type moduleSDK struct {
// The module implementing this SDK.
mod dagql.Instance[*core.Module]
// A server that the SDK module has been installed to.
dag *dagql.Server
// The SDK object retrieved from the server, for calling functions against.
sdk dagql.Object
}
func (s *moduleSchema) newModuleSDK(
ctx context.Context,
root *core.Query,
sdkModMeta dagql.Instance[*core.Module],
optionalFullSDKSourceDir dagql.Instance[*core.Directory],
) (*moduleSDK, error) {
ctx = analytics.WithInternal(ctx)
dag := dagql.NewServer(root)
dag.Cache = root.Cache
if err := sdkModMeta.Self.Install(ctx, dag); err != nil {
return nil, fmt.Errorf("failed to install sdk module %s: %w", sdkModMeta.Self.Name(), err)
}
for _, defaultDep := range sdkModMeta.Self.Query.DefaultDeps.Mods {
if err := defaultDep.Install(ctx, dag); err != nil {
return nil, fmt.Errorf("failed to install default dep %s for sdk module %s: %w", defaultDep.Name(), sdkModMeta.Self.Name(), err)
}
}
var sdk dagql.Object
var constructorArgs []dagql.NamedInput
if optionalFullSDKSourceDir.Self != nil {
constructorArgs = []dagql.NamedInput{
{Name: "sdkSourceDir", Value: dagql.Opt(dagql.NewID[*core.Directory](optionalFullSDKSourceDir.ID()))},
}
}
if err := dag.Select(ctx, dag.Root(), &sdk,
dagql.Selector{
Field: gqlFieldName(sdkModMeta.Self.Name()),
Args: constructorArgs,
},
); err != nil {
return nil, fmt.Errorf("failed to get sdk object for sdk module %s: %w", sdkModMeta.Self.Name(), err)
}
return &moduleSDK{mod: sdkModMeta, dag: dag, sdk: sdk}, nil
}
// Codegen calls the Codegen function on the SDK Module
func (sdk *moduleSDK) Codegen(ctx context.Context, deps *core.ModDeps, source dagql.Instance[*core.ModuleSource]) (*core.GeneratedCode, error) {
ctx = analytics.WithInternal(ctx)
introspectionJSON, err := deps.SchemaIntrospectionJSON(ctx, true)
if err != nil {
return nil, fmt.Errorf("failed to get schema introspection json during %s module sdk codegen: %w", sdk.mod.Self.Name(), err)
}
var inst dagql.Instance[*core.GeneratedCode]
err = sdk.dag.Select(ctx, sdk.sdk, &inst, dagql.Selector{
Field: "codegen",
Args: []dagql.NamedInput{
{
Name: "modSource",
Value: dagql.NewID[*core.ModuleSource](source.ID()),
},
{
Name: "introspectionJson",
Value: dagql.String(introspectionJSON),
},
},
})
if err != nil {
return nil, fmt.Errorf("failed to call sdk module codegen: %w", err)
}
return inst.Self, nil
}
// Runtime calls the Runtime function on the SDK Module
func (sdk *moduleSDK) Runtime(ctx context.Context, deps *core.ModDeps, source dagql.Instance[*core.ModuleSource]) (*core.Container, error) {
ctx = analytics.WithInternal(ctx)
introspectionJSON, err := deps.SchemaIntrospectionJSON(ctx, true)
if err != nil {
return nil, fmt.Errorf("failed to get schema introspection json during %s module sdk runtime: %w", sdk.mod.Self.Name(), err)
}
var inst dagql.Instance[*core.Container]
err = sdk.dag.Select(ctx, sdk.sdk, &inst,
dagql.Selector{
Field: "moduleRuntime",
Args: []dagql.NamedInput{
{
Name: "modSource",
Value: dagql.NewID[*core.ModuleSource](source.ID()),
},
{
Name: "introspectionJson",
Value: dagql.String(introspectionJSON),
},
},
},
dagql.Selector{
Field: "withWorkdir",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.NewString(runtimeWorkdirPath),
},
},
},
)
if err != nil {
return nil, fmt.Errorf("failed to call sdk module moduleRuntime: %w", err)
}
return inst.Self, nil
}
func (sdk *moduleSDK) RequiredPaths(ctx context.Context) ([]string, error) {
ctx = analytics.WithInternal(ctx)
var paths []string
err := sdk.dag.Select(ctx, sdk.sdk, &paths,
dagql.Selector{
Field: "requiredPaths",
},
)
if err != nil {
return nil, fmt.Errorf("failed to call sdk module requiredPaths: %w", err)
}
return paths, nil
}
// loadBuiltinSDK loads an SDK implemented as a module that is "builtin" to engine, which means its pre-packaged
// with the engine container in order to enable use w/out hard dependencies on the internet
func (s *moduleSchema) loadBuiltinSDK(
ctx context.Context,
root *core.Query,
name string,
engineContainerModulePath string,
) (*moduleSDK, error) {
ctx, recorder := progrock.WithGroup(ctx, fmt.Sprintf("load builtin module sdk %s", name))
// TODO: currently hardcoding assumption that builtin sdks put *module* source code at
// subdir right under the *full* sdk source dir. Can be generalized once we support
// default-args/scripts in dagger.json
fullSDKSourcePath := filepath.Dir(engineContainerModulePath)
_, desc, err := root.Buildkit.EngineContainerLocalImport(
ctx,
recorder,
root.Platform.Spec(),
fullSDKSourcePath,
nil,
nil,
)
if err != nil {
return nil, fmt.Errorf("failed to import full sdk source for sdk %s from engine container filesystem: %w", name, err)
}
fullSDKDir, err := core.LoadBlob(ctx, s.dag, desc)
if err != nil {
return nil, fmt.Errorf("failed to load full sdk source for module sdk %s: %w", name, err)
}
var sdkModDir dagql.Instance[*core.Directory]
err = s.dag.Select(ctx, fullSDKDir, &sdkModDir,
dagql.Selector{
Field: "directory",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(filepath.Base(engineContainerModulePath))},
},
},
)
if err != nil {
return nil, fmt.Errorf("failed to import module sdk %s: %w", name, err)
}
var sdkMod dagql.Instance[*core.Module]
err = s.dag.Select(ctx, sdkModDir, &sdkMod,
dagql.Selector{
Field: "asModule",
},
dagql.Selector{
Field: "initialize",
},
)
if err != nil {
return nil, fmt.Errorf("failed to load embedded sdk module %q: %w", name, err)
}
return s.newModuleSDK(ctx, root, sdkMod, fullSDKDir)
}
const (
goSDKUserModContextDirPath = "/src"
goSDKRuntimePath = "/runtime"
goSDKIntrospectionJSONPath = "/schema.json"
)
/*
goSDK is the one special sdk not implemented as module, instead the
`cmd/codegen/` binary is packaged into a container w/ the go runtime,
tarball'd up and included in the engine image.
The Codegen and Runtime methods are implemented by loading that tarball and
executing the codegen binary inside it to generate user code and then execute
it with the resulting /runtime binary.
*/
type goSDK struct {
root *core.Query
dag *dagql.Server
}
func (sdk *goSDK) Codegen(
ctx context.Context,
deps *core.ModDeps,
source dagql.Instance[*core.ModuleSource],
) (*core.GeneratedCode, error) {
ctr, err := sdk.baseWithCodegen(ctx, deps, source)
if err != nil {
return nil, err
}
var modifiedSrcDir dagql.Instance[*core.Directory]
if err := sdk.dag.Select(ctx, ctr, &modifiedSrcDir, dagql.Selector{
Field: "directory",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.String(goSDKUserModContextDirPath),
},
},
}); err != nil {
return nil, fmt.Errorf("failed to get modified source directory for go module sdk codegen: %w", err)
}
return &core.GeneratedCode{
Code: modifiedSrcDir,
VCSGeneratedPaths: []string{
"dagger.gen.go",
"querybuilder/**",
},
}, nil
}
func (sdk *goSDK) Runtime(
ctx context.Context,
deps *core.ModDeps,
source dagql.Instance[*core.ModuleSource],
) (*core.Container, error) {
ctr, err := sdk.baseWithCodegen(ctx, deps, source)
if err != nil {
return nil, err
}
if err := sdk.dag.Select(ctx, ctr, &ctr,
dagql.Selector{
Field: "withExec",
Args: []dagql.NamedInput{
{
Name: "args",
Value: dagql.ArrayInput[dagql.String]{
"go", "build",
"-o", goSDKRuntimePath,
".",
},
},
{
Name: "skipEntrypoint",
Value: dagql.NewBoolean(true),
},
},
},
dagql.Selector{
Field: "withEntrypoint",
Args: []dagql.NamedInput{
{
Name: "args",
Value: dagql.ArrayInput[dagql.String]{
goSDKRuntimePath,
},
},
},
},
dagql.Selector{
Field: "withWorkdir",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.NewString(runtimeWorkdirPath),
},
},
},
); err != nil {
return nil, fmt.Errorf("failed to exec go build in go module sdk container runtime: %w", err)
}
return ctr.Self, nil
}
func (sdk *goSDK) RequiredPaths(_ context.Context) ([]string, error) {
return []string{
"**/go.mod",
"**/go.sum",
"**/go.work",
"**/go.work.sum",
// TODO: the below could be optimized by scoping only to go modules that actually
// end up being needed for the dagger module.
// including vendor/ is potentially expensive, but required
"**/vendor/",
// needed in order to re-use go.mod from any parent dir (otherwise it's an invalid go module)
"**/*.go",
}, nil
}
func (sdk *goSDK) baseWithCodegen(
ctx context.Context,
deps *core.ModDeps,
src dagql.Instance[*core.ModuleSource],
) (dagql.Instance[*core.Container], error) {
var ctr dagql.Instance[*core.Container]
introspectionJSON, err := deps.SchemaIntrospectionJSON(ctx, true)
if err != nil {
return ctr, fmt.Errorf("failed to get schema introspection json during module sdk codegen: %w", err)
}
modName, err := src.Self.ModuleOriginalName(ctx)
if err != nil {
return ctr, fmt.Errorf("failed to get module name for go module sdk codegen: %w", err)
}
contextDir, err := src.Self.ContextDirectory()
if err != nil {
return ctr, fmt.Errorf("failed to get context directory for go module sdk codegen: %w", err)
}
srcSubpath, err := src.Self.SourceSubpathWithDefault(ctx)
if err != nil {
return ctr, fmt.Errorf("failed to get subpath for go module sdk codegen: %w", err)
}
ctr, err = sdk.base(ctx)
if err != nil {
return ctr, err
}
// Make the source subpath if it doesn't exist already.
// Also rm dagger.gen.go if it exists, which is going to be overwritten
// anyways. If it doesn't exist, we ignore not found in the implementation of
// `withoutFile` so it will be a no-op.
var emptyDir dagql.Instance[*core.Directory]
if err := sdk.dag.Select(ctx, sdk.dag.Root(), &emptyDir, dagql.Selector{Field: "directory"}); err != nil {
return ctr, fmt.Errorf("failed to create empty directory for go module sdk codegen: %w", err)
}
var updatedContextDir dagql.Instance[*core.Directory]
if err := sdk.dag.Select(ctx, contextDir, &updatedContextDir,
dagql.Selector{
Field: "withDirectory",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(srcSubpath)},
{Name: "directory", Value: dagql.NewID[*core.Directory](emptyDir.ID())},
},
},
dagql.Selector{
Field: "withoutFile",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.String(filepath.Join(srcSubpath, "dagger.gen.go")),
},
},
},
); err != nil {
return ctr, fmt.Errorf("failed to remove dagger.gen.go from source directory: %w", err)
}
if err := sdk.dag.Select(ctx, ctr, &ctr, dagql.Selector{
Field: "withNewFile",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.NewString(goSDKIntrospectionJSONPath),
},
{
Name: "contents",
Value: dagql.NewString(introspectionJSON),
},
{
Name: "permissions",
Value: dagql.NewInt(0444),
},
},
}, dagql.Selector{
Field: "withMountedDirectory",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.NewString(goSDKUserModContextDirPath),
},
{
Name: "source",
Value: dagql.NewID[*core.Directory](updatedContextDir.ID()),
},
},
}, dagql.Selector{
Field: "withWorkdir",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.NewString(filepath.Join(goSDKUserModContextDirPath, srcSubpath)),
},
},
}, dagql.Selector{
Field: "withoutDefaultArgs",
}, dagql.Selector{
Field: "withExec",
Args: []dagql.NamedInput{
{
Name: "args",
Value: dagql.ArrayInput[dagql.String]{
"--module-context", goSDKUserModContextDirPath,
"--module-name", dagql.String(modName),
"--propagate-logs=true",
"--introspection-json-path", goSDKIntrospectionJSONPath,
},
},
{
Name: "experimentalPrivilegedNesting",
Value: dagql.NewBoolean(true),
},
},
}); err != nil {
return ctr, fmt.Errorf("failed to mount introspection json file into go module sdk container codegen: %w", err)
}
return ctr, nil
}
func (sdk *goSDK) base(ctx context.Context) (dagql.Instance[*core.Container], error) {
var inst dagql.Instance[*core.Container]
ctx, recorder := progrock.WithGroup(ctx, "load builtin module sdk go")
tarDir, tarName := filepath.Split(distconsts.GoSDKEngineContainerTarballPath)
_, desc, err := sdk.root.Buildkit.EngineContainerLocalImport(
ctx,
recorder,
sdk.root.Platform.Spec(),
tarDir,
nil,
[]string{tarName},
)
if err != nil {
return inst, fmt.Errorf("failed to import go module sdk tarball from engine container filesystem: %s", err)
}
blobDir, err := core.LoadBlob(ctx, sdk.dag, desc)
if err != nil {
return inst, fmt.Errorf("failed to load go module sdk tarball: %w", err)
}
var tarballFile dagql.Instance[*core.File]
if err := sdk.dag.Select(ctx, blobDir, &tarballFile, dagql.Selector{
Field: "file",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.String(tarName),
},
},
}); err != nil {
return inst, fmt.Errorf("failed to get tarball file from go module sdk tarball: %w", err)
}
var modCache dagql.Instance[*core.CacheVolume]
if err := sdk.dag.Select(ctx, sdk.dag.Root(), &modCache, dagql.Selector{
Field: "cacheVolume",
Args: []dagql.NamedInput{
{
Name: "key",
Value: dagql.String("modgomodcache"),
},
},
}); err != nil {
return inst, fmt.Errorf("failed to get mod cache from go module sdk tarball: %w", err)
}
var buildCache dagql.Instance[*core.CacheVolume]
if err := sdk.dag.Select(ctx, sdk.dag.Root(), &buildCache, dagql.Selector{
Field: "cacheVolume",
Args: []dagql.NamedInput{
{
Name: "key",
Value: dagql.String("modgobuildcache"),
},
},
}); err != nil {
return inst, fmt.Errorf("failed to get build cache from go module sdk tarball: %w", err)
}
var ctr dagql.Instance[*core.Container]
if err := sdk.dag.Select(ctx, sdk.dag.Root(), &ctr, dagql.Selector{
Field: "container",
}, dagql.Selector{
Field: "import",
Args: []dagql.NamedInput{
{
Name: "source",
Value: dagql.NewID[*core.File](tarballFile.ID()),
},
},
}, dagql.Selector{
Field: "withMountedCache",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.String("/go/pkg/mod"),
},
{
Name: "cache",
Value: dagql.NewID[*core.CacheVolume](modCache.ID()),
},
{
Name: "sharing",
Value: core.CacheSharingModeShared,
},
},
}, dagql.Selector{
Field: "withMountedCache",
Args: []dagql.NamedInput{
{
Name: "path",
Value: dagql.String("/root/.cache/go-build"),
},
{
Name: "cache",
Value: dagql.NewID[*core.CacheVolume](buildCache.ID()),
},
{
Name: "sharing",
Value: core.CacheSharingModeShared,
},
},
}); err != nil {
return inst, fmt.Errorf("failed to get container from go module sdk tarball: %w", err)
}
return ctr, nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,669 | 🐞 installed module is unusable (codegen'd with wrong capitalization) | ### What is the issue?
Created module for running remote commands via SSH https://daggerverse.dev/mod/github.com/samalba/dagger-modules/ssh@35ed3e343d7e6faa3eab44570ee7531914dd4e65
I initialized the module with:
`dagger init --name ssh --sdk go --source .`
The module code uses a struct named `Ssh`. It works fine as standalone. However when you install the module from another module, it's available via `dag.SSH()` (different capitalization), which then fails to compile, because it cannot find the module version.
Simple way to reproduce: install the module from any other module and try to use it.
### Dagger version
dagger v0.9.10 (registry.dagger.io/engine) darwin/arm64 | https://github.com/dagger/dagger/issues/6669 | https://github.com/dagger/dagger/pull/6692 | a659c04b9982ef90a999dc20efb9485b11eda556 | 15cb7d10a00d0e0b19ea1a2e8fc07cf8c360d04c | "2024-02-13T22:55:54Z" | go | "2024-02-20T11:15:21Z" | cmd/codegen/generator/go/templates/format.go | package templates
import (
"strings"
"github.com/dagger/dagger/cmd/codegen/generator"
)
// FormatTypeFunc is an implementation of generator.FormatTypeFuncs interface
// to format GraphQL type into Golang.
type FormatTypeFunc struct {
scope string
}
func (f *FormatTypeFunc) WithScope(scope string) generator.FormatTypeFuncs {
if scope != "" {
scope += "."
}
clone := *f
clone.scope = scope
return &clone
}
func (f *FormatTypeFunc) FormatKindList(representation string) string {
representation = "[]" + representation
return representation
}
func (f *FormatTypeFunc) FormatKindScalarString(representation string) string {
representation += "string"
return representation
}
func (f *FormatTypeFunc) FormatKindScalarInt(representation string) string {
representation += "int"
return representation
}
func (f *FormatTypeFunc) FormatKindScalarFloat(representation string) string {
representation += "float"
return representation
}
func (f *FormatTypeFunc) FormatKindScalarBoolean(representation string) string {
representation += "bool"
return representation
}
func (f *FormatTypeFunc) FormatKindScalarDefault(representation string, refName string, input bool) string {
if obj, rest, ok := strings.Cut(refName, "ID"); input && ok && rest == "" {
representation += "*" + f.scope + obj
} else {
representation += f.scope + refName
}
return representation
}
func (f *FormatTypeFunc) FormatKindObject(representation string, refName string, input bool) string {
representation += f.scope + formatName(refName)
return representation
}
func (f *FormatTypeFunc) FormatKindInputObject(representation string, refName string, input bool) string {
representation += f.scope + formatName(refName)
return representation
}
func (f *FormatTypeFunc) FormatKindEnum(representation string, refName string) string {
representation += f.scope + refName
return representation
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,669 | 🐞 installed module is unusable (codegen'd with wrong capitalization) | ### What is the issue?
Created module for running remote commands via SSH https://daggerverse.dev/mod/github.com/samalba/dagger-modules/ssh@35ed3e343d7e6faa3eab44570ee7531914dd4e65
I initialized the module with:
`dagger init --name ssh --sdk go --source .`
The module code uses a struct named `Ssh`. It works fine as standalone. However when you install the module from another module, it's available via `dag.SSH()` (different capitalization), which then fails to compile, because it cannot find the module version.
Simple way to reproduce: install the module from any other module and try to use it.
### Dagger version
dagger v0.9.10 (registry.dagger.io/engine) darwin/arm64 | https://github.com/dagger/dagger/issues/6669 | https://github.com/dagger/dagger/pull/6692 | a659c04b9982ef90a999dc20efb9485b11eda556 | 15cb7d10a00d0e0b19ea1a2e8fc07cf8c360d04c | "2024-02-13T22:55:54Z" | go | "2024-02-20T11:15:21Z" | core/integration/module_test.go | package core
import (
"context"
_ "embed"
"encoding/json"
"fmt"
"go/format"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"time"
"github.com/MakeNowJust/heredoc/v2"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/dagql/idproto"
"github.com/iancoleman/strcase"
"github.com/moby/buildkit/identity"
"github.com/stretchr/testify/require"
"github.com/tidwall/gjson"
"golang.org/x/sync/errgroup"
"dagger.io/dagger"
"github.com/dagger/dagger/cmd/codegen/introspection"
)
func TestModuleGoInit(t *testing.T) {
t.Parallel()
t.Run("from scratch", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=bare", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("reserved go.mod name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=go", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{go{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"go":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("uses expected Go module name, camel-cases Dagger module name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=My-Module", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{myModule{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"myModule":{"containerEcho":{"stdout":"hello\n"}}}`, out)
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
t.Run("creates go.mod beneath an existing go.mod if context is beneath it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
// don't use .git under /work so the context ends up being /work/ci
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/go.mod", dagger.ContainerWithNewFileOpts{
Contents: "module example.com/test\n",
}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/ci").
With(daggerExec("init", "--name=beneathGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{beneathGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"beneathGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("names Go module after Dagger module", func(t *testing.T) {
generated, err := modGen.Directory("dagger").File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
})
t.Run("respects existing go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("preserves module name", func(t *testing.T) {
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module example.com/test")
})
})
t.Run("respects existing go.work", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithExec([]string{"go", "work", "init"}).
WithExec([]string{"go", "work", "use", "."}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("go.work is edited", func(t *testing.T) {
generated, err := modGen.File("go.work").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "\t.\n")
require.Contains(t, generated, "\t./dagger\n")
})
})
t.Run("ignores go.work for subdir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithExec([]string{"go", "work", "init"}).
WithExec([]string{"go", "work", "use", "."}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go", "subdir"))
// we can't write to the go.work at the top-level so it should remain
// unedited, but we should still be able to execute the module as
// expected
out, err := modGen.
WithWorkdir("./subdir").
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("go.work is unedited", func(t *testing.T) {
generated, err := modGen.File("go.work").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "use .\n")
})
})
t.Run("respects parent go.mod if root points to it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
With(daggerExec("init", "--name=child", "--sdk=go", "./child")).
WithWorkdir("/work/child").
// explicitly develop to see whether it makes a go.mod
With(daggerExec("develop")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
require.Equal(t, []string{".git", "child", "foo.go", "go.mod", "go.sum"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.NotContains(t, childEntries, "go.mod")
t.Run("preserves parent module name", func(t *testing.T) {
goMod, err := generated.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, goMod, "module example.com/test")
})
})
t.Run("respects existing go.mod even if root points to parent that has go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"}).
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/child").
WithExec([]string{"go", "mod", "init", "my-mod"}).
WithWorkdir("/work").
With(daggerExec("init", "--source=./child", "--name=child", "--sdk=go", "./child")).
WithWorkdir("/work/child").
// explicitly develop to see whether it makes a go.mod
With(daggerExec("develop")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
// no go.sum
require.Equal(t, []string{".git", "child", "foo.go", "go.mod"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.Contains(t, childEntries, "go.mod")
require.Contains(t, childEntries, "go.sum")
})
t.Run("respects existing main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasMainGo struct {}
func (m *HasMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("init", "--name=hasMainGo", "--sdk=go", "--source=."))
out, err := modGen.
With(daggerQuery(`{hasMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("respects existing main.go even if it uses types not generated yet", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasDaggerTypes struct {}
func (m *HasDaggerTypes) Hello() *Container {
return dag.Container().
From("` + alpineImage + `").
WithExec([]string{"echo", "Hello, world!"})
}
`,
}).
With(daggerExec("init", "--source=.", "--name=hasDaggerTypes", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasDaggerTypes{hello{stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasDaggerTypes":{"hello":{"stdout":"Hello, world!\n"}}}`, out)
})
t.Run("respects existing package without creating main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/notmain.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type HasNotMainGo struct {}
func (m *HasNotMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("init", "--source=.", "--name=hasNotMainGo", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasNotMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasNotMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("with source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=bare", "--sdk=go", "--source=some/subdir"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
sourceSubdirEnts, err := modGen.Directory("/work/some/subdir").Entries(ctx)
require.NoError(t, err)
require.Contains(t, sourceSubdirEnts, "main.go")
sourceRootEnts, err := modGen.Directory("/work").Entries(ctx)
require.NoError(t, err)
require.NotContains(t, sourceRootEnts, "main.go")
})
}
func TestModuleInitLICENSE(t *testing.T) {
t.Run("bootstraps Apache-2.0 LICENSE file if none found", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("creates LICENSE file in the directory specified by arg", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "./mymod"))
content, err := modGen.File("mymod/LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("does not bootstrap LICENSE file if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go"))
_, err := modGen.File("LICENSE").Contents(ctx)
require.Error(t, err)
})
t.Run("bootstraps a LICENSE file when requested, even if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "--license=MIT"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "MIT License")
})
}
func TestModuleGit(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
gitGeneratedFiles []string
gitIgnoredFiles []string
}
for _, tc := range []testCase{
{
sdk: "go",
gitGeneratedFiles: []string{
"/dagger.gen.go",
"/querybuilder/**",
},
},
{
sdk: "python",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
{
sdk: "typescript",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
} {
tc := tc
t.Run(fmt.Sprintf("module %s git", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
With(daggerExec("init", "--name=bare", "--sdk="+tc.sdk))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("configures .gitattributes", func(t *testing.T) {
ignore, err := modGen.File(".gitattributes").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitGeneratedFiles {
require.Contains(t, ignore, fmt.Sprintf("%s linguist-generated\n", fileName))
}
})
if len(tc.gitIgnoredFiles) > 0 {
t.Run("configures .gitignore", func(t *testing.T) {
ignore, err := modGen.File(".gitignore").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitIgnoredFiles {
require.Contains(t, ignore, fileName)
}
})
}
})
}
}
//go:embed testdata/modules/go/minimal/main.go
var goSignatures string
func TestModuleGoSignatures(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
t.Run("func Hello() string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello"}}`, out)
})
t.Run("func Echo(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echo(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echo":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointer(*string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointerPointer(**string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointerPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointerPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoOptional(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptional(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalPointer(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalPointer}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalSlice([]string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalSlice(msg: ["hello", "there"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"hello+there...hello+there...hello+there..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalSlice}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"foobar...foobar...foobar..."}}`, out)
})
t.Run("func Echoes([]string) []string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoes(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoes":["hello...hello...hello..."]}}`, out)
})
t.Run("func EchoesVariadic(...string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoesVariadic(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoesVariadic":"hello...hello...hello..."}}`, out)
})
t.Run("func HelloContext(context.Context) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloContext}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloContext":"hello context"}}`, out)
})
t.Run("func EchoContext(context.Context, string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoContext(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoContext":"ctx.hello...ctx.hello...ctx.hello..."}}`, out)
})
t.Run("func HelloStringError() (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloStringError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloStringError":"hello i worked"}}`, out)
})
t.Run("func HelloVoid()", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoid}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoid":null}}`, out)
})
t.Run("func HelloVoidError() error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoidError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoidError":null}}`, out)
})
t.Run("func EchoOpts(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInline(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlinePointer(*struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineCtx(ctx, struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineTags(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsPragmas(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsPragmas(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsPragmas":"hi...hi...hi..."}}`, out)
})
}
func TestModuleGoSignaturesBuiltinTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("dagger/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Minimal struct {}
func (m *Minimal) Read(ctx context.Context, dir Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadPointer(ctx context.Context, dir *Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadSlice(ctx context.Context, dir []Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadVariadic(ctx context.Context, dir ...Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadOptional(
ctx context.Context,
dir *Directory, // +optional
) (string, error) {
if dir != nil {
return dir.File("foo").Contents(ctx)
}
return "", nil
}
`,
})
out, err := modGen.With(daggerQuery(`{directory{withNewFile(path: "foo", contents: "bar"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
dirID := gjson.Get(out, "directory.withNewFile.id").String()
t.Run("func Read(ctx, Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{read(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"read":"bar"}}`, out)
})
t.Run("func ReadPointer(ctx, *Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readPointer(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readPointer":"bar"}}`, out)
})
t.Run("func ReadSlice(ctx, []Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readSlice(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readSlice":"bar"}}`, out)
})
t.Run("func ReadVariadic(ctx, ...Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readVariadic(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readVariadic":"bar"}}`, out)
})
t.Run("func ReadOptional(ctx, Optional[Directory]) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readOptional(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":"bar"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{readOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":""}}`, out)
})
}
func TestModuleGoSignaturesUnexported(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) string {
return name
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
objs := inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 1, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
objs = inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 2, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
require.Equal(t, "MinimalFoo", objs.Get("1.name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {
Bar bar
}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
_, err := modGen.With(moduleIntrospection).Stderr(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "cannot code-generate unexported type bar")
}
func TestModuleGoSignaturesMixMatch(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
func (m *Minimal) Hello(name string, opts struct{}, opts2 struct{}) string {
return name
}
`,
})
_, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "nested structs are not supported")
}
func TestModuleGoSignaturesNameConflict(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {
Foo Foo
Bar Bar
Baz Baz
}
type Foo struct {}
type Bar struct {}
type Baz struct {}
func (m *Foo) Hello(name string) string {
return name
}
func (f *Bar) Hello(name string, name2 string) string {
return name + name2
}
func (b *Baz) Hello() (string, error) {
return "", nil
}
`,
})
objs := inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 4, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
require.Equal(t, "MinimalFoo", objs.Get("1.name").String())
require.Equal(t, "MinimalBar", objs.Get("2.name").String())
require.Equal(t, "MinimalBaz", objs.Get("3.name").String())
}
func TestModuleGoDocs(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
logGen(ctx, t, modGen.Directory("."))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Empty(t, hello.Get("description").String())
require.Empty(t, hello.Get("args").Array())
// test the args-based form
echoOpts := obj.Get(`functions.#(name="echoOpts")`)
require.Equal(t, "echoOpts", echoOpts.Get("name").String())
require.Equal(t, "EchoOpts does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the inline struct form
echoOpts = obj.Get(`functions.#(name="echoOptsInline")`)
require.Equal(t, "echoOptsInline", echoOpts.Get("name").String())
require.Equal(t, "EchoOptsInline does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the arg-based form (with pragmas)
echoOpts = obj.Get(`functions.#(name="echoOptsPragmas")`)
require.Equal(t, "echoOptsPragmas", echoOpts.Get("name").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "", echoOpts.Get("args.0.defaultValue").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "\"...\"", echoOpts.Get("args.1.defaultValue").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "3", echoOpts.Get("args.2.defaultValue").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
}
func TestModuleGoDocsEdgeCases(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
// Minimal is a thing
type Minimal struct {
// X is this
X, Y string // Y is not this
// +private
Z string
}
// some docs
func (m *Minimal) Hello(foo string, bar string,
// hello
baz string, qux string, x string, // lol
) string {
return foo + bar
}
func (m *Minimal) HelloMore(
// foo here
foo,
// bar here
bar string,
) string {
return foo + bar
}
func (m *Minimal) HelloMoreInline(opts struct{
// foo here
foo, bar string
}) string {
return opts.foo + opts.bar
}
func (m *Minimal) HelloAgain( // docs for helloagain
foo string,
bar string, // docs for bar
baz string,
) string {
return foo + bar
}
func (m *Minimal) HelloFinal(
foo string) string { // woops
return foo
}
`,
})
logGen(ctx, t, modGen.Directory("."))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Equal(t, "Minimal is a thing", obj.Get("description").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 5)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "hello", hello.Get("args.2.description").String())
require.Equal(t, "qux", hello.Get("args.3.name").String())
require.Equal(t, "", hello.Get("args.3.description").String())
require.Equal(t, "x", hello.Get("args.4.name").String())
require.Equal(t, "lol", hello.Get("args.4.description").String())
hello = obj.Get(`functions.#(name="helloMore")`)
require.Equal(t, "helloMore", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "bar here", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloMoreInline")`)
require.Equal(t, "helloMoreInline", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloAgain")`)
require.Equal(t, "helloAgain", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 3)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "docs for bar", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "", hello.Get("args.2.description").String())
hello = obj.Get(`functions.#(name="helloFinal")`)
require.Equal(t, "helloFinal", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 1)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Len(t, obj.Get(`fields`).Array(), 2)
prop := obj.Get(`fields.#(name="x")`)
require.Equal(t, "x", prop.Get("name").String())
require.Equal(t, "X is this", prop.Get("description").String())
prop = obj.Get(`fields.#(name="y")`)
require.Equal(t, "y", prop.Get("name").String())
require.Equal(t, "", prop.Get("description").String())
}
func TestModuleGoWeirdFields(t *testing.T) {
// these are all cases that used to panic due to the disparity in the type spec and the ast
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Z string
type Minimal struct {
// field with single (normal) name
W string
// field with multiple names
X, Y string
// field with no names
Z
}
func New() Minimal {
return Minimal{
W: "-",
X: "-",
Y: "-",
Z: Z("-"),
}
}
// struct with no fields
type Bar struct{}
func (m *Minimal) Say(
// field with single (normal) name
a string,
// field with multiple names
b, c string,
// field with no names (not included, mixed names not allowed)
// string
) string {
return a + " " + b + " " + c
}
func (m *Minimal) Hello(
// field with no names
string,
) string {
return "hello"
}
func (m *Minimal) SayOpts(opts struct{
// field with single (normal) name
A string
// field with multiple names
B, C string
// field with no names (not included because of above)
// string
}) string {
return opts.A + " " + opts.B + " " + opts.C
}
func (m *Minimal) HelloOpts(opts struct{
// field with no names
string
}) string {
return "hello"
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{w, x, y, z}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"w": "-", "x": "-", "y": "-", "z": "-"}}`, out)
for _, name := range []string{"say", "sayOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(a: "hello", b: "world", c: "!")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello world !"}}`, name), out)
}
for _, name := range []string{"hello", "helloOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(string: "")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello"}}`, name), out)
}
}
func TestModuleGoFieldMustBeNil(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "fmt"
type Minimal struct {
Src *Directory
Name *string
}
func New() *Minimal {
return &Minimal{}
}
func (m *Minimal) IsEmpty() bool {
if m.Name != nil {
panic(fmt.Sprintf("name should be nil but is %v", m.Name))
}
if m.Src != nil {
panic(fmt.Sprintf("src should be nil but is %v", m.Src))
}
return true
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{isEmpty}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"isEmpty": true}}`, out)
}
func TestModuleDescription(t *testing.T) {
t.Parallel()
type source struct {
file string
contents string
}
for _, tc := range []struct {
sdk string
sources []source
}{
{
sdk: "go",
sources: []source{
{
file: "main.go",
contents: `
// Test module, short description
//
// Long description, with full sentences.
package main
// Test object, short description
type Test struct {
// +default="foo"
Foo string
}
`,
},
},
},
{
sdk: "go",
sources: []source{
{
file: "a.go",
contents: `
// First, but not main
package main
type Foo struct {}
`,
},
{
file: "z.go",
contents: `
// Test module, short description
//
// Long description, with full sentences.
package main
// Test object, short description
type Test struct {
}
func (*Test) Foo() Foo {
return Foo{}
}
`,
},
},
},
{
sdk: "python",
sources: []source{
{
file: "src/main.py",
contents: `
"""Test module, short description
Long description, with full sentences.
"""
from dagger import field, object_type
@object_type
class Test:
"""Test object, short description"""
foo: str = field(default="foo")
`,
},
},
},
{
sdk: "python",
sources: []source{
{
file: "src/main/foo.py",
contents: `
"""Not the main file"""
from dagger import field, object_type
@object_type
class Foo:
bar: str = field(default="bar")
`,
},
{
file: "src/main/__init__.py",
contents: `
"""Test module, short description
Long description, with full sentences.
"""
from dagger import function, object_type
from .foo import Foo
@object_type
class Test:
"""Test object, short description"""
foo = function(Foo)
`,
},
},
},
{
sdk: "typescript",
sources: []source{
{
file: "src/index.ts",
contents: `
/**
* Test module, short description
*
* Long description, with full sentences.
*/
import { object, field } from '@dagger.io/dagger'
/**
* Test object, short description
*/
@object()
class Test {
@field()
foo: string = "foo"
}
`,
},
},
},
{
sdk: "typescript",
sources: []source{
{
file: "src/foo.ts",
contents: `
/**
* Not the main file
*/
import { object, field } from '@dagger.io/dagger'
@object()
export class Foo {
@field()
bar = "bar"
}
`,
},
{
file: "src/index.ts",
contents: `
/**
* Test module, short description
*
* Long description, with full sentences.
*/
import { object, field } from '@dagger.io/dagger'
import { Foo } from "./foo"
/**
* Test object, short description
*/
@object()
class Test {
@func()
foo(): Foo {
return new Foo()
}
}
`,
},
},
},
} {
tc := tc
t.Run(fmt.Sprintf("%s with %d files", tc.sdk, len(tc.sources)), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
for _, src := range tc.sources {
src := src
modGen = modGen.WithNewFile(src.file, dagger.ContainerWithNewFileOpts{
Contents: heredoc.Doc(src.contents),
})
}
mod := inspectModule(ctx, t,
modGen.With(daggerExec("init", "--source=.", "--name=test", "--sdk="+tc.sdk)))
require.Equal(t,
"Test module, short description\n\nLong description, with full sentences.",
mod.Get("description").String(),
)
require.Equal(t,
"Test object, short description",
mod.Get("objects.#.asObject|#(name=Test).description").String(),
)
})
}
}
func TestModulePrivateField(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
sdk string
source string
}{
{
sdk: "go",
source: `package main
type Minimal struct {
Foo string
Bar string // +private
}
func (m *Minimal) Set(foo string, bar string) *Minimal {
m.Foo = foo
m.Bar = bar
return m
}
func (m *Minimal) Hello() string {
return m.Foo + m.Bar
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Minimal:
foo: str = field(default="")
bar: str = ""
@function
def set(self, foo: str, bar: str) -> "Minimal":
self.foo = foo
self.bar = bar
return self
@function
def hello(self) -> str:
return self.foo + self.bar
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Minimal {
@field()
foo: string
bar?: string
constructor(foo?: string, bar?: string) {
this.foo = foo
this.bar = bar
}
@func()
set(foo: string, bar: string): Minimal {
this.foo = foo
this.bar = bar
return this
}
@func()
hello(): string {
return this.foo + this.bar
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Len(t, obj.Get(`fields`).Array(), 1)
prop := obj.Get(`fields.#(name="foo")`)
require.Equal(t, "foo", prop.Get("name").String())
out, err := modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){hello}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"hello": "abcxyz"}}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){foo}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"foo": "abc"}}}`, out)
_, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){bar}}}`)).Stdout(ctx)
require.ErrorContains(t, err, `Minimal has no such field: "bar"`)
})
}
}
// this is no longer allowed, but verify the SDK errors out
func TestModuleGoExtendCore(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=container", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
func (c *Container) Echo(ctx context.Context, msg string) (string, error) {
return c.WithExec([]string{"echo", msg}).Stdout(ctx)
}
`,
}).
With(daggerQuery(`{container{from(address:"` + alpineImage + `"){echo(msg:"echo!"){stdout}}}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "cannot define methods on objects from outside this module")
}
func TestModuleGoBadCtx(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=foo", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Foo struct {}
func (f *Foo) Echo(ctx context.Context, ctx2 context.Context) (string, error) {
return "", nil
}
`,
}).
With(daggerQuery(`{foo{echo}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "unexpected context type")
}
func TestModuleCustomTypes(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Test struct{}
func (m *Test) Repeater(msg string, times int) *Repeater {
return &Repeater{
Message: msg,
Times: times,
}
}
type Repeater struct {
Message string
Times int
}
func (t *Repeater) Render() string {
return strings.Repeat(t.Message, t.Times)
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Repeater:
message: str = field(default="")
times: int = field(default=0)
@function
def render(self) -> str:
return self.message * self.times
@function
def repeater(msg: str, times: int) -> Repeater:
return Repeater(message=msg, times=times)
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Repeater {
@field()
message: string
@field()
times: number
constructor(message: string, times: number) {
this.message = message
this.times = times
}
@func()
render(): string {
return this.message.repeat(this.times)
}
}
@object()
class Test {
@func()
repeater(msg: string, times: number): Repeater {
return new Repeater(msg, times)
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("custom %s types", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := modInit(ctx, t, c, tc.sdk, tc.source).
With(daggerQuery(`{test{repeater(msg:"echo!", times: 3){render}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"repeater":{"render":"echo!echo!echo!"}}}`, out)
})
}
}
func TestModuleReturnTypeDetection(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
}
func (m *Foo) MyFunction() X {
return X{Message: "foo"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
@function
def my_function() -> X:
return X(message="foo")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class X {
@field()
message: string
constructor(message: string) {
this.message = message;
}
}
@object()
class Foo {
@func()
myFunction(): X {
return new X("foo");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{myFunction{message}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo"}}}`, out)
})
}
}
func TestModuleReturnObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
When string ` + "`json:\"Timestamp\"`" + `
To string ` + "`json:\"recipient\"`" + `
From string
}
func (m *Foo) MyFunction() X {
return X{Message: "foo", When: "now", To: "user", From: "admin"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
when: str = field(default="", name="Timestamp")
to: str = field(default="", name="recipient")
from_: str = field(default="", name="from")
@object_type
class Foo:
@function
def my_function(self) -> X:
return X(message="foo", when="now", to="user", from_="admin")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class X {
@field()
message: string
@field()
timestamp: string
@field()
recipient: string
@field()
from: string
constructor(message: string, timestamp: string, recipient: string, from: string) {
this.message = message;
this.timestamp = timestamp;
this.recipient = recipient;
this.from = from;
}
}
@object()
class Foo {
@func()
myFunction(): X {
return new X("foo", "now", "user", "admin");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{myFunction{message, recipient, from, timestamp}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo", "recipient":"user", "from":"admin", "timestamp":"now"}}}`, out)
})
}
}
func TestModuleReturnNestedObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type Foo struct {
MsgContainer Bar
}
type Bar struct {
Msg string
}
func (m *Playground) MyFunction() Foo {
return Foo{MsgContainer: Bar{Msg: "hello world"}}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Bar:
msg: str = field()
@object_type
class Foo:
msg_container: Bar = field()
@object_type
class Playground:
@function
def my_function(self) -> Foo:
return Foo(msg_container=Bar(msg="hello world"))
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Bar {
@field()
msg: string;
constructor(msg: string) {
this.msg = msg;
}
}
@object()
class Foo {
@field()
msgContainer: Bar;
constructor(msgContainer: Bar) {
this.msgContainer = msgContainer;
}
}
@object()
class Playground {
@func()
myFunction(): Foo {
return new Foo(new Bar("hello world"));
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{myFunction{msgContainer{msg}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myFunction":{"msgContainer":{"msg": "hello world"}}}}`, out)
})
}
}
func TestModuleReturnCompositeCore(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
func (m *Playground) MySlice() []*Container {
return []*Container{dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"})}
}
type Foo struct {
Con *Container
// verify fields can remain nil w/out error too
UnsetFile *File
}
func (m *Playground) MyStruct() *Foo {
return &Foo{Con: dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"})}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class Foo:
con: dagger.Container = field()
unset_file: dagger.File | None = field(default=None)
@object_type
class Playground:
@function
def my_slice(self) -> list[dagger.Container]:
return [dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"])]
@function
def my_struct(self) -> Foo:
return Foo(con=dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"]))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, File, object, func, field } from "@dagger.io/dagger"
@object()
class Foo {
@field()
con: Container
@field()
unsetFile?: File
constructor(con: Container, usetFile?: File) {
this.con = con
this.usetFile = usetFile
}
}
@object()
class Playground {
@func()
mySlice(): Container[] {
return [
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
]
}
@func()
myStruct(): Foo {
return new Foo(
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{mySlice{stdout}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"mySlice":[{"stdout":"hello world\n"}]}}`, out)
out, err = modGen.With(daggerQuery(`{playground{myStruct{con{stdout}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myStruct":{"con":{"stdout":"hello world\n"}}}}`, out)
})
}
}
func TestModuleReturnComplexThing(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type ScanResult struct {
Containers []*Container ` + "`json:\"targets\"`" + `
Report ScanReport
}
type ScanReport struct {
Contents string ` + "`json:\"contents\"`" + `
Authors []string ` + "`json:\"Authors\"`" + `
}
func (m *Playground) Scan() ScanResult {
return ScanResult{
Containers: []*Container{
dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"}),
},
Report: ScanReport{
Contents: "hello world",
Authors: []string{"foo", "bar"},
},
}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class ScanReport:
contents: str = field()
authors: list[str] = field()
@object_type
class ScanResult:
containers: list[dagger.Container] = field(name="targets")
report: ScanReport = field()
@object_type
class Playground:
@function
def scan(self) -> ScanResult:
return ScanResult(
containers=[
dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"]),
],
report=ScanReport(
contents="hello world",
authors=["foo", "bar"],
),
)
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object()
class ScanReport {
@field()
contents: string
@field()
authors: string[]
constructor(contents: string, authors: string[]) {
this.contents = contents
this.authors = authors
}
}
@object()
class ScanResult {
@field("targets")
containers: Container[]
@field()
report: ScanReport
constructor(containers: Container[], report: ScanReport) {
this.containers = containers
this.report = report
}
}
@object()
class Playground {
@func()
async scan(): Promise<ScanResult> {
return new ScanResult(
[
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
],
new ScanReport("hello world", ["foo", "bar"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{scan{targets{stdout},report{contents,authors}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"scan":{"targets":[{"stdout":"hello world\n"}],"report":{"contents":"hello world","authors":["foo","bar"]}}}}`, out)
})
}
}
func TestModuleGlobalVarDAG(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
type Foo struct {}
var someDefault = dag.Container().From("` + alpineImage + `")
func (m *Foo) Fn(ctx context.Context) (string, error) {
return someDefault.WithExec([]string{"echo", "foo"}).Stdout(ctx)
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function, object_type
SOME_DEFAULT = dag.container().from_("` + alpineImage + `")
@object_type
class Foo:
@function
async def fn(self) -> str:
return await SOME_DEFAULT.with_exec(["echo", "foo"]).stdout()
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from "@dagger.io/dagger"
var someDefault = dag.container().from("` + alpineImage + `")
@object()
class Foo {
@func()
async fn(): Promise<string> {
return someDefault.withExec(["echo", "foo"]).stdout()
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"fn":"foo\n"}}`, out)
})
}
}
func TestModuleIDableType(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {
Data string
}
func (m *Foo) Set(data string) *Foo {
m.Data = data
return m
}
func (m *Foo) Get() string {
return m.Data
}
`,
},
{
sdk: "python",
source: `from typing import Self
from dagger import field, function, object_type
@object_type
class Foo:
data: str = ""
@function
def set(self, data: str) -> Self:
self.data = data
return self
@function
def get(self) -> str:
return self.data
`,
},
{
sdk: "typescript",
source: `
import { object, func } from "@dagger.io/dagger"
@object()
class Foo {
data: string = ""
@func()
set(data: string): Foo {
this.data = data
return this
}
@func()
get(): string {
return this.data
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
// sanity check
out, err := modGen.With(daggerQuery(`{foo{set(data: "abc"){get}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"set":{"get": "abc"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{set(data: "abc"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.set.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.set(data: "abc"): Foo!`)
out, err = modGen.With(daggerQuery(`{loadFooFromID(id: "%s"){get}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"loadFooFromID":{"get": "abc"}}`, out)
})
}
}
func TestModuleArgOwnType(t *testing.T) {
// Verify use of a module's own object as an argument type.
// The server needs to specifically decode the input type from an ID into
// the raw JSON, since the module doesn't understand it's own types as IDs
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Foo struct{}
type Message struct {
Content string
}
func (m *Foo) SayHello(name string) Message {
return Message{Content: "hello " + name}
}
func (m *Foo) Upper(msg Message) Message {
msg.Content = strings.ToUpper(msg.Content)
return msg
}
func (m *Foo) Uppers(msg []Message) []Message {
for i := range msg {
msg[i].Content = strings.ToUpper(msg[i].Content)
}
return msg
}`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Message:
content: str = field()
@object_type
class Foo:
@function
def say_hello(self, name: str) -> Message:
return Message(content=f"hello {name}")
@function
def upper(self, msg: Message) -> Message:
msg.content = msg.content.upper()
return msg
@function
def uppers(self, msg: list[Message]) -> list[Message]:
for m in msg:
m.content = m.content.upper()
return msg
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Message {
@field()
content: string
constructor(content: string) {
this.content = content
}
}
@object()
class Foo {
@func()
sayHello(name: string): Message {
return new Message("hello " + name)
}
@func()
upper(msg: Message): Message {
msg.content = msg.content.toUpperCase()
return msg
}
@func()
uppers(msg: Message[]): Message[] {
for (let i = 0; i < msg.length; i++) {
msg[i].content = msg[i].content.toUpperCase()
}
return msg
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{sayHello(name: "world"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.sayHello.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.sayHello(name: "world"): FooMessage!`)
out, err = modGen.With(daggerQuery(`{foo{upper(msg:"%s"){content}}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"upper":{"content": "HELLO WORLD"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{uppers(msg:["%s", "%s"]){content}}}`, id, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"uppers":[{"content": "HELLO WORLD"}, {"content": "HELLO WORLD"}]}}`, out)
})
}
}
func TestModuleConflictingSameNameDeps(t *testing.T) {
// A -> B -> Dint
// A -> C -> Dstr
// where Dint and Dstr are modules with the same name and same object names but conflicting types
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dstr").
With(daggerExec("init", "--source=.", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo string
}
func (m *D) Fn(foo string) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dint").
With(daggerExec("init", "--source=.", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo int
}
func (m *D) Fn(foo int) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=c", "--name=c", "--sdk=go", "c")).
WithWorkdir("/work/c").
With(daggerExec("install", "../dstr")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type C struct{}
func (m *C) Fn(ctx context.Context, foo string) (string, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=b", "--name=b", "--sdk=go", "b")).
With(daggerExec("install", "-m=b", "./dint")).
WithNewFile("/work/b/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type B struct{}
func (m *B) Fn(ctx context.Context, foo int) (int, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=a", "--name=a", "--sdk=go", "a")).
WithWorkdir("/work/a").
With(daggerExec("install", "../b")).
With(daggerExec("install", "../c")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"strconv"
)
type A struct{}
func (m *A) Fn(ctx context.Context) (string, error) {
fooStr, err := dag.C().Fn(ctx, "foo")
if err != nil {
return "", err
}
fooInt, err := dag.B().Fn(ctx, 123)
if err != nil {
return "", err
}
return fooStr + strconv.Itoa(fooInt), nil
}
`,
})
out, err := ctr.With(daggerQuery(`{a{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"a":{"fn": "foo123"}}`, out)
// verify that no types from (transitive) deps show up
types := currentSchema(ctx, t, ctr).Types
require.NotNil(t, types.Get("A"))
require.Nil(t, types.Get("B"))
require.Nil(t, types.Get("C"))
require.Nil(t, types.Get("D"))
}
func TestModuleSelfAPICall(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"github.com/Khan/genqlient/graphql"
)
type Test struct{}
func (m *Test) FnA(ctx context.Context) (string, error) {
resp := &graphql.Response{}
err := dag.Client.MakeRequest(ctx, &graphql.Request{
Query: "{test{fnB}}",
}, resp)
if err != nil {
return "", err
}
return resp.Data.(map[string]any)["test"].(map[string]any)["fnB"].(string), nil
}
func (m *Test) FnB() string {
return "hi from b"
}
`,
}).
With(daggerQuery(`{test{fnA}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fnA": "hi from b"}}`, out)
}
func TestModuleGoWithOtherModuleTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Dep struct{}
type Obj struct {
Foo string
}
func (m *Dep) Fn() Obj {
return Obj{Foo: "foo"}
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=test", "--name=test", "--sdk=go", "test")).
With(daggerExec("install", "-m=test", "./dep")).
WithWorkdir("/work/test")
t.Run("return as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() (*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() ([]*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
})
t.Run("arg as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj *DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj []*DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
})
t.Run("field as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo *DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo []*DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
})
}
func TestModuleGoUseDaggerTypesDirect(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "main/dagger"
type Minimal struct{}
func (m *Minimal) Foo(dir *Directory) (*dagger.Directory) {
return dir.WithNewFile("foo", "xxx")
}
func (m *Minimal) Bar(dir *dagger.Directory) (*Directory) {
return dir.WithNewFile("bar", "yyy")
}
`,
})
out, err := modGen.With(daggerQuery(`{directory{id}}`)).Stdout(ctx)
require.NoError(t, err)
dirID := gjson.Get(out, "directory.id").String()
out, err = modGen.With(daggerQuery(`{minimal{foo(dir: "%s"){file(path: "foo"){contents}}}}`, dirID)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"foo":{"file":{"contents": "xxx"}}}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{bar(dir: "%s"){file(path: "bar"){contents}}}}`, dirID)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"bar":{"file":{"contents": "yyy"}}}}`, out)
}
func TestModuleGoUtilsPkg(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"main/utils"
)
type Minimal struct{}
func (m *Minimal) Hello(ctx context.Context) (string, error) {
return utils.Foo().File("foo").Contents(ctx)
}
`,
}).
WithNewFile("utils/util.go", dagger.ContainerWithNewFileOpts{
Contents: `package utils
import "main/dagger"
func Foo() *dagger.Directory {
return dagger.Connect().Directory().WithNewFile("/foo", "hello world")
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello world"}}`, out)
}
var useInner = `package main
type Dep struct{}
func (m *Dep) Hello() string {
return "hello"
}
`
var useGoOuter = `package main
import "context"
type Use struct{}
func (m *Use) UseHello(ctx context.Context) (string, error) {
return dag.Dep().Hello(ctx)
}
`
var usePythonOuter = `from dagger import dag, function
@function
def use_hello() -> str:
return dag.dep().hello()
`
var useTSOuter = `
import { dag, object, func } from '@dagger.io/dagger'
@object()
class Use {
@func()
async useHello(): Promise<string> {
return dag.dep().hello()
}
}
`
func TestModuleUseLocal(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// cannot use transitive dependency directly
_, err = modGen.With(daggerQuery(`{dep{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, `Query has no such field: "dep"`)
})
}
}
func TestModuleCodegenOnDepChange(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
changed string
expected string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
expected: "Hellov2",
changed: strings.ReplaceAll(useGoOuter, `Hello(ctx)`, `Hellov2(ctx)`),
},
{
sdk: "python",
source: usePythonOuter,
expected: "hellov2",
changed: strings.ReplaceAll(usePythonOuter, `.hello()`, `.hellov2()`),
},
{
sdk: "typescript",
source: useTSOuter,
expected: "hellov2",
changed: strings.ReplaceAll(useTSOuter, `.hello()`, `.hellov2()`),
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// make back-incompatible change to dep
newInner := strings.ReplaceAll(useInner, `Hello()`, `Hellov2()`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("develop"))
codegenContents, err := modGen.File(sdkCodegenFile(t, tc.sdk)).Contents(ctx)
require.NoError(t, err)
require.Contains(t, codegenContents, tc.expected)
modGen = modGen.With(sdkSource(tc.sdk, tc.changed))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
})
}
}
func TestModuleSyncDeps(t *testing.T) {
// verify that changes to deps result in a develop to the depender module
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
modGen = modGen.With(daggerQuery(`{use{useHello}}`))
out, err := modGen.Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
newInner := strings.ReplaceAll(useInner, `"hello"`, `"goodbye"`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("develop"))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"goodbye"}}`, out)
})
}
}
func TestModuleUseLocalMulti(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
import "fmt"
type Use struct {}
func (m *Use) Names(ctx context.Context) ([]string, error) {
fooName, err := dag.Foo().Name(ctx)
if err != nil {
return nil, fmt.Errorf("foo.name: %w", err)
}
barName, err := dag.Bar().Name(ctx)
if err != nil {
return nil, fmt.Errorf("bar.name: %w", err)
}
return []string{fooName, barName}, nil
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function
@function
async def names() -> list[str]:
return [
await dag.foo().name(),
await dag.bar().name(),
]
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from '@dagger.io/dagger'
@object()
class Use {
@func()
async names(): Promise<string[]> {
return [await dag.foo().name(), await dag.bar().name()]
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/foo").
WithNewFile("/work/foo/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Foo struct {}
func (m *Foo) Name() string { return "foo" }
`,
}).
With(daggerExec("init", "--source=.", "--name=foo", "--sdk=go")).
WithWorkdir("/work/bar").
WithNewFile("/work/bar/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Bar struct {}
func (m *Bar) Name() string { return "bar" }
`,
}).
With(daggerExec("init", "--source=.", "--name=bar", "--sdk=go")).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(daggerExec("install", "./foo")).
With(daggerExec("install", "./bar")).
With(sdkSource(tc.sdk, tc.source)).
WithEnvVariable("BUST", identity.NewID()) // NB(vito): hmm...
out, err := modGen.With(daggerQuery(`{use{names}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"names":["foo", "bar"]}}`, out)
})
}
}
func TestModuleConstructor(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("basic", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(
ctx context.Context,
foo string,
bar *int, // +optional
baz []string,
dir *Directory,
) *Test {
bar2 := 42
if bar != nil {
bar2 = *bar
}
return &Test{
Foo: foo,
Bar: bar2,
Baz: baz,
Dir: dir,
}
}
type Test struct {
Foo string
Bar int
Baz []string
Dir *Directory
NeverSetDir *Directory
}
func (m *Test) GimmeFoo() string {
return m.Foo
}
func (m *Test) GimmeBar() int {
return m.Bar
}
func (m *Test) GimmeBaz() []string {
return m.Baz
}
func (m *Test) GimmeDirEnts(ctx context.Context) ([]string, error) {
return m.Dir.Entries(ctx)
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import field, function, object_type
@object_type
class Test:
foo: str = field()
dir: dagger.Directory = field()
bar: int = field(default=42)
baz: list[str] = field(default=list)
never_set_dir: dagger.Directory | None = field(default=None)
@function
def gimme_foo(self) -> str:
return self.foo
@function
def gimme_bar(self) -> int:
return self.bar
@function
def gimme_baz(self) -> list[str]:
return self.baz
@function
async def gimme_dir_ents(self) -> list[str]:
return await self.dir.entries()
`,
},
{
sdk: "typescript",
source: `
import { Directory, object, func, field } from '@dagger.io/dagger';
@object()
class Test {
@field()
foo: string
@field()
dir: Directory
@field()
bar: number
@field()
baz: string[]
@field()
neverSetDir?: Directory
constructor(foo: string, dir: Directory, bar = 42, baz: string[] = []) {
this.foo = foo;
this.dir = dir;
this.bar = bar;
this.baz = baz;
}
@func()
gimmeFoo(): string {
return this.foo;
}
@func()
gimmeBar(): number {
return this.bar;
}
@func()
gimmeBaz(): string[] {
return this.baz;
}
@func()
async gimmeDirEnts(): Promise<string[]> {
return this.dir.entries();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := modInit(ctx, t, c, tc.sdk, tc.source)
out, err := ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-dir-ents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, strings.TrimSpace(out), "dagger.json")
})
}
})
t.Run("fields only", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(ctx context.Context) (Test, error) {
v, err := dag.Container().From("alpine:3.18.4").File("/etc/alpine-release").Contents(ctx)
if err != nil {
return Test{}, err
}
return Test{
AlpineVersion: v,
}, nil
}
type Test struct {
AlpineVersion string
}
`,
},
{
sdk: "python",
source: `from dagger import dag, field, function, object_type
@object_type
class Test:
alpine_version: str = field()
@classmethod
async def create(cls) -> "Test":
return cls(alpine_version=await (
dag.container()
.from_("alpine:3.18.4")
.file("/etc/alpine-release")
.contents()
))
`,
},
{
sdk: "typescript",
source: `
import { dag, object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
alpineVersion: string
// NOTE: this is not standard to do async operations in the constructor.
// This is only for testing purpose but it shouldn't be done in real usage.
constructor() {
return (async () => {
this.alpineVersion = await dag.container().from("alpine:3.18.4").file("/etc/alpine-release").contents()
return this; // Return the newly-created instance
})();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := ctr.With(daggerCall("alpine-version")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "3.18.4")
})
}
})
t.Run("return error", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"fmt"
)
func New() (*Test, error) {
return nil, fmt.Errorf("too bad")
}
type Test struct {
Foo string
}
`,
},
{
sdk: "python",
source: `from dagger import object_type, field
@object_type
class Test:
foo: str = field()
def __init__(self):
raise ValueError("too bad")
`,
},
{
sdk: "typescript",
source: `
import { object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
foo: string
constructor() {
throw new Error("too bad")
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
_, err := ctr.With(daggerCall("foo")).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "too bad")
})
}
})
t.Run("python: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=python")).
With(sdkSource("python", fmt.Sprintf(`import dagger
from dagger import dag, object_type, field
@object_type
class Test:
foo: dagger.File = field(default=lambda: (
dag.directory()
.with_new_file("foo.txt", contents="%s")
.file("foo.txt")
))
bar: list[str] = field(default=list)
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "python"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
t.Run("typescript: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=typescript")).
With(sdkSource("typescript", fmt.Sprintf(`
import { dag, File, object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
foo: File = dag.directory().withNewFile("foo.txt", "%s").file("foo.txt")
@field()
bar: string[] = []
// Allow foo to be set through the constructor
constructor(foo?: File) {
if (foo) {
this.foo = foo
}
}
}
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "typescript"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
}
func TestModuleWrapping(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Wrapper struct{}
func (m *Wrapper) Container() *WrappedContainer {
return &WrappedContainer{
dag.Container().From("` + alpineImage + `"),
}
}
type WrappedContainer struct {
Unwrap *Container` + "`" + `json:"unwrap"` + "`" + `
}
func (c *WrappedContainer) Echo(msg string) *WrappedContainer {
return &WrappedContainer{
c.Unwrap.WithExec([]string{"echo", "-n", msg}),
}
}
`,
},
{
sdk: "python",
source: `from typing import Self
import dagger
from dagger import dag, field, function, object_type
@object_type
class WrappedContainer:
unwrap: dagger.Container = field()
@function
def echo(self, msg: str) -> Self:
return WrappedContainer(unwrap=self.unwrap.with_exec(["echo", "-n", msg]))
@object_type
class Wrapper:
@function
def container(self) -> WrappedContainer:
return WrappedContainer(unwrap=dag.container().from_("` + alpineImage + `"))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object()
class WrappedContainer {
@field()
unwrap: Container
constructor(unwrap: Container) {
this.unwrap = unwrap
}
@func()
echo(msg: string): WrappedContainer {
return new WrappedContainer(this.unwrap.withExec(["echo", "-n", msg]))
}
}
@object()
class Wrapper {
@func()
container(): WrappedContainer {
return new WrappedContainer(dag.container().from("` + alpineImage + `"))
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=wrapper", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
id := identity.NewID()
out, err := modGen.With(daggerQuery(
fmt.Sprintf(`{wrapper{container{echo(msg:%q){unwrap{stdout}}}}}`, id),
)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t,
fmt.Sprintf(`{"wrapper":{"container":{"echo":{"unwrap":{"stdout":%q}}}}}`, id),
out)
})
}
}
func TestModuleLotsOfFunctions(t *testing.T) {
t.Parallel()
const funcCount = 100
t.Run("go sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
package main
type PotatoSack struct {}
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
func (m *PotatoSack) Potato%d() string {
return "potato #%d"
}
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("init", "--source=.", "--name=potatoSack", "--sdk=go"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("python sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `from dagger import function
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@function
def potato_%d() -> str:
return "potato #%d"
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("./src/main.py", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("init", "--source=.", "--name=potatoSack", "--sdk=python"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("typescript sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
import { object, func } from "@dagger.io/dagger"
@object()
class PotatoSack {
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@func()
potato_%d(): string {
return "potato #%d"
}
`, i, i)
}
mainSrc += "\n}"
modGen := c.
Container().
From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(sdkSource("typescript", mainSrc)).
With(daggerExec("init", "--name=potatoSack", "--sdk=typescript"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
}
func TestModuleLotsOfDeps(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
modCount := 0
getModMainSrc := func(name string, depNames []string) string {
t.Helper()
mainSrc := fmt.Sprintf(`package main
import "context"
type %s struct {}
func (m *%s) Fn(ctx context.Context) (string, error) {
s := "%s"
var depS string
_ = depS
var err error
_ = err
`, strcase.ToCamel(name), strcase.ToCamel(name), name)
for _, depName := range depNames {
mainSrc += fmt.Sprintf(`
depS, err = dag.%s().Fn(ctx)
if err != nil {
return "", err
}
s += depS
`, strcase.ToCamel(depName))
}
mainSrc += "return s, nil\n}\n"
fmted, err := format.Source([]byte(mainSrc))
require.NoError(t, err)
return string(fmted)
}
// need to construct dagger.json directly in order to avoid excessive
// `dagger mod use` calls while constructing the huge DAG of deps
var rootCfg modules.ModuleConfig
addModulesWithDeps := func(newMods int, depNames []string) []string {
t.Helper()
var newModNames []string
for i := 0; i < newMods; i++ {
name := fmt.Sprintf("mod%d", modCount)
modCount++
newModNames = append(newModNames, name)
modGen = modGen.
WithWorkdir("/work/"+name).
WithNewFile("./main.go", dagger.ContainerWithNewFileOpts{
Contents: getModMainSrc(name, depNames),
})
var depCfgs []*modules.ModuleConfigDependency
for _, depName := range depNames {
depCfgs = append(depCfgs, &modules.ModuleConfigDependency{
Name: depName,
Source: filepath.Join("..", depName),
})
}
modGen = modGen.With(configFile(".", &modules.ModuleConfig{
Name: name,
SDK: "go",
Dependencies: depCfgs,
}))
}
return newModNames
}
// Create a base module, then add 6 layers of deps, where each layer has one more module
// than the previous layer and each module within the layer has a dep on each module
// from the previous layer. Finally add a single module at the top that depends on all
// modules from the last layer and call that.
// Basically, this creates a quadratically growing DAG of modules and verifies we
// handle it efficiently enough to be callable.
curDeps := addModulesWithDeps(1, nil)
for i := 0; i < 6; i++ {
curDeps = addModulesWithDeps(len(curDeps)+1, curDeps)
}
addModulesWithDeps(1, curDeps)
modGen = modGen.With(configFile("..", &rootCfg))
_, err := modGen.With(daggerCall("fn")).Sync(ctx)
require.NoError(t, err)
}
func TestModuleNamespacing(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
moduleSrcPath, err := filepath.Abs("./testdata/modules/go/namespacing")
require.NoError(t, err)
ctr := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithMountedDirectory("/work", c.Host().Directory(moduleSrcPath)).
WithWorkdir("/work")
out, err := ctr.
With(daggerQuery(`{test{fn(s:"yo")}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fn":["*dagger.Sub1Obj made 1:yo", "*dagger.Sub2Obj made 2:yo"]}}`, out)
}
func TestModuleLoops(t *testing.T) {
// verify circular module dependencies result in an error
t.Parallel()
c, ctx := connect(t)
_, err := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
With(daggerExec("init", "--name=depA", "--sdk=go", "depA")).
With(daggerExec("init", "--name=depB", "--sdk=go", "depB")).
With(daggerExec("init", "--name=depC", "--sdk=go", "depC")).
With(daggerExec("install", "-m=depC", "./depB")).
With(daggerExec("install", "-m=depB", "./depA")).
With(daggerExec("install", "-m=depA", "./depC")).
Sync(ctx)
require.ErrorContains(t, err, `local module at "/work/depA" has a circular dependency`)
}
//go:embed testdata/modules/go/id/arg/main.go
var badIDArgGoSrc string
//go:embed testdata/modules/python/id/arg/main.py
var badIDArgPySrc string
//go:embed testdata/modules/typescript/id/arg/index.ts
var badIDArgTSSrc string
//go:embed testdata/modules/go/id/field/main.go
var badIDFieldGoSrc string
//go:embed testdata/modules/typescript/id/field/index.ts
var badIDFieldTSSrc string
//go:embed testdata/modules/go/id/fn/main.go
var badIDFnGoSrc string
//go:embed testdata/modules/python/id/fn/main.py
var badIDFnPySrc string
//go:embed testdata/modules/typescript/id/fn/index.ts
var badIDFnTSSrc string
func TestModuleReservedWords(t *testing.T) {
// verify disallowed names are rejected
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("id", func(t *testing.T) {
t.Parallel()
t.Run("arg", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDArgGoSrc,
},
{
sdk: "python",
source: badIDArgPySrc,
},
{
sdk: "typescript",
source: badIDArgTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := modInit(ctx, t, c, tc.sdk, tc.source).
With(daggerQuery(`{test{fn(id:"no")}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define argument with reserved name \"id\"")
})
}
})
t.Run("field", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFieldGoSrc,
},
{
sdk: "typescript",
source: badIDFieldTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{fn{id}}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define field with reserved name \"id\"")
})
}
})
t.Run("fn", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFnGoSrc,
},
{
sdk: "python",
source: badIDFnPySrc,
},
{
sdk: "typescript",
source: badIDFnTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{id}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define function with reserved name \"id\"")
})
}
})
})
}
func TestModuleExecError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=playground", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
import (
"context"
"errors"
)
type Playground struct{}
func (p *Playground) DoThing(ctx context.Context) error {
_, err := dag.Container().From("` + alpineImage + `").WithExec([]string{"sh", "-c", "exit 5"}).Sync(ctx)
var e *ExecError
if errors.As(err, &e) {
if e.ExitCode == 5 {
return nil
}
}
panic("yikes")
}
`})
_, err := modGen.
With(daggerQuery(`{playground{doThing}}`)).
Stdout(ctx)
require.NoError(t, err)
}
func TestModuleCurrentModuleAPI(t *testing.T) {
t.Parallel()
t.Run("name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=WaCkY", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type WaCkY struct {}
func (m *WaCkY) Fn(ctx context.Context) (string, error) {
return dag.CurrentModule().Name(ctx)
}
`,
}).
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "WaCkY", strings.TrimSpace(out))
})
t.Run("source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/subdir/coolfile.txt", dagger.ContainerWithNewFileOpts{
Contents: "nice",
}).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) *File {
return dag.CurrentModule().Source().File("subdir/coolfile.txt")
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("workdir", func(t *testing.T) {
t.Parallel()
t.Run("dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*Directory, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().Workdir("subdir/moresubdir"), nil
}
`,
}).
With(daggerCall("fn", "file", "--path=coolfile.txt", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("file", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*File, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().WorkdirFile("subdir/moresubdir/coolfile.txt"), nil
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("error on escape", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
func New() (*Test, error) {
if err := os.WriteFile("/rootfile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
if err := os.MkdirAll("/foo", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("/foo/foofile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
return &Test{}, nil
}
type Test struct {}
func (m *Test) EscapeFile(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("../rootfile.txt")
}
func (m *Test) EscapeFileAbs(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("/rootfile.txt")
}
func (m *Test) EscapeDir(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("../foo")
}
func (m *Test) EscapeDirAbs(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("/foo")
}
`,
})
_, err := ctr.
With(daggerCall("escape-file", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-file-abs", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../foo" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir-abs", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/foo" escapes workdir`)
})
})
}
func TestModuleCustomSDK(t *testing.T) {
t.Parallel()
t.Run("local", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/coolsdk").
With(daggerExec("init", "--source=.", "--name=cool-sdk", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type CoolSdk struct {}
func (m *CoolSdk) ModuleRuntime(modSource *ModuleSource, introspectionJson string) *Container {
return modSource.WithSDK("go").AsModule().Runtime().WithEnvVariable("COOL", "true")
}
func (m *CoolSdk) Codegen(modSource *ModuleSource, introspectionJson string) *GeneratedCode {
return dag.GeneratedCode(modSource.WithSDK("go").AsModule().GeneratedContextDirectory())
}
func (m *CoolSdk) RequiredPaths() []string {
return []string{
"**/go.mod",
"**/go.sum",
"**/go.work",
"**/go.work.sum",
"**/vendor/",
"**/*.go",
}
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=coolsdk")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "os"
type Test struct {}
func (m *Test) Fn() string {
return os.Getenv("COOL")
}
`,
})
out, err := ctr.
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "true", strings.TrimSpace(out))
})
t.Run("git", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk="+testGitModuleRef("cool-sdk"))).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "os"
type Test struct {}
func (m *Test) Fn() string {
return os.Getenv("COOL")
}
`,
})
out, err := ctr.
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "true", strings.TrimSpace(out))
})
}
// TestModuleHostError verifies the host api is not exposed to modules
func TestModuleHostError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) *Directory {
return dag.Host().Directory(".")
}
`,
}).
With(daggerCall("fn")).
Sync(ctx)
require.ErrorContains(t, err, "dag.Host undefined")
}
func daggerExec(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerQuery(query string, args ...any) dagger.WithContainerFunc {
return daggerQueryAt("", query, args...)
}
func daggerQueryAt(modPath string, query string, args ...any) dagger.WithContainerFunc {
query = fmt.Sprintf(query, args...)
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "query"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(execArgs, dagger.ContainerWithExecOpts{
Stdin: query,
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerCall(args ...string) dagger.WithContainerFunc {
return daggerCallAt("", args...)
}
func daggerCallAt(modPath string, args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "call"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(append(execArgs, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerFunctions(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug", "functions"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func configFile(dirPath string, cfg *modules.ModuleConfig) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
cfgPath := filepath.Join(dirPath, "dagger.json")
cfgBytes, err := json.Marshal(cfg)
if err != nil {
panic(err)
}
return c.WithNewFile(cfgPath, dagger.ContainerWithNewFileOpts{
Contents: string(cfgBytes),
})
}
}
// command for a dagger cli call direct on the host
func hostDaggerCommand(ctx context.Context, t testing.TB, workdir string, args ...string) *exec.Cmd {
t.Helper()
cmd := exec.CommandContext(ctx, daggerCliPath(t), args...)
cmd.Dir = workdir
return cmd
}
// runs a dagger cli command directly on the host, rather than in an exec
func hostDaggerExec(ctx context.Context, t testing.TB, workdir string, args ...string) ([]byte, error) {
t.Helper()
cmd := hostDaggerCommand(ctx, t, workdir, args...)
output, err := cmd.CombinedOutput()
if err != nil {
err = fmt.Errorf("%s: %w", string(output), err)
}
return output, err
}
func sdkSource(sdk, contents string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
sourcePath := sdkSourceFile(sdk)
if sourcePath == "" {
return c
}
return c.WithNewFile(sourcePath, dagger.ContainerWithNewFileOpts{
Contents: heredoc.Doc(contents),
})
}
}
func sdkSourceFile(sdk string) string {
switch sdk {
case "go":
return "dagger/main.go"
case "python":
return "dagger/src/main.py"
case "typescript":
return "dagger/src/index.ts"
default:
return ""
}
}
func sdkCodegenFile(t *testing.T, sdk string) string {
t.Helper()
switch sdk {
case "go":
// FIXME: go codegen is split up into dagger/dagger.gen.go and
// dagger/dagger/dagger.gen.go
return "dagger/dagger/dagger.gen.go"
case "python":
return "dagger/sdk/src/dagger/client/gen.py"
case "typescript":
return "dagger/sdk/api/client.gen.ts"
default:
return ""
}
}
func modInit(ctx context.Context, t *testing.T, c *dagger.Client, sdk, contents string) *dagger.Container {
t.Helper()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+sdk)).
With(sdkSource(sdk, contents))
return modGen
}
func currentSchema(ctx context.Context, t *testing.T, ctr *dagger.Container) *introspection.Schema {
t.Helper()
out, err := ctr.With(daggerQuery(introspection.Query)).Stdout(ctx)
require.NoError(t, err)
var schemaResp introspection.Response
err = json.Unmarshal([]byte(out), &schemaResp)
require.NoError(t, err)
return schemaResp.Schema
}
var moduleIntrospection = daggerQuery(`
query { host { directory(path: ".") { asModule { initialize {
description
objects {
asObject {
name
description
constructor {
description
args {
name
description
defaultValue
}
}
functions {
name
description
args {
name
description
defaultValue
}
}
fields {
name
description
}
}
}
} } } } }
`)
func inspectModule(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
t.Helper()
out, err := ctr.With(moduleIntrospection).Stdout(ctx)
require.NoError(t, err)
result := gjson.Get(out, "host.directory.asModule.initialize")
t.Logf("module introspection:\n%v", result.Raw)
return result
}
func inspectModuleObjects(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
t.Helper()
return inspectModule(ctx, t, ctr).Get("objects.#.asObject")
}
func goGitBase(t *testing.T, c *dagger.Client) *dagger.Container {
t.Helper()
return c.Container().From(golangImage).
WithExec([]string{"apk", "add", "git"}).
WithExec([]string{"git", "config", "--global", "user.email", "dagger@example.com"}).
WithExec([]string{"git", "config", "--global", "user.name", "Dagger Tests"}).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"})
}
func logGen(ctx context.Context, t *testing.T, modSrc *dagger.Directory) {
t.Helper()
generated, err := modSrc.File("dagger.gen.go").Contents(ctx)
require.NoError(t, err)
t.Cleanup(func() {
t.Name()
fileName := filepath.Join(
os.TempDir(),
t.Name(),
fmt.Sprintf("dagger.gen.%d.go", time.Now().Unix()),
)
if err := os.MkdirAll(filepath.Dir(fileName), 0o755); err != nil {
t.Logf("failed to create temp dir for generated code: %v", err)
return
}
if err := os.WriteFile(fileName, []byte(generated), 0644); err != nil {
t.Logf("failed to write generated code to %s: %v", fileName, err)
} else {
t.Logf("wrote generated code to %s", fileName)
}
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,625 | 🐞 Modules: generated .gitxxx files are put next do dagger.json rather than on source path | Follow-up from:
- https://github.com/dagger/dagger/pull/6575
For example, in our root:
```
dagger init --sdk=python --source=dev
```
This will add, or overwrite, .gitattributes and .gitignore with `/sdk`, when it's actually in `dev/sdk`.
Everytime I do `dagger develop`, these files get overwritten.
\cc @sipsma | https://github.com/dagger/dagger/issues/6625 | https://github.com/dagger/dagger/pull/6699 | 4a04803cfb834c39b39ef7bac57fcf7b74c35d38 | 77a53a85956942540fb2078ef490ac8eeac56e0e | "2024-02-08T19:20:56Z" | go | "2024-02-20T14:01:32Z" | core/integration/module_test.go | package core
import (
"context"
_ "embed"
"encoding/json"
"fmt"
"go/format"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"time"
"github.com/MakeNowJust/heredoc/v2"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/dagql/idproto"
"github.com/iancoleman/strcase"
"github.com/moby/buildkit/identity"
"github.com/stretchr/testify/require"
"github.com/tidwall/gjson"
"golang.org/x/sync/errgroup"
"dagger.io/dagger"
"github.com/dagger/dagger/cmd/codegen/introspection"
)
func TestModuleGoInit(t *testing.T) {
t.Parallel()
t.Run("from scratch", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=bare", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("reserved go.mod name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=go", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{go{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"go":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("uses expected Go module name, camel-cases Dagger module name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=My-Module", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{myModule{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"myModule":{"containerEcho":{"stdout":"hello\n"}}}`, out)
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
t.Run("creates go.mod beneath an existing go.mod if context is beneath it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
// don't use .git under /work so the context ends up being /work/ci
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/go.mod", dagger.ContainerWithNewFileOpts{
Contents: "module example.com/test\n",
}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/ci").
With(daggerExec("init", "--name=beneathGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{beneathGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"beneathGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("names Go module after Dagger module", func(t *testing.T) {
generated, err := modGen.Directory("dagger").File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
})
t.Run("respects existing go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("preserves module name", func(t *testing.T) {
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module example.com/test")
})
})
t.Run("respects existing go.work", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithExec([]string{"go", "work", "init"}).
WithExec([]string{"go", "work", "use", "."}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("go.work is edited", func(t *testing.T) {
generated, err := modGen.File("go.work").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "\t.\n")
require.Contains(t, generated, "\t./dagger\n")
})
})
t.Run("respects existing go.work for top-level source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithExec([]string{"go", "work", "init"}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go", "--source=."))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("go.work is edited", func(t *testing.T) {
generated, err := modGen.File("go.work").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "use .\n")
})
})
t.Run("ignores go.work for subdir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithExec([]string{"go", "work", "init"}).
WithExec([]string{"go", "work", "use", "."}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go", "subdir"))
// we can't write to the go.work at the top-level so it should remain
// unedited, but we should still be able to execute the module as
// expected
out, err := modGen.
WithWorkdir("./subdir").
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("go.work is unedited", func(t *testing.T) {
generated, err := modGen.File("go.work").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "use .\n")
})
})
t.Run("respects parent go.mod if root points to it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
With(daggerExec("init", "--name=child", "--sdk=go", "./child")).
WithWorkdir("/work/child").
// explicitly develop to see whether it makes a go.mod
With(daggerExec("develop")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
require.Equal(t, []string{".git", "child", "foo.go", "go.mod", "go.sum"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.NotContains(t, childEntries, "go.mod")
t.Run("preserves parent module name", func(t *testing.T) {
goMod, err := generated.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, goMod, "module example.com/test")
})
})
t.Run("respects existing go.mod even if root points to parent that has go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"}).
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/child").
WithExec([]string{"go", "mod", "init", "my-mod"}).
WithWorkdir("/work").
With(daggerExec("init", "--source=./child", "--name=child", "--sdk=go", "./child")).
WithWorkdir("/work/child").
// explicitly develop to see whether it makes a go.mod
With(daggerExec("develop")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
// no go.sum
require.Equal(t, []string{".git", "child", "foo.go", "go.mod"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.Contains(t, childEntries, "go.mod")
require.Contains(t, childEntries, "go.sum")
})
t.Run("respects existing main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasMainGo struct {}
func (m *HasMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("init", "--name=hasMainGo", "--sdk=go", "--source=."))
out, err := modGen.
With(daggerQuery(`{hasMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("respects existing main.go even if it uses types not generated yet", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasDaggerTypes struct {}
func (m *HasDaggerTypes) Hello() *Container {
return dag.Container().
From("` + alpineImage + `").
WithExec([]string{"echo", "Hello, world!"})
}
`,
}).
With(daggerExec("init", "--source=.", "--name=hasDaggerTypes", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasDaggerTypes{hello{stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasDaggerTypes":{"hello":{"stdout":"Hello, world!\n"}}}`, out)
})
t.Run("respects existing package without creating main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/notmain.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type HasNotMainGo struct {}
func (m *HasNotMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("init", "--source=.", "--name=hasNotMainGo", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasNotMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasNotMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("with source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=bare", "--sdk=go", "--source=some/subdir"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
sourceSubdirEnts, err := modGen.Directory("/work/some/subdir").Entries(ctx)
require.NoError(t, err)
require.Contains(t, sourceSubdirEnts, "main.go")
sourceRootEnts, err := modGen.Directory("/work").Entries(ctx)
require.NoError(t, err)
require.NotContains(t, sourceRootEnts, "main.go")
})
}
func TestModuleInitLICENSE(t *testing.T) {
t.Run("bootstraps Apache-2.0 LICENSE file if none found", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("creates LICENSE file in the directory specified by arg", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "./mymod"))
content, err := modGen.File("mymod/LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("does not bootstrap LICENSE file if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go"))
_, err := modGen.File("LICENSE").Contents(ctx)
require.Error(t, err)
})
t.Run("bootstraps a LICENSE file when requested, even if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "--license=MIT"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "MIT License")
})
}
func TestModuleGit(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
gitGeneratedFiles []string
gitIgnoredFiles []string
}
for _, tc := range []testCase{
{
sdk: "go",
gitGeneratedFiles: []string{
"/dagger.gen.go",
"/querybuilder/**",
},
},
{
sdk: "python",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
{
sdk: "typescript",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
} {
tc := tc
t.Run(fmt.Sprintf("module %s git", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
With(daggerExec("init", "--name=bare", "--sdk="+tc.sdk))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("configures .gitattributes", func(t *testing.T) {
ignore, err := modGen.File(".gitattributes").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitGeneratedFiles {
require.Contains(t, ignore, fmt.Sprintf("%s linguist-generated\n", fileName))
}
})
if len(tc.gitIgnoredFiles) > 0 {
t.Run("configures .gitignore", func(t *testing.T) {
ignore, err := modGen.File(".gitignore").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitIgnoredFiles {
require.Contains(t, ignore, fileName)
}
})
}
})
}
}
//go:embed testdata/modules/go/minimal/main.go
var goSignatures string
func TestModuleGoSignatures(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
t.Run("func Hello() string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello"}}`, out)
})
t.Run("func Echo(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echo(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echo":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointer(*string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointerPointer(**string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointerPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointerPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoOptional(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptional(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalPointer(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalPointer}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalSlice([]string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalSlice(msg: ["hello", "there"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"hello+there...hello+there...hello+there..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalSlice}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"foobar...foobar...foobar..."}}`, out)
})
t.Run("func Echoes([]string) []string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoes(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoes":["hello...hello...hello..."]}}`, out)
})
t.Run("func EchoesVariadic(...string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoesVariadic(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoesVariadic":"hello...hello...hello..."}}`, out)
})
t.Run("func HelloContext(context.Context) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloContext}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloContext":"hello context"}}`, out)
})
t.Run("func EchoContext(context.Context, string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoContext(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoContext":"ctx.hello...ctx.hello...ctx.hello..."}}`, out)
})
t.Run("func HelloStringError() (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloStringError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloStringError":"hello i worked"}}`, out)
})
t.Run("func HelloVoid()", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoid}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoid":null}}`, out)
})
t.Run("func HelloVoidError() error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoidError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoidError":null}}`, out)
})
t.Run("func EchoOpts(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInline(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlinePointer(*struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineCtx(ctx, struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineTags(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsPragmas(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsPragmas(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsPragmas":"hi...hi...hi..."}}`, out)
})
}
func TestModuleGoSignaturesBuiltinTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("dagger/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Minimal struct {}
func (m *Minimal) Read(ctx context.Context, dir Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadPointer(ctx context.Context, dir *Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadSlice(ctx context.Context, dir []Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadVariadic(ctx context.Context, dir ...Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadOptional(
ctx context.Context,
dir *Directory, // +optional
) (string, error) {
if dir != nil {
return dir.File("foo").Contents(ctx)
}
return "", nil
}
`,
})
out, err := modGen.With(daggerQuery(`{directory{withNewFile(path: "foo", contents: "bar"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
dirID := gjson.Get(out, "directory.withNewFile.id").String()
t.Run("func Read(ctx, Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{read(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"read":"bar"}}`, out)
})
t.Run("func ReadPointer(ctx, *Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readPointer(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readPointer":"bar"}}`, out)
})
t.Run("func ReadSlice(ctx, []Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readSlice(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readSlice":"bar"}}`, out)
})
t.Run("func ReadVariadic(ctx, ...Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readVariadic(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readVariadic":"bar"}}`, out)
})
t.Run("func ReadOptional(ctx, Optional[Directory]) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readOptional(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":"bar"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{readOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":""}}`, out)
})
}
func TestModuleGoSignaturesUnexported(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) string {
return name
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
objs := inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 1, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
objs = inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 2, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
require.Equal(t, "MinimalFoo", objs.Get("1.name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {
Bar bar
}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
_, err := modGen.With(moduleIntrospection).Stderr(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "cannot code-generate unexported type bar")
}
func TestModuleGoSignaturesMixMatch(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
func (m *Minimal) Hello(name string, opts struct{}, opts2 struct{}) string {
return name
}
`,
})
_, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "nested structs are not supported")
}
func TestModuleGoSignaturesNameConflict(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {
Foo Foo
Bar Bar
Baz Baz
}
type Foo struct {}
type Bar struct {}
type Baz struct {}
func (m *Foo) Hello(name string) string {
return name
}
func (f *Bar) Hello(name string, name2 string) string {
return name + name2
}
func (b *Baz) Hello() (string, error) {
return "", nil
}
`,
})
objs := inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 4, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
require.Equal(t, "MinimalFoo", objs.Get("1.name").String())
require.Equal(t, "MinimalBar", objs.Get("2.name").String())
require.Equal(t, "MinimalBaz", objs.Get("3.name").String())
}
func TestModuleGoDocs(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
logGen(ctx, t, modGen.Directory("."))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Empty(t, hello.Get("description").String())
require.Empty(t, hello.Get("args").Array())
// test the args-based form
echoOpts := obj.Get(`functions.#(name="echoOpts")`)
require.Equal(t, "echoOpts", echoOpts.Get("name").String())
require.Equal(t, "EchoOpts does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the inline struct form
echoOpts = obj.Get(`functions.#(name="echoOptsInline")`)
require.Equal(t, "echoOptsInline", echoOpts.Get("name").String())
require.Equal(t, "EchoOptsInline does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the arg-based form (with pragmas)
echoOpts = obj.Get(`functions.#(name="echoOptsPragmas")`)
require.Equal(t, "echoOptsPragmas", echoOpts.Get("name").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "", echoOpts.Get("args.0.defaultValue").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "\"...\"", echoOpts.Get("args.1.defaultValue").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "3", echoOpts.Get("args.2.defaultValue").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
}
func TestModuleGoDocsEdgeCases(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
// Minimal is a thing
type Minimal struct {
// X is this
X, Y string // Y is not this
// +private
Z string
}
// some docs
func (m *Minimal) Hello(foo string, bar string,
// hello
baz string, qux string, x string, // lol
) string {
return foo + bar
}
func (m *Minimal) HelloMore(
// foo here
foo,
// bar here
bar string,
) string {
return foo + bar
}
func (m *Minimal) HelloMoreInline(opts struct{
// foo here
foo, bar string
}) string {
return opts.foo + opts.bar
}
func (m *Minimal) HelloAgain( // docs for helloagain
foo string,
bar string, // docs for bar
baz string,
) string {
return foo + bar
}
func (m *Minimal) HelloFinal(
foo string) string { // woops
return foo
}
`,
})
logGen(ctx, t, modGen.Directory("."))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Equal(t, "Minimal is a thing", obj.Get("description").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 5)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "hello", hello.Get("args.2.description").String())
require.Equal(t, "qux", hello.Get("args.3.name").String())
require.Equal(t, "", hello.Get("args.3.description").String())
require.Equal(t, "x", hello.Get("args.4.name").String())
require.Equal(t, "lol", hello.Get("args.4.description").String())
hello = obj.Get(`functions.#(name="helloMore")`)
require.Equal(t, "helloMore", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "bar here", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloMoreInline")`)
require.Equal(t, "helloMoreInline", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloAgain")`)
require.Equal(t, "helloAgain", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 3)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "docs for bar", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "", hello.Get("args.2.description").String())
hello = obj.Get(`functions.#(name="helloFinal")`)
require.Equal(t, "helloFinal", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 1)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Len(t, obj.Get(`fields`).Array(), 2)
prop := obj.Get(`fields.#(name="x")`)
require.Equal(t, "x", prop.Get("name").String())
require.Equal(t, "X is this", prop.Get("description").String())
prop = obj.Get(`fields.#(name="y")`)
require.Equal(t, "y", prop.Get("name").String())
require.Equal(t, "", prop.Get("description").String())
}
func TestModuleGoWeirdFields(t *testing.T) {
// these are all cases that used to panic due to the disparity in the type spec and the ast
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Z string
type Minimal struct {
// field with single (normal) name
W string
// field with multiple names
X, Y string
// field with no names
Z
}
func New() Minimal {
return Minimal{
W: "-",
X: "-",
Y: "-",
Z: Z("-"),
}
}
// struct with no fields
type Bar struct{}
func (m *Minimal) Say(
// field with single (normal) name
a string,
// field with multiple names
b, c string,
// field with no names (not included, mixed names not allowed)
// string
) string {
return a + " " + b + " " + c
}
func (m *Minimal) Hello(
// field with no names
string,
) string {
return "hello"
}
func (m *Minimal) SayOpts(opts struct{
// field with single (normal) name
A string
// field with multiple names
B, C string
// field with no names (not included because of above)
// string
}) string {
return opts.A + " " + opts.B + " " + opts.C
}
func (m *Minimal) HelloOpts(opts struct{
// field with no names
string
}) string {
return "hello"
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{w, x, y, z}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"w": "-", "x": "-", "y": "-", "z": "-"}}`, out)
for _, name := range []string{"say", "sayOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(a: "hello", b: "world", c: "!")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello world !"}}`, name), out)
}
for _, name := range []string{"hello", "helloOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(string: "")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello"}}`, name), out)
}
}
func TestModuleGoFieldMustBeNil(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "fmt"
type Minimal struct {
Src *Directory
Name *string
}
func New() *Minimal {
return &Minimal{}
}
func (m *Minimal) IsEmpty() bool {
if m.Name != nil {
panic(fmt.Sprintf("name should be nil but is %v", m.Name))
}
if m.Src != nil {
panic(fmt.Sprintf("src should be nil but is %v", m.Src))
}
return true
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{isEmpty}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"isEmpty": true}}`, out)
}
func TestModuleDescription(t *testing.T) {
t.Parallel()
type source struct {
file string
contents string
}
for _, tc := range []struct {
sdk string
sources []source
}{
{
sdk: "go",
sources: []source{
{
file: "main.go",
contents: `
// Test module, short description
//
// Long description, with full sentences.
package main
// Test object, short description
type Test struct {
// +default="foo"
Foo string
}
`,
},
},
},
{
sdk: "go",
sources: []source{
{
file: "a.go",
contents: `
// First, but not main
package main
type Foo struct {}
`,
},
{
file: "z.go",
contents: `
// Test module, short description
//
// Long description, with full sentences.
package main
// Test object, short description
type Test struct {
}
func (*Test) Foo() Foo {
return Foo{}
}
`,
},
},
},
{
sdk: "python",
sources: []source{
{
file: "src/main.py",
contents: `
"""Test module, short description
Long description, with full sentences.
"""
from dagger import field, object_type
@object_type
class Test:
"""Test object, short description"""
foo: str = field(default="foo")
`,
},
},
},
{
sdk: "python",
sources: []source{
{
file: "src/main/foo.py",
contents: `
"""Not the main file"""
from dagger import field, object_type
@object_type
class Foo:
bar: str = field(default="bar")
`,
},
{
file: "src/main/__init__.py",
contents: `
"""Test module, short description
Long description, with full sentences.
"""
from dagger import function, object_type
from .foo import Foo
@object_type
class Test:
"""Test object, short description"""
foo = function(Foo)
`,
},
},
},
{
sdk: "typescript",
sources: []source{
{
file: "src/index.ts",
contents: `
/**
* Test module, short description
*
* Long description, with full sentences.
*/
import { object, field } from '@dagger.io/dagger'
/**
* Test object, short description
*/
@object()
class Test {
@field()
foo: string = "foo"
}
`,
},
},
},
{
sdk: "typescript",
sources: []source{
{
file: "src/foo.ts",
contents: `
/**
* Not the main file
*/
import { object, field } from '@dagger.io/dagger'
@object()
export class Foo {
@field()
bar = "bar"
}
`,
},
{
file: "src/index.ts",
contents: `
/**
* Test module, short description
*
* Long description, with full sentences.
*/
import { object, field } from '@dagger.io/dagger'
import { Foo } from "./foo"
/**
* Test object, short description
*/
@object()
class Test {
@func()
foo(): Foo {
return new Foo()
}
}
`,
},
},
},
} {
tc := tc
t.Run(fmt.Sprintf("%s with %d files", tc.sdk, len(tc.sources)), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
for _, src := range tc.sources {
src := src
modGen = modGen.WithNewFile(src.file, dagger.ContainerWithNewFileOpts{
Contents: heredoc.Doc(src.contents),
})
}
mod := inspectModule(ctx, t,
modGen.With(daggerExec("init", "--source=.", "--name=test", "--sdk="+tc.sdk)))
require.Equal(t,
"Test module, short description\n\nLong description, with full sentences.",
mod.Get("description").String(),
)
require.Equal(t,
"Test object, short description",
mod.Get("objects.#.asObject|#(name=Test).description").String(),
)
})
}
}
func TestModulePrivateField(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
sdk string
source string
}{
{
sdk: "go",
source: `package main
type Minimal struct {
Foo string
Bar string // +private
}
func (m *Minimal) Set(foo string, bar string) *Minimal {
m.Foo = foo
m.Bar = bar
return m
}
func (m *Minimal) Hello() string {
return m.Foo + m.Bar
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Minimal:
foo: str = field(default="")
bar: str = ""
@function
def set(self, foo: str, bar: str) -> "Minimal":
self.foo = foo
self.bar = bar
return self
@function
def hello(self) -> str:
return self.foo + self.bar
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Minimal {
@field()
foo: string
bar?: string
constructor(foo?: string, bar?: string) {
this.foo = foo
this.bar = bar
}
@func()
set(foo: string, bar: string): Minimal {
this.foo = foo
this.bar = bar
return this
}
@func()
hello(): string {
return this.foo + this.bar
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Len(t, obj.Get(`fields`).Array(), 1)
prop := obj.Get(`fields.#(name="foo")`)
require.Equal(t, "foo", prop.Get("name").String())
out, err := modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){hello}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"hello": "abcxyz"}}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){foo}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"foo": "abc"}}}`, out)
_, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){bar}}}`)).Stdout(ctx)
require.ErrorContains(t, err, `Minimal has no such field: "bar"`)
})
}
}
// this is no longer allowed, but verify the SDK errors out
func TestModuleGoExtendCore(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=container", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
func (c *Container) Echo(ctx context.Context, msg string) (string, error) {
return c.WithExec([]string{"echo", msg}).Stdout(ctx)
}
`,
}).
With(daggerQuery(`{container{from(address:"` + alpineImage + `"){echo(msg:"echo!"){stdout}}}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "cannot define methods on objects from outside this module")
}
func TestModuleGoBadCtx(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=foo", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Foo struct {}
func (f *Foo) Echo(ctx context.Context, ctx2 context.Context) (string, error) {
return "", nil
}
`,
}).
With(daggerQuery(`{foo{echo}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "unexpected context type")
}
func TestModuleCustomTypes(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Test struct{}
func (m *Test) Repeater(msg string, times int) *Repeater {
return &Repeater{
Message: msg,
Times: times,
}
}
type Repeater struct {
Message string
Times int
}
func (t *Repeater) Render() string {
return strings.Repeat(t.Message, t.Times)
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Repeater:
message: str = field(default="")
times: int = field(default=0)
@function
def render(self) -> str:
return self.message * self.times
@function
def repeater(msg: str, times: int) -> Repeater:
return Repeater(message=msg, times=times)
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Repeater {
@field()
message: string
@field()
times: number
constructor(message: string, times: number) {
this.message = message
this.times = times
}
@func()
render(): string {
return this.message.repeat(this.times)
}
}
@object()
class Test {
@func()
repeater(msg: string, times: number): Repeater {
return new Repeater(msg, times)
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("custom %s types", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := modInit(ctx, t, c, tc.sdk, tc.source).
With(daggerQuery(`{test{repeater(msg:"echo!", times: 3){render}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"repeater":{"render":"echo!echo!echo!"}}}`, out)
})
}
}
func TestModuleReturnTypeDetection(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
}
func (m *Foo) MyFunction() X {
return X{Message: "foo"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
@function
def my_function() -> X:
return X(message="foo")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class X {
@field()
message: string
constructor(message: string) {
this.message = message;
}
}
@object()
class Foo {
@func()
myFunction(): X {
return new X("foo");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{myFunction{message}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo"}}}`, out)
})
}
}
func TestModuleReturnObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
When string ` + "`json:\"Timestamp\"`" + `
To string ` + "`json:\"recipient\"`" + `
From string
}
func (m *Foo) MyFunction() X {
return X{Message: "foo", When: "now", To: "user", From: "admin"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
when: str = field(default="", name="Timestamp")
to: str = field(default="", name="recipient")
from_: str = field(default="", name="from")
@object_type
class Foo:
@function
def my_function(self) -> X:
return X(message="foo", when="now", to="user", from_="admin")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class X {
@field()
message: string
@field()
timestamp: string
@field()
recipient: string
@field()
from: string
constructor(message: string, timestamp: string, recipient: string, from: string) {
this.message = message;
this.timestamp = timestamp;
this.recipient = recipient;
this.from = from;
}
}
@object()
class Foo {
@func()
myFunction(): X {
return new X("foo", "now", "user", "admin");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{myFunction{message, recipient, from, timestamp}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo", "recipient":"user", "from":"admin", "timestamp":"now"}}}`, out)
})
}
}
func TestModuleReturnNestedObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type Foo struct {
MsgContainer Bar
}
type Bar struct {
Msg string
}
func (m *Playground) MyFunction() Foo {
return Foo{MsgContainer: Bar{Msg: "hello world"}}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Bar:
msg: str = field()
@object_type
class Foo:
msg_container: Bar = field()
@object_type
class Playground:
@function
def my_function(self) -> Foo:
return Foo(msg_container=Bar(msg="hello world"))
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Bar {
@field()
msg: string;
constructor(msg: string) {
this.msg = msg;
}
}
@object()
class Foo {
@field()
msgContainer: Bar;
constructor(msgContainer: Bar) {
this.msgContainer = msgContainer;
}
}
@object()
class Playground {
@func()
myFunction(): Foo {
return new Foo(new Bar("hello world"));
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{myFunction{msgContainer{msg}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myFunction":{"msgContainer":{"msg": "hello world"}}}}`, out)
})
}
}
func TestModuleReturnCompositeCore(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
func (m *Playground) MySlice() []*Container {
return []*Container{dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"})}
}
type Foo struct {
Con *Container
// verify fields can remain nil w/out error too
UnsetFile *File
}
func (m *Playground) MyStruct() *Foo {
return &Foo{Con: dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"})}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class Foo:
con: dagger.Container = field()
unset_file: dagger.File | None = field(default=None)
@object_type
class Playground:
@function
def my_slice(self) -> list[dagger.Container]:
return [dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"])]
@function
def my_struct(self) -> Foo:
return Foo(con=dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"]))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, File, object, func, field } from "@dagger.io/dagger"
@object()
class Foo {
@field()
con: Container
@field()
unsetFile?: File
constructor(con: Container, usetFile?: File) {
this.con = con
this.usetFile = usetFile
}
}
@object()
class Playground {
@func()
mySlice(): Container[] {
return [
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
]
}
@func()
myStruct(): Foo {
return new Foo(
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{mySlice{stdout}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"mySlice":[{"stdout":"hello world\n"}]}}`, out)
out, err = modGen.With(daggerQuery(`{playground{myStruct{con{stdout}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myStruct":{"con":{"stdout":"hello world\n"}}}}`, out)
})
}
}
func TestModuleReturnComplexThing(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type ScanResult struct {
Containers []*Container ` + "`json:\"targets\"`" + `
Report ScanReport
}
type ScanReport struct {
Contents string ` + "`json:\"contents\"`" + `
Authors []string ` + "`json:\"Authors\"`" + `
}
func (m *Playground) Scan() ScanResult {
return ScanResult{
Containers: []*Container{
dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"}),
},
Report: ScanReport{
Contents: "hello world",
Authors: []string{"foo", "bar"},
},
}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class ScanReport:
contents: str = field()
authors: list[str] = field()
@object_type
class ScanResult:
containers: list[dagger.Container] = field(name="targets")
report: ScanReport = field()
@object_type
class Playground:
@function
def scan(self) -> ScanResult:
return ScanResult(
containers=[
dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"]),
],
report=ScanReport(
contents="hello world",
authors=["foo", "bar"],
),
)
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object()
class ScanReport {
@field()
contents: string
@field()
authors: string[]
constructor(contents: string, authors: string[]) {
this.contents = contents
this.authors = authors
}
}
@object()
class ScanResult {
@field("targets")
containers: Container[]
@field()
report: ScanReport
constructor(containers: Container[], report: ScanReport) {
this.containers = containers
this.report = report
}
}
@object()
class Playground {
@func()
async scan(): Promise<ScanResult> {
return new ScanResult(
[
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
],
new ScanReport("hello world", ["foo", "bar"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{scan{targets{stdout},report{contents,authors}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"scan":{"targets":[{"stdout":"hello world\n"}],"report":{"contents":"hello world","authors":["foo","bar"]}}}}`, out)
})
}
}
func TestModuleGlobalVarDAG(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
type Foo struct {}
var someDefault = dag.Container().From("` + alpineImage + `")
func (m *Foo) Fn(ctx context.Context) (string, error) {
return someDefault.WithExec([]string{"echo", "foo"}).Stdout(ctx)
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function, object_type
SOME_DEFAULT = dag.container().from_("` + alpineImage + `")
@object_type
class Foo:
@function
async def fn(self) -> str:
return await SOME_DEFAULT.with_exec(["echo", "foo"]).stdout()
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from "@dagger.io/dagger"
var someDefault = dag.container().from("` + alpineImage + `")
@object()
class Foo {
@func()
async fn(): Promise<string> {
return someDefault.withExec(["echo", "foo"]).stdout()
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"fn":"foo\n"}}`, out)
})
}
}
func TestModuleIDableType(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {
Data string
}
func (m *Foo) Set(data string) *Foo {
m.Data = data
return m
}
func (m *Foo) Get() string {
return m.Data
}
`,
},
{
sdk: "python",
source: `from typing import Self
from dagger import field, function, object_type
@object_type
class Foo:
data: str = ""
@function
def set(self, data: str) -> Self:
self.data = data
return self
@function
def get(self) -> str:
return self.data
`,
},
{
sdk: "typescript",
source: `
import { object, func } from "@dagger.io/dagger"
@object()
class Foo {
data: string = ""
@func()
set(data: string): Foo {
this.data = data
return this
}
@func()
get(): string {
return this.data
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
// sanity check
out, err := modGen.With(daggerQuery(`{foo{set(data: "abc"){get}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"set":{"get": "abc"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{set(data: "abc"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.set.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.set(data: "abc"): Foo!`)
out, err = modGen.With(daggerQuery(`{loadFooFromID(id: "%s"){get}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"loadFooFromID":{"get": "abc"}}`, out)
})
}
}
func TestModuleArgOwnType(t *testing.T) {
// Verify use of a module's own object as an argument type.
// The server needs to specifically decode the input type from an ID into
// the raw JSON, since the module doesn't understand it's own types as IDs
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Foo struct{}
type Message struct {
Content string
}
func (m *Foo) SayHello(name string) Message {
return Message{Content: "hello " + name}
}
func (m *Foo) Upper(msg Message) Message {
msg.Content = strings.ToUpper(msg.Content)
return msg
}
func (m *Foo) Uppers(msg []Message) []Message {
for i := range msg {
msg[i].Content = strings.ToUpper(msg[i].Content)
}
return msg
}`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Message:
content: str = field()
@object_type
class Foo:
@function
def say_hello(self, name: str) -> Message:
return Message(content=f"hello {name}")
@function
def upper(self, msg: Message) -> Message:
msg.content = msg.content.upper()
return msg
@function
def uppers(self, msg: list[Message]) -> list[Message]:
for m in msg:
m.content = m.content.upper()
return msg
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Message {
@field()
content: string
constructor(content: string) {
this.content = content
}
}
@object()
class Foo {
@func()
sayHello(name: string): Message {
return new Message("hello " + name)
}
@func()
upper(msg: Message): Message {
msg.content = msg.content.toUpperCase()
return msg
}
@func()
uppers(msg: Message[]): Message[] {
for (let i = 0; i < msg.length; i++) {
msg[i].content = msg[i].content.toUpperCase()
}
return msg
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{sayHello(name: "world"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.sayHello.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.sayHello(name: "world"): FooMessage!`)
out, err = modGen.With(daggerQuery(`{foo{upper(msg:"%s"){content}}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"upper":{"content": "HELLO WORLD"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{uppers(msg:["%s", "%s"]){content}}}`, id, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"uppers":[{"content": "HELLO WORLD"}, {"content": "HELLO WORLD"}]}}`, out)
})
}
}
func TestModuleConflictingSameNameDeps(t *testing.T) {
// A -> B -> Dint
// A -> C -> Dstr
// where Dint and Dstr are modules with the same name and same object names but conflicting types
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dstr").
With(daggerExec("init", "--source=.", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo string
}
func (m *D) Fn(foo string) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dint").
With(daggerExec("init", "--source=.", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo int
}
func (m *D) Fn(foo int) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=c", "--name=c", "--sdk=go", "c")).
WithWorkdir("/work/c").
With(daggerExec("install", "../dstr")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type C struct{}
func (m *C) Fn(ctx context.Context, foo string) (string, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=b", "--name=b", "--sdk=go", "b")).
With(daggerExec("install", "-m=b", "./dint")).
WithNewFile("/work/b/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type B struct{}
func (m *B) Fn(ctx context.Context, foo int) (int, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=a", "--name=a", "--sdk=go", "a")).
WithWorkdir("/work/a").
With(daggerExec("install", "../b")).
With(daggerExec("install", "../c")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"strconv"
)
type A struct{}
func (m *A) Fn(ctx context.Context) (string, error) {
fooStr, err := dag.C().Fn(ctx, "foo")
if err != nil {
return "", err
}
fooInt, err := dag.B().Fn(ctx, 123)
if err != nil {
return "", err
}
return fooStr + strconv.Itoa(fooInt), nil
}
`,
})
out, err := ctr.With(daggerQuery(`{a{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"a":{"fn": "foo123"}}`, out)
// verify that no types from (transitive) deps show up
types := currentSchema(ctx, t, ctr).Types
require.NotNil(t, types.Get("A"))
require.Nil(t, types.Get("B"))
require.Nil(t, types.Get("C"))
require.Nil(t, types.Get("D"))
}
func TestModuleSelfAPICall(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"github.com/Khan/genqlient/graphql"
)
type Test struct{}
func (m *Test) FnA(ctx context.Context) (string, error) {
resp := &graphql.Response{}
err := dag.Client.MakeRequest(ctx, &graphql.Request{
Query: "{test{fnB}}",
}, resp)
if err != nil {
return "", err
}
return resp.Data.(map[string]any)["test"].(map[string]any)["fnB"].(string), nil
}
func (m *Test) FnB() string {
return "hi from b"
}
`,
}).
With(daggerQuery(`{test{fnA}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fnA": "hi from b"}}`, out)
}
func TestModuleGoWithOtherModuleTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Dep struct{}
type Obj struct {
Foo string
}
func (m *Dep) Fn() Obj {
return Obj{Foo: "foo"}
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=test", "--name=test", "--sdk=go", "test")).
With(daggerExec("install", "-m=test", "./dep")).
WithWorkdir("/work/test")
t.Run("return as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() (*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() ([]*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
})
t.Run("arg as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj *DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj []*DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
})
t.Run("field as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo *DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo []*DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
})
}
func TestModuleGoUseDaggerTypesDirect(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "main/dagger"
type Minimal struct{}
func (m *Minimal) Foo(dir *Directory) (*dagger.Directory) {
return dir.WithNewFile("foo", "xxx")
}
func (m *Minimal) Bar(dir *dagger.Directory) (*Directory) {
return dir.WithNewFile("bar", "yyy")
}
`,
})
out, err := modGen.With(daggerQuery(`{directory{id}}`)).Stdout(ctx)
require.NoError(t, err)
dirID := gjson.Get(out, "directory.id").String()
out, err = modGen.With(daggerQuery(`{minimal{foo(dir: "%s"){file(path: "foo"){contents}}}}`, dirID)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"foo":{"file":{"contents": "xxx"}}}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{bar(dir: "%s"){file(path: "bar"){contents}}}}`, dirID)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"bar":{"file":{"contents": "yyy"}}}}`, out)
}
func TestModuleGoUtilsPkg(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"main/utils"
)
type Minimal struct{}
func (m *Minimal) Hello(ctx context.Context) (string, error) {
return utils.Foo().File("foo").Contents(ctx)
}
`,
}).
WithNewFile("utils/util.go", dagger.ContainerWithNewFileOpts{
Contents: `package utils
import "main/dagger"
func Foo() *dagger.Directory {
return dagger.Connect().Directory().WithNewFile("/foo", "hello world")
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello world"}}`, out)
}
func TestModuleGoNameCase(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c))
ctr = ctr.
WithWorkdir("/toplevel/ssh").
With(daggerExec("init", "--name=ssh", "--sdk=go", "--source=.")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Ssh struct {}
func (ssh *Ssh) SayHello() string {
return "hello!"
}
`,
})
out, err := ctr.With(daggerQuery(`{ssh{sayHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"ssh":{"sayHello":"hello!"}}`, out)
ctr = ctr.
WithWorkdir("/toplevel").
With(daggerExec("init", "--name=toplevel", "--sdk=go", "--source=.")).
With(daggerExec("install", "./ssh")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Toplevel struct {}
func (t *Toplevel) SayHello(ctx context.Context) (string, error) {
return dag.SSH().SayHello(ctx)
}
`,
})
logGen(ctx, t, ctr.Directory("."))
out, err = ctr.With(daggerQuery(`{toplevel{sayHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"toplevel":{"sayHello":"hello!"}}`, out)
}
var useInner = `package main
type Dep struct{}
func (m *Dep) Hello() string {
return "hello"
}
`
var useGoOuter = `package main
import "context"
type Use struct{}
func (m *Use) UseHello(ctx context.Context) (string, error) {
return dag.Dep().Hello(ctx)
}
`
var usePythonOuter = `from dagger import dag, function
@function
def use_hello() -> str:
return dag.dep().hello()
`
var useTSOuter = `
import { dag, object, func } from '@dagger.io/dagger'
@object()
class Use {
@func()
async useHello(): Promise<string> {
return dag.dep().hello()
}
}
`
func TestModuleUseLocal(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// cannot use transitive dependency directly
_, err = modGen.With(daggerQuery(`{dep{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, `Query has no such field: "dep"`)
})
}
}
func TestModuleCodegenOnDepChange(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
changed string
expected string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
expected: "Hellov2",
changed: strings.ReplaceAll(useGoOuter, `Hello(ctx)`, `Hellov2(ctx)`),
},
{
sdk: "python",
source: usePythonOuter,
expected: "hellov2",
changed: strings.ReplaceAll(usePythonOuter, `.hello()`, `.hellov2()`),
},
{
sdk: "typescript",
source: useTSOuter,
expected: "hellov2",
changed: strings.ReplaceAll(useTSOuter, `.hello()`, `.hellov2()`),
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// make back-incompatible change to dep
newInner := strings.ReplaceAll(useInner, `Hello()`, `Hellov2()`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("develop"))
codegenContents, err := modGen.File(sdkCodegenFile(t, tc.sdk)).Contents(ctx)
require.NoError(t, err)
require.Contains(t, codegenContents, tc.expected)
modGen = modGen.With(sdkSource(tc.sdk, tc.changed))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
})
}
}
func TestModuleSyncDeps(t *testing.T) {
// verify that changes to deps result in a develop to the depender module
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
modGen = modGen.With(daggerQuery(`{use{useHello}}`))
out, err := modGen.Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
newInner := strings.ReplaceAll(useInner, `"hello"`, `"goodbye"`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("develop"))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"goodbye"}}`, out)
})
}
}
func TestModuleUseLocalMulti(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
import "fmt"
type Use struct {}
func (m *Use) Names(ctx context.Context) ([]string, error) {
fooName, err := dag.Foo().Name(ctx)
if err != nil {
return nil, fmt.Errorf("foo.name: %w", err)
}
barName, err := dag.Bar().Name(ctx)
if err != nil {
return nil, fmt.Errorf("bar.name: %w", err)
}
return []string{fooName, barName}, nil
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function
@function
async def names() -> list[str]:
return [
await dag.foo().name(),
await dag.bar().name(),
]
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from '@dagger.io/dagger'
@object()
class Use {
@func()
async names(): Promise<string[]> {
return [await dag.foo().name(), await dag.bar().name()]
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/foo").
WithNewFile("/work/foo/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Foo struct {}
func (m *Foo) Name() string { return "foo" }
`,
}).
With(daggerExec("init", "--source=.", "--name=foo", "--sdk=go")).
WithWorkdir("/work/bar").
WithNewFile("/work/bar/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Bar struct {}
func (m *Bar) Name() string { return "bar" }
`,
}).
With(daggerExec("init", "--source=.", "--name=bar", "--sdk=go")).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(daggerExec("install", "./foo")).
With(daggerExec("install", "./bar")).
With(sdkSource(tc.sdk, tc.source)).
WithEnvVariable("BUST", identity.NewID()) // NB(vito): hmm...
out, err := modGen.With(daggerQuery(`{use{names}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"names":["foo", "bar"]}}`, out)
})
}
}
func TestModuleConstructor(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("basic", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(
ctx context.Context,
foo string,
bar *int, // +optional
baz []string,
dir *Directory,
) *Test {
bar2 := 42
if bar != nil {
bar2 = *bar
}
return &Test{
Foo: foo,
Bar: bar2,
Baz: baz,
Dir: dir,
}
}
type Test struct {
Foo string
Bar int
Baz []string
Dir *Directory
NeverSetDir *Directory
}
func (m *Test) GimmeFoo() string {
return m.Foo
}
func (m *Test) GimmeBar() int {
return m.Bar
}
func (m *Test) GimmeBaz() []string {
return m.Baz
}
func (m *Test) GimmeDirEnts(ctx context.Context) ([]string, error) {
return m.Dir.Entries(ctx)
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import field, function, object_type
@object_type
class Test:
foo: str = field()
dir: dagger.Directory = field()
bar: int = field(default=42)
baz: list[str] = field(default=list)
never_set_dir: dagger.Directory | None = field(default=None)
@function
def gimme_foo(self) -> str:
return self.foo
@function
def gimme_bar(self) -> int:
return self.bar
@function
def gimme_baz(self) -> list[str]:
return self.baz
@function
async def gimme_dir_ents(self) -> list[str]:
return await self.dir.entries()
`,
},
{
sdk: "typescript",
source: `
import { Directory, object, func, field } from '@dagger.io/dagger';
@object()
class Test {
@field()
foo: string
@field()
dir: Directory
@field()
bar: number
@field()
baz: string[]
@field()
neverSetDir?: Directory
constructor(foo: string, dir: Directory, bar = 42, baz: string[] = []) {
this.foo = foo;
this.dir = dir;
this.bar = bar;
this.baz = baz;
}
@func()
gimmeFoo(): string {
return this.foo;
}
@func()
gimmeBar(): number {
return this.bar;
}
@func()
gimmeBaz(): string[] {
return this.baz;
}
@func()
async gimmeDirEnts(): Promise<string[]> {
return this.dir.entries();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := modInit(ctx, t, c, tc.sdk, tc.source)
out, err := ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-dir-ents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, strings.TrimSpace(out), "dagger.json")
})
}
})
t.Run("fields only", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(ctx context.Context) (Test, error) {
v, err := dag.Container().From("alpine:3.18.4").File("/etc/alpine-release").Contents(ctx)
if err != nil {
return Test{}, err
}
return Test{
AlpineVersion: v,
}, nil
}
type Test struct {
AlpineVersion string
}
`,
},
{
sdk: "python",
source: `from dagger import dag, field, function, object_type
@object_type
class Test:
alpine_version: str = field()
@classmethod
async def create(cls) -> "Test":
return cls(alpine_version=await (
dag.container()
.from_("alpine:3.18.4")
.file("/etc/alpine-release")
.contents()
))
`,
},
{
sdk: "typescript",
source: `
import { dag, object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
alpineVersion: string
// NOTE: this is not standard to do async operations in the constructor.
// This is only for testing purpose but it shouldn't be done in real usage.
constructor() {
return (async () => {
this.alpineVersion = await dag.container().from("alpine:3.18.4").file("/etc/alpine-release").contents()
return this; // Return the newly-created instance
})();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := ctr.With(daggerCall("alpine-version")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "3.18.4")
})
}
})
t.Run("return error", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"fmt"
)
func New() (*Test, error) {
return nil, fmt.Errorf("too bad")
}
type Test struct {
Foo string
}
`,
},
{
sdk: "python",
source: `from dagger import object_type, field
@object_type
class Test:
foo: str = field()
def __init__(self):
raise ValueError("too bad")
`,
},
{
sdk: "typescript",
source: `
import { object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
foo: string
constructor() {
throw new Error("too bad")
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
_, err := ctr.With(daggerCall("foo")).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "too bad")
})
}
})
t.Run("python: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=python")).
With(sdkSource("python", fmt.Sprintf(`import dagger
from dagger import dag, object_type, field
@object_type
class Test:
foo: dagger.File = field(default=lambda: (
dag.directory()
.with_new_file("foo.txt", contents="%s")
.file("foo.txt")
))
bar: list[str] = field(default=list)
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "python"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
t.Run("typescript: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=typescript")).
With(sdkSource("typescript", fmt.Sprintf(`
import { dag, File, object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
foo: File = dag.directory().withNewFile("foo.txt", "%s").file("foo.txt")
@field()
bar: string[] = []
// Allow foo to be set through the constructor
constructor(foo?: File) {
if (foo) {
this.foo = foo
}
}
}
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "typescript"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
}
func TestModuleWrapping(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Wrapper struct{}
func (m *Wrapper) Container() *WrappedContainer {
return &WrappedContainer{
dag.Container().From("` + alpineImage + `"),
}
}
type WrappedContainer struct {
Unwrap *Container` + "`" + `json:"unwrap"` + "`" + `
}
func (c *WrappedContainer) Echo(msg string) *WrappedContainer {
return &WrappedContainer{
c.Unwrap.WithExec([]string{"echo", "-n", msg}),
}
}
`,
},
{
sdk: "python",
source: `from typing import Self
import dagger
from dagger import dag, field, function, object_type
@object_type
class WrappedContainer:
unwrap: dagger.Container = field()
@function
def echo(self, msg: str) -> Self:
return WrappedContainer(unwrap=self.unwrap.with_exec(["echo", "-n", msg]))
@object_type
class Wrapper:
@function
def container(self) -> WrappedContainer:
return WrappedContainer(unwrap=dag.container().from_("` + alpineImage + `"))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object()
class WrappedContainer {
@field()
unwrap: Container
constructor(unwrap: Container) {
this.unwrap = unwrap
}
@func()
echo(msg: string): WrappedContainer {
return new WrappedContainer(this.unwrap.withExec(["echo", "-n", msg]))
}
}
@object()
class Wrapper {
@func()
container(): WrappedContainer {
return new WrappedContainer(dag.container().from("` + alpineImage + `"))
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=wrapper", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
id := identity.NewID()
out, err := modGen.With(daggerQuery(
fmt.Sprintf(`{wrapper{container{echo(msg:%q){unwrap{stdout}}}}}`, id),
)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t,
fmt.Sprintf(`{"wrapper":{"container":{"echo":{"unwrap":{"stdout":%q}}}}}`, id),
out)
})
}
}
func TestModuleLotsOfFunctions(t *testing.T) {
t.Parallel()
const funcCount = 100
t.Run("go sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
package main
type PotatoSack struct {}
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
func (m *PotatoSack) Potato%d() string {
return "potato #%d"
}
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("init", "--source=.", "--name=potatoSack", "--sdk=go"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("python sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `from dagger import function
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@function
def potato_%d() -> str:
return "potato #%d"
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("./src/main.py", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("init", "--source=.", "--name=potatoSack", "--sdk=python"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("typescript sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
import { object, func } from "@dagger.io/dagger"
@object()
class PotatoSack {
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@func()
potato_%d(): string {
return "potato #%d"
}
`, i, i)
}
mainSrc += "\n}"
modGen := c.
Container().
From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(sdkSource("typescript", mainSrc)).
With(daggerExec("init", "--name=potatoSack", "--sdk=typescript"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
}
func TestModuleLotsOfDeps(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
modCount := 0
getModMainSrc := func(name string, depNames []string) string {
t.Helper()
mainSrc := fmt.Sprintf(`package main
import "context"
type %s struct {}
func (m *%s) Fn(ctx context.Context) (string, error) {
s := "%s"
var depS string
_ = depS
var err error
_ = err
`, strcase.ToCamel(name), strcase.ToCamel(name), name)
for _, depName := range depNames {
mainSrc += fmt.Sprintf(`
depS, err = dag.%s().Fn(ctx)
if err != nil {
return "", err
}
s += depS
`, strcase.ToCamel(depName))
}
mainSrc += "return s, nil\n}\n"
fmted, err := format.Source([]byte(mainSrc))
require.NoError(t, err)
return string(fmted)
}
// need to construct dagger.json directly in order to avoid excessive
// `dagger mod use` calls while constructing the huge DAG of deps
var rootCfg modules.ModuleConfig
addModulesWithDeps := func(newMods int, depNames []string) []string {
t.Helper()
var newModNames []string
for i := 0; i < newMods; i++ {
name := fmt.Sprintf("mod%d", modCount)
modCount++
newModNames = append(newModNames, name)
modGen = modGen.
WithWorkdir("/work/"+name).
WithNewFile("./main.go", dagger.ContainerWithNewFileOpts{
Contents: getModMainSrc(name, depNames),
})
var depCfgs []*modules.ModuleConfigDependency
for _, depName := range depNames {
depCfgs = append(depCfgs, &modules.ModuleConfigDependency{
Name: depName,
Source: filepath.Join("..", depName),
})
}
modGen = modGen.With(configFile(".", &modules.ModuleConfig{
Name: name,
SDK: "go",
Dependencies: depCfgs,
}))
}
return newModNames
}
// Create a base module, then add 6 layers of deps, where each layer has one more module
// than the previous layer and each module within the layer has a dep on each module
// from the previous layer. Finally add a single module at the top that depends on all
// modules from the last layer and call that.
// Basically, this creates a quadratically growing DAG of modules and verifies we
// handle it efficiently enough to be callable.
curDeps := addModulesWithDeps(1, nil)
for i := 0; i < 6; i++ {
curDeps = addModulesWithDeps(len(curDeps)+1, curDeps)
}
addModulesWithDeps(1, curDeps)
modGen = modGen.With(configFile("..", &rootCfg))
_, err := modGen.With(daggerCall("fn")).Sync(ctx)
require.NoError(t, err)
}
func TestModuleNamespacing(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
moduleSrcPath, err := filepath.Abs("./testdata/modules/go/namespacing")
require.NoError(t, err)
ctr := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithMountedDirectory("/work", c.Host().Directory(moduleSrcPath)).
WithWorkdir("/work")
out, err := ctr.
With(daggerQuery(`{test{fn(s:"yo")}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fn":["*dagger.Sub1Obj made 1:yo", "*dagger.Sub2Obj made 2:yo"]}}`, out)
}
func TestModuleLoops(t *testing.T) {
// verify circular module dependencies result in an error
t.Parallel()
c, ctx := connect(t)
_, err := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
With(daggerExec("init", "--name=depA", "--sdk=go", "depA")).
With(daggerExec("init", "--name=depB", "--sdk=go", "depB")).
With(daggerExec("init", "--name=depC", "--sdk=go", "depC")).
With(daggerExec("install", "-m=depC", "./depB")).
With(daggerExec("install", "-m=depB", "./depA")).
With(daggerExec("install", "-m=depA", "./depC")).
Sync(ctx)
require.ErrorContains(t, err, `local module at "/work/depA" has a circular dependency`)
}
//go:embed testdata/modules/go/id/arg/main.go
var badIDArgGoSrc string
//go:embed testdata/modules/python/id/arg/main.py
var badIDArgPySrc string
//go:embed testdata/modules/typescript/id/arg/index.ts
var badIDArgTSSrc string
//go:embed testdata/modules/go/id/field/main.go
var badIDFieldGoSrc string
//go:embed testdata/modules/typescript/id/field/index.ts
var badIDFieldTSSrc string
//go:embed testdata/modules/go/id/fn/main.go
var badIDFnGoSrc string
//go:embed testdata/modules/python/id/fn/main.py
var badIDFnPySrc string
//go:embed testdata/modules/typescript/id/fn/index.ts
var badIDFnTSSrc string
func TestModuleReservedWords(t *testing.T) {
// verify disallowed names are rejected
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("id", func(t *testing.T) {
t.Parallel()
t.Run("arg", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDArgGoSrc,
},
{
sdk: "python",
source: badIDArgPySrc,
},
{
sdk: "typescript",
source: badIDArgTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := modInit(ctx, t, c, tc.sdk, tc.source).
With(daggerQuery(`{test{fn(id:"no")}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define argument with reserved name \"id\"")
})
}
})
t.Run("field", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFieldGoSrc,
},
{
sdk: "typescript",
source: badIDFieldTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{fn{id}}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define field with reserved name \"id\"")
})
}
})
t.Run("fn", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFnGoSrc,
},
{
sdk: "python",
source: badIDFnPySrc,
},
{
sdk: "typescript",
source: badIDFnTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{id}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define function with reserved name \"id\"")
})
}
})
})
}
func TestModuleExecError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=playground", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
import (
"context"
"errors"
)
type Playground struct{}
func (p *Playground) DoThing(ctx context.Context) error {
_, err := dag.Container().From("` + alpineImage + `").WithExec([]string{"sh", "-c", "exit 5"}).Sync(ctx)
var e *ExecError
if errors.As(err, &e) {
if e.ExitCode == 5 {
return nil
}
}
panic("yikes")
}
`})
_, err := modGen.
With(daggerQuery(`{playground{doThing}}`)).
Stdout(ctx)
require.NoError(t, err)
}
func TestModuleCurrentModuleAPI(t *testing.T) {
t.Parallel()
t.Run("name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=WaCkY", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type WaCkY struct {}
func (m *WaCkY) Fn(ctx context.Context) (string, error) {
return dag.CurrentModule().Name(ctx)
}
`,
}).
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "WaCkY", strings.TrimSpace(out))
})
t.Run("source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/subdir/coolfile.txt", dagger.ContainerWithNewFileOpts{
Contents: "nice",
}).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) *File {
return dag.CurrentModule().Source().File("subdir/coolfile.txt")
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("workdir", func(t *testing.T) {
t.Parallel()
t.Run("dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*Directory, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().Workdir("subdir/moresubdir"), nil
}
`,
}).
With(daggerCall("fn", "file", "--path=coolfile.txt", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("file", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*File, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().WorkdirFile("subdir/moresubdir/coolfile.txt"), nil
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("error on escape", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
func New() (*Test, error) {
if err := os.WriteFile("/rootfile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
if err := os.MkdirAll("/foo", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("/foo/foofile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
return &Test{}, nil
}
type Test struct {}
func (m *Test) EscapeFile(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("../rootfile.txt")
}
func (m *Test) EscapeFileAbs(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("/rootfile.txt")
}
func (m *Test) EscapeDir(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("../foo")
}
func (m *Test) EscapeDirAbs(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("/foo")
}
`,
})
_, err := ctr.
With(daggerCall("escape-file", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-file-abs", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../foo" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir-abs", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/foo" escapes workdir`)
})
})
}
func TestModuleCustomSDK(t *testing.T) {
t.Parallel()
t.Run("local", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/coolsdk").
With(daggerExec("init", "--source=.", "--name=cool-sdk", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type CoolSdk struct {}
func (m *CoolSdk) ModuleRuntime(modSource *ModuleSource, introspectionJson string) *Container {
return modSource.WithSDK("go").AsModule().Runtime().WithEnvVariable("COOL", "true")
}
func (m *CoolSdk) Codegen(modSource *ModuleSource, introspectionJson string) *GeneratedCode {
return dag.GeneratedCode(modSource.WithSDK("go").AsModule().GeneratedContextDirectory())
}
func (m *CoolSdk) RequiredPaths() []string {
return []string{
"**/go.mod",
"**/go.sum",
"**/go.work",
"**/go.work.sum",
"**/vendor/",
"**/*.go",
}
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=coolsdk")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "os"
type Test struct {}
func (m *Test) Fn() string {
return os.Getenv("COOL")
}
`,
})
out, err := ctr.
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "true", strings.TrimSpace(out))
})
t.Run("git", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk="+testGitModuleRef("cool-sdk"))).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "os"
type Test struct {}
func (m *Test) Fn() string {
return os.Getenv("COOL")
}
`,
})
out, err := ctr.
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "true", strings.TrimSpace(out))
})
}
// TestModuleHostError verifies the host api is not exposed to modules
func TestModuleHostError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) *Directory {
return dag.Host().Directory(".")
}
`,
}).
With(daggerCall("fn")).
Sync(ctx)
require.ErrorContains(t, err, "dag.Host undefined")
}
func daggerExec(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerQuery(query string, args ...any) dagger.WithContainerFunc {
return daggerQueryAt("", query, args...)
}
func daggerQueryAt(modPath string, query string, args ...any) dagger.WithContainerFunc {
query = fmt.Sprintf(query, args...)
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "query"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(execArgs, dagger.ContainerWithExecOpts{
Stdin: query,
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerCall(args ...string) dagger.WithContainerFunc {
return daggerCallAt("", args...)
}
func daggerCallAt(modPath string, args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "call"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(append(execArgs, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerFunctions(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug", "functions"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func configFile(dirPath string, cfg *modules.ModuleConfig) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
cfgPath := filepath.Join(dirPath, "dagger.json")
cfgBytes, err := json.Marshal(cfg)
if err != nil {
panic(err)
}
return c.WithNewFile(cfgPath, dagger.ContainerWithNewFileOpts{
Contents: string(cfgBytes),
})
}
}
// command for a dagger cli call direct on the host
func hostDaggerCommand(ctx context.Context, t testing.TB, workdir string, args ...string) *exec.Cmd {
t.Helper()
cmd := exec.CommandContext(ctx, daggerCliPath(t), args...)
cmd.Dir = workdir
return cmd
}
// runs a dagger cli command directly on the host, rather than in an exec
func hostDaggerExec(ctx context.Context, t testing.TB, workdir string, args ...string) ([]byte, error) {
t.Helper()
cmd := hostDaggerCommand(ctx, t, workdir, args...)
output, err := cmd.CombinedOutput()
if err != nil {
err = fmt.Errorf("%s: %w", string(output), err)
}
return output, err
}
func sdkSource(sdk, contents string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
sourcePath := sdkSourceFile(sdk)
if sourcePath == "" {
return c
}
return c.WithNewFile(sourcePath, dagger.ContainerWithNewFileOpts{
Contents: heredoc.Doc(contents),
})
}
}
func sdkSourceFile(sdk string) string {
switch sdk {
case "go":
return "dagger/main.go"
case "python":
return "dagger/src/main.py"
case "typescript":
return "dagger/src/index.ts"
default:
return ""
}
}
func sdkCodegenFile(t *testing.T, sdk string) string {
t.Helper()
switch sdk {
case "go":
// FIXME: go codegen is split up into dagger/dagger.gen.go and
// dagger/dagger/dagger.gen.go
return "dagger/dagger/dagger.gen.go"
case "python":
return "dagger/sdk/src/dagger/client/gen.py"
case "typescript":
return "dagger/sdk/api/client.gen.ts"
default:
return ""
}
}
func modInit(ctx context.Context, t *testing.T, c *dagger.Client, sdk, contents string) *dagger.Container {
t.Helper()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+sdk)).
With(sdkSource(sdk, contents))
return modGen
}
func currentSchema(ctx context.Context, t *testing.T, ctr *dagger.Container) *introspection.Schema {
t.Helper()
out, err := ctr.With(daggerQuery(introspection.Query)).Stdout(ctx)
require.NoError(t, err)
var schemaResp introspection.Response
err = json.Unmarshal([]byte(out), &schemaResp)
require.NoError(t, err)
return schemaResp.Schema
}
var moduleIntrospection = daggerQuery(`
query { host { directory(path: ".") { asModule { initialize {
description
objects {
asObject {
name
description
constructor {
description
args {
name
description
defaultValue
}
}
functions {
name
description
args {
name
description
defaultValue
}
}
fields {
name
description
}
}
}
} } } } }
`)
func inspectModule(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
t.Helper()
out, err := ctr.With(moduleIntrospection).Stdout(ctx)
require.NoError(t, err)
result := gjson.Get(out, "host.directory.asModule.initialize")
t.Logf("module introspection:\n%v", result.Raw)
return result
}
func inspectModuleObjects(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
t.Helper()
return inspectModule(ctx, t, ctr).Get("objects.#.asObject")
}
func goGitBase(t *testing.T, c *dagger.Client) *dagger.Container {
t.Helper()
return c.Container().From(golangImage).
WithExec([]string{"apk", "add", "git"}).
WithExec([]string{"git", "config", "--global", "user.email", "dagger@example.com"}).
WithExec([]string{"git", "config", "--global", "user.name", "Dagger Tests"}).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"})
}
func logGen(ctx context.Context, t *testing.T, modSrc *dagger.Directory) {
t.Helper()
generated, err := modSrc.File("dagger.gen.go").Contents(ctx)
require.NoError(t, err)
t.Cleanup(func() {
t.Name()
fileName := filepath.Join(
os.TempDir(),
t.Name(),
fmt.Sprintf("dagger.gen.%d.go", time.Now().Unix()),
)
if err := os.MkdirAll(filepath.Dir(fileName), 0o755); err != nil {
t.Logf("failed to create temp dir for generated code: %v", err)
return
}
if err := os.WriteFile(fileName, []byte(generated), 0644); err != nil {
t.Logf("failed to write generated code to %s: %v", fileName, err)
} else {
t.Logf("wrote generated code to %s", fileName)
}
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,625 | 🐞 Modules: generated .gitxxx files are put next do dagger.json rather than on source path | Follow-up from:
- https://github.com/dagger/dagger/pull/6575
For example, in our root:
```
dagger init --sdk=python --source=dev
```
This will add, or overwrite, .gitattributes and .gitignore with `/sdk`, when it's actually in `dev/sdk`.
Everytime I do `dagger develop`, these files get overwritten.
\cc @sipsma | https://github.com/dagger/dagger/issues/6625 | https://github.com/dagger/dagger/pull/6699 | 4a04803cfb834c39b39ef7bac57fcf7b74c35d38 | 77a53a85956942540fb2078ef490ac8eeac56e0e | "2024-02-08T19:20:56Z" | go | "2024-02-20T14:01:32Z" | core/schema/module.go | package schema
import (
"bytes"
"context"
"encoding/json"
"fmt"
"path/filepath"
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/dagql"
"github.com/dagger/dagger/engine"
"golang.org/x/sync/errgroup"
)
type moduleSchema struct {
dag *dagql.Server
}
var _ SchemaResolvers = &moduleSchema{}
func (s *moduleSchema) Install() {
dagql.Fields[*core.Query]{
dagql.Func("module", s.module).
Doc(`Create a new module.`),
dagql.Func("typeDef", s.typeDef).
Doc(`Create a new TypeDef.`),
dagql.Func("generatedCode", s.generatedCode).
Doc(`Create a code generation result, given a directory containing the generated code.`),
dagql.Func("moduleSource", s.moduleSource).
Doc(`Create a new module source instance from a source ref string.`).
ArgDoc("refString", `The string ref representation of the module source`).
ArgDoc("stable", `If true, enforce that the source is a stable version for source kinds that support versioning.`),
dagql.Func("moduleDependency", s.moduleDependency).
Doc(`Create a new module dependency configuration from a module source and name`).
ArgDoc("source", `The source of the dependency`).
ArgDoc("name", `If set, the name to use for the dependency. Otherwise, once installed to a parent module, the name of the dependency module will be used by default.`),
dagql.Func("function", s.function).
Doc(`Creates a function.`).
ArgDoc("name", `Name of the function, in its original format from the implementation language.`).
ArgDoc("returnType", `Return type of the function.`),
dagql.Func("currentModule", s.currentModule).
Impure(`Changes depending on which module is calling it.`).
Doc(`The module currently being served in the session, if any.`),
dagql.Func("currentTypeDefs", s.currentTypeDefs).
Impure(`Changes depending on which modules are currently installed.`).
Doc(`The TypeDef representations of the objects currently being served in the session.`),
dagql.Func("currentFunctionCall", s.currentFunctionCall).
Impure(`Changes depending on which function calls it.`).
Doc(`The FunctionCall context that the SDK caller is currently executing in.`,
`If the caller is not currently executing in a function, this will
return an error.`),
}.Install(s.dag)
dagql.Fields[*core.Directory]{
dagql.NodeFunc("asModule", s.directoryAsModule).
Doc(`Load the directory as a Dagger module`).
ArgDoc("sourceRootPath",
`An optional subpath of the directory which contains the module's configuration file.`,
`This is needed when the module code is in a subdirectory but requires
parent directories to be loaded in order to execute. For example, the
module source code may need a go.mod, project.toml, package.json, etc.
file from a parent directory.`,
`If not set, the module source code is loaded from the root of the directory.`),
}.Install(s.dag)
dagql.Fields[*core.FunctionCall]{
dagql.Func("returnValue", s.functionCallReturnValue).
Impure(`Updates internal engine state with the given value.`).
Doc(`Set the return value of the function call to the provided value.`).
ArgDoc("value", `JSON serialization of the return value.`),
}.Install(s.dag)
dagql.Fields[*core.ModuleSource]{
dagql.Func("contextDirectory", s.moduleSourceContextDirectory).
Doc(`The directory containing everything needed to load load and use the module.`),
dagql.Func("withContextDirectory", s.moduleSourceWithContextDirectory).
Doc(`Update the module source with a new context directory. Only valid for local sources.`).
ArgDoc("dir", `The directory to set as the context directory.`),
dagql.Func("directory", s.moduleSourceDirectory).
Doc(`The directory containing the module configuration and source code (source code may be in a subdir).`).
ArgDoc(`path`, `The path from the source directory to select.`),
dagql.Func("sourceRootSubpath", s.moduleSourceRootSubpath).
Doc(`The path relative to context of the root of the module source, which contains dagger.json. It also contains the module implementation source code, but that may or may not being a subdir of this root.`),
dagql.Func("sourceSubpath", s.moduleSourceSubpath).
Doc(`The path relative to context of the module implementation source code.`),
dagql.Func("withSourceSubpath", s.moduleSourceWithSourceSubpath).
Doc(`Update the module source with a new source subpath.`).
ArgDoc("path", `The path to set as the source subpath.`),
dagql.Func("moduleName", s.moduleSourceModuleName).
Doc(`If set, the name of the module this source references, including any overrides at runtime by callers.`),
dagql.Func("moduleOriginalName", s.moduleSourceModuleOriginalName).
Doc(`The original name of the module this source references, as defined in the module configuration.`),
dagql.Func("withName", s.moduleSourceWithName).
Doc(`Update the module source with a new name.`).
ArgDoc("name", `The name to set.`),
dagql.NodeFunc("dependencies", s.moduleSourceDependencies).
Doc(`The dependencies of the module source. Includes dependencies from the configuration and any extras from withDependencies calls.`),
dagql.Func("withDependencies", s.moduleSourceWithDependencies).
Doc(`Append the provided dependencies to the module source's dependency list.`).
ArgDoc("dependencies", `The dependencies to append.`),
dagql.Func("withSDK", s.moduleSourceWithSDK).
Doc(`Update the module source with a new SDK.`).
ArgDoc("sdk", `The SDK to set.`),
dagql.Func("configExists", s.moduleSourceConfigExists).
Doc(`Returns whether the module source has a configuration file.`),
dagql.Func("resolveDependency", s.moduleSourceResolveDependency).
Doc(`Resolve the provided module source arg as a dependency relative to this module source.`).
ArgDoc("dep", `The dependency module source to resolve.`),
dagql.Func("asString", s.moduleSourceAsString).
Doc(`A human readable ref string representation of this module source.`),
dagql.NodeFunc("asModule", s.moduleSourceAsModule).
Doc(`Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation`),
dagql.Func("resolveFromCaller", s.moduleSourceResolveFromCaller).
Impure(`Loads live caller-specific data from their filesystem.`).
Doc(`Load the source from its path on the caller's filesystem, including only needed+configured files and directories. Only valid for local sources.`),
dagql.Func("resolveContextPathFromCaller", s.moduleSourceResolveContextPathFromCaller).
Impure(`Queries live caller-specific data from their filesystem.`).
Doc(`The path to the module source's context directory on the caller's filesystem. Only valid for local sources.`),
}.Install(s.dag)
dagql.Fields[*core.LocalModuleSource]{}.Install(s.dag)
dagql.Fields[*core.GitModuleSource]{
dagql.Func("cloneURL", s.gitModuleSourceCloneURL).
Doc(`The URL from which the source's git repo can be cloned.`),
dagql.Func("htmlURL", s.gitModuleSourceHTMLURL).
Doc(`The URL to the source's git repo in a web browser`),
}.Install(s.dag)
dagql.Fields[*core.ModuleDependency]{}.Install(s.dag)
dagql.Fields[*core.Module]{
dagql.Func("withSource", s.moduleWithSource).
Doc(`Retrieves the module with basic configuration loaded if present.`).
ArgDoc("source", `The module source to initialize from.`),
dagql.Func("generatedContextDiff", s.moduleGeneratedContextDiff).
Doc(`The generated files and directories made on top of the module source's context directory.`),
dagql.NodeFunc("initialize", s.moduleInitialize).
Doc(`Retrieves the module with the objects loaded via its SDK.`),
dagql.Func("withDescription", s.moduleWithDescription).
Doc(`Retrieves the module with the given description`).
ArgDoc("description", `The description to set`),
dagql.Func("withObject", s.moduleWithObject).
Doc(`This module plus the given Object type and associated functions.`),
dagql.Func("withInterface", s.moduleWithInterface).
Doc(`This module plus the given Interface type and associated functions`),
dagql.NodeFunc("serve", s.moduleServe).
Impure(`Mutates the calling session's global schema.`).
Doc(`Serve a module's API in the current session.`,
`Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.`),
}.Install(s.dag)
dagql.Fields[*core.CurrentModule]{
dagql.Func("name", s.currentModuleName).
Doc(`The name of the module being executed in`),
dagql.Func("source", s.currentModuleSource).
Doc(`The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).`),
dagql.Func("workdir", s.currentModuleWorkdir).
Impure(`Loads live caller-specific data from their filesystem.`).
Doc(`Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.`).
ArgDoc("path", `Location of the directory to access (e.g., ".").`).
ArgDoc("exclude", `Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).`).
ArgDoc("include", `Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).`),
dagql.Func("workdirFile", s.currentModuleWorkdirFile).
Impure(`Loads live caller-specific data from their filesystem.`).
Doc(`Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.`).
ArgDoc("path", `Location of the file to retrieve (e.g., "README.md").`),
}.Install(s.dag)
dagql.Fields[*core.Function]{
dagql.Func("withDescription", s.functionWithDescription).
Doc(`Returns the function with the given doc string.`).
ArgDoc("description", `The doc string to set.`),
dagql.Func("withArg", s.functionWithArg).
Doc(`Returns the function with the provided argument`).
ArgDoc("name", `The name of the argument`).
ArgDoc("typeDef", `The type of the argument`).
ArgDoc("description", `A doc string for the argument, if any`).
ArgDoc("defaultValue", `A default value to use for this argument if not explicitly set by the caller, if any`),
}.Install(s.dag)
dagql.Fields[*core.FunctionArg]{}.Install(s.dag)
dagql.Fields[*core.FunctionCallArgValue]{}.Install(s.dag)
dagql.Fields[*core.TypeDef]{
dagql.Func("withOptional", s.typeDefWithOptional).
Doc(`Sets whether this type can be set to null.`),
dagql.Func("withKind", s.typeDefWithKind).
Doc(`Sets the kind of the type.`),
dagql.Func("withListOf", s.typeDefWithListOf).
Doc(`Returns a TypeDef of kind List with the provided type for its elements.`),
dagql.Func("withObject", s.typeDefWithObject).
Doc(`Returns a TypeDef of kind Object with the provided name.`,
`Note that an object's fields and functions may be omitted if the
intent is only to refer to an object. This is how functions are able to
return their own object, or any other circular reference.`),
dagql.Func("withInterface", s.typeDefWithInterface).
Doc(`Returns a TypeDef of kind Interface with the provided name.`),
dagql.Func("withField", s.typeDefWithObjectField).
Doc(`Adds a static field for an Object TypeDef, failing if the type is not an object.`).
ArgDoc("name", `The name of the field in the object`).
ArgDoc("typeDef", `The type of the field`).
ArgDoc("description", `A doc string for the field, if any`),
dagql.Func("withFunction", s.typeDefWithFunction).
Doc(`Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.`),
dagql.Func("withConstructor", s.typeDefWithObjectConstructor).
Doc(`Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.`),
}.Install(s.dag)
dagql.Fields[*core.ObjectTypeDef]{}.Install(s.dag)
dagql.Fields[*core.InterfaceTypeDef]{}.Install(s.dag)
dagql.Fields[*core.InputTypeDef]{}.Install(s.dag)
dagql.Fields[*core.FieldTypeDef]{}.Install(s.dag)
dagql.Fields[*core.ListTypeDef]{}.Install(s.dag)
dagql.Fields[*core.GeneratedCode]{
dagql.Func("withVCSGeneratedPaths", s.generatedCodeWithVCSGeneratedPaths).
Doc(`Set the list of paths to mark generated in version control.`),
dagql.Func("withVCSIgnoredPaths", s.generatedCodeWithVCSIgnoredPaths).
Doc(`Set the list of paths to ignore in version control.`),
}.Install(s.dag)
}
func (s *moduleSchema) typeDef(ctx context.Context, _ *core.Query, args struct{}) (*core.TypeDef, error) {
return &core.TypeDef{}, nil
}
func (s *moduleSchema) typeDefWithOptional(ctx context.Context, def *core.TypeDef, args struct {
Optional bool
}) (*core.TypeDef, error) {
return def.WithOptional(args.Optional), nil
}
func (s *moduleSchema) typeDefWithKind(ctx context.Context, def *core.TypeDef, args struct {
Kind core.TypeDefKind
}) (*core.TypeDef, error) {
return def.WithKind(args.Kind), nil
}
func (s *moduleSchema) typeDefWithListOf(ctx context.Context, def *core.TypeDef, args struct {
ElementType core.TypeDefID
}) (*core.TypeDef, error) {
elemType, err := args.ElementType.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode element type: %w", err)
}
return def.WithListOf(elemType.Self), nil
}
func (s *moduleSchema) typeDefWithObject(ctx context.Context, def *core.TypeDef, args struct {
Name string
Description string `default:""`
}) (*core.TypeDef, error) {
if args.Name == "" {
return nil, fmt.Errorf("object type def must have a name")
}
return def.WithObject(args.Name, args.Description), nil
}
func (s *moduleSchema) typeDefWithInterface(ctx context.Context, def *core.TypeDef, args struct {
Name string
Description string `default:""`
}) (*core.TypeDef, error) {
return def.WithInterface(args.Name, args.Description), nil
}
func (s *moduleSchema) typeDefWithObjectField(ctx context.Context, def *core.TypeDef, args struct {
Name string
TypeDef core.TypeDefID
Description string `default:""`
}) (*core.TypeDef, error) {
fieldType, err := args.TypeDef.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode element type: %w", err)
}
return def.WithObjectField(args.Name, fieldType.Self, args.Description)
}
func (s *moduleSchema) typeDefWithFunction(ctx context.Context, def *core.TypeDef, args struct {
Function core.FunctionID
}) (*core.TypeDef, error) {
fn, err := args.Function.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode element type: %w", err)
}
return def.WithFunction(fn.Self)
}
func (s *moduleSchema) typeDefWithObjectConstructor(ctx context.Context, def *core.TypeDef, args struct {
Function core.FunctionID
}) (*core.TypeDef, error) {
inst, err := args.Function.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode element type: %w", err)
}
fn := inst.Self.Clone()
// Constructors are invoked by setting the ObjectName to the name of the object its constructing and the
// FunctionName to "", so ignore the name of the function.
fn.Name = ""
fn.OriginalName = ""
return def.WithObjectConstructor(fn)
}
func (s *moduleSchema) generatedCode(ctx context.Context, _ *core.Query, args struct {
Code core.DirectoryID
}) (*core.GeneratedCode, error) {
dir, err := args.Code.Load(ctx, s.dag)
if err != nil {
return nil, err
}
return core.NewGeneratedCode(dir), nil
}
func (s *moduleSchema) generatedCodeWithVCSGeneratedPaths(ctx context.Context, code *core.GeneratedCode, args struct {
Paths []string
}) (*core.GeneratedCode, error) {
return code.WithVCSGeneratedPaths(args.Paths), nil
}
func (s *moduleSchema) generatedCodeWithVCSIgnoredPaths(ctx context.Context, code *core.GeneratedCode, args struct {
Paths []string
}) (*core.GeneratedCode, error) {
return code.WithVCSIgnoredPaths(args.Paths), nil
}
func (s *moduleSchema) module(ctx context.Context, query *core.Query, _ struct{}) (*core.Module, error) {
return query.NewModule(), nil
}
func (s *moduleSchema) function(ctx context.Context, _ *core.Query, args struct {
Name string
ReturnType core.TypeDefID
}) (*core.Function, error) {
returnType, err := args.ReturnType.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode return type: %w", err)
}
return core.NewFunction(args.Name, returnType.Self), nil
}
func (s *moduleSchema) functionWithDescription(ctx context.Context, fn *core.Function, args struct {
Description string
}) (*core.Function, error) {
return fn.WithDescription(args.Description), nil
}
func (s *moduleSchema) functionWithArg(ctx context.Context, fn *core.Function, args struct {
Name string
TypeDef core.TypeDefID
Description string `default:""`
DefaultValue core.JSON `default:""`
}) (*core.Function, error) {
argType, err := args.TypeDef.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode arg type: %w", err)
}
return fn.WithArg(args.Name, argType.Self, args.Description, args.DefaultValue), nil
}
func (s *moduleSchema) moduleDependency(
ctx context.Context,
query *core.Query,
args struct {
Source core.ModuleSourceID
Name string `default:""`
},
) (*core.ModuleDependency, error) {
src, err := args.Source.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode dependency source: %w", err)
}
return &core.ModuleDependency{
Source: src,
Name: args.Name,
}, nil
}
func (s *moduleSchema) currentModule(
ctx context.Context,
self *core.Query,
_ struct{},
) (*core.CurrentModule, error) {
mod, err := self.CurrentModule(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get current module: %w", err)
}
return &core.CurrentModule{Module: mod}, nil
}
func (s *moduleSchema) currentFunctionCall(ctx context.Context, self *core.Query, _ struct{}) (*core.FunctionCall, error) {
return self.CurrentFunctionCall(ctx)
}
func (s *moduleSchema) moduleServe(ctx context.Context, modMeta dagql.Instance[*core.Module], _ struct{}) (dagql.Nullable[core.Void], error) {
return dagql.Null[core.Void](), modMeta.Self.Query.ServeModuleToMainClient(ctx, modMeta)
}
func (s *moduleSchema) currentTypeDefs(ctx context.Context, self *core.Query, _ struct{}) ([]*core.TypeDef, error) {
deps, err := self.CurrentServedDeps(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get current module: %w", err)
}
return deps.TypeDefs(ctx)
}
func (s *moduleSchema) functionCallReturnValue(ctx context.Context, fnCall *core.FunctionCall, args struct {
Value core.JSON
}) (dagql.Nullable[core.Void], error) {
// TODO: error out if caller is not coming from a module
return dagql.Null[core.Void](), fnCall.ReturnValue(ctx, args.Value)
}
func (s *moduleSchema) moduleWithDescription(ctx context.Context, mod *core.Module, args struct {
Description string
}) (*core.Module, error) {
return mod.WithDescription(args.Description), nil
}
func (s *moduleSchema) moduleWithObject(ctx context.Context, mod *core.Module, args struct {
Object core.TypeDefID
}) (_ *core.Module, rerr error) {
def, err := args.Object.Load(ctx, s.dag)
if err != nil {
return nil, err
}
return mod.WithObject(ctx, def.Self)
}
func (s *moduleSchema) moduleWithInterface(ctx context.Context, mod *core.Module, args struct {
Iface core.TypeDefID
}) (_ *core.Module, rerr error) {
def, err := args.Iface.Load(ctx, s.dag)
if err != nil {
return nil, err
}
return mod.WithInterface(ctx, def.Self)
}
func (s *moduleSchema) currentModuleName(
ctx context.Context,
curMod *core.CurrentModule,
args struct{},
) (string, error) {
return curMod.Module.Name(), nil
}
func (s *moduleSchema) currentModuleSource(
ctx context.Context,
curMod *core.CurrentModule,
args struct{},
) (inst dagql.Instance[*core.Directory], err error) {
srcSubpath, err := curMod.Module.Source.Self.SourceSubpathWithDefault(ctx)
if err != nil {
return inst, fmt.Errorf("failed to get module source subpath: %w", err)
}
err = s.dag.Select(ctx, curMod.Module.GeneratedContextDirectory, &inst,
dagql.Selector{
Field: "directory",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(srcSubpath)},
},
},
)
return inst, err
}
func (s *moduleSchema) currentModuleWorkdir(
ctx context.Context,
curMod *core.CurrentModule,
args struct {
Path string
core.CopyFilter
},
) (inst dagql.Instance[*core.Directory], err error) {
if !filepath.IsLocal(args.Path) {
return inst, fmt.Errorf("workdir path %q escapes workdir", args.Path)
}
args.Path = filepath.Join(runtimeWorkdirPath, args.Path)
err = s.dag.Select(ctx, s.dag.Root(), &inst,
dagql.Selector{
Field: "host",
},
dagql.Selector{
Field: "directory",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(args.Path)},
{Name: "exclude", Value: asArrayInput(args.Exclude, dagql.NewString)},
{Name: "include", Value: asArrayInput(args.Include, dagql.NewString)},
},
},
)
return inst, err
}
func (s *moduleSchema) currentModuleWorkdirFile(
ctx context.Context,
curMod *core.CurrentModule,
args struct {
Path string
},
) (inst dagql.Instance[*core.File], err error) {
if !filepath.IsLocal(args.Path) {
return inst, fmt.Errorf("workdir path %q escapes workdir", args.Path)
}
args.Path = filepath.Join(runtimeWorkdirPath, args.Path)
err = s.dag.Select(ctx, s.dag.Root(), &inst,
dagql.Selector{
Field: "host",
},
dagql.Selector{
Field: "file",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(args.Path)},
},
},
)
return inst, err
}
type directoryAsModuleArgs struct {
SourceRootPath string `default:"."`
}
func (s *moduleSchema) directoryAsModule(ctx context.Context, contextDir dagql.Instance[*core.Directory], args directoryAsModuleArgs) (*core.Module, error) {
var inst dagql.Instance[*core.Module]
err := s.dag.Select(ctx, s.dag.Root(), &inst,
dagql.Selector{
Field: "moduleSource",
Args: []dagql.NamedInput{
{Name: "refString", Value: dagql.String(args.SourceRootPath)},
},
},
dagql.Selector{
Field: "withContextDirectory",
Args: []dagql.NamedInput{
{Name: "dir", Value: dagql.NewID[*core.Directory](contextDir.ID())},
},
},
dagql.Selector{
Field: "asModule",
},
)
if err != nil {
return nil, fmt.Errorf("failed to create module from directory: %w", err)
}
return inst.Self, nil
}
// TODO: initialize probably doesn't need to exist anymore, can just try to init in withSource
// and, if error, return that error in future calls that rely on the module being initialized
func (s *moduleSchema) moduleInitialize(
ctx context.Context,
inst dagql.Instance[*core.Module],
args struct{},
) (*core.Module, error) {
if inst.Self.NameField == "" || inst.Self.SDKConfig == "" {
return nil, fmt.Errorf("module name and SDK must be set")
}
mod, err := inst.Self.Initialize(ctx, inst, dagql.CurrentID(ctx))
if err != nil {
return nil, fmt.Errorf("failed to initialize module: %w", err)
}
return mod, nil
}
func (s *moduleSchema) moduleWithSource(ctx context.Context, mod *core.Module, args struct {
Source core.ModuleSourceID
}) (*core.Module, error) {
src, err := args.Source.Load(ctx, s.dag)
if err != nil {
return nil, fmt.Errorf("failed to decode module source: %w", err)
}
mod = mod.Clone()
mod.Source = src
mod.NameField, err = src.Self.ModuleName(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get module name: %w", err)
}
mod.OriginalName, err = src.Self.ModuleOriginalName(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get module original name: %w", err)
}
mod.SDKConfig, err = src.Self.SDK(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get module SDK: %w", err)
}
if err := s.updateDeps(ctx, mod, src); err != nil {
return nil, fmt.Errorf("failed to update module dependencies: %w", err)
}
if err := s.updateCodegenAndRuntime(ctx, mod, src); err != nil {
return nil, fmt.Errorf("failed to update codegen and runtime: %w", err)
}
// update dagger.json last so SDKs can't intentionally or unintentionally
// modify it during codegen in ways that would be hard to deal with
if err := s.updateDaggerConfig(ctx, mod, src); err != nil {
return nil, fmt.Errorf("failed to update dagger.json: %w", err)
}
return mod, nil
}
func (s *moduleSchema) moduleGeneratedContextDiff(
ctx context.Context,
mod *core.Module,
args struct{},
) (inst dagql.Instance[*core.Directory], err error) {
baseContext, err := mod.Source.Self.ContextDirectory()
if err != nil {
return inst, fmt.Errorf("failed to get base context directory: %w", err)
}
var diff dagql.Instance[*core.Directory]
err = s.dag.Select(ctx, baseContext, &diff,
dagql.Selector{
Field: "diff",
Args: []dagql.NamedInput{
{Name: "other", Value: dagql.NewID[*core.Directory](mod.GeneratedContextDirectory.ID())},
},
},
)
if err != nil {
return inst, fmt.Errorf("failed to diff generated context: %w", err)
}
return diff, nil
}
func (s *moduleSchema) updateDeps(
ctx context.Context,
mod *core.Module,
src dagql.Instance[*core.ModuleSource],
) error {
var deps []dagql.Instance[*core.ModuleDependency]
err := s.dag.Select(ctx, src, &deps, dagql.Selector{Field: "dependencies"})
if err != nil {
return fmt.Errorf("failed to load module dependencies: %w", err)
}
mod.DependencyConfig = make([]*core.ModuleDependency, len(deps))
for i, dep := range deps {
// verify that the dependency config actually exists
_, cfgExists, err := dep.Self.Source.Self.ModuleConfig(ctx)
if err != nil {
return fmt.Errorf("failed to load module %q dependency %q config: %w", mod.NameField, dep.Self.Name, err)
}
if !cfgExists {
// best effort for err message, ignore err
sourceRootPath, _ := dep.Self.Source.Self.SourceRootSubpath()
return fmt.Errorf("module %q dependency %q with source root path %q does not exist or does not have a configuration file", mod.NameField, dep.Self.Name, sourceRootPath)
}
mod.DependencyConfig[i] = dep.Self
}
mod.DependenciesField = make([]dagql.Instance[*core.Module], len(deps))
var eg errgroup.Group
for i, dep := range deps {
i, dep := i, dep
eg.Go(func() error {
err := s.dag.Select(ctx, dep.Self.Source, &mod.DependenciesField[i],
dagql.Selector{
Field: "withName",
Args: []dagql.NamedInput{
{Name: "name", Value: dagql.String(dep.Self.Name)},
},
},
dagql.Selector{
Field: "asModule",
},
dagql.Selector{
Field: "initialize",
},
)
if err != nil {
return fmt.Errorf("failed to initialize dependency module: %w", err)
}
return nil
})
}
if err := eg.Wait(); err != nil {
return fmt.Errorf("failed to initialize dependency modules: %w", err)
}
mod.Deps = core.NewModDeps(src.Self.Query, src.Self.Query.DefaultDeps.Mods)
for _, dep := range mod.DependenciesField {
mod.Deps = mod.Deps.Append(dep.Self)
}
return nil
}
func (s *moduleSchema) updateCodegenAndRuntime(
ctx context.Context,
mod *core.Module,
src dagql.Instance[*core.ModuleSource],
) error {
if mod.NameField == "" || mod.SDKConfig == "" {
// can't codegen yet
return nil
}
baseContext, err := src.Self.ContextDirectory()
if err != nil {
return fmt.Errorf("failed to get base context directory: %w", err)
}
mod.GeneratedContextDirectory = baseContext
rootSubpath, err := src.Self.SourceRootSubpath()
if err != nil {
return fmt.Errorf("failed to get source root subpath: %w", err)
}
sdk, err := s.sdkForModule(ctx, src.Self.Query, mod.SDKConfig, src)
if err != nil {
return fmt.Errorf("failed to load sdk for module: %w", err)
}
generatedCode, err := sdk.Codegen(ctx, mod.Deps, src)
if err != nil {
return fmt.Errorf("failed to generate code: %w", err)
}
var diff dagql.Instance[*core.Directory]
err = s.dag.Select(ctx, baseContext, &diff,
dagql.Selector{
Field: "diff",
Args: []dagql.NamedInput{
{Name: "other", Value: dagql.NewID[*core.Directory](generatedCode.Code.ID())},
},
},
)
if err != nil {
return fmt.Errorf("failed to diff generated code: %w", err)
}
err = s.dag.Select(ctx, mod.GeneratedContextDirectory, &mod.GeneratedContextDirectory,
dagql.Selector{
Field: "withDirectory",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String("/")},
{Name: "directory", Value: dagql.NewID[*core.Directory](diff.ID())},
},
},
)
if err != nil {
return fmt.Errorf("failed to add codegen to module context directory: %w", err)
}
// update .gitattributes
// (linter thinks this chunk of code is too similar to the below, but not clear abstraction is worth it)
//nolint:dupl
if len(generatedCode.VCSGeneratedPaths) > 0 {
gitAttrsPath := filepath.Join(rootSubpath, ".gitattributes")
var gitAttrsContents []byte
gitAttrsFile, err := baseContext.Self.File(ctx, gitAttrsPath)
if err == nil {
gitAttrsContents, err = gitAttrsFile.Contents(ctx)
if err != nil {
return fmt.Errorf("failed to get git attributes file contents: %w", err)
}
if !bytes.HasSuffix(gitAttrsContents, []byte("\n")) {
gitAttrsContents = append(gitAttrsContents, []byte("\n")...)
}
}
for _, fileName := range generatedCode.VCSGeneratedPaths {
if bytes.Contains(gitAttrsContents, []byte(fileName)) {
// already has some config for the file
continue
}
gitAttrsContents = append(gitAttrsContents,
[]byte(fmt.Sprintf("/%s linguist-generated\n", fileName))...,
)
}
err = s.dag.Select(ctx, mod.GeneratedContextDirectory, &mod.GeneratedContextDirectory,
dagql.Selector{
Field: "withNewFile",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(gitAttrsPath)},
{Name: "contents", Value: dagql.String(gitAttrsContents)},
{Name: "permissions", Value: dagql.Int(0600)},
},
},
)
if err != nil {
return fmt.Errorf("failed to add vcs generated file: %w", err)
}
}
// update .gitignore
// (linter thinks this chunk of code is too similar to the above, but not clear abstraction is worth it)
//nolint:dupl
if len(generatedCode.VCSIgnoredPaths) > 0 {
gitIgnorePath := filepath.Join(rootSubpath, ".gitignore")
var gitIgnoreContents []byte
gitIgnoreFile, err := baseContext.Self.File(ctx, gitIgnorePath)
if err == nil {
gitIgnoreContents, err = gitIgnoreFile.Contents(ctx)
if err != nil {
return fmt.Errorf("failed to get .gitignore file contents: %w", err)
}
if !bytes.HasSuffix(gitIgnoreContents, []byte("\n")) {
gitIgnoreContents = append(gitIgnoreContents, []byte("\n")...)
}
}
for _, fileName := range generatedCode.VCSIgnoredPaths {
if bytes.Contains(gitIgnoreContents, []byte(fileName)) {
continue
}
gitIgnoreContents = append(gitIgnoreContents,
[]byte(fmt.Sprintf("/%s\n", fileName))...,
)
}
err = s.dag.Select(ctx, mod.GeneratedContextDirectory, &mod.GeneratedContextDirectory,
dagql.Selector{
Field: "withNewFile",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(gitIgnorePath)},
{Name: "contents", Value: dagql.String(gitIgnoreContents)},
{Name: "permissions", Value: dagql.Int(0600)},
},
},
)
if err != nil {
return fmt.Errorf("failed to add vcs ignore file: %w", err)
}
}
mod.Runtime, err = sdk.Runtime(ctx, mod.Deps, src)
if err != nil {
return fmt.Errorf("failed to get module runtime: %w", err)
}
return nil
}
func (s *moduleSchema) updateDaggerConfig(
ctx context.Context,
mod *core.Module,
src dagql.Instance[*core.ModuleSource],
) error {
modCfg, ok, err := src.Self.ModuleConfig(ctx)
if err != nil {
return fmt.Errorf("failed to get module config: %w", err)
}
if !ok {
modCfg = &modules.ModuleConfig{}
}
modCfg.Name = mod.OriginalName
modCfg.SDK = mod.SDKConfig
modCfg.EngineVersion = engine.Version
sourceRootSubpath, err := src.Self.SourceRootSubpath()
if err != nil {
return fmt.Errorf("failed to get source root subpath: %w", err)
}
sourceSubpath, err := src.Self.SourceSubpathWithDefault(ctx)
if err != nil {
return fmt.Errorf("failed to get source subpath: %w", err)
}
sourceRelSubpath, err := filepath.Rel(sourceRootSubpath, sourceSubpath)
if err != nil {
return fmt.Errorf("failed to get relative source subpath: %w", err)
}
if sourceRelSubpath != "." {
modCfg.Source = sourceRelSubpath
}
modCfg.Dependencies = make([]*modules.ModuleConfigDependency, len(mod.DependencyConfig))
for i, dep := range mod.DependencyConfig {
var srcStr string
switch dep.Source.Self.Kind {
case core.ModuleSourceKindLocal:
// make it relative to this module's source root
depRootSubpath, err := dep.Source.Self.SourceRootSubpath()
if err != nil {
return fmt.Errorf("failed to get source root subpath: %w", err)
}
depRelPath, err := filepath.Rel(sourceRootSubpath, depRootSubpath)
if err != nil {
return fmt.Errorf("failed to get relative path to dep: %w", err)
}
srcStr = depRelPath
case core.ModuleSourceKindGit:
srcStr = dep.Source.Self.AsGitSource.Value.RefString()
default:
return fmt.Errorf("unsupported dependency source kind: %s", dep.Source.Self.Kind)
}
depName := dep.Name
if dep.Name == "" {
// fill in default dep names if missing with the name of the module
depName = mod.DependenciesField[i].Self.Name()
}
modCfg.Dependencies[i] = &modules.ModuleConfigDependency{
Name: depName,
Source: srcStr,
}
}
rootSubpath, err := src.Self.SourceRootSubpath()
if err != nil {
return fmt.Errorf("failed to get source root subpath: %w", err)
}
modCfgPath := filepath.Join(rootSubpath, modules.Filename)
updatedModCfgBytes, err := json.MarshalIndent(modCfg, "", " ")
if err != nil {
return fmt.Errorf("failed to encode module config: %w", err)
}
updatedModCfgBytes = append(updatedModCfgBytes, '\n')
if mod.GeneratedContextDirectory.Self == nil {
// valid case for sdk-less modules (i.e. dep only), initialize as empty directory
err = s.dag.Select(ctx, s.dag.Root(), &mod.GeneratedContextDirectory,
dagql.Selector{Field: "directory"},
)
if err != nil {
return fmt.Errorf("failed to initialize module context directory: %w", err)
}
}
err = s.dag.Select(ctx, mod.GeneratedContextDirectory, &mod.GeneratedContextDirectory,
dagql.Selector{
Field: "withNewFile",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.String(modCfgPath)},
{Name: "contents", Value: dagql.String(updatedModCfgBytes)},
{Name: "permissions", Value: dagql.Int(0644)},
},
},
)
if err != nil {
return fmt.Errorf("failed to update module context directory config file: %w", err)
}
return nil
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,731 | 🐞 [CLI]: `dagger functions $function_name` returns an error if return type is not a dagger object | ### What is the issue?
calling `dagger functions foo` on the following function definition raises the following error:
`Error: function 'foo' returns non-object type STRING_KIND`
```go
package main
type Testmodule struct{}
func (m *Testmodule) Foo() string {
return "bar"
}
```
### Dagger version
dagger v0.9.11
### Steps to reproduce
run `dagger functions foo` on the code given above
### Log output
Error: function 'foo' returns non-object type STRING_KIND
| https://github.com/dagger/dagger/issues/6731 | https://github.com/dagger/dagger/pull/6733 | 58f4b8f7791786a740134ee36854002f9021c1fc | 4359dd91d1739cddbc83ca37328943f6187ce50a | "2024-02-25T14:27:41Z" | go | "2024-02-26T12:02:06Z" | cmd/dagger/functions.go | package main
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"dagger.io/dagger"
"dagger.io/dagger/querybuilder"
"github.com/dagger/dagger/dagql/idtui"
"github.com/dagger/dagger/engine/client"
"github.com/juju/ansiterm/tabwriter"
"github.com/muesli/termenv"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/vito/progrock"
)
const (
Directory string = "Directory"
Container string = "Container"
File string = "File"
Secret string = "Secret"
Service string = "Service"
Terminal string = "Terminal"
PortForward string = "PortForward"
CacheVolume string = "CacheVolume"
)
var funcGroup = &cobra.Group{
ID: "functions",
Title: "Function Commands",
}
var funcCmds = FuncCommands{
funcListCmd,
callCmd,
}
var funcListCmd = &FuncCommand{
Name: "functions [flags] [FUNCTION]...",
Short: `List available functions`,
Long: strings.ReplaceAll(`List available functions in a module.
This is similar to ´dagger call --help´, but only focused on showing the
available functions.
`,
"´",
"`",
),
Execute: func(fc *FuncCommand, cmd *cobra.Command) error {
tw := tabwriter.NewWriter(cmd.OutOrStdout(), 0, 0, 3, ' ', tabwriter.DiscardEmptyColumns)
var o functionProvider = fc.mod.GetMainObject()
fmt.Fprintf(tw, "%s\t%s\n",
termenv.String("Name").Bold(),
termenv.String("Description").Bold(),
)
// Walk the hypothetical function pipeline specified by the args
for _, field := range cmd.Flags().Args() {
// Lookup the next function in the specified pipeline
nextFunc, err := o.GetFunction(field)
if err != nil {
return err
}
nextType := nextFunc.ReturnType
if nextType.AsFunctionProvider() != nil {
// sipsma explains why 'nextType.AsObject' is not enough:
// > when we're returning the hierarchies of TypeDefs from the API,
// > and an object shows up as an output/input type to a function,
// > we just return a TypeDef with a name of the object rather than the full object definition.
// > You can get the full object definition only from the "top-level" returned object on the api call.
//
// > The reason is that if we repeated the full object definition every time,
// > you'd at best be using O(n^2) space in the result,
// > and at worst cause json serialization errors due to cyclic references
// > (i.e. with* functions on an object that return the object itself).
o = fc.mod.GetFunctionProvider(nextType.Name())
continue
}
// FIXME: handle arrays of objects
return fmt.Errorf("function '%s' returns non-object type %v", field, nextType.Kind)
}
// List functions on the final object
fns := o.GetFunctions()
sort.Slice(fns, func(i, j int) bool {
return fns[i].Name < fns[j].Name
})
for _, fn := range fns {
desc := strings.SplitN(fn.Description, "\n", 2)[0]
if desc == "" {
desc = "-"
}
fmt.Fprintf(tw, "%s\t%s\n",
cliName(fn.Name),
desc,
)
}
return tw.Flush()
},
}
type FuncCommands []*FuncCommand
func (fcs FuncCommands) AddFlagSet(flags *pflag.FlagSet) {
for _, cmd := range fcs.All() {
cmd.PersistentFlags().AddFlagSet(flags)
}
}
func (fcs FuncCommands) AddParent(rootCmd *cobra.Command) {
rootCmd.AddCommand(fcs.All()...)
}
func (fcs FuncCommands) All() []*cobra.Command {
cmds := make([]*cobra.Command, len(fcs))
for i, fc := range fcs {
cmds[i] = fc.Command()
}
return cmds
}
func setCmdOutput(cmd *cobra.Command, vtx *progrock.VertexRecorder) {
cmd.SetOut(vtx.Stdout())
cmd.SetErr(vtx.Stderr())
}
// FuncCommand is a config object used to create a dynamic set of commands
// for querying a module's functions.
type FuncCommand struct {
// The name of the command (or verb), as shown in usage.
Name string
// Aliases is an array of aliases that can be used instead of the first word in Use.
Aliases []string
// Short is the short description shown in the 'help' output.
Short string
// Long is the long message shown in the 'help <this-command>' output.
Long string
// Example is examples of how to use the command.
Example string
// Init is called when the command is created and initialized,
// before execution.
//
// It can be useful to add persistent flags for all subcommands here.
Init func(*cobra.Command)
// Execute circumvents the default behavior of traversing subcommands
// from the arguments, but still has access to the loaded objects from
// the module.
Execute func(*FuncCommand, *cobra.Command) error
// BeforeParse is called before parsing the flags for a subcommand.
//
// It can be useful to add any additional flags for a subcommand here.
BeforeParse func(*FuncCommand, *cobra.Command, *modFunction) error
// OnSelectObjectLeaf is called when a user provided command ends in a
// object and no more sub-commands are provided.
//
// If set, it should make another selection on the object that results
// return no error. Otherwise if it doesn't handle the object, it should
// return an error.
OnSelectObjectLeaf func(*FuncCommand, string) error
// BeforeRequest is called before making the request with the query that
// contains the whole chain of functions.
//
// It can be useful to validate the return type of the function or as a
// last effort to select a GraphQL sub-field.
BeforeRequest func(*FuncCommand, *cobra.Command, *modTypeDef) error
// AfterResponse is called when the query has completed and returned a result.
AfterResponse func(*FuncCommand, *cobra.Command, *modTypeDef, any) error
// cmd is the parent cobra command.
cmd *cobra.Command
// mod is the loaded module definition.
mod *moduleDef
// showHelp is set in the loader vertex to flag whether to show the help
// in the execution vertex.
showHelp bool
// showUsage flags whether to show a one-line usage message after error.
showUsage bool
q *querybuilder.Selection
c *client.Client
}
func (fc *FuncCommand) Command() *cobra.Command {
if fc.cmd == nil {
fc.cmd = &cobra.Command{
Use: fc.Name,
Aliases: fc.Aliases,
Short: fc.Short,
Long: fc.Long,
Example: fc.Example,
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "",
},
// We need to disable flag parsing because it'll act on --help
// and validate the args before we have a chance to add the
// subcommands.
DisableFlagParsing: true,
DisableFlagsInUseLine: true,
PreRunE: func(c *cobra.Command, a []string) error {
// Recover what DisableFlagParsing disabled.
// In PreRunE it's, already past the --help check and
// args validation, but not flag validation which we want.
c.DisableFlagParsing = false
// Since we disabled flag parsing, we'll get all args,
// not just flags. We want to stop parsing at the first
// possible dynamic sub-command since they've not been
// added yet.
c.Flags().SetInterspersed(false)
// Allow using flags with the name that was reported
// by the SDK. This avoids confusion as users are editing
// a module and trying to test its functions.
c.SetGlobalNormalizationFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName {
return pflag.NormalizedName(cliName(name))
})
// temporarily allow unknown flags so we can parse any global flags before starting
// the engine+TUI while not erroring out on module constructor flags (which can't be
// added until the engine has started)
c.FParseErrWhitelist.UnknownFlags = true
if err := c.ParseFlags(a); err != nil {
// This gives a chance for FuncCommand implementations to
// handle errors from parsing flags.
return c.FlagErrorFunc()(c, err)
}
c.FParseErrWhitelist.UnknownFlags = false
fc.showHelp, _ = c.Flags().GetBool("help")
return nil
},
// Between PreRunE and RunE, flags are validated.
RunE: func(c *cobra.Command, a []string) error {
return withEngineAndTUI(c.Context(), client.Params{}, func(ctx context.Context, engineClient *client.Client) (rerr error) {
fc.c = engineClient
// withEngineAndTUI changes the context.
c.SetContext(ctx)
// We need to print the errors ourselves because the root command
// will print the command path for this one (parent), not any
// sub-command.
c.SilenceErrors = true
return fc.execute(c, a)
})
},
}
if fc.Init != nil {
fc.Init(fc.cmd)
}
}
return fc.cmd
}
func (fc *FuncCommand) execute(c *cobra.Command, a []string) (rerr error) {
ctx := c.Context()
rec := progrock.FromContext(ctx)
var primaryVtx *progrock.VertexRecorder
var cmd *cobra.Command
// The following is a little complicated because it needs to handle the case
// where we fail to load the modules or parse the CLI.
//
// In the happy path we want to initialize the PrimaryVertex with the parsed
// command string, but we can't have that until we load the command.
//
// So we just detect if we failed before getting to that point and fall back
// to the outer command.
defer func() {
if cmd == nil { // errored during loading
cmd = c
}
if primaryVtx == nil { // errored during loading
primaryVtx = rec.Vertex(idtui.PrimaryVertex, cmd.CommandPath())
defer func() { primaryVtx.Done(rerr) }()
setCmdOutput(cmd, primaryVtx)
}
if ctx.Err() != nil {
cmd.PrintErrln("Canceled.")
} else if rerr != nil {
cmd.PrintErrln("Error:", rerr.Error())
if fc.showHelp {
// Explicitly show the help here while still returning the error.
// This handles the case of `dagger call --help` run on a broken module; in that case
// we want to error out since we can't actually load the module and show all subcommands
// and flags in the help output, but we still want to show the user *something*
cmd.Help()
}
if fc.showUsage {
cmd.PrintErrf("Run '%v --help' for usage.\n", cmd.CommandPath())
}
}
}()
// Load the command, which may fail if modules are broken.
cmd, flags, err := fc.load(c, a)
if err != nil {
return err
}
// Ok, we've loaded the command, now we can initialize the PrimaryVertex.
primaryVtx = rec.Vertex(idtui.PrimaryVertex, cmd.CommandPath())
defer func() { primaryVtx.Done(rerr) }()
setCmdOutput(cmd, primaryVtx)
if fc.showHelp {
// Hide aliases for sub-commands. They just allow using the SDK's
// casing for functions but there's no need to advertise.
if cmd != c {
cmd.Aliases = nil
}
return cmd.Help()
}
// There should be no args left, if there are it's an unknown command.
if err := cobra.NoArgs(cmd, flags); err != nil {
return err
}
if fc.Execute != nil {
return fc.Execute(fc, cmd)
}
// No args to the parent command, default to showing help.
if cmd == c {
return cmd.Help()
}
err = cmd.RunE(cmd, flags)
if err != nil {
return err
}
return nil
}
func (fc *FuncCommand) load(c *cobra.Command, a []string) (cmd *cobra.Command, _ []string, rerr error) {
ctx := c.Context()
dag := fc.c.Dagger()
modConf, err := getDefaultModuleConfiguration(ctx, dag, true)
if err != nil {
return nil, nil, fmt.Errorf("failed to get configured module: %w", err)
}
if !modConf.FullyInitialized() {
return nil, nil, fmt.Errorf("module at source dir %q doesn't exist or is invalid", modConf.LocalRootSourcePath)
}
mod := modConf.Source.AsModule().Initialize()
_, err = mod.Serve(ctx)
if err != nil {
return nil, nil, err
}
modDef, err := loadModTypeDefs(ctx, dag, mod)
if err != nil {
return nil, nil, err
}
obj := modDef.GetMainObject()
if obj == nil {
return nil, nil, fmt.Errorf("main object not found")
}
fc.mod = modDef
if fc.Execute != nil {
// if `Execute` is set, there's no need for sub-commands.
return c, nil, nil
}
if obj.Constructor != nil {
// add constructor args as top-level flags
if err := fc.addArgsForFunction(c, a, obj.Constructor, dag); err != nil {
return nil, nil, err
}
fc.selectFunc(obj.Name, obj.Constructor, c, dag)
} else {
fc.Select(obj.Name)
}
// Add main object's functions as subcommands
fc.addSubCommands(c, dag, obj)
if fc.showHelp {
return c, nil, nil
}
cmd, flags, err := fc.traverse(c)
if err != nil {
if errors.Is(err, pflag.ErrHelp) {
fc.showHelp = true
return cmd, flags, nil
}
fc.showUsage = true
return cmd, flags, err
}
return cmd, flags, nil
}
// traverse the arguments to build the command tree and return the leaf command.
func (fc *FuncCommand) traverse(c *cobra.Command) (*cobra.Command, []string, error) {
cmd, args, err := c.Find(c.Flags().Args())
if err != nil {
return cmd, args, err
}
// Leaf command
if cmd == c {
return cmd, args, nil
}
cmd.SetContext(c.Context())
cmd.InitDefaultHelpFlag()
// Load and ParseFlags
err = cmd.PreRunE(cmd, args)
if err != nil {
return cmd, args, err
}
return fc.traverse(cmd)
}
func (fc *FuncCommand) addSubCommands(cmd *cobra.Command, dag *dagger.Client, fnProvider functionProvider) {
if fnProvider != nil {
cmd.AddGroup(funcGroup)
for _, fn := range fnProvider.GetFunctions() {
subCmd := fc.makeSubCmd(dag, fn)
cmd.AddCommand(subCmd)
}
}
}
func (fc *FuncCommand) makeSubCmd(dag *dagger.Client, fn *modFunction) *cobra.Command {
newCmd := &cobra.Command{
Use: cliName(fn.Name),
Short: strings.SplitN(fn.Description, "\n", 2)[0],
Long: fn.Description,
GroupID: funcGroup.ID,
PreRunE: func(cmd *cobra.Command, args []string) (err error) {
if err := fc.addArgsForFunction(cmd, args, fn, dag); err != nil {
return err
}
fnProvider := fn.ReturnType.AsFunctionProvider()
if fnProvider == nil && fn.ReturnType.AsList != nil {
fnProvider = fn.ReturnType.AsList.ElementTypeDef.AsFunctionProvider()
}
fc.addSubCommands(cmd, dag, fnProvider)
// Show help for first command that has the --help flag.
help, _ := cmd.Flags().GetBool("help")
if help {
return pflag.ErrHelp
}
// Need to make the query selection before chaining off.
return fc.selectFunc(fn.Name, fn, cmd, dag)
},
// This is going to be executed in the "execution" vertex, when
// we have the final/leaf command.
RunE: func(cmd *cobra.Command, args []string) (err error) {
switch fn.ReturnType.Kind {
case dagger.ObjectKind, dagger.InterfaceKind:
if fc.OnSelectObjectLeaf == nil {
// there is no handling of this object and no further selections, error out
fc.showUsage = true
return fmt.Errorf("%q requires a sub-command", cmd.Name())
}
// the top-level command may handle this via OnSelectObjectLeaf
err := fc.OnSelectObjectLeaf(fc, fn.ReturnType.Name())
if err != nil {
fc.showUsage = true
return fmt.Errorf("invalid selection for command %q: %w", cmd.Name(), err)
}
case dagger.ListKind:
fnProvider := fn.ReturnType.AsList.ElementTypeDef.AsFunctionProvider()
if fnProvider != nil && len(fnProvider.GetFunctions()) > 0 {
// we don't handle lists of objects/interfaces w/ extra functions on any commands right now
fc.showUsage = true
return fmt.Errorf("%q requires a sub-command", cmd.Name())
}
}
if fc.BeforeRequest != nil {
if err = fc.BeforeRequest(fc, cmd, fn.ReturnType); err != nil {
return err
}
}
ctx := cmd.Context()
query, _ := fc.q.Build(ctx)
rec := progrock.FromContext(ctx)
rec.Debug("executing", progrock.Labelf("query", "%+v", query))
var response any
q := fc.q.Bind(&response)
if err := q.Execute(ctx, dag.Client); err != nil {
return fmt.Errorf("response from query: %w", err)
}
if fc.AfterResponse != nil {
return fc.AfterResponse(fc, cmd, fn.ReturnType, response)
}
if fn.ReturnType.Kind != dagger.VoidKind {
cmd.Println(response)
}
return nil
},
}
// Allow using the function name from the SDK as an alias for the command.
if fn.Name != newCmd.Name() {
newCmd.Aliases = append(newCmd.Aliases, fn.Name)
}
newCmd.Flags().SetInterspersed(false)
return newCmd
}
func (fc *FuncCommand) addArgsForFunction(cmd *cobra.Command, cmdArgs []string, fn *modFunction, dag *dagger.Client) error {
fc.mod.LoadTypeDef(fn.ReturnType)
for _, arg := range fn.Args {
fc.mod.LoadTypeDef(arg.TypeDef)
}
for _, arg := range fn.Args {
_, err := arg.AddFlag(cmd.Flags(), dag)
if err != nil {
return err
}
if !arg.TypeDef.Optional {
cmd.MarkFlagRequired(arg.FlagName())
}
}
if fc.BeforeParse != nil {
if err := fc.BeforeParse(fc, cmd, fn); err != nil {
return err
}
}
if err := cmd.ParseFlags(cmdArgs); err != nil {
// This gives a chance for FuncCommand implementations to
// handle errors from parsing flags.
return cmd.FlagErrorFunc()(cmd, err)
}
help, _ := cmd.Flags().GetBool("help")
if !help {
if err := cmd.ValidateRequiredFlags(); err != nil {
return err
}
if err := cmd.ValidateFlagGroups(); err != nil {
return err
}
}
return nil
}
// selectFunc adds the function selection to the query.
// Note that the type can change if there's an extra selection for supported types.
func (fc *FuncCommand) selectFunc(selectName string, fn *modFunction, cmd *cobra.Command, dag *dagger.Client) error {
fc.Select(selectName)
for _, arg := range fn.Args {
var val any
flag := cmd.Flags().Lookup(arg.FlagName())
if flag == nil {
return fmt.Errorf("no flag for %q", arg.FlagName())
}
// Don't send optional arguments that weren't set.
if arg.TypeDef.Optional && !flag.Changed {
continue
}
val = flag.Value
switch v := val.(type) {
case DaggerValue:
obj, err := v.Get(cmd.Context(), dag)
if err != nil {
return fmt.Errorf("failed to get value for argument %q: %w", arg.Name, err)
}
if obj == nil {
return fmt.Errorf("no value for argument: %s", arg.Name)
}
val = obj
case pflag.SliceValue:
val = v.GetSlice()
}
fc.Arg(arg.Name, val)
}
return nil
}
func (fc *FuncCommand) Select(name string) {
if fc.q == nil {
fc.q = querybuilder.Query()
}
fc.q = fc.q.Select(gqlFieldName(name))
}
func (fc *FuncCommand) Arg(name string, value any) {
fc.q = fc.q.Arg(gqlArgName(name), value)
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,731 | 🐞 [CLI]: `dagger functions $function_name` returns an error if return type is not a dagger object | ### What is the issue?
calling `dagger functions foo` on the following function definition raises the following error:
`Error: function 'foo' returns non-object type STRING_KIND`
```go
package main
type Testmodule struct{}
func (m *Testmodule) Foo() string {
return "bar"
}
```
### Dagger version
dagger v0.9.11
### Steps to reproduce
run `dagger functions foo` on the code given above
### Log output
Error: function 'foo' returns non-object type STRING_KIND
| https://github.com/dagger/dagger/issues/6731 | https://github.com/dagger/dagger/pull/6733 | 58f4b8f7791786a740134ee36854002f9021c1fc | 4359dd91d1739cddbc83ca37328943f6187ce50a | "2024-02-25T14:27:41Z" | go | "2024-02-26T12:02:06Z" | core/integration/module_functions_test.go | package core
import (
"strings"
"testing"
"dagger.io/dagger"
"github.com/stretchr/testify/require"
)
func TestModuleDaggerCLIFunctions(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type Test struct{}
// doc for FnA
func (m *Test) FnA() *Container {
return nil
}
// doc for FnB
func (m *Test) FnB() Duck {
return nil
}
type Duck interface {
DaggerObject
// quack that thang
Quack(ctx context.Context) (string, error)
}
// doc for FnC
func (m *Test) FnC() *Obj {
return nil
}
type Obj struct {
// doc for FieldA
FieldA *Container
// doc for FieldB
FieldB string
// doc for FieldC
FieldC *Obj
// doc for FieldD
FieldD *OtherObj
}
// doc for FnD
func (m *Obj) FnD() *Container {
return nil
}
type OtherObj struct {
// doc for OtherFieldA
OtherFieldA *Container
// doc for OtherFieldB
OtherFieldB string
// doc for OtherFieldC
OtherFieldC *Obj
// doc for OtherFieldD
OtherFieldD *OtherObj
}
// doc for FnE
func (m *OtherObj) FnE() *Container {
return nil
}
`,
})
t.Run("top-level", func(t *testing.T) {
out, err := ctr.With(daggerFunctions()).Stdout(ctx)
require.NoError(t, err)
lines := strings.Split(out, "\n")
require.Contains(t, lines, "fn-a doc for FnA")
require.Contains(t, lines, "fn-b doc for FnB")
require.Contains(t, lines, "fn-c doc for FnC")
})
t.Run("return core object", func(t *testing.T) {
out, err := ctr.With(daggerFunctions("fn-a")).Stdout(ctx)
require.NoError(t, err)
lines := strings.Split(out, "\n")
// just verify some of the container funcs are there, too many to be exhaustive
require.Contains(t, lines, "file Retrieves a file at the given path.")
require.Contains(t, lines, "as-tarball Returns a File representing the container serialized to a tarball.")
})
t.Run("alt casing", func(t *testing.T) {
out, err := ctr.With(daggerFunctions("fnA")).Stdout(ctx)
require.NoError(t, err)
lines := strings.Split(out, "\n")
// just verify some of the container funcs are there, too many to be exhaustive
require.Contains(t, lines, "file Retrieves a file at the given path.")
require.Contains(t, lines, "as-tarball Returns a File representing the container serialized to a tarball.")
})
t.Run("return user interface", func(t *testing.T) {
out, err := ctr.With(daggerFunctions("fn-b")).Stdout(ctx)
require.NoError(t, err)
lines := strings.Split(out, "\n")
require.Contains(t, lines, "quack quack that thang")
})
t.Run("return user object", func(t *testing.T) {
out, err := ctr.With(daggerFunctions("fn-c")).Stdout(ctx)
require.NoError(t, err)
lines := strings.Split(out, "\n")
// just verify some of the container funcs are there, too many to be exhaustive
require.Contains(t, lines, "field-a doc for FieldA")
require.Contains(t, lines, "field-b doc for FieldB")
require.Contains(t, lines, "field-c doc for FieldC")
require.Contains(t, lines, "field-d doc for FieldD")
require.Contains(t, lines, "fn-d doc for FnD")
})
t.Run("return user object nested", func(t *testing.T) {
out, err := ctr.With(daggerFunctions("fn-c", "field-d")).Stdout(ctx)
require.NoError(t, err)
lines := strings.Split(out, "\n")
// just verify some of the container funcs are there, too many to be exhaustive
require.Contains(t, lines, "other-field-a doc for OtherFieldA")
require.Contains(t, lines, "other-field-b doc for OtherFieldB")
require.Contains(t, lines, "other-field-c doc for OtherFieldC")
require.Contains(t, lines, "other-field-d doc for OtherFieldD")
require.Contains(t, lines, "fn-e doc for FnE")
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,662 | Using embedded fields with go modules fails with unhelpful error | Take the following code:
```go
type Playground struct {
// This breaks
*Directory
// This doesn't
// Directory *Directory
}
func New() Playground {
return Playground{Directory: dag.Directory()}
}
```
When attempting to evaluate anything on the `Playground` object, we get the following error:
```
Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground"
``` | https://github.com/dagger/dagger/issues/6662 | https://github.com/dagger/dagger/pull/6715 | 2f975ef29ad78e08c5b9328f6db3797b4c57da69 | b966257dbc24b714e6ee39f01158f10f8fa24fd3 | "2024-02-13T15:54:25Z" | go | "2024-02-26T15:11:43Z" | cmd/codegen/generator/go/templates/module_objects.go | package templates
import (
"fmt"
"go/ast"
"go/types"
"maps"
"reflect"
"sort"
"strconv"
"strings"
. "github.com/dave/jennifer/jen" //nolint:stylecheck
)
func (ps *parseState) parseGoStruct(t *types.Struct, named *types.Named) (*parsedObjectType, error) {
spec := &parsedObjectType{
goType: t,
moduleName: ps.moduleName,
}
if named == nil {
return nil, fmt.Errorf("struct types must be named")
}
spec.name = named.Obj().Name()
if spec.name == "" {
return nil, fmt.Errorf("struct types must be named")
}
// We don't support extending objects from outside this module, so we will
// be skipping it. But first we want to verify the user isn't adding methods
// to it (in which case we error out).
objectIsDaggerGenerated := ps.isDaggerGenerated(named.Obj())
goFuncTypes := []*types.Func{}
methodSet := types.NewMethodSet(types.NewPointer(named))
for i := 0; i < methodSet.Len(); i++ {
methodObj := methodSet.At(i).Obj()
if ps.isDaggerGenerated(methodObj) {
// We don't care about pre-existing methods on core types or objects from dependency modules.
continue
}
if objectIsDaggerGenerated {
return nil, fmt.Errorf("cannot define methods on objects from outside this module")
}
goFuncType, ok := methodObj.(*types.Func)
if !ok {
return nil, fmt.Errorf("expected method to be a func, got %T", methodObj)
}
if !goFuncType.Exported() {
continue
}
goFuncTypes = append(goFuncTypes, goFuncType)
}
if objectIsDaggerGenerated {
return nil, nil
}
sort.Slice(goFuncTypes, func(i, j int) bool {
return goFuncTypes[i].Pos() < goFuncTypes[j].Pos()
})
for _, goFuncType := range goFuncTypes {
funcTypeSpec, err := ps.parseGoFunc(named, goFuncType)
if err != nil {
return nil, fmt.Errorf("failed to parse method %s: %w", goFuncType.Name(), err)
}
spec.methods = append(spec.methods, funcTypeSpec)
}
// get the comment above the struct (if any)
astSpec, err := ps.astSpecForNamedType(named)
if err != nil {
return nil, fmt.Errorf("failed to find decl for named type %s: %w", spec.name, err)
}
spec.doc = astSpec.Doc.Text()
astStructType, ok := astSpec.Type.(*ast.StructType)
if !ok {
return nil, fmt.Errorf("expected type spec to be a struct, got %T", astSpec.Type)
}
// Fill out the static fields of the struct (if any)
astFields := unpackASTFields(astStructType.Fields)
for i := 0; i < t.NumFields(); i++ {
field := t.Field(i)
if !field.Exported() {
continue
}
fieldSpec := &fieldSpec{goType: field.Type()}
fieldSpec.typeSpec, err = ps.parseGoTypeReference(fieldSpec.goType, nil, false)
if err != nil {
return nil, fmt.Errorf("failed to parse field type: %w", err)
}
fieldSpec.goName = field.Name()
fieldSpec.name = fieldSpec.goName
// override the name with the json tag if it was set - otherwise, we
// end up asking for a name that we won't unmarshal correctly
tag := reflect.StructTag(t.Tag(i))
if dt := tag.Get("json"); dt != "" {
dt, _, _ = strings.Cut(dt, ",")
if dt == "-" {
continue
}
fieldSpec.name = dt
}
docPragmas, docComment := parsePragmaComment(astFields[i].Doc.Text())
linePragmas, lineComment := parsePragmaComment(astFields[i].Comment.Text())
comment := strings.TrimSpace(docComment)
if comment == "" {
comment = strings.TrimSpace(lineComment)
}
pragmas := make(map[string]string)
maps.Copy(pragmas, docPragmas)
maps.Copy(pragmas, linePragmas)
if v, ok := pragmas["private"]; ok {
if v == "" {
fieldSpec.isPrivate = true
} else {
fieldSpec.isPrivate, _ = strconv.ParseBool(v)
}
}
fieldSpec.doc = comment
spec.fields = append(spec.fields, fieldSpec)
}
if ps.isMainModuleObject(spec.name) && ps.constructor != nil {
spec.constructor, err = ps.parseGoFunc(nil, ps.constructor)
if err != nil {
return nil, fmt.Errorf("failed to parse constructor: %w", err)
}
}
return spec, nil
}
type parsedObjectType struct {
name string
moduleName string
doc string
fields []*fieldSpec
methods []*funcTypeSpec
constructor *funcTypeSpec
goType *types.Struct
}
var _ NamedParsedType = &parsedObjectType{}
func (spec *parsedObjectType) TypeDefCode() (*Statement, error) {
withObjectArgsCode := []Code{
Lit(spec.name),
}
withObjectOptsCode := []Code{}
if spec.doc != "" {
withObjectOptsCode = append(withObjectOptsCode, Id("Description").Op(":").Lit(strings.TrimSpace(spec.doc)))
}
if len(withObjectOptsCode) > 0 {
withObjectArgsCode = append(withObjectArgsCode, Id("TypeDefWithObjectOpts").Values(withObjectOptsCode...))
}
typeDefCode := Qual("dag", "TypeDef").Call().Dot("WithObject").Call(withObjectArgsCode...)
for _, method := range spec.methods {
fnTypeDefCode, err := method.TypeDefCode()
if err != nil {
return nil, fmt.Errorf("failed to convert method %s to function def: %w", method.name, err)
}
typeDefCode = dotLine(typeDefCode, "WithFunction").Call(Add(Line(), fnTypeDefCode))
}
for _, field := range spec.fields {
if field.isPrivate {
continue
}
fieldTypeDefCode, err := field.typeSpec.TypeDefCode()
if err != nil {
return nil, fmt.Errorf("failed to convert field type: %w", err)
}
withFieldArgsCode := []Code{
Lit(field.name),
fieldTypeDefCode,
}
if field.doc != "" {
withFieldArgsCode = append(withFieldArgsCode,
Id("TypeDefWithFieldOpts").Values(
Id("Description").Op(":").Lit(field.doc),
))
}
typeDefCode = dotLine(typeDefCode, "WithField").Call(withFieldArgsCode...)
}
if spec.constructor != nil {
fnTypeDefCode, err := spec.constructor.TypeDefCode()
if err != nil {
return nil, fmt.Errorf("failed to convert constructor to function def: %w", err)
}
typeDefCode = dotLine(typeDefCode, "WithConstructor").Call(Add(Line(), fnTypeDefCode))
}
return typeDefCode, nil
}
func (spec *parsedObjectType) GoType() types.Type {
return spec.goType
}
func (spec *parsedObjectType) GoSubTypes() []types.Type {
var subTypes []types.Type
for _, method := range spec.methods {
subTypes = append(subTypes, method.GoSubTypes()...)
}
for _, field := range spec.fields {
if field.isPrivate {
continue
}
subTypes = append(subTypes, field.typeSpec.GoSubTypes()...)
}
if spec.constructor != nil {
subTypes = append(subTypes, spec.constructor.GoSubTypes()...)
}
return subTypes
}
func (spec *parsedObjectType) Name() string {
return spec.name
}
func (spec *parsedObjectType) ModuleName() string {
return spec.moduleName
}
/*
Extra generated code needed for the object implementation.
Right now, this is just an UnmarshalJSON method. This is needed because objects may have fields
of an interface type, which the JSON unmarshaller can't handle on its own. Instead, this custom
unmarshaller will unmarshal the JSON into a struct where all the fields are concrete types,
including the underlying concrete struct implementation of any interface fields.
After it unmarshals into that, it copies the fields to the real object fields, handling any
special cases around interface conversions (e.g. converting a slice of structs to a slice of
interfaces).
e.g.:
func (r *Test) UnmarshalJSON(bs []byte) error {
var concrete struct {
Iface *customIfaceImpl
IfaceList []*customIfaceImpl
OtherIfaceList []*otherIfaceImpl
}
err := json.Unmarshal(bs, &concrete)
if err != nil {
return err
}
r.Iface = concrete.Iface.toIface()
r.IfaceList = convertSlice(concrete.IfaceList, (*customIfaceImpl).toIface)
r.OtherIfaceList = convertSlice(concrete.OtherIfaceList, (*otherIfaceImpl).toIface)
return nil
}
*/
func (spec *parsedObjectType) ImplementationCode() (*Statement, error) {
concreteFields := make([]Code, 0, len(spec.fields))
setFieldCodes := make([]*Statement, 0, len(spec.fields))
for _, field := range spec.fields {
fieldTypeCode, err := spec.concreteFieldTypeCode(field.typeSpec)
if err != nil {
return nil, fmt.Errorf("failed to generate field type code: %w", err)
}
fieldCode := Id(field.goName).Add(fieldTypeCode)
if field.goName != field.name {
fieldCode.Tag(map[string]string{"json": field.name})
}
concreteFields = append(concreteFields, fieldCode)
setFieldCode, err := spec.setFieldsFromConcreteStructCode(field)
if err != nil {
return nil, fmt.Errorf("failed to generate set field code: %w", err)
}
setFieldCodes = append(setFieldCodes, setFieldCode)
}
return Func().Params(Id("r").Op("*").Id(spec.name)).
Id("UnmarshalJSON").
Params(Id("bs").Id("[]byte")).
Params(Id("error")).
BlockFunc(func(g *Group) {
g.Var().Id("concrete").Struct(concreteFields...)
g.Id("err").Op(":=").Id("json").Dot("Unmarshal").Call(Id("bs"), Op("&").Id("concrete"))
g.If(Id("err").Op("!=").Nil()).Block(Return(Id("err")))
for _, setFieldCode := range setFieldCodes {
g.Add(setFieldCode)
}
g.Return(Nil())
}).
Line(), nil
}
/*
The code for the type of a field in the concrete struct unmarshalled into. Mainly needs to handle
interface types, which need to be converted to their concrete struct implementations.
*/
func (spec *parsedObjectType) concreteFieldTypeCode(typeSpec ParsedType) (*Statement, error) {
s := Empty()
switch typeSpec := typeSpec.(type) {
case *parsedPrimitiveType:
if typeSpec.isPtr {
s.Op("*")
}
if typeSpec.alias != "" {
s.Id(typeSpec.alias)
} else {
s.Id(typeSpec.GoType().String())
}
case *parsedSliceType:
fieldTypeCode, err := spec.concreteFieldTypeCode(typeSpec.underlying)
if err != nil {
return nil, fmt.Errorf("failed to generate slice field type code: %w", err)
}
s.Index().Add(fieldTypeCode)
case *parsedObjectTypeReference:
if typeSpec.isPtr {
s.Op("*")
}
s.Id(typeSpec.name)
case *parsedIfaceTypeReference:
s.Op("*").Id(formatIfaceImplName(typeSpec.name))
default:
return nil, fmt.Errorf("unsupported concrete field type %T", typeSpec)
}
return s, nil
}
/*
The code for setting the fields of the real object from the concrete struct unmarshalled into. e.g.:
r.Iface = concrete.Iface.toIface()
r.IfaceList = convertSlice(concrete.IfaceList, (*customIfaceImpl).toIface)
*/
func (spec *parsedObjectType) setFieldsFromConcreteStructCode(field *fieldSpec) (*Statement, error) {
s := Empty()
switch typeSpec := field.typeSpec.(type) {
case *parsedPrimitiveType, *parsedObjectTypeReference:
s.Id("r").Dot(field.goName).Op("=").Id("concrete").Dot(field.goName)
case *parsedSliceType:
switch underlyingTypeSpec := typeSpec.underlying.(type) {
case *parsedIfaceTypeReference:
s.Id("r").Dot(field.goName).Op("=").Id("convertSlice").Call(
Id("concrete").Dot(field.goName),
Parens(Op("*").Id(formatIfaceImplName(underlyingTypeSpec.name))).Dot("toIface"),
)
default:
s.Id("r").Dot(field.goName).Op("=").Id("concrete").Dot(field.goName)
}
case *parsedIfaceTypeReference:
s.Id("r").Dot(field.goName).Op("=").Id("concrete").Dot(field.goName).Dot("toIface").Call()
default:
return nil, fmt.Errorf("unsupported field type %T", typeSpec)
}
return s, nil
}
type fieldSpec struct {
name string
doc string
typeSpec ParsedType
// isPrivate is true if the field is marked with the +private pragma
isPrivate bool
// goName is the name of the field in the Go struct. It may be different than name if the user changed the name of the field via a json tag
goName string
goType types.Type
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,662 | Using embedded fields with go modules fails with unhelpful error | Take the following code:
```go
type Playground struct {
// This breaks
*Directory
// This doesn't
// Directory *Directory
}
func New() Playground {
return Playground{Directory: dag.Directory()}
}
```
When attempting to evaluate anything on the `Playground` object, we get the following error:
```
Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground"
``` | https://github.com/dagger/dagger/issues/6662 | https://github.com/dagger/dagger/pull/6715 | 2f975ef29ad78e08c5b9328f6db3797b4c57da69 | b966257dbc24b714e6ee39f01158f10f8fa24fd3 | "2024-02-13T15:54:25Z" | go | "2024-02-26T15:11:43Z" | core/integration/module_test.go | package core
import (
"context"
_ "embed"
"encoding/json"
"fmt"
"go/format"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"time"
"github.com/MakeNowJust/heredoc/v2"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/dagql/idproto"
"github.com/iancoleman/strcase"
"github.com/moby/buildkit/identity"
"github.com/stretchr/testify/require"
"github.com/tidwall/gjson"
"golang.org/x/sync/errgroup"
"dagger.io/dagger"
"github.com/dagger/dagger/cmd/codegen/introspection"
)
func TestModuleGoInit(t *testing.T) {
t.Parallel()
t.Run("from scratch", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=bare", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("reserved go.mod name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=go", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{go{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"go":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("uses expected Go module name, camel-cases Dagger module name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=My-Module", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{myModule{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"myModule":{"containerEcho":{"stdout":"hello\n"}}}`, out)
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
t.Run("creates go.mod beneath an existing go.mod if context is beneath it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
// don't use .git under /work so the context ends up being /work/ci
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/go.mod", dagger.ContainerWithNewFileOpts{
Contents: "module example.com/test\n",
}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/ci").
With(daggerExec("init", "--name=beneathGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{beneathGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"beneathGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("names Go module after Dagger module", func(t *testing.T) {
generated, err := modGen.Directory("dagger").File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
})
t.Run("respects existing go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("preserves module name", func(t *testing.T) {
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module example.com/test")
})
})
t.Run("respects existing go.work", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithExec([]string{"go", "work", "init"}).
WithExec([]string{"go", "work", "use", "."}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("go.work is edited", func(t *testing.T) {
generated, err := modGen.File("go.work").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "\t.\n")
require.Contains(t, generated, "\t./dagger\n")
})
})
t.Run("respects existing go.work for top-level source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithExec([]string{"go", "work", "init"}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go", "--source=."))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("go.work is edited", func(t *testing.T) {
generated, err := modGen.File("go.work").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "use .\n")
})
})
t.Run("ignores go.work for subdir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithExec([]string{"go", "work", "init"}).
WithExec([]string{"go", "work", "use", "."}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go", "subdir"))
// we can't write to the go.work at the top-level so it should remain
// unedited, but we should still be able to execute the module as
// expected
out, err := modGen.
WithWorkdir("./subdir").
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("go.work is unedited", func(t *testing.T) {
generated, err := modGen.File("go.work").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "use .\n")
})
})
t.Run("respects parent go.mod if root points to it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
With(daggerExec("init", "--name=child", "--sdk=go", "./child")).
WithWorkdir("/work/child").
// explicitly develop to see whether it makes a go.mod
With(daggerExec("develop")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
require.Equal(t, []string{".git", "child", "foo.go", "go.mod", "go.sum"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.NotContains(t, childEntries, "go.mod")
t.Run("preserves parent module name", func(t *testing.T) {
goMod, err := generated.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, goMod, "module example.com/test")
})
})
t.Run("respects existing go.mod even if root points to parent that has go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"}).
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/child").
WithExec([]string{"go", "mod", "init", "my-mod"}).
WithWorkdir("/work").
With(daggerExec("init", "--source=./child", "--name=child", "--sdk=go", "./child")).
WithWorkdir("/work/child").
// explicitly develop to see whether it makes a go.mod
With(daggerExec("develop")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
// no go.sum
require.Equal(t, []string{".git", "child", "foo.go", "go.mod"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.Contains(t, childEntries, "go.mod")
require.Contains(t, childEntries, "go.sum")
})
t.Run("respects existing main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasMainGo struct {}
func (m *HasMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("init", "--name=hasMainGo", "--sdk=go", "--source=."))
out, err := modGen.
With(daggerQuery(`{hasMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("respects existing main.go even if it uses types not generated yet", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasDaggerTypes struct {}
func (m *HasDaggerTypes) Hello() *Container {
return dag.Container().
From("` + alpineImage + `").
WithExec([]string{"echo", "Hello, world!"})
}
`,
}).
With(daggerExec("init", "--source=.", "--name=hasDaggerTypes", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasDaggerTypes{hello{stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasDaggerTypes":{"hello":{"stdout":"Hello, world!\n"}}}`, out)
})
t.Run("respects existing package without creating main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/notmain.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type HasNotMainGo struct {}
func (m *HasNotMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("init", "--source=.", "--name=hasNotMainGo", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasNotMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasNotMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("with source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=bare", "--sdk=go", "--source=some/subdir"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
sourceSubdirEnts, err := modGen.Directory("/work/some/subdir").Entries(ctx)
require.NoError(t, err)
require.Contains(t, sourceSubdirEnts, "main.go")
sourceRootEnts, err := modGen.Directory("/work").Entries(ctx)
require.NoError(t, err)
require.NotContains(t, sourceRootEnts, "main.go")
})
}
func TestModuleInitLICENSE(t *testing.T) {
t.Run("bootstraps Apache-2.0 LICENSE file if none found", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("creates LICENSE file in the directory specified by arg", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "./mymod"))
content, err := modGen.File("mymod/LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("does not bootstrap LICENSE file if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go"))
_, err := modGen.File("LICENSE").Contents(ctx)
require.Error(t, err)
})
t.Run("bootstraps a LICENSE file when requested, even if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "--license=MIT"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "MIT License")
})
}
func TestModuleGit(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
gitGeneratedFiles []string
gitIgnoredFiles []string
}
for _, tc := range []testCase{
{
sdk: "go",
gitGeneratedFiles: []string{
"/dagger.gen.go",
"/internal/dagger/**",
"/internal/querybuilder/**",
},
},
{
sdk: "python",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
{
sdk: "typescript",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
} {
tc := tc
t.Run(fmt.Sprintf("module %s git", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
With(daggerExec("init", "--name=bare", "--sdk="+tc.sdk))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("configures .gitattributes", func(t *testing.T) {
ignore, err := modGen.File("dagger/.gitattributes").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitGeneratedFiles {
require.Contains(t, ignore, fmt.Sprintf("%s linguist-generated\n", fileName))
}
})
if len(tc.gitIgnoredFiles) > 0 {
t.Run("configures .gitignore", func(t *testing.T) {
ignore, err := modGen.File("dagger/.gitignore").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitIgnoredFiles {
require.Contains(t, ignore, fileName)
}
})
}
})
}
}
//go:embed testdata/modules/go/minimal/main.go
var goSignatures string
func TestModuleGoSignatures(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
t.Run("func Hello() string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello"}}`, out)
})
t.Run("func Echo(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echo(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echo":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointer(*string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointerPointer(**string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointerPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointerPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoOptional(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptional(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalPointer(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalPointer}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalSlice([]string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalSlice(msg: ["hello", "there"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"hello+there...hello+there...hello+there..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalSlice}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"foobar...foobar...foobar..."}}`, out)
})
t.Run("func Echoes([]string) []string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoes(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoes":["hello...hello...hello..."]}}`, out)
})
t.Run("func EchoesVariadic(...string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoesVariadic(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoesVariadic":"hello...hello...hello..."}}`, out)
})
t.Run("func HelloContext(context.Context) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloContext}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloContext":"hello context"}}`, out)
})
t.Run("func EchoContext(context.Context, string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoContext(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoContext":"ctx.hello...ctx.hello...ctx.hello..."}}`, out)
})
t.Run("func HelloStringError() (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloStringError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloStringError":"hello i worked"}}`, out)
})
t.Run("func HelloVoid()", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoid}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoid":null}}`, out)
})
t.Run("func HelloVoidError() error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoidError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoidError":null}}`, out)
})
t.Run("func EchoOpts(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInline(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlinePointer(*struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineCtx(ctx, struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineTags(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsPragmas(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsPragmas(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsPragmas":"hi...hi...hi..."}}`, out)
})
}
func TestModuleGoSignaturesBuiltinTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("dagger/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Minimal struct {}
func (m *Minimal) Read(ctx context.Context, dir Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadPointer(ctx context.Context, dir *Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadSlice(ctx context.Context, dir []Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadVariadic(ctx context.Context, dir ...Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadOptional(
ctx context.Context,
dir *Directory, // +optional
) (string, error) {
if dir != nil {
return dir.File("foo").Contents(ctx)
}
return "", nil
}
`,
})
out, err := modGen.With(daggerQuery(`{directory{withNewFile(path: "foo", contents: "bar"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
dirID := gjson.Get(out, "directory.withNewFile.id").String()
t.Run("func Read(ctx, Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{read(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"read":"bar"}}`, out)
})
t.Run("func ReadPointer(ctx, *Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readPointer(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readPointer":"bar"}}`, out)
})
t.Run("func ReadSlice(ctx, []Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readSlice(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readSlice":"bar"}}`, out)
})
t.Run("func ReadVariadic(ctx, ...Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readVariadic(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readVariadic":"bar"}}`, out)
})
t.Run("func ReadOptional(ctx, Optional[Directory]) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readOptional(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":"bar"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{readOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":""}}`, out)
})
}
func TestModuleGoSignaturesUnexported(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) string {
return name
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
objs := inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 1, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
objs = inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 2, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
require.Equal(t, "MinimalFoo", objs.Get("1.name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {
Bar bar
}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
_, err := modGen.With(moduleIntrospection).Stderr(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "cannot code-generate unexported type bar")
}
func TestModuleGoSignaturesMixMatch(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
func (m *Minimal) Hello(name string, opts struct{}, opts2 struct{}) string {
return name
}
`,
})
_, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "nested structs are not supported")
}
func TestModuleGoSignaturesNameConflict(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {
Foo Foo
Bar Bar
Baz Baz
}
type Foo struct {}
type Bar struct {}
type Baz struct {}
func (m *Foo) Hello(name string) string {
return name
}
func (f *Bar) Hello(name string, name2 string) string {
return name + name2
}
func (b *Baz) Hello() (string, error) {
return "", nil
}
`,
})
objs := inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 4, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
require.Equal(t, "MinimalFoo", objs.Get("1.name").String())
require.Equal(t, "MinimalBar", objs.Get("2.name").String())
require.Equal(t, "MinimalBaz", objs.Get("3.name").String())
}
func TestModuleGoDocs(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
logGen(ctx, t, modGen.Directory("."))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Empty(t, hello.Get("description").String())
require.Empty(t, hello.Get("args").Array())
// test the args-based form
echoOpts := obj.Get(`functions.#(name="echoOpts")`)
require.Equal(t, "echoOpts", echoOpts.Get("name").String())
require.Equal(t, "EchoOpts does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the inline struct form
echoOpts = obj.Get(`functions.#(name="echoOptsInline")`)
require.Equal(t, "echoOptsInline", echoOpts.Get("name").String())
require.Equal(t, "EchoOptsInline does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the arg-based form (with pragmas)
echoOpts = obj.Get(`functions.#(name="echoOptsPragmas")`)
require.Equal(t, "echoOptsPragmas", echoOpts.Get("name").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "", echoOpts.Get("args.0.defaultValue").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "\"...\"", echoOpts.Get("args.1.defaultValue").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "3", echoOpts.Get("args.2.defaultValue").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
}
func TestModuleGoDocsEdgeCases(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
// Minimal is a thing
type Minimal struct {
// X is this
X, Y string // Y is not this
// +private
Z string
}
// some docs
func (m *Minimal) Hello(foo string, bar string,
// hello
baz string, qux string, x string, // lol
) string {
return foo + bar
}
func (m *Minimal) HelloMore(
// foo here
foo,
// bar here
bar string,
) string {
return foo + bar
}
func (m *Minimal) HelloMoreInline(opts struct{
// foo here
foo, bar string
}) string {
return opts.foo + opts.bar
}
func (m *Minimal) HelloAgain( // docs for helloagain
foo string,
bar string, // docs for bar
baz string,
) string {
return foo + bar
}
func (m *Minimal) HelloFinal(
foo string) string { // woops
return foo
}
`,
})
logGen(ctx, t, modGen.Directory("."))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Equal(t, "Minimal is a thing", obj.Get("description").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 5)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "hello", hello.Get("args.2.description").String())
require.Equal(t, "qux", hello.Get("args.3.name").String())
require.Equal(t, "", hello.Get("args.3.description").String())
require.Equal(t, "x", hello.Get("args.4.name").String())
require.Equal(t, "lol", hello.Get("args.4.description").String())
hello = obj.Get(`functions.#(name="helloMore")`)
require.Equal(t, "helloMore", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "bar here", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloMoreInline")`)
require.Equal(t, "helloMoreInline", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloAgain")`)
require.Equal(t, "helloAgain", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 3)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "docs for bar", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "", hello.Get("args.2.description").String())
hello = obj.Get(`functions.#(name="helloFinal")`)
require.Equal(t, "helloFinal", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 1)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Len(t, obj.Get(`fields`).Array(), 2)
prop := obj.Get(`fields.#(name="x")`)
require.Equal(t, "x", prop.Get("name").String())
require.Equal(t, "X is this", prop.Get("description").String())
prop = obj.Get(`fields.#(name="y")`)
require.Equal(t, "y", prop.Get("name").String())
require.Equal(t, "", prop.Get("description").String())
}
func TestModuleGoWeirdFields(t *testing.T) {
// these are all cases that used to panic due to the disparity in the type spec and the ast
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Z string
type Minimal struct {
// field with single (normal) name
W string
// field with multiple names
X, Y string
// field with no names
Z
}
func New() Minimal {
return Minimal{
W: "-",
X: "-",
Y: "-",
Z: Z("-"),
}
}
// struct with no fields
type Bar struct{}
func (m *Minimal) Say(
// field with single (normal) name
a string,
// field with multiple names
b, c string,
// field with no names (not included, mixed names not allowed)
// string
) string {
return a + " " + b + " " + c
}
func (m *Minimal) Hello(
// field with no names
string,
) string {
return "hello"
}
func (m *Minimal) SayOpts(opts struct{
// field with single (normal) name
A string
// field with multiple names
B, C string
// field with no names (not included because of above)
// string
}) string {
return opts.A + " " + opts.B + " " + opts.C
}
func (m *Minimal) HelloOpts(opts struct{
// field with no names
string
}) string {
return "hello"
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{w, x, y, z}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"w": "-", "x": "-", "y": "-", "z": "-"}}`, out)
for _, name := range []string{"say", "sayOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(a: "hello", b: "world", c: "!")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello world !"}}`, name), out)
}
for _, name := range []string{"hello", "helloOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(string: "")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello"}}`, name), out)
}
}
func TestModuleGoFieldMustBeNil(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "fmt"
type Minimal struct {
Src *Directory
Name *string
}
func New() *Minimal {
return &Minimal{}
}
func (m *Minimal) IsEmpty() bool {
if m.Name != nil {
panic(fmt.Sprintf("name should be nil but is %v", m.Name))
}
if m.Src != nil {
panic(fmt.Sprintf("src should be nil but is %v", m.Src))
}
return true
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{isEmpty}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"isEmpty": true}}`, out)
}
func TestModuleDescription(t *testing.T) {
t.Parallel()
type source struct {
file string
contents string
}
for _, tc := range []struct {
sdk string
sources []source
}{
{
sdk: "go",
sources: []source{
{
file: "main.go",
contents: `
// Test module, short description
//
// Long description, with full sentences.
package main
// Test object, short description
type Test struct {
// +default="foo"
Foo string
}
`,
},
},
},
{
sdk: "go",
sources: []source{
{
file: "a.go",
contents: `
// First, but not main
package main
type Foo struct {}
`,
},
{
file: "z.go",
contents: `
// Test module, short description
//
// Long description, with full sentences.
package main
// Test object, short description
type Test struct {
}
func (*Test) Foo() Foo {
return Foo{}
}
`,
},
},
},
{
sdk: "python",
sources: []source{
{
file: "src/main.py",
contents: `
"""Test module, short description
Long description, with full sentences.
"""
from dagger import field, object_type
@object_type
class Test:
"""Test object, short description"""
foo: str = field(default="foo")
`,
},
},
},
{
sdk: "python",
sources: []source{
{
file: "src/main/foo.py",
contents: `
"""Not the main file"""
from dagger import field, object_type
@object_type
class Foo:
bar: str = field(default="bar")
`,
},
{
file: "src/main/__init__.py",
contents: `
"""Test module, short description
Long description, with full sentences.
"""
from dagger import function, object_type
from .foo import Foo
@object_type
class Test:
"""Test object, short description"""
foo = function(Foo)
`,
},
},
},
{
sdk: "typescript",
sources: []source{
{
file: "src/index.ts",
contents: `
/**
* Test module, short description
*
* Long description, with full sentences.
*/
import { object, field } from '@dagger.io/dagger'
/**
* Test object, short description
*/
@object()
class Test {
@field()
foo: string = "foo"
}
`,
},
},
},
{
sdk: "typescript",
sources: []source{
{
file: "src/foo.ts",
contents: `
/**
* Not the main file
*/
import { object, field } from '@dagger.io/dagger'
@object()
export class Foo {
@field()
bar = "bar"
}
`,
},
{
file: "src/index.ts",
contents: `
/**
* Test module, short description
*
* Long description, with full sentences.
*/
import { object, field } from '@dagger.io/dagger'
import { Foo } from "./foo"
/**
* Test object, short description
*/
@object()
class Test {
@func()
foo(): Foo {
return new Foo()
}
}
`,
},
},
},
} {
tc := tc
t.Run(fmt.Sprintf("%s with %d files", tc.sdk, len(tc.sources)), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
for _, src := range tc.sources {
src := src
modGen = modGen.WithNewFile(src.file, dagger.ContainerWithNewFileOpts{
Contents: heredoc.Doc(src.contents),
})
}
mod := inspectModule(ctx, t,
modGen.With(daggerExec("init", "--source=.", "--name=test", "--sdk="+tc.sdk)))
require.Equal(t,
"Test module, short description\n\nLong description, with full sentences.",
mod.Get("description").String(),
)
require.Equal(t,
"Test object, short description",
mod.Get("objects.#.asObject|#(name=Test).description").String(),
)
})
}
}
func TestModulePrivateField(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
sdk string
source string
}{
{
sdk: "go",
source: `package main
type Minimal struct {
Foo string
Bar string // +private
}
func (m *Minimal) Set(foo string, bar string) *Minimal {
m.Foo = foo
m.Bar = bar
return m
}
func (m *Minimal) Hello() string {
return m.Foo + m.Bar
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Minimal:
foo: str = field(default="")
bar: str = ""
@function
def set(self, foo: str, bar: str) -> "Minimal":
self.foo = foo
self.bar = bar
return self
@function
def hello(self) -> str:
return self.foo + self.bar
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Minimal {
@field()
foo: string
bar?: string
constructor(foo?: string, bar?: string) {
this.foo = foo
this.bar = bar
}
@func()
set(foo: string, bar: string): Minimal {
this.foo = foo
this.bar = bar
return this
}
@func()
hello(): string {
return this.foo + this.bar
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Len(t, obj.Get(`fields`).Array(), 1)
prop := obj.Get(`fields.#(name="foo")`)
require.Equal(t, "foo", prop.Get("name").String())
out, err := modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){hello}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"hello": "abcxyz"}}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){foo}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"foo": "abc"}}}`, out)
_, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){bar}}}`)).Stdout(ctx)
require.ErrorContains(t, err, `Minimal has no such field: "bar"`)
})
}
}
// this is no longer allowed, but verify the SDK errors out
func TestModuleGoExtendCore(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=container", "--sdk=go")).
WithNewFile("internal/dagger/more.go", dagger.ContainerWithNewFileOpts{
Contents: `package dagger
import "context"
func (c *Container) Echo(ctx context.Context, msg string) (string, error) {
return c.WithExec([]string{"echo", msg}).Stdout(ctx)
}
`,
}).
With(daggerQuery(`{container{from(address:"` + alpineImage + `"){echo(msg:"echo!"){stdout}}}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "cannot define methods on objects from outside this module")
}
func TestModuleGoBadCtx(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=foo", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Foo struct {}
func (f *Foo) Echo(ctx context.Context, ctx2 context.Context) (string, error) {
return "", nil
}
`,
}).
With(daggerQuery(`{foo{echo}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "unexpected context type")
}
func TestModuleCustomTypes(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Test struct{}
func (m *Test) Repeater(msg string, times int) *Repeater {
return &Repeater{
Message: msg,
Times: times,
}
}
type Repeater struct {
Message string
Times int
}
func (t *Repeater) Render() string {
return strings.Repeat(t.Message, t.Times)
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Repeater:
message: str = field(default="")
times: int = field(default=0)
@function
def render(self) -> str:
return self.message * self.times
@function
def repeater(msg: str, times: int) -> Repeater:
return Repeater(message=msg, times=times)
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Repeater {
@field()
message: string
@field()
times: number
constructor(message: string, times: number) {
this.message = message
this.times = times
}
@func()
render(): string {
return this.message.repeat(this.times)
}
}
@object()
class Test {
@func()
repeater(msg: string, times: number): Repeater {
return new Repeater(msg, times)
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("custom %s types", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := modInit(ctx, t, c, tc.sdk, tc.source).
With(daggerQuery(`{test{repeater(msg:"echo!", times: 3){render}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"repeater":{"render":"echo!echo!echo!"}}}`, out)
})
}
}
func TestModuleReturnTypeDetection(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
}
func (m *Foo) MyFunction() X {
return X{Message: "foo"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
@function
def my_function() -> X:
return X(message="foo")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class X {
@field()
message: string
constructor(message: string) {
this.message = message;
}
}
@object()
class Foo {
@func()
myFunction(): X {
return new X("foo");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{myFunction{message}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo"}}}`, out)
})
}
}
func TestModuleReturnObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
When string ` + "`json:\"Timestamp\"`" + `
To string ` + "`json:\"recipient\"`" + `
From string
}
func (m *Foo) MyFunction() X {
return X{Message: "foo", When: "now", To: "user", From: "admin"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
when: str = field(default="", name="Timestamp")
to: str = field(default="", name="recipient")
from_: str = field(default="", name="from")
@object_type
class Foo:
@function
def my_function(self) -> X:
return X(message="foo", when="now", to="user", from_="admin")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class X {
@field()
message: string
@field()
timestamp: string
@field()
recipient: string
@field()
from: string
constructor(message: string, timestamp: string, recipient: string, from: string) {
this.message = message;
this.timestamp = timestamp;
this.recipient = recipient;
this.from = from;
}
}
@object()
class Foo {
@func()
myFunction(): X {
return new X("foo", "now", "user", "admin");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{myFunction{message, recipient, from, timestamp}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo", "recipient":"user", "from":"admin", "timestamp":"now"}}}`, out)
})
}
}
func TestModuleReturnNestedObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type Foo struct {
MsgContainer Bar
}
type Bar struct {
Msg string
}
func (m *Playground) MyFunction() Foo {
return Foo{MsgContainer: Bar{Msg: "hello world"}}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Bar:
msg: str = field()
@object_type
class Foo:
msg_container: Bar = field()
@object_type
class Playground:
@function
def my_function(self) -> Foo:
return Foo(msg_container=Bar(msg="hello world"))
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Bar {
@field()
msg: string;
constructor(msg: string) {
this.msg = msg;
}
}
@object()
class Foo {
@field()
msgContainer: Bar;
constructor(msgContainer: Bar) {
this.msgContainer = msgContainer;
}
}
@object()
class Playground {
@func()
myFunction(): Foo {
return new Foo(new Bar("hello world"));
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{myFunction{msgContainer{msg}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myFunction":{"msgContainer":{"msg": "hello world"}}}}`, out)
})
}
}
func TestModuleReturnCompositeCore(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
func (m *Playground) MySlice() []*Container {
return []*Container{dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"})}
}
type Foo struct {
Con *Container
// verify fields can remain nil w/out error too
UnsetFile *File
}
func (m *Playground) MyStruct() *Foo {
return &Foo{Con: dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"})}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class Foo:
con: dagger.Container = field()
unset_file: dagger.File | None = field(default=None)
@object_type
class Playground:
@function
def my_slice(self) -> list[dagger.Container]:
return [dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"])]
@function
def my_struct(self) -> Foo:
return Foo(con=dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"]))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, File, object, func, field } from "@dagger.io/dagger"
@object()
class Foo {
@field()
con: Container
@field()
unsetFile?: File
constructor(con: Container, usetFile?: File) {
this.con = con
this.usetFile = usetFile
}
}
@object()
class Playground {
@func()
mySlice(): Container[] {
return [
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
]
}
@func()
myStruct(): Foo {
return new Foo(
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{mySlice{stdout}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"mySlice":[{"stdout":"hello world\n"}]}}`, out)
out, err = modGen.With(daggerQuery(`{playground{myStruct{con{stdout}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myStruct":{"con":{"stdout":"hello world\n"}}}}`, out)
})
}
}
func TestModuleReturnComplexThing(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type ScanResult struct {
Containers []*Container ` + "`json:\"targets\"`" + `
Report ScanReport
}
type ScanReport struct {
Contents string ` + "`json:\"contents\"`" + `
Authors []string ` + "`json:\"Authors\"`" + `
}
func (m *Playground) Scan() ScanResult {
return ScanResult{
Containers: []*Container{
dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"}),
},
Report: ScanReport{
Contents: "hello world",
Authors: []string{"foo", "bar"},
},
}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class ScanReport:
contents: str = field()
authors: list[str] = field()
@object_type
class ScanResult:
containers: list[dagger.Container] = field(name="targets")
report: ScanReport = field()
@object_type
class Playground:
@function
def scan(self) -> ScanResult:
return ScanResult(
containers=[
dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"]),
],
report=ScanReport(
contents="hello world",
authors=["foo", "bar"],
),
)
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object()
class ScanReport {
@field()
contents: string
@field()
authors: string[]
constructor(contents: string, authors: string[]) {
this.contents = contents
this.authors = authors
}
}
@object()
class ScanResult {
@field("targets")
containers: Container[]
@field()
report: ScanReport
constructor(containers: Container[], report: ScanReport) {
this.containers = containers
this.report = report
}
}
@object()
class Playground {
@func()
async scan(): Promise<ScanResult> {
return new ScanResult(
[
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
],
new ScanReport("hello world", ["foo", "bar"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{scan{targets{stdout},report{contents,authors}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"scan":{"targets":[{"stdout":"hello world\n"}],"report":{"contents":"hello world","authors":["foo","bar"]}}}}`, out)
})
}
}
func TestModuleGlobalVarDAG(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
type Foo struct {}
var someDefault = dag.Container().From("` + alpineImage + `")
func (m *Foo) Fn(ctx context.Context) (string, error) {
return someDefault.WithExec([]string{"echo", "foo"}).Stdout(ctx)
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function, object_type
SOME_DEFAULT = dag.container().from_("` + alpineImage + `")
@object_type
class Foo:
@function
async def fn(self) -> str:
return await SOME_DEFAULT.with_exec(["echo", "foo"]).stdout()
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from "@dagger.io/dagger"
var someDefault = dag.container().from("` + alpineImage + `")
@object()
class Foo {
@func()
async fn(): Promise<string> {
return someDefault.withExec(["echo", "foo"]).stdout()
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"fn":"foo\n"}}`, out)
})
}
}
func TestModuleIDableType(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {
Data string
}
func (m *Foo) Set(data string) *Foo {
m.Data = data
return m
}
func (m *Foo) Get() string {
return m.Data
}
`,
},
{
sdk: "python",
source: `from typing import Self
from dagger import field, function, object_type
@object_type
class Foo:
data: str = ""
@function
def set(self, data: str) -> Self:
self.data = data
return self
@function
def get(self) -> str:
return self.data
`,
},
{
sdk: "typescript",
source: `
import { object, func } from "@dagger.io/dagger"
@object()
class Foo {
data: string = ""
@func()
set(data: string): Foo {
this.data = data
return this
}
@func()
get(): string {
return this.data
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
// sanity check
out, err := modGen.With(daggerQuery(`{foo{set(data: "abc"){get}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"set":{"get": "abc"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{set(data: "abc"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.set.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.set(data: "abc"): Foo!`)
out, err = modGen.With(daggerQuery(`{loadFooFromID(id: "%s"){get}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"loadFooFromID":{"get": "abc"}}`, out)
})
}
}
func TestModuleArgOwnType(t *testing.T) {
// Verify use of a module's own object as an argument type.
// The server needs to specifically decode the input type from an ID into
// the raw JSON, since the module doesn't understand it's own types as IDs
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Foo struct{}
type Message struct {
Content string
}
func (m *Foo) SayHello(name string) Message {
return Message{Content: "hello " + name}
}
func (m *Foo) Upper(msg Message) Message {
msg.Content = strings.ToUpper(msg.Content)
return msg
}
func (m *Foo) Uppers(msg []Message) []Message {
for i := range msg {
msg[i].Content = strings.ToUpper(msg[i].Content)
}
return msg
}`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Message:
content: str = field()
@object_type
class Foo:
@function
def say_hello(self, name: str) -> Message:
return Message(content=f"hello {name}")
@function
def upper(self, msg: Message) -> Message:
msg.content = msg.content.upper()
return msg
@function
def uppers(self, msg: list[Message]) -> list[Message]:
for m in msg:
m.content = m.content.upper()
return msg
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Message {
@field()
content: string
constructor(content: string) {
this.content = content
}
}
@object()
class Foo {
@func()
sayHello(name: string): Message {
return new Message("hello " + name)
}
@func()
upper(msg: Message): Message {
msg.content = msg.content.toUpperCase()
return msg
}
@func()
uppers(msg: Message[]): Message[] {
for (let i = 0; i < msg.length; i++) {
msg[i].content = msg[i].content.toUpperCase()
}
return msg
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{sayHello(name: "world"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.sayHello.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.sayHello(name: "world"): FooMessage!`)
out, err = modGen.With(daggerQuery(`{foo{upper(msg:"%s"){content}}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"upper":{"content": "HELLO WORLD"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{uppers(msg:["%s", "%s"]){content}}}`, id, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"uppers":[{"content": "HELLO WORLD"}, {"content": "HELLO WORLD"}]}}`, out)
})
}
}
func TestModuleConflictingSameNameDeps(t *testing.T) {
// A -> B -> Dint
// A -> C -> Dstr
// where Dint and Dstr are modules with the same name and same object names but conflicting types
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dstr").
With(daggerExec("init", "--source=.", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo string
}
func (m *D) Fn(foo string) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dint").
With(daggerExec("init", "--source=.", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo int
}
func (m *D) Fn(foo int) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=c", "--name=c", "--sdk=go", "c")).
WithWorkdir("/work/c").
With(daggerExec("install", "../dstr")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type C struct{}
func (m *C) Fn(ctx context.Context, foo string) (string, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=b", "--name=b", "--sdk=go", "b")).
With(daggerExec("install", "-m=b", "./dint")).
WithNewFile("/work/b/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type B struct{}
func (m *B) Fn(ctx context.Context, foo int) (int, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=a", "--name=a", "--sdk=go", "a")).
WithWorkdir("/work/a").
With(daggerExec("install", "../b")).
With(daggerExec("install", "../c")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"strconv"
)
type A struct{}
func (m *A) Fn(ctx context.Context) (string, error) {
fooStr, err := dag.C().Fn(ctx, "foo")
if err != nil {
return "", err
}
fooInt, err := dag.B().Fn(ctx, 123)
if err != nil {
return "", err
}
return fooStr + strconv.Itoa(fooInt), nil
}
`,
})
out, err := ctr.With(daggerQuery(`{a{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"a":{"fn": "foo123"}}`, out)
// verify that no types from (transitive) deps show up
types := currentSchema(ctx, t, ctr).Types
require.NotNil(t, types.Get("A"))
require.Nil(t, types.Get("B"))
require.Nil(t, types.Get("C"))
require.Nil(t, types.Get("D"))
}
func TestModuleSelfAPICall(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"github.com/Khan/genqlient/graphql"
)
type Test struct{}
func (m *Test) FnA(ctx context.Context) (string, error) {
resp := &graphql.Response{}
err := dag.Client.MakeRequest(ctx, &graphql.Request{
Query: "{test{fnB}}",
}, resp)
if err != nil {
return "", err
}
return resp.Data.(map[string]any)["test"].(map[string]any)["fnB"].(string), nil
}
func (m *Test) FnB() string {
return "hi from b"
}
`,
}).
With(daggerQuery(`{test{fnA}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fnA": "hi from b"}}`, out)
}
func TestModuleGoWithOtherModuleTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Dep struct{}
type Obj struct {
Foo string
}
func (m *Dep) Fn() Obj {
return Obj{Foo: "foo"}
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=test", "--name=test", "--sdk=go", "test")).
With(daggerExec("install", "-m=test", "./dep")).
WithWorkdir("/work/test")
t.Run("return as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() (*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() ([]*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
})
t.Run("arg as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj *DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj []*DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
})
t.Run("field as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo *DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo []*DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
})
}
func TestModuleGoUseDaggerTypesDirect(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "main/internal/dagger"
type Minimal struct{}
func (m *Minimal) Foo(dir *Directory) (*dagger.Directory) {
return dir.WithNewFile("foo", "xxx")
}
func (m *Minimal) Bar(dir *dagger.Directory) (*Directory) {
return dir.WithNewFile("bar", "yyy")
}
`,
})
out, err := modGen.With(daggerQuery(`{directory{id}}`)).Stdout(ctx)
require.NoError(t, err)
dirID := gjson.Get(out, "directory.id").String()
out, err = modGen.With(daggerQuery(`{minimal{foo(dir: "%s"){file(path: "foo"){contents}}}}`, dirID)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"foo":{"file":{"contents": "xxx"}}}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{bar(dir: "%s"){file(path: "bar"){contents}}}}`, dirID)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"bar":{"file":{"contents": "yyy"}}}}`, out)
}
func TestModuleGoUtilsPkg(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"main/utils"
)
type Minimal struct{}
func (m *Minimal) Hello(ctx context.Context) (string, error) {
return utils.Foo().File("foo").Contents(ctx)
}
`,
}).
WithNewFile("utils/util.go", dagger.ContainerWithNewFileOpts{
Contents: `package utils
import "main/internal/dagger"
func Foo() *dagger.Directory {
return dagger.Connect().Directory().WithNewFile("/foo", "hello world")
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello world"}}`, out)
}
func TestModuleGoNameCase(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c))
ctr = ctr.
WithWorkdir("/toplevel/ssh").
With(daggerExec("init", "--name=ssh", "--sdk=go", "--source=.")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Ssh struct {}
func (ssh *Ssh) SayHello() string {
return "hello!"
}
`,
})
out, err := ctr.With(daggerQuery(`{ssh{sayHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"ssh":{"sayHello":"hello!"}}`, out)
ctr = ctr.
WithWorkdir("/toplevel").
With(daggerExec("init", "--name=toplevel", "--sdk=go", "--source=.")).
With(daggerExec("install", "./ssh")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Toplevel struct {}
func (t *Toplevel) SayHello(ctx context.Context) (string, error) {
return dag.SSH().SayHello(ctx)
}
`,
})
logGen(ctx, t, ctr.Directory("."))
out, err = ctr.With(daggerQuery(`{toplevel{sayHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"toplevel":{"sayHello":"hello!"}}`, out)
}
var useInner = `package main
type Dep struct{}
func (m *Dep) Hello() string {
return "hello"
}
`
var useGoOuter = `package main
import "context"
type Use struct{}
func (m *Use) UseHello(ctx context.Context) (string, error) {
return dag.Dep().Hello(ctx)
}
`
var usePythonOuter = `from dagger import dag, function
@function
def use_hello() -> str:
return dag.dep().hello()
`
var useTSOuter = `
import { dag, object, func } from '@dagger.io/dagger'
@object()
class Use {
@func()
async useHello(): Promise<string> {
return dag.dep().hello()
}
}
`
func TestModuleUseLocal(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// cannot use transitive dependency directly
_, err = modGen.With(daggerQuery(`{dep{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, `Query has no such field: "dep"`)
})
}
}
func TestModuleCodegenOnDepChange(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
changed string
expected string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
expected: "Hellov2",
changed: strings.ReplaceAll(useGoOuter, `Hello(ctx)`, `Hellov2(ctx)`),
},
{
sdk: "python",
source: usePythonOuter,
expected: "hellov2",
changed: strings.ReplaceAll(usePythonOuter, `.hello()`, `.hellov2()`),
},
{
sdk: "typescript",
source: useTSOuter,
expected: "hellov2",
changed: strings.ReplaceAll(useTSOuter, `.hello()`, `.hellov2()`),
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// make back-incompatible change to dep
newInner := strings.ReplaceAll(useInner, `Hello()`, `Hellov2()`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("develop"))
codegenContents, err := modGen.File(sdkCodegenFile(t, tc.sdk)).Contents(ctx)
require.NoError(t, err)
require.Contains(t, codegenContents, tc.expected)
modGen = modGen.With(sdkSource(tc.sdk, tc.changed))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
})
}
}
func TestModuleSyncDeps(t *testing.T) {
// verify that changes to deps result in a develop to the depender module
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
modGen = modGen.With(daggerQuery(`{use{useHello}}`))
out, err := modGen.Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
newInner := strings.ReplaceAll(useInner, `"hello"`, `"goodbye"`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("develop"))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"goodbye"}}`, out)
})
}
}
func TestModuleUseLocalMulti(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
import "fmt"
type Use struct {}
func (m *Use) Names(ctx context.Context) ([]string, error) {
fooName, err := dag.Foo().Name(ctx)
if err != nil {
return nil, fmt.Errorf("foo.name: %w", err)
}
barName, err := dag.Bar().Name(ctx)
if err != nil {
return nil, fmt.Errorf("bar.name: %w", err)
}
return []string{fooName, barName}, nil
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function
@function
async def names() -> list[str]:
return [
await dag.foo().name(),
await dag.bar().name(),
]
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from '@dagger.io/dagger'
@object()
class Use {
@func()
async names(): Promise<string[]> {
return [await dag.foo().name(), await dag.bar().name()]
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/foo").
WithNewFile("/work/foo/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Foo struct {}
func (m *Foo) Name() string { return "foo" }
`,
}).
With(daggerExec("init", "--source=.", "--name=foo", "--sdk=go")).
WithWorkdir("/work/bar").
WithNewFile("/work/bar/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Bar struct {}
func (m *Bar) Name() string { return "bar" }
`,
}).
With(daggerExec("init", "--source=.", "--name=bar", "--sdk=go")).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(daggerExec("install", "./foo")).
With(daggerExec("install", "./bar")).
With(sdkSource(tc.sdk, tc.source)).
WithEnvVariable("BUST", identity.NewID()) // NB(vito): hmm...
out, err := modGen.With(daggerQuery(`{use{names}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"names":["foo", "bar"]}}`, out)
})
}
}
func TestModuleConstructor(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("basic", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(
ctx context.Context,
foo string,
bar *int, // +optional
baz []string,
dir *Directory,
) *Test {
bar2 := 42
if bar != nil {
bar2 = *bar
}
return &Test{
Foo: foo,
Bar: bar2,
Baz: baz,
Dir: dir,
}
}
type Test struct {
Foo string
Bar int
Baz []string
Dir *Directory
NeverSetDir *Directory
}
func (m *Test) GimmeFoo() string {
return m.Foo
}
func (m *Test) GimmeBar() int {
return m.Bar
}
func (m *Test) GimmeBaz() []string {
return m.Baz
}
func (m *Test) GimmeDirEnts(ctx context.Context) ([]string, error) {
return m.Dir.Entries(ctx)
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import field, function, object_type
@object_type
class Test:
foo: str = field()
dir: dagger.Directory = field()
bar: int = field(default=42)
baz: list[str] = field(default=list)
never_set_dir: dagger.Directory | None = field(default=None)
@function
def gimme_foo(self) -> str:
return self.foo
@function
def gimme_bar(self) -> int:
return self.bar
@function
def gimme_baz(self) -> list[str]:
return self.baz
@function
async def gimme_dir_ents(self) -> list[str]:
return await self.dir.entries()
`,
},
{
sdk: "typescript",
source: `
import { Directory, object, func, field } from '@dagger.io/dagger';
@object()
class Test {
@field()
foo: string
@field()
dir: Directory
@field()
bar: number
@field()
baz: string[]
@field()
neverSetDir?: Directory
constructor(foo: string, dir: Directory, bar = 42, baz: string[] = []) {
this.foo = foo;
this.dir = dir;
this.bar = bar;
this.baz = baz;
}
@func()
gimmeFoo(): string {
return this.foo;
}
@func()
gimmeBar(): number {
return this.bar;
}
@func()
gimmeBaz(): string[] {
return this.baz;
}
@func()
async gimmeDirEnts(): Promise<string[]> {
return this.dir.entries();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := modInit(ctx, t, c, tc.sdk, tc.source)
out, err := ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-dir-ents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, strings.TrimSpace(out), "dagger.json")
})
}
})
t.Run("fields only", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(ctx context.Context) (Test, error) {
v, err := dag.Container().From("alpine:3.18.4").File("/etc/alpine-release").Contents(ctx)
if err != nil {
return Test{}, err
}
return Test{
AlpineVersion: v,
}, nil
}
type Test struct {
AlpineVersion string
}
`,
},
{
sdk: "python",
source: `from dagger import dag, field, function, object_type
@object_type
class Test:
alpine_version: str = field()
@classmethod
async def create(cls) -> "Test":
return cls(alpine_version=await (
dag.container()
.from_("alpine:3.18.4")
.file("/etc/alpine-release")
.contents()
))
`,
},
{
sdk: "typescript",
source: `
import { dag, object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
alpineVersion: string
// NOTE: this is not standard to do async operations in the constructor.
// This is only for testing purpose but it shouldn't be done in real usage.
constructor() {
return (async () => {
this.alpineVersion = await dag.container().from("alpine:3.18.4").file("/etc/alpine-release").contents()
return this; // Return the newly-created instance
})();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := ctr.With(daggerCall("alpine-version")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "3.18.4")
})
}
})
t.Run("return error", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"fmt"
)
func New() (*Test, error) {
return nil, fmt.Errorf("too bad")
}
type Test struct {
Foo string
}
`,
},
{
sdk: "python",
source: `from dagger import object_type, field
@object_type
class Test:
foo: str = field()
def __init__(self):
raise ValueError("too bad")
`,
},
{
sdk: "typescript",
source: `
import { object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
foo: string
constructor() {
throw new Error("too bad")
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
_, err := ctr.With(daggerCall("foo")).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "too bad")
})
}
})
t.Run("python: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=python")).
With(sdkSource("python", fmt.Sprintf(`import dagger
from dagger import dag, object_type, field
@object_type
class Test:
foo: dagger.File = field(default=lambda: (
dag.directory()
.with_new_file("foo.txt", contents="%s")
.file("foo.txt")
))
bar: list[str] = field(default=list)
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "python"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
t.Run("typescript: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=typescript")).
With(sdkSource("typescript", fmt.Sprintf(`
import { dag, File, object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
foo: File = dag.directory().withNewFile("foo.txt", "%s").file("foo.txt")
@field()
bar: string[] = []
// Allow foo to be set through the constructor
constructor(foo?: File) {
if (foo) {
this.foo = foo
}
}
}
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "typescript"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
}
func TestModuleWrapping(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Wrapper struct{}
func (m *Wrapper) Container() *WrappedContainer {
return &WrappedContainer{
dag.Container().From("` + alpineImage + `"),
}
}
type WrappedContainer struct {
Unwrap *Container` + "`" + `json:"unwrap"` + "`" + `
}
func (c *WrappedContainer) Echo(msg string) *WrappedContainer {
return &WrappedContainer{
c.Unwrap.WithExec([]string{"echo", "-n", msg}),
}
}
`,
},
{
sdk: "python",
source: `from typing import Self
import dagger
from dagger import dag, field, function, object_type
@object_type
class WrappedContainer:
unwrap: dagger.Container = field()
@function
def echo(self, msg: str) -> Self:
return WrappedContainer(unwrap=self.unwrap.with_exec(["echo", "-n", msg]))
@object_type
class Wrapper:
@function
def container(self) -> WrappedContainer:
return WrappedContainer(unwrap=dag.container().from_("` + alpineImage + `"))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object()
class WrappedContainer {
@field()
unwrap: Container
constructor(unwrap: Container) {
this.unwrap = unwrap
}
@func()
echo(msg: string): WrappedContainer {
return new WrappedContainer(this.unwrap.withExec(["echo", "-n", msg]))
}
}
@object()
class Wrapper {
@func()
container(): WrappedContainer {
return new WrappedContainer(dag.container().from("` + alpineImage + `"))
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=wrapper", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
id := identity.NewID()
out, err := modGen.With(daggerQuery(
fmt.Sprintf(`{wrapper{container{echo(msg:%q){unwrap{stdout}}}}}`, id),
)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t,
fmt.Sprintf(`{"wrapper":{"container":{"echo":{"unwrap":{"stdout":%q}}}}}`, id),
out)
})
}
}
func TestModuleLotsOfFunctions(t *testing.T) {
t.Parallel()
const funcCount = 100
t.Run("go sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
package main
type PotatoSack struct {}
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
func (m *PotatoSack) Potato%d() string {
return "potato #%d"
}
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("init", "--source=.", "--name=potatoSack", "--sdk=go"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("python sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `from dagger import function
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@function
def potato_%d() -> str:
return "potato #%d"
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("./src/main.py", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("init", "--source=.", "--name=potatoSack", "--sdk=python"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("typescript sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
import { object, func } from "@dagger.io/dagger"
@object()
class PotatoSack {
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@func()
potato_%d(): string {
return "potato #%d"
}
`, i, i)
}
mainSrc += "\n}"
modGen := c.
Container().
From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(sdkSource("typescript", mainSrc)).
With(daggerExec("init", "--name=potatoSack", "--sdk=typescript"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
}
func TestModuleLotsOfDeps(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
modCount := 0
getModMainSrc := func(name string, depNames []string) string {
t.Helper()
mainSrc := fmt.Sprintf(`package main
import "context"
type %s struct {}
func (m *%s) Fn(ctx context.Context) (string, error) {
s := "%s"
var depS string
_ = depS
var err error
_ = err
`, strcase.ToCamel(name), strcase.ToCamel(name), name)
for _, depName := range depNames {
mainSrc += fmt.Sprintf(`
depS, err = dag.%s().Fn(ctx)
if err != nil {
return "", err
}
s += depS
`, strcase.ToCamel(depName))
}
mainSrc += "return s, nil\n}\n"
fmted, err := format.Source([]byte(mainSrc))
require.NoError(t, err)
return string(fmted)
}
// need to construct dagger.json directly in order to avoid excessive
// `dagger mod use` calls while constructing the huge DAG of deps
var rootCfg modules.ModuleConfig
addModulesWithDeps := func(newMods int, depNames []string) []string {
t.Helper()
var newModNames []string
for i := 0; i < newMods; i++ {
name := fmt.Sprintf("mod%d", modCount)
modCount++
newModNames = append(newModNames, name)
modGen = modGen.
WithWorkdir("/work/"+name).
WithNewFile("./main.go", dagger.ContainerWithNewFileOpts{
Contents: getModMainSrc(name, depNames),
})
var depCfgs []*modules.ModuleConfigDependency
for _, depName := range depNames {
depCfgs = append(depCfgs, &modules.ModuleConfigDependency{
Name: depName,
Source: filepath.Join("..", depName),
})
}
modGen = modGen.With(configFile(".", &modules.ModuleConfig{
Name: name,
SDK: "go",
Dependencies: depCfgs,
}))
}
return newModNames
}
// Create a base module, then add 6 layers of deps, where each layer has one more module
// than the previous layer and each module within the layer has a dep on each module
// from the previous layer. Finally add a single module at the top that depends on all
// modules from the last layer and call that.
// Basically, this creates a quadratically growing DAG of modules and verifies we
// handle it efficiently enough to be callable.
curDeps := addModulesWithDeps(1, nil)
for i := 0; i < 6; i++ {
curDeps = addModulesWithDeps(len(curDeps)+1, curDeps)
}
addModulesWithDeps(1, curDeps)
modGen = modGen.With(configFile("..", &rootCfg))
_, err := modGen.With(daggerCall("fn")).Sync(ctx)
require.NoError(t, err)
}
func TestModuleNamespacing(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
moduleSrcPath, err := filepath.Abs("./testdata/modules/go/namespacing")
require.NoError(t, err)
ctr := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithMountedDirectory("/work", c.Host().Directory(moduleSrcPath)).
WithWorkdir("/work")
out, err := ctr.
With(daggerQuery(`{test{fn(s:"yo")}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fn":["*dagger.Sub1Obj made 1:yo", "*dagger.Sub2Obj made 2:yo"]}}`, out)
}
func TestModuleLoops(t *testing.T) {
// verify circular module dependencies result in an error
t.Parallel()
c, ctx := connect(t)
_, err := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
With(daggerExec("init", "--name=depA", "--sdk=go", "depA")).
With(daggerExec("init", "--name=depB", "--sdk=go", "depB")).
With(daggerExec("init", "--name=depC", "--sdk=go", "depC")).
With(daggerExec("install", "-m=depC", "./depB")).
With(daggerExec("install", "-m=depB", "./depA")).
With(daggerExec("install", "-m=depA", "./depC")).
Sync(ctx)
require.ErrorContains(t, err, `local module at "/work/depA" has a circular dependency`)
}
//go:embed testdata/modules/go/id/arg/main.go
var badIDArgGoSrc string
//go:embed testdata/modules/python/id/arg/main.py
var badIDArgPySrc string
//go:embed testdata/modules/typescript/id/arg/index.ts
var badIDArgTSSrc string
//go:embed testdata/modules/go/id/field/main.go
var badIDFieldGoSrc string
//go:embed testdata/modules/typescript/id/field/index.ts
var badIDFieldTSSrc string
//go:embed testdata/modules/go/id/fn/main.go
var badIDFnGoSrc string
//go:embed testdata/modules/python/id/fn/main.py
var badIDFnPySrc string
//go:embed testdata/modules/typescript/id/fn/index.ts
var badIDFnTSSrc string
func TestModuleReservedWords(t *testing.T) {
// verify disallowed names are rejected
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("id", func(t *testing.T) {
t.Parallel()
t.Run("arg", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDArgGoSrc,
},
{
sdk: "python",
source: badIDArgPySrc,
},
{
sdk: "typescript",
source: badIDArgTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := modInit(ctx, t, c, tc.sdk, tc.source).
With(daggerQuery(`{test{fn(id:"no")}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define argument with reserved name \"id\"")
})
}
})
t.Run("field", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFieldGoSrc,
},
{
sdk: "typescript",
source: badIDFieldTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{fn{id}}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define field with reserved name \"id\"")
})
}
})
t.Run("fn", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFnGoSrc,
},
{
sdk: "python",
source: badIDFnPySrc,
},
{
sdk: "typescript",
source: badIDFnTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{id}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define function with reserved name \"id\"")
})
}
})
})
}
func TestModuleExecError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=playground", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
import (
"context"
"errors"
)
type Playground struct{}
func (p *Playground) DoThing(ctx context.Context) error {
_, err := dag.Container().From("` + alpineImage + `").WithExec([]string{"sh", "-c", "exit 5"}).Sync(ctx)
var e *ExecError
if errors.As(err, &e) {
if e.ExitCode == 5 {
return nil
}
}
panic("yikes")
}
`})
_, err := modGen.
With(daggerQuery(`{playground{doThing}}`)).
Stdout(ctx)
require.NoError(t, err)
}
func TestModuleCurrentModuleAPI(t *testing.T) {
t.Parallel()
t.Run("name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=WaCkY", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type WaCkY struct {}
func (m *WaCkY) Fn(ctx context.Context) (string, error) {
return dag.CurrentModule().Name(ctx)
}
`,
}).
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "WaCkY", strings.TrimSpace(out))
})
t.Run("source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/subdir/coolfile.txt", dagger.ContainerWithNewFileOpts{
Contents: "nice",
}).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) *File {
return dag.CurrentModule().Source().File("subdir/coolfile.txt")
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("workdir", func(t *testing.T) {
t.Parallel()
t.Run("dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*Directory, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().Workdir("subdir/moresubdir"), nil
}
`,
}).
With(daggerCall("fn", "file", "--path=coolfile.txt", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("file", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*File, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().WorkdirFile("subdir/moresubdir/coolfile.txt"), nil
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("error on escape", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
func New() (*Test, error) {
if err := os.WriteFile("/rootfile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
if err := os.MkdirAll("/foo", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("/foo/foofile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
return &Test{}, nil
}
type Test struct {}
func (m *Test) EscapeFile(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("../rootfile.txt")
}
func (m *Test) EscapeFileAbs(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("/rootfile.txt")
}
func (m *Test) EscapeDir(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("../foo")
}
func (m *Test) EscapeDirAbs(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("/foo")
}
`,
})
_, err := ctr.
With(daggerCall("escape-file", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-file-abs", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../foo" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir-abs", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/foo" escapes workdir`)
})
})
}
func TestModuleCustomSDK(t *testing.T) {
t.Parallel()
t.Run("local", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/coolsdk").
With(daggerExec("init", "--source=.", "--name=cool-sdk", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type CoolSdk struct {}
func (m *CoolSdk) ModuleRuntime(modSource *ModuleSource, introspectionJson string) *Container {
return modSource.WithSDK("go").AsModule().Runtime().WithEnvVariable("COOL", "true")
}
func (m *CoolSdk) Codegen(modSource *ModuleSource, introspectionJson string) *GeneratedCode {
return dag.GeneratedCode(modSource.WithSDK("go").AsModule().GeneratedContextDirectory())
}
func (m *CoolSdk) RequiredPaths() []string {
return []string{
"**/go.mod",
"**/go.sum",
"**/go.work",
"**/go.work.sum",
"**/vendor/",
"**/*.go",
}
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=coolsdk")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "os"
type Test struct {}
func (m *Test) Fn() string {
return os.Getenv("COOL")
}
`,
})
out, err := ctr.
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "true", strings.TrimSpace(out))
})
t.Run("git", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk="+testGitModuleRef("cool-sdk"))).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "os"
type Test struct {}
func (m *Test) Fn() string {
return os.Getenv("COOL")
}
`,
})
out, err := ctr.
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "true", strings.TrimSpace(out))
})
}
// TestModuleHostError verifies the host api is not exposed to modules
func TestModuleHostError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) *Directory {
return dag.Host().Directory(".")
}
`,
}).
With(daggerCall("fn")).
Sync(ctx)
require.ErrorContains(t, err, "dag.Host undefined")
}
func daggerExec(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerQuery(query string, args ...any) dagger.WithContainerFunc {
return daggerQueryAt("", query, args...)
}
func daggerQueryAt(modPath string, query string, args ...any) dagger.WithContainerFunc {
query = fmt.Sprintf(query, args...)
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "query"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(execArgs, dagger.ContainerWithExecOpts{
Stdin: query,
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerCall(args ...string) dagger.WithContainerFunc {
return daggerCallAt("", args...)
}
func daggerCallAt(modPath string, args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "call"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(append(execArgs, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerFunctions(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug", "functions"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func configFile(dirPath string, cfg *modules.ModuleConfig) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
cfgPath := filepath.Join(dirPath, "dagger.json")
cfgBytes, err := json.Marshal(cfg)
if err != nil {
panic(err)
}
return c.WithNewFile(cfgPath, dagger.ContainerWithNewFileOpts{
Contents: string(cfgBytes),
})
}
}
// command for a dagger cli call direct on the host
func hostDaggerCommand(ctx context.Context, t testing.TB, workdir string, args ...string) *exec.Cmd {
t.Helper()
cmd := exec.CommandContext(ctx, daggerCliPath(t), args...)
cmd.Dir = workdir
return cmd
}
// runs a dagger cli command directly on the host, rather than in an exec
func hostDaggerExec(ctx context.Context, t testing.TB, workdir string, args ...string) ([]byte, error) {
t.Helper()
cmd := hostDaggerCommand(ctx, t, workdir, args...)
output, err := cmd.CombinedOutput()
if err != nil {
err = fmt.Errorf("%s: %w", string(output), err)
}
return output, err
}
func sdkSource(sdk, contents string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
sourcePath := sdkSourceFile(sdk)
if sourcePath == "" {
return c
}
return c.WithNewFile(sourcePath, dagger.ContainerWithNewFileOpts{
Contents: heredoc.Doc(contents),
})
}
}
func sdkSourceFile(sdk string) string {
switch sdk {
case "go":
return "dagger/main.go"
case "python":
return "dagger/src/main.py"
case "typescript":
return "dagger/src/index.ts"
default:
return ""
}
}
func sdkCodegenFile(t *testing.T, sdk string) string {
t.Helper()
switch sdk {
case "go":
// FIXME: go codegen is split up into dagger/dagger.gen.go and
// dagger/internal/dagger/dagger.gen.go
return "dagger/internal/dagger/dagger.gen.go"
case "python":
return "dagger/sdk/src/dagger/client/gen.py"
case "typescript":
return "dagger/sdk/api/client.gen.ts"
default:
return ""
}
}
func modInit(ctx context.Context, t *testing.T, c *dagger.Client, sdk, contents string) *dagger.Container {
t.Helper()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+sdk)).
With(sdkSource(sdk, contents))
return modGen
}
func currentSchema(ctx context.Context, t *testing.T, ctr *dagger.Container) *introspection.Schema {
t.Helper()
out, err := ctr.With(daggerQuery(introspection.Query)).Stdout(ctx)
require.NoError(t, err)
var schemaResp introspection.Response
err = json.Unmarshal([]byte(out), &schemaResp)
require.NoError(t, err)
return schemaResp.Schema
}
var moduleIntrospection = daggerQuery(`
query { host { directory(path: ".") { asModule { initialize {
description
objects {
asObject {
name
description
constructor {
description
args {
name
description
defaultValue
}
}
functions {
name
description
args {
name
description
defaultValue
}
}
fields {
name
description
}
}
}
} } } } }
`)
func inspectModule(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
t.Helper()
out, err := ctr.With(moduleIntrospection).Stdout(ctx)
require.NoError(t, err)
result := gjson.Get(out, "host.directory.asModule.initialize")
t.Logf("module introspection:\n%v", result.Raw)
return result
}
func inspectModuleObjects(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
t.Helper()
return inspectModule(ctx, t, ctr).Get("objects.#.asObject")
}
func goGitBase(t *testing.T, c *dagger.Client) *dagger.Container {
t.Helper()
return c.Container().From(golangImage).
WithExec([]string{"apk", "add", "git"}).
WithExec([]string{"git", "config", "--global", "user.email", "dagger@example.com"}).
WithExec([]string{"git", "config", "--global", "user.name", "Dagger Tests"}).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"})
}
func logGen(ctx context.Context, t *testing.T, modSrc *dagger.Directory) {
t.Helper()
generated, err := modSrc.File("dagger.gen.go").Contents(ctx)
require.NoError(t, err)
t.Cleanup(func() {
t.Name()
fileName := filepath.Join(
os.TempDir(),
t.Name(),
fmt.Sprintf("dagger.gen.%d.go", time.Now().Unix()),
)
if err := os.MkdirAll(filepath.Dir(fileName), 0o755); err != nil {
t.Logf("failed to create temp dir for generated code: %v", err)
return
}
if err := os.WriteFile(fileName, []byte(generated), 0644); err != nil {
t.Logf("failed to write generated code to %s: %v", fileName, err)
} else {
t.Logf("wrote generated code to %s", fileName)
}
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,640 | 🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9 | ### What is the issue?
There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with:
```
Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync
```
If you run this command inside a module it also fails with the same error:
```
$ dagger mod init --name test --sdk go
$ dagger listen --disable-host-read-write
├ [0.01s] loading module
✘ directory ERROR [0.01s]
▶ directory ▶ host.directory /home/matipan/bin/test
✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s]
├ [0.00s] transferring /home/matipan/bin/test:
• Engine: 6241366fb45d (version v0.9.7)
⧗ 1.97s ✔ 6 ✘ 3
Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled
input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled
```
### Dagger version
dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64
### Steps to reproduce
```
$ dagger listen --progress plain --disable-host-read-write
```
### Log output
```
Connected to engine 5c478db0e017 (version v0.9.9)
Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync
``` | https://github.com/dagger/dagger/issues/6640 | https://github.com/dagger/dagger/pull/6732 | b966257dbc24b714e6ee39f01158f10f8fa24fd3 | ca447cd4d7ca6d25e62008d3e1f87100111709df | "2024-02-09T14:29:11Z" | go | "2024-02-26T17:12:49Z" | cmd/dagger/module.go | package main
import (
"context"
"encoding/json"
"fmt"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"dagger.io/dagger"
"github.com/dagger/dagger/analytics"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/dagql/idtui"
"github.com/dagger/dagger/engine/client"
"github.com/go-git/go-git/v5"
"github.com/iancoleman/strcase"
"github.com/juju/ansiterm/tabwriter"
"github.com/moby/buildkit/util/gitutil"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/vito/progrock"
)
var (
moduleGroup = &cobra.Group{
ID: "module",
Title: "Dagger Module Commands (Experimental)",
}
moduleURL string
moduleFlags = pflag.NewFlagSet("module", pflag.ContinueOnError)
sdk string
licenseID string
moduleName string
moduleSourcePath string
installName string
developSDK string
developSourcePath string
force bool
)
const (
moduleURLDefault = "."
defaultModuleSourceDirName = "dagger"
)
func init() {
moduleFlags.StringVarP(&moduleURL, "mod", "m", "", "Path to dagger.json config file for the module or a directory containing that file. Either local path (e.g. \"/path/to/some/dir\") or a github repo (e.g. \"github.com/dagger/dagger/path/to/some/subdir\")")
moduleFlags.BoolVar(&focus, "focus", true, "Only show output for focused commands")
listenCmd.PersistentFlags().AddFlagSet(moduleFlags)
queryCmd.PersistentFlags().AddFlagSet(moduleFlags)
funcCmds.AddFlagSet(moduleFlags)
moduleInitCmd.Flags().StringVar(&sdk, "sdk", "", "Optionally initialize module for development in the given SDK")
moduleInitCmd.Flags().StringVar(&moduleName, "name", "", "Name of the new module (defaults to parent directory name)")
moduleInitCmd.Flags().StringVar(&moduleSourcePath, "source", "", "Directory to store the module implementation source code in (defaults to \"dagger/ if \"--sdk\" is provided)")
moduleInitCmd.Flags().StringVar(&licenseID, "license", "", "License identifier to generate - see https://spdx.org/licenses/")
modulePublishCmd.Flags().BoolVarP(&force, "force", "f", false, "Force publish even if the git repository is not clean")
modulePublishCmd.Flags().AddFlagSet(moduleFlags)
moduleInstallCmd.Flags().StringVarP(&installName, "name", "n", "", "Name to use for the dependency in the module. Defaults to the name of the module being installed.")
moduleInstallCmd.Flags().AddFlagSet(moduleFlags)
moduleDevelopCmd.Flags().StringVar(&developSDK, "sdk", "", "New SDK for the module")
moduleDevelopCmd.Flags().StringVar(&developSourcePath, "source", "", "Directory to store the module implementation source code in")
moduleDevelopCmd.PersistentFlags().AddFlagSet(moduleFlags)
configCmd.PersistentFlags().AddFlagSet(moduleFlags)
configCmd.AddCommand(oldInitCmd, oldInstallCmd, oldSyncCmd)
configCmd.AddGroup(moduleGroup)
}
var oldInitCmd = &cobra.Command{
Use: "init",
Short: "Initialize a new Dagger module",
Hidden: true,
SilenceUsage: true,
DisableFlagParsing: true,
Args: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf(`"dagger mod init" has been replaced by "dagger init"`)
},
Run: func(cmd *cobra.Command, args []string) {
// do nothing
},
}
var oldInstallCmd = &cobra.Command{
Use: "install",
Short: "Add a new dependency to a Dagger module",
Hidden: true,
SilenceUsage: true,
DisableFlagParsing: true,
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
Args: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf(`"dagger mod install" has been replaced by "dagger install"`)
},
Run: func(cmd *cobra.Command, args []string) {
// do nothing
},
}
var oldSyncCmd = &cobra.Command{
Use: "sync",
Short: "Setup or update all the resources needed to develop on a module locally",
Hidden: true,
SilenceUsage: true,
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
DisableFlagParsing: true,
Args: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf(`"dagger mod sync" has been replaced by "dagger develop"`)
},
Run: func(cmd *cobra.Command, args []string) {
// do nothing
},
}
var configCmd = &cobra.Command{
Use: "config",
Aliases: []string{"mod"},
Short: "Get or set the configuration of a Dagger module",
Long: "Get or set the configuration of a Dagger module. By default, print the configuration of the specified module.",
Example: strings.TrimSpace(`
dagger config -m /path/to/some/dir
dagger config -m github.com/dagger/hello-dagger
`,
),
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
cmd.SetContext(ctx)
vtx := progrock.FromContext(ctx).Vertex(idtui.PrimaryVertex, cmd.CommandPath())
defer func() { vtx.Done(err) }()
setCmdOutput(cmd, vtx)
modConf, err := getDefaultModuleConfiguration(ctx, engineClient.Dagger(), true)
if err != nil {
return fmt.Errorf("failed to load module: %w", err)
}
if !modConf.FullyInitialized() {
return fmt.Errorf("module must be fully initialized")
}
mod := modConf.Source.AsModule()
name, err := mod.Name(ctx)
if err != nil {
return fmt.Errorf("failed to get module name: %w", err)
}
sdk, err := mod.SDK(ctx)
if err != nil {
return fmt.Errorf("failed to get module SDK: %w", err)
}
tw := tabwriter.NewWriter(cmd.OutOrStdout(), 0, 0, 3, ' ', tabwriter.DiscardEmptyColumns)
fmt.Fprintf(tw, "%s\t%s\n",
"Name:",
name,
)
fmt.Fprintf(tw, "%s\t%s\n",
"SDK:",
sdk,
)
fmt.Fprintf(tw, "%s\t%s\n",
"Root Directory:",
modConf.LocalContextPath,
)
fmt.Fprintf(tw, "%s\t%s\n",
"Source Directory:",
modConf.LocalRootSourcePath,
)
return tw.Flush()
})
},
}
var moduleInitCmd = &cobra.Command{
Use: "init [flags] [PATH]",
Short: "Initialize a new Dagger module",
Long: `Initialize a new Dagger module in a local directory.
By default, create a new dagger.json configuration in the current working directory. If the positional argument PATH is provided, create the module in that directory instead.
The configuration will default the name of the module to the parent directory name, unless specified with --name.
Any module can be installed to via "dagger install".
A module can only be called once it has been initialized with an SDK though. The "--sdk" flag can be provided to init here, but if it's not the configuration can be updated later via "dagger develop".
The "--source" flag allows controlling the directory in which the actual module source code is stored. By default, it will be stored in a directory named "dagger".
`,
Example: "dagger init --name=hello --sdk=python --source=some/subdir",
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
dag := engineClient.Dagger()
vtx := progrock.FromContext(ctx).Vertex(idtui.PrimaryVertex, cmd.CommandPath())
defer func() { vtx.Done(err) }()
setCmdOutput(cmd, vtx)
// default the module source root to the current working directory if it doesn't exist yet
cwd, err := os.Getwd()
if err != nil {
return fmt.Errorf("failed to get current working directory: %w", err)
}
srcRootPath := cwd
if len(extraArgs) > 0 {
srcRootPath = extraArgs[0]
}
if filepath.IsAbs(srcRootPath) {
srcRootPath, err = filepath.Rel(cwd, srcRootPath)
if err != nil {
return fmt.Errorf("failed to get relative path: %w", err)
}
}
modConf, err := getModuleConfigurationForSourceRef(ctx, dag, srcRootPath, false)
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
if modConf.SourceKind != dagger.LocalSource {
return fmt.Errorf("module must be local")
}
if modConf.ModuleSourceConfigExists {
return fmt.Errorf("module already exists")
}
// default module name to directory of source root
if moduleName == "" {
moduleName = filepath.Base(modConf.LocalRootSourcePath)
}
// only bother setting source path if there's an sdk at this time
if sdk != "" {
if moduleSourcePath == "" {
moduleSourcePath = filepath.Join(modConf.LocalRootSourcePath, defaultModuleSourceDirName)
}
// ensure source path is relative to the source root
sourceAbsPath, err := filepath.Abs(moduleSourcePath)
if err != nil {
return fmt.Errorf("failed to get absolute source path for %s: %w", moduleSourcePath, err)
}
moduleSourcePath, err = filepath.Rel(modConf.LocalRootSourcePath, sourceAbsPath)
if err != nil {
return fmt.Errorf("failed to get relative source path: %w", err)
}
}
_, err = modConf.Source.
WithName(moduleName).
WithSDK(sdk).
WithSourceSubpath(moduleSourcePath).
ResolveFromCaller().
AsModule().
GeneratedContextDiff().
Export(ctx, modConf.LocalContextPath)
if err != nil {
return fmt.Errorf("failed to generate code: %w", err)
}
if err := findOrCreateLicense(ctx, modConf.LocalRootSourcePath); err != nil {
return err
}
fmt.Fprintln(cmd.OutOrStdout(), "Initialized module", moduleName, "in", srcRootPath)
return nil
})
},
}
var moduleInstallCmd = &cobra.Command{
Use: "install [flags] MODULE",
Aliases: []string{"use"},
Short: "Add a new dependency to a Dagger module",
Long: "Add a Dagger module as a dependency of a local module.",
// TODO: use example from a reference module, using a tag instead of commit
Example: "dagger install github.com/shykes/daggerverse/ttlsh@16e40ec244966e55e36a13cb6e1ff8023e1e1473",
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
dag := engineClient.Dagger()
modConf, err := getDefaultModuleConfiguration(ctx, dag, false)
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
if modConf.SourceKind != dagger.LocalSource {
return fmt.Errorf("module must be local")
}
if !modConf.FullyInitialized() {
return fmt.Errorf("module must be fully initialized")
}
depRefStr := extraArgs[0]
depSrc := dag.ModuleSource(depRefStr)
depSrcKind, err := depSrc.Kind(ctx)
if err != nil {
return fmt.Errorf("failed to get module ref kind: %w", err)
}
if depSrcKind == dagger.LocalSource {
// need to ensure that local dep paths are relative to the parent root source
depAbsPath, err := filepath.Abs(depRefStr)
if err != nil {
return fmt.Errorf("failed to get dep absolute path for %s: %w", depRefStr, err)
}
depRelPath, err := filepath.Rel(modConf.LocalRootSourcePath, depAbsPath)
if err != nil {
return fmt.Errorf("failed to get dep relative path: %w", err)
}
depSrc = dag.ModuleSource(depRelPath)
}
dep := dag.ModuleDependency(depSrc, dagger.ModuleDependencyOpts{
Name: installName,
})
modSrc := modConf.Source.
WithDependencies([]*dagger.ModuleDependency{dep}).
ResolveFromCaller()
_, err = modSrc.
AsModule().
GeneratedContextDiff().
Export(ctx, modConf.LocalContextPath)
if err != nil {
return fmt.Errorf("failed to generate code: %w", err)
}
depSrc = modSrc.ResolveDependency(depSrc)
name, err := depSrc.ModuleName(ctx)
if err != nil {
return err
}
sdk, err := depSrc.AsModule().SDK(ctx)
if err != nil {
return err
}
depRootSubpath, err := depSrc.SourceRootSubpath(ctx)
if err != nil {
return err
}
if depSrcKind == dagger.GitSource {
git := depSrc.AsGitSource()
gitURL, err := git.CloneURL(ctx)
if err != nil {
return err
}
gitVersion, err := git.Version(ctx)
if err != nil {
return err
}
gitCommit, err := git.Commit(ctx)
if err != nil {
return err
}
analytics.Ctx(ctx).Capture(ctx, "module_install", map[string]string{
"module_name": name,
"install_name": installName,
"module_sdk": sdk,
"source_kind": "git",
"git_symbolic": filepath.Join(gitURL, depRootSubpath),
"git_clone_url": gitURL,
"git_subpath": depRootSubpath,
"git_version": gitVersion,
"git_commit": gitCommit,
})
} else if depSrcKind == dagger.LocalSource {
analytics.Ctx(ctx).Capture(ctx, "module_install", map[string]string{
"module_name": name,
"install_name": installName,
"module_sdk": sdk,
"source_kind": "local",
"local_subpath": depRootSubpath,
})
}
return nil
})
},
}
var moduleDevelopCmd = &cobra.Command{
Use: "develop",
Short: "Setup or update all the resources needed to develop on a module locally",
Long: `Setup or update all the resources needed to develop on a module locally.
This command re-regerates the module's generated code based on dependencies
and the current state of the module's source code.
If --sdk is set, the config file and generated code will be updated with those values reflected. It currently can only be used to set the SDK of a module that does not have one already.
--source allows controlling the directory in which the actual module source code is stored. By default, it will be stored in a directory named "dagger".
:::note
If not updating source or SDK, this is only required for IDE auto-completion/LSP purposes.
:::
`,
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
dag := engineClient.Dagger()
modConf, err := getDefaultModuleConfiguration(ctx, dag, false)
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
if modConf.SourceKind != dagger.LocalSource {
return fmt.Errorf("module must be local")
}
src := modConf.Source
// use this one to read sdk/source path since they require the host filesystem be loaded.
// this is kind of inefficient, could update the engine to support these APIs without a full
// ResolveFromCaller call first
modConf.Source = modConf.Source.ResolveFromCaller()
modSDK, err := modConf.Source.AsModule().SDK(ctx)
if err != nil {
return fmt.Errorf("failed to get module SDK: %w", err)
}
if developSDK != "" {
if modSDK != "" && modSDK != developSDK {
return fmt.Errorf("cannot update module SDK that has already been set to %q", modSDK)
}
modSDK = developSDK
src = src.WithSDK(modSDK)
}
modSourcePath, err := modConf.Source.SourceSubpath(ctx)
if err != nil {
return fmt.Errorf("failed to get module source subpath: %w", err)
}
// if SDK is set but source path isn't and the user didn't provide --source, we'll use the default source path
if modSDK != "" && modSourcePath == "" && developSourcePath == "" {
developSourcePath = filepath.Join(modConf.LocalRootSourcePath, defaultModuleSourceDirName)
}
// if there's no SDK and the user isn't changing the source path, there's nothing to do.
// error out rather than silently doing nothing.
if modSDK == "" && developSourcePath == "" {
return fmt.Errorf("dagger develop on a module without an SDK requires either --sdk or --source")
}
if developSourcePath != "" {
// ensure source path is relative to the source root
sourceAbsPath, err := filepath.Abs(developSourcePath)
if err != nil {
return fmt.Errorf("failed to get absolute source path for %s: %w", developSourcePath, err)
}
developSourcePath, err = filepath.Rel(modConf.LocalRootSourcePath, sourceAbsPath)
if err != nil {
return fmt.Errorf("failed to get relative source path: %w", err)
}
if modSourcePath != "" && modSourcePath != developSourcePath {
return fmt.Errorf("cannot update module source path that has already been set to %q", modSourcePath)
}
modSourcePath = developSourcePath
src = src.WithSourceSubpath(modSourcePath)
}
_, err = src.ResolveFromCaller().
AsModule().
GeneratedContextDiff().
Export(ctx, modConf.LocalContextPath)
if err != nil {
return fmt.Errorf("failed to generate code: %w", err)
}
return nil
})
},
}
const daDaggerverse = "https://daggerverse.dev"
var modulePublishCmd = &cobra.Command{
Use: "publish",
Hidden: true, // Hide while we finalize publishing workflow
Short: "Publish a Dagger module to the Daggerverse",
Long: fmt.Sprintf(`Publish a local module to the Daggerverse (%s).
The module needs to be committed to a git repository and have a remote
configured with name "origin". The git repository must be clean (unless
forced), to avoid mistakingly depending on uncommitted files.
`,
daDaggerverse,
),
GroupID: moduleGroup.ID,
Annotations: map[string]string{
"experimental": "true",
},
RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) {
ctx := cmd.Context()
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) {
rec := progrock.FromContext(ctx)
vtx := rec.Vertex(idtui.PrimaryVertex, cmd.CommandPath())
defer func() { vtx.Done(err) }()
setCmdOutput(cmd, vtx)
dag := engineClient.Dagger()
modConf, err := getDefaultModuleConfiguration(ctx, dag, true)
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
if modConf.SourceKind != dagger.LocalSource {
return fmt.Errorf("module must be local")
}
if !modConf.FullyInitialized() {
return fmt.Errorf("module must be fully initialized")
}
repo, err := git.PlainOpenWithOptions(modConf.LocalRootSourcePath, &git.PlainOpenOptions{
DetectDotGit: true,
})
if err != nil {
return fmt.Errorf("failed to open git repo: %w", err)
}
wt, err := repo.Worktree()
if err != nil {
return fmt.Errorf("failed to get git worktree: %w", err)
}
st, err := wt.Status()
if err != nil {
return fmt.Errorf("failed to get git status: %w", err)
}
head, err := repo.Head()
if err != nil {
return fmt.Errorf("failed to get git HEAD: %w", err)
}
commit := head.Hash()
rec.Debug("git commit", progrock.Labelf("commit", commit.String()))
orig, err := repo.Remote("origin")
if err != nil {
return fmt.Errorf("failed to get git remote: %w", err)
}
refPath, err := originToPath(orig.Config().URLs[0])
if err != nil {
return fmt.Errorf("failed to get module path: %w", err)
}
// calculate path relative to repo root
gitRoot := wt.Filesystem.Root()
pathFromRoot, err := filepath.Rel(gitRoot, modConf.LocalRootSourcePath)
if err != nil {
return fmt.Errorf("failed to get path from git root: %w", err)
}
// NB: you might think to ignore changes to files outside of the module,
// but we should probably play it safe. in a monorepo for example this
// could mean publishing a broken module because it depends on
// uncommitted code in a dependent module.
//
// TODO: the proper fix here might be to check for dependent code, too.
// Specifically I should be able to publish a dependency before
// committing + pushing its dependers. but in the end it doesn't really
// matter; just commit everything and _then_ publish.
if !st.IsClean() && !force {
cmd.Println(st)
return fmt.Errorf("git repository is not clean; run with --force to ignore")
}
refStr := fmt.Sprintf("%s@%s", path.Join(refPath, pathFromRoot), commit)
crawlURL, err := url.JoinPath(daDaggerverse, "crawl")
if err != nil {
return fmt.Errorf("failed to get module URL: %w", err)
}
data := url.Values{}
data.Add("ref", refStr)
req, err := http.NewRequest(http.MethodPut, crawlURL, strings.NewReader(data.Encode()))
if err != nil {
return fmt.Errorf("failed to create request: %w", err)
}
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := http.DefaultClient.Do(req)
if err != nil {
return fmt.Errorf("failed to get module: %w", err)
}
// TODO(vito): inspect response and/or poll, would be nice to surface errors here
cmd.Println("Publishing", refStr, "to", daDaggerverse+"...")
cmd.Println()
cmd.Println("You can check on the crawling status here:")
cmd.Println()
cmd.Println(" " + res.Request.URL.String())
modURL, err := url.JoinPath(daDaggerverse, "mod", refStr)
if err != nil {
return fmt.Errorf("failed to get module URL: %w", err)
}
cmd.Println()
cmd.Println("Once the crawl is complete, you can view your module here:")
cmd.Println()
cmd.Println(" " + modURL)
return res.Body.Close()
})
},
}
func originToPath(origin string) (string, error) {
url, err := gitutil.ParseURL(origin)
if err != nil {
return "", fmt.Errorf("failed to parse git remote origin URL: %w", err)
}
return strings.TrimSuffix(path.Join(url.Host, url.Path), ".git"), nil
}
type configuredModule struct {
Source *dagger.ModuleSource
SourceKind dagger.ModuleSourceKind
LocalContextPath string
LocalRootSourcePath string
// whether the dagger.json in the module source dir exists yet
ModuleSourceConfigExists bool
}
func (c *configuredModule) FullyInitialized() bool {
return c.ModuleSourceConfigExists
}
func getDefaultModuleConfiguration(
ctx context.Context,
dag *dagger.Client,
// if true, will resolve local sources from the caller
// before returning the source. This should be set false
// if the caller wants to mutate configuration (sdk/dependency/etc.)
// since those changes require the source be resolved after
// they are made (due to the fact that they may result in more
// files needing to be loaded).
resolveFromCaller bool,
) (*configuredModule, error) {
srcRefStr := moduleURL
if srcRefStr == "" {
// it's unset or default value, use mod if present
if v, ok := os.LookupEnv("DAGGER_MODULE"); ok {
srcRefStr = v
}
// it's still unset, set to the default
if srcRefStr == "" {
srcRefStr = moduleURLDefault
}
}
return getModuleConfigurationForSourceRef(ctx, dag, srcRefStr, resolveFromCaller)
}
func getModuleConfigurationForSourceRef(
ctx context.Context,
dag *dagger.Client,
srcRefStr string,
resolveFromCaller bool,
) (*configuredModule, error) {
conf := &configuredModule{}
conf.Source = dag.ModuleSource(srcRefStr)
var err error
conf.SourceKind, err = conf.Source.Kind(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get module ref kind: %w", err)
}
if conf.SourceKind == dagger.LocalSource {
// first check if this is a named module from the default find-up dagger.json
// TODO: can move this to engine now?
cwd, err := os.Getwd()
if err != nil {
return nil, fmt.Errorf("failed to get current working directory: %w", err)
}
defaultConfigDir, foundDefaultConfig, err := findUp(cwd)
if err != nil {
return nil, fmt.Errorf("error trying to find config path for %s: %s", cwd, err)
}
if foundDefaultConfig {
configPath := filepath.Join(defaultConfigDir, modules.Filename)
contents, err := os.ReadFile(configPath)
if err != nil {
return nil, fmt.Errorf("failed to read %s: %w", configPath, err)
}
var modCfg modules.ModuleConfig
if err := json.Unmarshal(contents, &modCfg); err != nil {
return nil, fmt.Errorf("failed to unmarshal %s: %s", configPath, err)
}
if namedDep, ok := modCfg.DependencyByName(srcRefStr); ok {
src := dag.ModuleSource(namedDep.Source)
kind, err := src.Kind(ctx)
if err != nil {
return nil, err
}
if kind == dagger.GitSource {
return getModuleConfigurationForSourceRef(ctx, dag, namedDep.Source, resolveFromCaller)
}
depPath := filepath.Join(defaultConfigDir, namedDep.Source)
srcRefStr = depPath
}
}
conf.LocalRootSourcePath, err = filepath.Abs(srcRefStr)
if err != nil {
return nil, fmt.Errorf("failed to get absolute path for %s: %w", srcRefStr, err)
}
if filepath.IsAbs(srcRefStr) {
srcRefStr, err = filepath.Rel(cwd, srcRefStr)
if err != nil {
return nil, fmt.Errorf("failed to get relative path for %s: %w", srcRefStr, err)
}
}
if err := os.MkdirAll(srcRefStr, 0755); err != nil {
return nil, fmt.Errorf("failed to create directory for %s: %w", srcRefStr, err)
}
conf.Source = dag.ModuleSource(srcRefStr)
conf.LocalContextPath, err = conf.Source.ResolveContextPathFromCaller(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get local root path: %w", err)
}
_, err = os.Lstat(filepath.Join(conf.LocalRootSourcePath, modules.Filename))
conf.ModuleSourceConfigExists = err == nil
if resolveFromCaller {
conf.Source = conf.Source.ResolveFromCaller()
}
} else {
conf.ModuleSourceConfigExists, err = conf.Source.ConfigExists(ctx)
if err != nil {
return nil, fmt.Errorf("failed to check if module config exists: %w", err)
}
}
return conf, nil
}
func findUp(curDirPath string) (string, bool, error) {
if !filepath.IsAbs(curDirPath) {
return "", false, fmt.Errorf("path is not absolute: %s", curDirPath)
}
configPath := filepath.Join(curDirPath, modules.Filename)
stat, err := os.Lstat(configPath)
switch {
case os.IsNotExist(err):
case err == nil:
// make sure it's a file
if !stat.Mode().IsRegular() {
return "", false, fmt.Errorf("expected %s to be a file", configPath)
}
return curDirPath, true, nil
default:
return "", false, fmt.Errorf("failed to lstat %s: %s", configPath, err)
}
// didn't exist, try parent unless we've hit "/" or a git repo checkout root
if curDirPath == "/" {
return curDirPath, false, nil
}
_, err = os.Lstat(filepath.Join(curDirPath, ".git"))
if err == nil {
return curDirPath, false, nil
}
parentDirPath := filepath.Dir(curDirPath)
return findUp(parentDirPath)
}
// Wraps a command with optional module loading. If a module was explicitly specified by the user,
// it will try to load it and error out if it's not found or invalid. If no module was specified,
// it will try the current directory as a module but provide a nil module if it's not found, not
// erroring out.
func optionalModCmdWrapper(
fn func(context.Context, *client.Client, *dagger.Module, *cobra.Command, []string) error,
presetSecretToken string,
) func(*cobra.Command, []string) error {
return func(cmd *cobra.Command, cmdArgs []string) error {
return withEngineAndTUI(cmd.Context(), client.Params{
SecretToken: presetSecretToken,
}, func(ctx context.Context, engineClient *client.Client) (err error) {
modConf, err := getDefaultModuleConfiguration(ctx, engineClient.Dagger(), true)
if err != nil {
return fmt.Errorf("failed to get configured module: %w", err)
}
var loadedMod *dagger.Module
if modConf.FullyInitialized() {
loadedMod = modConf.Source.AsModule().Initialize()
_, err := loadedMod.Serve(ctx)
if err != nil {
return fmt.Errorf("failed to serve module: %w", err)
}
}
return fn(ctx, engineClient, loadedMod, cmd, cmdArgs)
})
}
}
// loadModTypeDefs loads the objects defined by the given module in an easier to use data structure.
func loadModTypeDefs(ctx context.Context, dag *dagger.Client, mod *dagger.Module) (*moduleDef, error) {
var res struct {
TypeDefs []*modTypeDef
}
const query = `
fragment TypeDefRefParts on TypeDef {
kind
optional
asObject {
name
}
asInterface {
name
}
asInput {
name
}
asList {
elementTypeDef {
kind
asObject {
name
}
asInterface {
name
}
asInput {
name
}
}
}
}
fragment FunctionParts on Function {
name
description
returnType {
...TypeDefRefParts
}
args {
name
description
defaultValue
typeDef {
...TypeDefRefParts
}
}
}
fragment FieldParts on FieldTypeDef {
name
description
typeDef {
...TypeDefRefParts
}
}
query TypeDefs($module: ModuleID!) {
typeDefs: currentTypeDefs {
kind
optional
asObject {
name
sourceModuleName
constructor {
...FunctionParts
}
functions {
...FunctionParts
}
fields {
...FieldParts
}
}
asInterface {
name
sourceModuleName
functions {
...FunctionParts
}
}
asInput {
name
fields {
...FieldParts
}
}
}
}
`
err := dag.Do(ctx, &dagger.Request{
Query: query,
Variables: map[string]interface{}{
"module": mod,
},
}, &dagger.Response{
Data: &res,
})
if err != nil {
return nil, fmt.Errorf("query module objects: %w", err)
}
name, err := mod.Name(ctx)
if err != nil {
return nil, fmt.Errorf("get module name: %w", err)
}
modDef := &moduleDef{Name: name}
for _, typeDef := range res.TypeDefs {
switch typeDef.Kind {
case dagger.ObjectKind:
modDef.Objects = append(modDef.Objects, typeDef)
case dagger.InterfaceKind:
modDef.Interfaces = append(modDef.Interfaces, typeDef)
case dagger.InputKind:
modDef.Inputs = append(modDef.Inputs, typeDef)
}
}
return modDef, nil
}
// moduleDef is a representation of dagger.Module.
type moduleDef struct {
Name string
Objects []*modTypeDef
Interfaces []*modTypeDef
Inputs []*modTypeDef
}
func (m *moduleDef) AsFunctionProviders() []functionProvider {
providers := make([]functionProvider, 0, len(m.Objects)+len(m.Interfaces))
for _, obj := range m.AsObjects() {
providers = append(providers, obj)
}
for _, iface := range m.AsInterfaces() {
providers = append(providers, iface)
}
return providers
}
// AsObjects returns the module's object type definitions.
func (m *moduleDef) AsObjects() []*modObject {
var defs []*modObject
for _, typeDef := range m.Objects {
if typeDef.AsObject != nil {
defs = append(defs, typeDef.AsObject)
}
}
return defs
}
func (m *moduleDef) AsInterfaces() []*modInterface {
var defs []*modInterface
for _, typeDef := range m.Interfaces {
if typeDef.AsInterface != nil {
defs = append(defs, typeDef.AsInterface)
}
}
return defs
}
func (m *moduleDef) AsInputs() []*modInput {
var defs []*modInput
for _, typeDef := range m.Inputs {
if typeDef.AsInput != nil {
defs = append(defs, typeDef.AsInput)
}
}
return defs
}
// GetObject retrieves a saved object type definition from the module.
func (m *moduleDef) GetObject(name string) *modObject {
for _, obj := range m.AsObjects() {
// Normalize name in case an SDK uses a different convention for object names.
if gqlObjectName(obj.Name) == gqlObjectName(name) {
return obj
}
}
return nil
}
// GetInterface retrieves a saved interface type definition from the module.
func (m *moduleDef) GetInterface(name string) *modInterface {
for _, iface := range m.AsInterfaces() {
// Normalize name in case an SDK uses a different convention for interface names.
if gqlObjectName(iface.Name) == gqlObjectName(name) {
return iface
}
}
return nil
}
// GetInterface retrieves a saved object or interface type definition from the module as a functionProvider.
func (m *moduleDef) GetFunctionProvider(name string) functionProvider {
if obj := m.GetObject(name); obj != nil {
return obj
}
if iface := m.GetInterface(name); iface != nil {
return iface
}
return nil
}
// GetInput retrieves a saved interface type definition from the module.
func (m *moduleDef) GetInput(name string) *modInput {
for _, input := range m.AsInputs() {
// Normalize name in case an SDK uses a different convention for input names.
if gqlObjectName(input.Name) == gqlObjectName(name) {
return input
}
}
return nil
}
func (m *moduleDef) GetMainObject() *modObject {
return m.GetObject(m.Name)
}
// LoadTypeDef attempts to replace a function's return object type or argument's
// object type with with one from the module's object type definitions, to
// recover missing function definitions in those places when chaining functions.
func (m *moduleDef) LoadTypeDef(typeDef *modTypeDef) {
if typeDef.AsObject != nil && typeDef.AsObject.Functions == nil && typeDef.AsObject.Fields == nil {
obj := m.GetObject(typeDef.AsObject.Name)
if obj != nil {
typeDef.AsObject = obj
}
}
if typeDef.AsInterface != nil && typeDef.AsInterface.Functions == nil {
iface := m.GetInterface(typeDef.AsInterface.Name)
if iface != nil {
typeDef.AsInterface = iface
}
}
if typeDef.AsInput != nil && typeDef.AsInput.Fields == nil {
input := m.GetInput(typeDef.AsInput.Name)
if input != nil {
typeDef.AsInput = input
}
}
if typeDef.AsList != nil {
m.LoadTypeDef(typeDef.AsList.ElementTypeDef)
}
}
// modTypeDef is a representation of dagger.TypeDef.
type modTypeDef struct {
Kind dagger.TypeDefKind
Optional bool
AsObject *modObject
AsInterface *modInterface
AsInput *modInput
AsList *modList
}
type functionProvider interface {
ProviderName() string
GetFunctions() []*modFunction
GetFunction(name string) (*modFunction, error)
}
func (t *modTypeDef) Name() string {
if t.AsObject != nil {
return t.AsObject.Name
}
if t.AsInterface != nil {
return t.AsInterface.Name
}
return ""
}
func (t *modTypeDef) AsFunctionProvider() functionProvider {
if t.AsObject != nil {
return t.AsObject
}
if t.AsInterface != nil {
return t.AsInterface
}
return nil
}
// modObject is a representation of dagger.ObjectTypeDef.
type modObject struct {
Name string
Functions []*modFunction
Fields []*modField
Constructor *modFunction
SourceModuleName string
}
var _ functionProvider = (*modObject)(nil)
func (o *modObject) ProviderName() string {
return o.Name
}
// GetFunctions returns the object's function definitions as well as the fields,
// which are treated as functions with no arguments.
func (o *modObject) GetFunctions() []*modFunction {
fns := make([]*modFunction, 0, len(o.Functions)+len(o.Fields))
for _, f := range o.Fields {
fns = append(fns, &modFunction{
Name: f.Name,
Description: f.Description,
ReturnType: f.TypeDef,
})
}
fns = append(fns, o.Functions...)
return fns
}
func (o *modObject) GetFunction(name string) (*modFunction, error) {
for _, fn := range o.Functions {
if fn.Name == name || cliName(fn.Name) == name {
return fn, nil
}
}
for _, f := range o.Fields {
if f.Name == name || cliName(f.Name) == name {
return &modFunction{
Name: f.Name,
Description: f.Description,
ReturnType: f.TypeDef,
}, nil
}
}
return nil, fmt.Errorf("no function '%s' in object type '%s'", name, o.Name)
}
type modInterface struct {
Name string
Functions []*modFunction
}
var _ functionProvider = (*modInterface)(nil)
func (o *modInterface) ProviderName() string {
return o.Name
}
func (o *modInterface) GetFunctions() []*modFunction {
fns := make([]*modFunction, 0, len(o.Functions))
fns = append(fns, o.Functions...)
return fns
}
func (o *modInterface) GetFunction(name string) (*modFunction, error) {
for _, fn := range o.Functions {
if fn.Name == name || cliName(fn.Name) == name {
return fn, nil
}
}
return nil, fmt.Errorf("no function '%s' in interface type '%s'", name, o.Name)
}
type modInput struct {
Name string
Fields []*modField
}
// modList is a representation of dagger.ListTypeDef.
type modList struct {
ElementTypeDef *modTypeDef
}
// modField is a representation of dagger.FieldTypeDef.
type modField struct {
Name string
Description string
TypeDef *modTypeDef
}
// modFunction is a representation of dagger.Function.
type modFunction struct {
Name string
Description string
ReturnType *modTypeDef
Args []*modFunctionArg
}
// modFunctionArg is a representation of dagger.FunctionArg.
type modFunctionArg struct {
Name string
Description string
TypeDef *modTypeDef
DefaultValue dagger.JSON
flagName string
}
// FlagName returns the name of the argument using CLI naming conventions.
func (r *modFunctionArg) FlagName() string {
if r.flagName == "" {
r.flagName = cliName(r.Name)
}
return r.flagName
}
func getDefaultValue[T any](r *modFunctionArg) (T, error) {
var val T
err := json.Unmarshal([]byte(r.DefaultValue), &val)
return val, err
}
// gqlObjectName converts casing to a GraphQL object name
func gqlObjectName(name string) string {
return strcase.ToCamel(name)
}
// gqlFieldName converts casing to a GraphQL object field name
func gqlFieldName(name string) string {
return strcase.ToLowerCamel(name)
}
// gqlArgName converts casing to a GraphQL field argument name
func gqlArgName(name string) string {
return strcase.ToLowerCamel(name)
}
// cliName converts casing to the CLI convention (kebab)
func cliName(name string) string {
return strcase.ToKebab(name)
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,640 | 🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9 | ### What is the issue?
There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with:
```
Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync
```
If you run this command inside a module it also fails with the same error:
```
$ dagger mod init --name test --sdk go
$ dagger listen --disable-host-read-write
├ [0.01s] loading module
✘ directory ERROR [0.01s]
▶ directory ▶ host.directory /home/matipan/bin/test
✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s]
├ [0.00s] transferring /home/matipan/bin/test:
• Engine: 6241366fb45d (version v0.9.7)
⧗ 1.97s ✔ 6 ✘ 3
Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled
input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled
```
### Dagger version
dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64
### Steps to reproduce
```
$ dagger listen --progress plain --disable-host-read-write
```
### Log output
```
Connected to engine 5c478db0e017 (version v0.9.9)
Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync
``` | https://github.com/dagger/dagger/issues/6640 | https://github.com/dagger/dagger/pull/6732 | b966257dbc24b714e6ee39f01158f10f8fa24fd3 | ca447cd4d7ca6d25e62008d3e1f87100111709df | "2024-02-09T14:29:11Z" | go | "2024-02-26T17:12:49Z" | core/integration/module_test.go | package core
import (
"context"
_ "embed"
"encoding/json"
"fmt"
"go/format"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"time"
"github.com/MakeNowJust/heredoc/v2"
"github.com/dagger/dagger/core/modules"
"github.com/dagger/dagger/dagql/idproto"
"github.com/iancoleman/strcase"
"github.com/moby/buildkit/identity"
"github.com/stretchr/testify/require"
"github.com/tidwall/gjson"
"golang.org/x/sync/errgroup"
"dagger.io/dagger"
"github.com/dagger/dagger/cmd/codegen/introspection"
)
func TestModuleGoInit(t *testing.T) {
t.Parallel()
t.Run("from scratch", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=bare", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("reserved go.mod name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=go", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{go{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"go":{"containerEcho":{"stdout":"hello\n"}}}`, out)
})
t.Run("uses expected Go module name, camel-cases Dagger module name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=My-Module", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{myModule{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"myModule":{"containerEcho":{"stdout":"hello\n"}}}`, out)
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
t.Run("creates go.mod beneath an existing go.mod if context is beneath it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
// don't use .git under /work so the context ends up being /work/ci
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/go.mod", dagger.ContainerWithNewFileOpts{
Contents: "module example.com/test\n",
}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/ci").
With(daggerExec("init", "--name=beneathGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{beneathGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"beneathGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("names Go module after Dagger module", func(t *testing.T) {
generated, err := modGen.Directory("dagger").File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module main")
})
})
t.Run("respects existing go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("preserves module name", func(t *testing.T) {
generated, err := modGen.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "module example.com/test")
})
})
t.Run("respects existing go.work", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithExec([]string{"go", "work", "init"}).
WithExec([]string{"go", "work", "use", "."}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("go.work is edited", func(t *testing.T) {
generated, err := modGen.File("go.work").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "\t.\n")
require.Contains(t, generated, "\t./dagger\n")
})
})
t.Run("respects existing go.work for top-level source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithExec([]string{"go", "work", "init"}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go", "--source=."))
out, err := modGen.
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("go.work is edited", func(t *testing.T) {
generated, err := modGen.File("go.work").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "use .\n")
})
})
t.Run("ignores go.work for subdir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithExec([]string{"go", "work", "init"}).
WithExec([]string{"go", "work", "use", "."}).
With(daggerExec("init", "--name=hasGoMod", "--sdk=go", "subdir"))
// we can't write to the go.work at the top-level so it should remain
// unedited, but we should still be able to execute the module as
// expected
out, err := modGen.
WithWorkdir("./subdir").
With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("go.work is unedited", func(t *testing.T) {
generated, err := modGen.File("go.work").Contents(ctx)
require.NoError(t, err)
require.Contains(t, generated, "use .\n")
})
})
t.Run("respects parent go.mod if root points to it", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
With(daggerExec("init", "--name=child", "--sdk=go", "./child")).
WithWorkdir("/work/child").
// explicitly develop to see whether it makes a go.mod
With(daggerExec("develop")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
require.Equal(t, []string{".git", "child", "foo.go", "go.mod", "go.sum"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.NotContains(t, childEntries, "go.mod")
t.Run("preserves parent module name", func(t *testing.T) {
goMod, err := generated.File("go.mod").Contents(ctx)
require.NoError(t, err)
require.Contains(t, goMod, "module example.com/test")
})
})
t.Run("respects existing go.mod even if root points to parent that has go.mod", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
generated := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"}).
WithExec([]string{"go", "mod", "init", "example.com/test"}).
WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
Contents: "package foo\n",
}).
WithWorkdir("/work/child").
WithExec([]string{"go", "mod", "init", "my-mod"}).
WithWorkdir("/work").
With(daggerExec("init", "--source=./child", "--name=child", "--sdk=go", "./child")).
WithWorkdir("/work/child").
// explicitly develop to see whether it makes a go.mod
With(daggerExec("develop")).
Directory("/work")
parentEntries, err := generated.Entries(ctx)
require.NoError(t, err)
// no go.sum
require.Equal(t, []string{".git", "child", "foo.go", "go.mod"}, parentEntries)
childEntries, err := generated.Directory("child").Entries(ctx)
require.NoError(t, err)
require.Contains(t, childEntries, "go.mod")
require.Contains(t, childEntries, "go.sum")
})
t.Run("respects existing main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasMainGo struct {}
func (m *HasMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("init", "--name=hasMainGo", "--sdk=go", "--source=."))
out, err := modGen.
With(daggerQuery(`{hasMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("respects existing main.go even if it uses types not generated yet", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
type HasDaggerTypes struct {}
func (m *HasDaggerTypes) Hello() *Container {
return dag.Container().
From("` + alpineImage + `").
WithExec([]string{"echo", "Hello, world!"})
}
`,
}).
With(daggerExec("init", "--source=.", "--name=hasDaggerTypes", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasDaggerTypes{hello{stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasDaggerTypes":{"hello":{"stdout":"Hello, world!\n"}}}`, out)
})
t.Run("respects existing package without creating main.go", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/notmain.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type HasNotMainGo struct {}
func (m *HasNotMainGo) Hello() string { return "Hello, world!" }
`,
}).
With(daggerExec("init", "--source=.", "--name=hasNotMainGo", "--sdk=go"))
out, err := modGen.
With(daggerQuery(`{hasNotMainGo{hello}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"hasNotMainGo":{"hello":"Hello, world!"}}`, out)
})
t.Run("with source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=bare", "--sdk=go", "--source=some/subdir"))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
sourceSubdirEnts, err := modGen.Directory("/work/some/subdir").Entries(ctx)
require.NoError(t, err)
require.Contains(t, sourceSubdirEnts, "main.go")
sourceRootEnts, err := modGen.Directory("/work").Entries(ctx)
require.NoError(t, err)
require.NotContains(t, sourceRootEnts, "main.go")
})
}
func TestModuleInitLICENSE(t *testing.T) {
t.Run("bootstraps Apache-2.0 LICENSE file if none found", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("creates LICENSE file in the directory specified by arg", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "./mymod"))
content, err := modGen.File("mymod/LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "Apache License, Version 2.0")
})
t.Run("does not bootstrap LICENSE file if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go"))
_, err := modGen.File("LICENSE").Contents(ctx)
require.Error(t, err)
})
t.Run("bootstraps a LICENSE file when requested, even if it exists in the parent dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{
Contents: "doesnt matter",
}).
WithWorkdir("/work/sub").
With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "--license=MIT"))
content, err := modGen.File("LICENSE").Contents(ctx)
require.NoError(t, err)
require.Contains(t, content, "MIT License")
})
}
func TestModuleGit(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
gitGeneratedFiles []string
gitIgnoredFiles []string
}
for _, tc := range []testCase{
{
sdk: "go",
gitGeneratedFiles: []string{
"/dagger.gen.go",
"/internal/dagger/**",
"/internal/querybuilder/**",
},
},
{
sdk: "python",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
{
sdk: "typescript",
gitGeneratedFiles: []string{
"/sdk/**",
},
gitIgnoredFiles: []string{
"/sdk",
},
},
} {
tc := tc
t.Run(fmt.Sprintf("module %s git", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
With(daggerExec("init", "--name=bare", "--sdk="+tc.sdk))
out, err := modGen.
With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out)
t.Run("configures .gitattributes", func(t *testing.T) {
ignore, err := modGen.File("dagger/.gitattributes").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitGeneratedFiles {
require.Contains(t, ignore, fmt.Sprintf("%s linguist-generated\n", fileName))
}
})
if len(tc.gitIgnoredFiles) > 0 {
t.Run("configures .gitignore", func(t *testing.T) {
ignore, err := modGen.File("dagger/.gitignore").Contents(ctx)
require.NoError(t, err)
for _, fileName := range tc.gitIgnoredFiles {
require.Contains(t, ignore, fileName)
}
})
}
})
}
}
//go:embed testdata/modules/go/minimal/main.go
var goSignatures string
func TestModuleGoSignatures(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
t.Run("func Hello() string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello"}}`, out)
})
t.Run("func Echo(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echo(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echo":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointer(*string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoPointerPointer(**string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoPointerPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoPointerPointer":"hello...hello...hello..."}}`, out)
})
t.Run("func EchoOptional(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptional(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptional":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalPointer(string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalPointer(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"hello...hello...hello..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalPointer}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"default...default...default..."}}`, out)
})
t.Run("func EchoOptionalSlice([]string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptionalSlice(msg: ["hello", "there"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"hello+there...hello+there...hello+there..."}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptionalSlice}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"foobar...foobar...foobar..."}}`, out)
})
t.Run("func Echoes([]string) []string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoes(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoes":["hello...hello...hello..."]}}`, out)
})
t.Run("func EchoesVariadic(...string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoesVariadic(msgs: ["hello"])}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoesVariadic":"hello...hello...hello..."}}`, out)
})
t.Run("func HelloContext(context.Context) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloContext}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloContext":"hello context"}}`, out)
})
t.Run("func EchoContext(context.Context, string) string", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoContext(msg: "hello")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoContext":"ctx.hello...ctx.hello...ctx.hello..."}}`, out)
})
t.Run("func HelloStringError() (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloStringError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloStringError":"hello i worked"}}`, out)
})
t.Run("func HelloVoid()", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoid}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoid":null}}`, out)
})
t.Run("func HelloVoidError() error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{helloVoidError}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"helloVoidError":null}}`, out)
})
t.Run("func EchoOpts(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOpts":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInline(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlinePointer(*struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineCtx(ctx, struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsInlineTags(struct{string, string, int}) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi!hi!"}}`, out)
})
t.Run("func EchoOptsPragmas(string, string, int) error", func(t *testing.T) {
out, err := modGen.With(daggerQuery(`{minimal{echoOptsPragmas(msg: "hi")}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"echoOptsPragmas":"hi...hi...hi..."}}`, out)
})
}
func TestModuleGoSignaturesBuiltinTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk=go")).
WithNewFile("dagger/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Minimal struct {}
func (m *Minimal) Read(ctx context.Context, dir Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadPointer(ctx context.Context, dir *Directory) (string, error) {
return dir.File("foo").Contents(ctx)
}
func (m *Minimal) ReadSlice(ctx context.Context, dir []Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadVariadic(ctx context.Context, dir ...Directory) (string, error) {
return dir[0].File("foo").Contents(ctx)
}
func (m *Minimal) ReadOptional(
ctx context.Context,
dir *Directory, // +optional
) (string, error) {
if dir != nil {
return dir.File("foo").Contents(ctx)
}
return "", nil
}
`,
})
out, err := modGen.With(daggerQuery(`{directory{withNewFile(path: "foo", contents: "bar"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
dirID := gjson.Get(out, "directory.withNewFile.id").String()
t.Run("func Read(ctx, Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{read(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"read":"bar"}}`, out)
})
t.Run("func ReadPointer(ctx, *Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readPointer(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readPointer":"bar"}}`, out)
})
t.Run("func ReadSlice(ctx, []Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readSlice(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readSlice":"bar"}}`, out)
})
t.Run("func ReadVariadic(ctx, ...Directory) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readVariadic(dir: ["%s"])}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readVariadic":"bar"}}`, out)
})
t.Run("func ReadOptional(ctx, Optional[Directory]) (string, error)", func(t *testing.T) {
out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readOptional(dir: "%s")}}`, dirID))).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":"bar"}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{readOptional}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"readOptional":""}}`, out)
})
}
func TestModuleGoSignaturesUnexported(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) string {
return name
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
objs := inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 1, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
objs = inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 2, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
require.Equal(t, "MinimalFoo", objs.Get("1.name").String())
modGen = c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
type Foo struct {
Bar bar
}
type bar struct {}
func (m *Minimal) Hello(name string) Foo {
return Foo{}
}
func (f *Foo) Hello(name string) string {
return name
}
func (b *bar) Hello(name string) string {
return name
}
`,
})
_, err := modGen.With(moduleIntrospection).Stderr(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "cannot code-generate unexported type bar")
}
func TestModuleGoSignaturesMixMatch(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {}
func (m *Minimal) Hello(name string, opts struct{}, opts2 struct{}) string {
return name
}
`,
})
_, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
require.Contains(t, logs.String(), "nested structs are not supported")
}
func TestModuleGoSignaturesNameConflict(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Minimal struct {
Foo Foo
Bar Bar
Baz Baz
}
type Foo struct {}
type Bar struct {}
type Baz struct {}
func (m *Foo) Hello(name string) string {
return name
}
func (f *Bar) Hello(name string, name2 string) string {
return name + name2
}
func (b *Baz) Hello() (string, error) {
return "", nil
}
`,
})
objs := inspectModuleObjects(ctx, t, modGen)
require.Equal(t, 4, len(objs.Array()))
require.Equal(t, "Minimal", objs.Get("0.name").String())
require.Equal(t, "MinimalFoo", objs.Get("1.name").String())
require.Equal(t, "MinimalBar", objs.Get("2.name").String())
require.Equal(t, "MinimalBaz", objs.Get("3.name").String())
}
func TestModuleGoDocs(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: goSignatures,
})
logGen(ctx, t, modGen.Directory("."))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Empty(t, hello.Get("description").String())
require.Empty(t, hello.Get("args").Array())
// test the args-based form
echoOpts := obj.Get(`functions.#(name="echoOpts")`)
require.Equal(t, "echoOpts", echoOpts.Get("name").String())
require.Equal(t, "EchoOpts does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the inline struct form
echoOpts = obj.Get(`functions.#(name="echoOptsInline")`)
require.Equal(t, "echoOptsInline", echoOpts.Get("name").String())
require.Equal(t, "EchoOptsInline does some opts things", echoOpts.Get("description").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "the message to echo", echoOpts.Get("args.0.description").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
// test the arg-based form (with pragmas)
echoOpts = obj.Get(`functions.#(name="echoOptsPragmas")`)
require.Equal(t, "echoOptsPragmas", echoOpts.Get("name").String())
require.Len(t, echoOpts.Get("args").Array(), 3)
require.Equal(t, "msg", echoOpts.Get("args.0.name").String())
require.Equal(t, "", echoOpts.Get("args.0.defaultValue").String())
require.Equal(t, "suffix", echoOpts.Get("args.1.name").String())
require.Equal(t, "String to append to the echoed message", echoOpts.Get("args.1.description").String())
require.Equal(t, "\"...\"", echoOpts.Get("args.1.defaultValue").String())
require.Equal(t, "times", echoOpts.Get("args.2.name").String())
require.Equal(t, "3", echoOpts.Get("args.2.defaultValue").String())
require.Equal(t, "Number of times to repeat the message", echoOpts.Get("args.2.description").String())
}
func TestModuleGoDocsEdgeCases(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
// Minimal is a thing
type Minimal struct {
// X is this
X, Y string // Y is not this
// +private
Z string
}
// some docs
func (m *Minimal) Hello(foo string, bar string,
// hello
baz string, qux string, x string, // lol
) string {
return foo + bar
}
func (m *Minimal) HelloMore(
// foo here
foo,
// bar here
bar string,
) string {
return foo + bar
}
func (m *Minimal) HelloMoreInline(opts struct{
// foo here
foo, bar string
}) string {
return opts.foo + opts.bar
}
func (m *Minimal) HelloAgain( // docs for helloagain
foo string,
bar string, // docs for bar
baz string,
) string {
return foo + bar
}
func (m *Minimal) HelloFinal(
foo string) string { // woops
return foo
}
`,
})
logGen(ctx, t, modGen.Directory("."))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Equal(t, "Minimal is a thing", obj.Get("description").String())
hello := obj.Get(`functions.#(name="hello")`)
require.Equal(t, "hello", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 5)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "hello", hello.Get("args.2.description").String())
require.Equal(t, "qux", hello.Get("args.3.name").String())
require.Equal(t, "", hello.Get("args.3.description").String())
require.Equal(t, "x", hello.Get("args.4.name").String())
require.Equal(t, "lol", hello.Get("args.4.description").String())
hello = obj.Get(`functions.#(name="helloMore")`)
require.Equal(t, "helloMore", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "bar here", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloMoreInline")`)
require.Equal(t, "helloMoreInline", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 2)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "foo here", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "", hello.Get("args.1.description").String())
hello = obj.Get(`functions.#(name="helloAgain")`)
require.Equal(t, "helloAgain", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 3)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Equal(t, "bar", hello.Get("args.1.name").String())
require.Equal(t, "docs for bar", hello.Get("args.1.description").String())
require.Equal(t, "baz", hello.Get("args.2.name").String())
require.Equal(t, "", hello.Get("args.2.description").String())
hello = obj.Get(`functions.#(name="helloFinal")`)
require.Equal(t, "helloFinal", hello.Get("name").String())
require.Len(t, hello.Get("args").Array(), 1)
require.Equal(t, "foo", hello.Get("args.0.name").String())
require.Equal(t, "", hello.Get("args.0.description").String())
require.Len(t, obj.Get(`fields`).Array(), 2)
prop := obj.Get(`fields.#(name="x")`)
require.Equal(t, "x", prop.Get("name").String())
require.Equal(t, "X is this", prop.Get("description").String())
prop = obj.Get(`fields.#(name="y")`)
require.Equal(t, "y", prop.Get("name").String())
require.Equal(t, "", prop.Get("description").String())
}
func TestModuleGoWeirdFields(t *testing.T) {
// these are all cases that used to panic due to the disparity in the type spec and the ast
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Z string
type Minimal struct {
// field with single (normal) name
W string
// field with multiple names
X, Y string
// field with no names
Z
}
func New() Minimal {
return Minimal{
W: "-",
X: "-",
Y: "-",
Z: Z("-"),
}
}
// struct with no fields
type Bar struct{}
func (m *Minimal) Say(
// field with single (normal) name
a string,
// field with multiple names
b, c string,
// field with no names (not included, mixed names not allowed)
// string
) string {
return a + " " + b + " " + c
}
func (m *Minimal) Hello(
// field with no names
string,
) string {
return "hello"
}
func (m *Minimal) SayOpts(opts struct{
// field with single (normal) name
A string
// field with multiple names
B, C string
// field with no names (not included because of above)
// string
}) string {
return opts.A + " " + opts.B + " " + opts.C
}
func (m *Minimal) HelloOpts(opts struct{
// field with no names
string
}) string {
return "hello"
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{w, x, y, z}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"w": "-", "x": "-", "y": "-", "z": "-"}}`, out)
for _, name := range []string{"say", "sayOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(a: "hello", b: "world", c: "!")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello world !"}}`, name), out)
}
for _, name := range []string{"hello", "helloOpts"} {
out, err := modGen.With(daggerQuery(`{minimal{%s(string: "")}}`, name)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, fmt.Sprintf(`{"minimal": {"%s": "hello"}}`, name), out)
}
}
func TestModuleGoFieldMustBeNil(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "fmt"
type Minimal struct {
Src *Directory
Name *string
}
func New() *Minimal {
return &Minimal{}
}
func (m *Minimal) IsEmpty() bool {
if m.Name != nil {
panic(fmt.Sprintf("name should be nil but is %v", m.Name))
}
if m.Src != nil {
panic(fmt.Sprintf("src should be nil but is %v", m.Src))
}
return true
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{isEmpty}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal": {"isEmpty": true}}`, out)
}
func TestModuleDescription(t *testing.T) {
t.Parallel()
type source struct {
file string
contents string
}
for _, tc := range []struct {
sdk string
sources []source
}{
{
sdk: "go",
sources: []source{
{
file: "main.go",
contents: `
// Test module, short description
//
// Long description, with full sentences.
package main
// Test object, short description
type Test struct {
// +default="foo"
Foo string
}
`,
},
},
},
{
sdk: "go",
sources: []source{
{
file: "a.go",
contents: `
// First, but not main
package main
type Foo struct {}
`,
},
{
file: "z.go",
contents: `
// Test module, short description
//
// Long description, with full sentences.
package main
// Test object, short description
type Test struct {
}
func (*Test) Foo() Foo {
return Foo{}
}
`,
},
},
},
{
sdk: "python",
sources: []source{
{
file: "src/main.py",
contents: `
"""Test module, short description
Long description, with full sentences.
"""
from dagger import field, object_type
@object_type
class Test:
"""Test object, short description"""
foo: str = field(default="foo")
`,
},
},
},
{
sdk: "python",
sources: []source{
{
file: "src/main/foo.py",
contents: `
"""Not the main file"""
from dagger import field, object_type
@object_type
class Foo:
bar: str = field(default="bar")
`,
},
{
file: "src/main/__init__.py",
contents: `
"""Test module, short description
Long description, with full sentences.
"""
from dagger import function, object_type
from .foo import Foo
@object_type
class Test:
"""Test object, short description"""
foo = function(Foo)
`,
},
},
},
{
sdk: "typescript",
sources: []source{
{
file: "src/index.ts",
contents: `
/**
* Test module, short description
*
* Long description, with full sentences.
*/
import { object, field } from '@dagger.io/dagger'
/**
* Test object, short description
*/
@object()
class Test {
@field()
foo: string = "foo"
}
`,
},
},
},
{
sdk: "typescript",
sources: []source{
{
file: "src/foo.ts",
contents: `
/**
* Not the main file
*/
import { object, field } from '@dagger.io/dagger'
@object()
export class Foo {
@field()
bar = "bar"
}
`,
},
{
file: "src/index.ts",
contents: `
/**
* Test module, short description
*
* Long description, with full sentences.
*/
import { object, field } from '@dagger.io/dagger'
import { Foo } from "./foo"
/**
* Test object, short description
*/
@object()
class Test {
@func()
foo(): Foo {
return new Foo()
}
}
`,
},
},
},
} {
tc := tc
t.Run(fmt.Sprintf("%s with %d files", tc.sdk, len(tc.sources)), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
for _, src := range tc.sources {
src := src
modGen = modGen.WithNewFile(src.file, dagger.ContainerWithNewFileOpts{
Contents: heredoc.Doc(src.contents),
})
}
mod := inspectModule(ctx, t,
modGen.With(daggerExec("init", "--source=.", "--name=test", "--sdk="+tc.sdk)))
require.Equal(t,
"Test module, short description\n\nLong description, with full sentences.",
mod.Get("description").String(),
)
require.Equal(t,
"Test object, short description",
mod.Get("objects.#.asObject|#(name=Test).description").String(),
)
})
}
}
func TestModulePrivateField(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
sdk string
source string
}{
{
sdk: "go",
source: `package main
type Minimal struct {
Foo string
Bar string // +private
}
func (m *Minimal) Set(foo string, bar string) *Minimal {
m.Foo = foo
m.Bar = bar
return m
}
func (m *Minimal) Hello() string {
return m.Foo + m.Bar
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Minimal:
foo: str = field(default="")
bar: str = ""
@function
def set(self, foo: str, bar: str) -> "Minimal":
self.foo = foo
self.bar = bar
return self
@function
def hello(self) -> str:
return self.foo + self.bar
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Minimal {
@field()
foo: string
bar?: string
constructor(foo?: string, bar?: string) {
this.foo = foo
this.bar = bar
}
@func()
set(foo: string, bar: string): Minimal {
this.foo = foo
this.bar = bar
return this
}
@func()
hello(): string {
return this.foo + this.bar
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=minimal", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
obj := inspectModuleObjects(ctx, t, modGen).Get("0")
require.Equal(t, "Minimal", obj.Get("name").String())
require.Len(t, obj.Get(`fields`).Array(), 1)
prop := obj.Get(`fields.#(name="foo")`)
require.Equal(t, "foo", prop.Get("name").String())
out, err := modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){hello}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"hello": "abcxyz"}}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){foo}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"set":{"foo": "abc"}}}`, out)
_, err = modGen.With(daggerQuery(`{minimal{set(foo: "abc", bar: "xyz"){bar}}}`)).Stdout(ctx)
require.ErrorContains(t, err, `Minimal has no such field: "bar"`)
})
}
}
// this is no longer allowed, but verify the SDK errors out
func TestModuleGoExtendCore(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=container", "--sdk=go")).
WithNewFile("internal/dagger/more.go", dagger.ContainerWithNewFileOpts{
Contents: `package dagger
import "context"
func (c *Container) Echo(ctx context.Context, msg string) (string, error) {
return c.WithExec([]string{"echo", msg}).Stdout(ctx)
}
`,
}).
With(daggerQuery(`{container{from(address:"` + alpineImage + `"){echo(msg:"echo!"){stdout}}}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "cannot define methods on objects from outside this module")
}
func TestModuleGoBadCtx(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=foo", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Foo struct {}
func (f *Foo) Echo(ctx context.Context, ctx2 context.Context) (string, error) {
return "", nil
}
`,
}).
With(daggerQuery(`{foo{echo}}`)).
Sync(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "unexpected context type")
}
func TestModuleCustomTypes(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Test struct{}
func (m *Test) Repeater(msg string, times int) *Repeater {
return &Repeater{
Message: msg,
Times: times,
}
}
type Repeater struct {
Message string
Times int
}
func (t *Repeater) Render() string {
return strings.Repeat(t.Message, t.Times)
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Repeater:
message: str = field(default="")
times: int = field(default=0)
@function
def render(self) -> str:
return self.message * self.times
@function
def repeater(msg: str, times: int) -> Repeater:
return Repeater(message=msg, times=times)
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Repeater {
@field()
message: string
@field()
times: number
constructor(message: string, times: number) {
this.message = message
this.times = times
}
@func()
render(): string {
return this.message.repeat(this.times)
}
}
@object()
class Test {
@func()
repeater(msg: string, times: number): Repeater {
return new Repeater(msg, times)
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("custom %s types", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := modInit(ctx, t, c, tc.sdk, tc.source).
With(daggerQuery(`{test{repeater(msg:"echo!", times: 3){render}}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"repeater":{"render":"echo!echo!echo!"}}}`, out)
})
}
}
func TestModuleReturnTypeDetection(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
}
func (m *Foo) MyFunction() X {
return X{Message: "foo"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
@function
def my_function() -> X:
return X(message="foo")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class X {
@field()
message: string
constructor(message: string) {
this.message = message;
}
}
@object()
class Foo {
@func()
myFunction(): X {
return new X("foo");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{myFunction{message}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo"}}}`, out)
})
}
}
func TestModuleReturnObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {}
type X struct {
Message string ` + "`json:\"message\"`" + `
When string ` + "`json:\"Timestamp\"`" + `
To string ` + "`json:\"recipient\"`" + `
From string
}
func (m *Foo) MyFunction() X {
return X{Message: "foo", When: "now", To: "user", From: "admin"}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class X:
message: str = field(default="")
when: str = field(default="", name="Timestamp")
to: str = field(default="", name="recipient")
from_: str = field(default="", name="from")
@object_type
class Foo:
@function
def my_function(self) -> X:
return X(message="foo", when="now", to="user", from_="admin")
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class X {
@field()
message: string
@field()
timestamp: string
@field()
recipient: string
@field()
from: string
constructor(message: string, timestamp: string, recipient: string, from: string) {
this.message = message;
this.timestamp = timestamp;
this.recipient = recipient;
this.from = from;
}
}
@object()
class Foo {
@func()
myFunction(): X {
return new X("foo", "now", "user", "admin");
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{myFunction{message, recipient, from, timestamp}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"myFunction":{"message":"foo", "recipient":"user", "from":"admin", "timestamp":"now"}}}`, out)
})
}
}
func TestModuleReturnNestedObject(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type Foo struct {
MsgContainer Bar
}
type Bar struct {
Msg string
}
func (m *Playground) MyFunction() Foo {
return Foo{MsgContainer: Bar{Msg: "hello world"}}
}
`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Bar:
msg: str = field()
@object_type
class Foo:
msg_container: Bar = field()
@object_type
class Playground:
@function
def my_function(self) -> Foo:
return Foo(msg_container=Bar(msg="hello world"))
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Bar {
@field()
msg: string;
constructor(msg: string) {
this.msg = msg;
}
}
@object()
class Foo {
@field()
msgContainer: Bar;
constructor(msgContainer: Bar) {
this.msgContainer = msgContainer;
}
}
@object()
class Playground {
@func()
myFunction(): Foo {
return new Foo(new Bar("hello world"));
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{myFunction{msgContainer{msg}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myFunction":{"msgContainer":{"msg": "hello world"}}}}`, out)
})
}
}
func TestModuleReturnCompositeCore(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
func (m *Playground) MySlice() []*Container {
return []*Container{dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"})}
}
type Foo struct {
Con *Container
// verify fields can remain nil w/out error too
UnsetFile *File
}
func (m *Playground) MyStruct() *Foo {
return &Foo{Con: dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"})}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class Foo:
con: dagger.Container = field()
unset_file: dagger.File | None = field(default=None)
@object_type
class Playground:
@function
def my_slice(self) -> list[dagger.Container]:
return [dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"])]
@function
def my_struct(self) -> Foo:
return Foo(con=dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"]))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, File, object, func, field } from "@dagger.io/dagger"
@object()
class Foo {
@field()
con: Container
@field()
unsetFile?: File
constructor(con: Container, usetFile?: File) {
this.con = con
this.usetFile = usetFile
}
}
@object()
class Playground {
@func()
mySlice(): Container[] {
return [
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
]
}
@func()
myStruct(): Foo {
return new Foo(
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{mySlice{stdout}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"mySlice":[{"stdout":"hello world\n"}]}}`, out)
out, err = modGen.With(daggerQuery(`{playground{myStruct{con{stdout}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"myStruct":{"con":{"stdout":"hello world\n"}}}}`, out)
})
}
}
func TestModuleReturnComplexThing(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Playground struct{}
type ScanResult struct {
Containers []*Container ` + "`json:\"targets\"`" + `
Report ScanReport
}
type ScanReport struct {
Contents string ` + "`json:\"contents\"`" + `
Authors []string ` + "`json:\"Authors\"`" + `
}
func (m *Playground) Scan() ScanResult {
return ScanResult{
Containers: []*Container{
dag.Container().From("` + alpineImage + `").WithExec([]string{"echo", "hello world"}),
},
Report: ScanReport{
Contents: "hello world",
Authors: []string{"foo", "bar"},
},
}
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import dag, field, function, object_type
@object_type
class ScanReport:
contents: str = field()
authors: list[str] = field()
@object_type
class ScanResult:
containers: list[dagger.Container] = field(name="targets")
report: ScanReport = field()
@object_type
class Playground:
@function
def scan(self) -> ScanResult:
return ScanResult(
containers=[
dag.container().from_("` + alpineImage + `").with_exec(["echo", "hello world"]),
],
report=ScanReport(
contents="hello world",
authors=["foo", "bar"],
),
)
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object()
class ScanReport {
@field()
contents: string
@field()
authors: string[]
constructor(contents: string, authors: string[]) {
this.contents = contents
this.authors = authors
}
}
@object()
class ScanResult {
@field("targets")
containers: Container[]
@field()
report: ScanReport
constructor(containers: Container[], report: ScanReport) {
this.containers = containers
this.report = report
}
}
@object()
class Playground {
@func()
async scan(): Promise<ScanResult> {
return new ScanResult(
[
dag.container().from("` + alpineImage + `").withExec(["echo", "hello world"])
],
new ScanReport("hello world", ["foo", "bar"])
)
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=playground", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{playground{scan{targets{stdout},report{contents,authors}}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"scan":{"targets":[{"stdout":"hello world\n"}],"report":{"contents":"hello world","authors":["foo","bar"]}}}}`, out)
})
}
}
func TestModuleGlobalVarDAG(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
type Foo struct {}
var someDefault = dag.Container().From("` + alpineImage + `")
func (m *Foo) Fn(ctx context.Context) (string, error) {
return someDefault.WithExec([]string{"echo", "foo"}).Stdout(ctx)
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function, object_type
SOME_DEFAULT = dag.container().from_("` + alpineImage + `")
@object_type
class Foo:
@function
async def fn(self) -> str:
return await SOME_DEFAULT.with_exec(["echo", "foo"]).stdout()
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from "@dagger.io/dagger"
var someDefault = dag.container().from("` + alpineImage + `")
@object()
class Foo {
@func()
async fn(): Promise<string> {
return someDefault.withExec(["echo", "foo"]).stdout()
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"fn":"foo\n"}}`, out)
})
}
}
func TestModuleIDableType(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Foo struct {
Data string
}
func (m *Foo) Set(data string) *Foo {
m.Data = data
return m
}
func (m *Foo) Get() string {
return m.Data
}
`,
},
{
sdk: "python",
source: `from typing import Self
from dagger import field, function, object_type
@object_type
class Foo:
data: str = ""
@function
def set(self, data: str) -> Self:
self.data = data
return self
@function
def get(self) -> str:
return self.data
`,
},
{
sdk: "typescript",
source: `
import { object, func } from "@dagger.io/dagger"
@object()
class Foo {
data: string = ""
@func()
set(data: string): Foo {
this.data = data
return this
}
@func()
get(): string {
return this.data
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
// sanity check
out, err := modGen.With(daggerQuery(`{foo{set(data: "abc"){get}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"set":{"get": "abc"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{set(data: "abc"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.set.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.set(data: "abc"): Foo!`)
out, err = modGen.With(daggerQuery(`{loadFooFromID(id: "%s"){get}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"loadFooFromID":{"get": "abc"}}`, out)
})
}
}
func TestModuleArgOwnType(t *testing.T) {
// Verify use of a module's own object as an argument type.
// The server needs to specifically decode the input type from an ID into
// the raw JSON, since the module doesn't understand it's own types as IDs
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "strings"
type Foo struct{}
type Message struct {
Content string
}
func (m *Foo) SayHello(name string) Message {
return Message{Content: "hello " + name}
}
func (m *Foo) Upper(msg Message) Message {
msg.Content = strings.ToUpper(msg.Content)
return msg
}
func (m *Foo) Uppers(msg []Message) []Message {
for i := range msg {
msg[i].Content = strings.ToUpper(msg[i].Content)
}
return msg
}`,
},
{
sdk: "python",
source: `from dagger import field, function, object_type
@object_type
class Message:
content: str = field()
@object_type
class Foo:
@function
def say_hello(self, name: str) -> Message:
return Message(content=f"hello {name}")
@function
def upper(self, msg: Message) -> Message:
msg.content = msg.content.upper()
return msg
@function
def uppers(self, msg: list[Message]) -> list[Message]:
for m in msg:
m.content = m.content.upper()
return msg
`,
},
{
sdk: "typescript",
source: `
import { object, func, field } from "@dagger.io/dagger"
@object()
class Message {
@field()
content: string
constructor(content: string) {
this.content = content
}
}
@object()
class Foo {
@func()
sayHello(name: string): Message {
return new Message("hello " + name)
}
@func()
upper(msg: Message): Message {
msg.content = msg.content.toUpperCase()
return msg
}
@func()
uppers(msg: Message[]): Message[] {
for (let i = 0; i < msg.length; i++) {
msg[i].content = msg[i].content.toUpperCase()
}
return msg
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=foo", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := modGen.With(daggerQuery(`{foo{sayHello(name: "world"){id}}}`)).Stdout(ctx)
require.NoError(t, err)
id := gjson.Get(out, "foo.sayHello.id").String()
var idp idproto.ID
err = idp.Decode(id)
require.NoError(t, err)
require.Equal(t, idp.Display(), `foo.sayHello(name: "world"): FooMessage!`)
out, err = modGen.With(daggerQuery(`{foo{upper(msg:"%s"){content}}}`, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"upper":{"content": "HELLO WORLD"}}}`, out)
out, err = modGen.With(daggerQuery(`{foo{uppers(msg:["%s", "%s"]){content}}}`, id, id)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"foo":{"uppers":[{"content": "HELLO WORLD"}, {"content": "HELLO WORLD"}]}}`, out)
})
}
}
func TestModuleConflictingSameNameDeps(t *testing.T) {
// A -> B -> Dint
// A -> C -> Dstr
// where Dint and Dstr are modules with the same name and same object names but conflicting types
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dstr").
With(daggerExec("init", "--source=.", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo string
}
func (m *D) Fn(foo string) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dint").
With(daggerExec("init", "--source=.", "--name=d", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type D struct{}
type Obj struct {
Foo int
}
func (m *D) Fn(foo int) Obj {
return Obj{Foo: foo}
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=c", "--name=c", "--sdk=go", "c")).
WithWorkdir("/work/c").
With(daggerExec("install", "../dstr")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type C struct{}
func (m *C) Fn(ctx context.Context, foo string) (string, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=b", "--name=b", "--sdk=go", "b")).
With(daggerExec("install", "-m=b", "./dint")).
WithNewFile("/work/b/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type B struct{}
func (m *B) Fn(ctx context.Context, foo int) (int, error) {
return dag.D().Fn(foo).Foo(ctx)
}
`,
})
ctr = ctr.
WithWorkdir("/work").
With(daggerExec("init", "--source=a", "--name=a", "--sdk=go", "a")).
WithWorkdir("/work/a").
With(daggerExec("install", "../b")).
With(daggerExec("install", "../c")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"strconv"
)
type A struct{}
func (m *A) Fn(ctx context.Context) (string, error) {
fooStr, err := dag.C().Fn(ctx, "foo")
if err != nil {
return "", err
}
fooInt, err := dag.B().Fn(ctx, 123)
if err != nil {
return "", err
}
return fooStr + strconv.Itoa(fooInt), nil
}
`,
})
out, err := ctr.With(daggerQuery(`{a{fn}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"a":{"fn": "foo123"}}`, out)
// verify that no types from (transitive) deps show up
types := currentSchema(ctx, t, ctr).Types
require.NotNil(t, types.Get("A"))
require.Nil(t, types.Get("B"))
require.Nil(t, types.Get("C"))
require.Nil(t, types.Get("D"))
}
func TestModuleSelfAPICall(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"github.com/Khan/genqlient/graphql"
)
type Test struct{}
func (m *Test) FnA(ctx context.Context) (string, error) {
resp := &graphql.Response{}
err := dag.Client.MakeRequest(ctx, &graphql.Request{
Query: "{test{fnB}}",
}, resp)
if err != nil {
return "", err
}
return resp.Data.(map[string]any)["test"].(map[string]any)["fnB"].(string), nil
}
func (m *Test) FnB() string {
return "hi from b"
}
`,
}).
With(daggerQuery(`{test{fnA}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fnA": "hi from b"}}`, out)
}
func TestModuleGoWithOtherModuleTypes(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--source=.", "--name=dep", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Dep struct{}
type Obj struct {
Foo string
}
func (m *Dep) Fn() Obj {
return Obj{Foo: "foo"}
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=test", "--name=test", "--sdk=go", "test")).
With(daggerExec("install", "-m=test", "./dep")).
WithWorkdir("/work/test")
t.Run("return as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() (*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn() ([]*DepObj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q cannot return external type from dependency module %q",
"Test", "Fn", "dep",
))
})
})
t.Run("arg as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj *DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
func (m *Test) Fn(obj []*DepObj) error {
return nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q function %q arg %q cannot reference external type from dependency module %q",
"Test", "Fn", "obj", "dep",
))
})
})
t.Run("field as other module object", func(t *testing.T) {
t.Run("direct", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo *DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
t.Run("list", func(t *testing.T) {
_, err := ctr.
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Test struct{}
type Obj struct {
Foo []*DepObj
}
func (m *Test) Fn() (*Obj, error) {
return nil, nil
}
`,
}).
With(daggerFunctions()).
Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, fmt.Sprintf(
"object %q field %q cannot reference external type from dependency module %q",
"Obj", "Foo", "dep",
))
})
})
}
func TestModuleGoUseDaggerTypesDirect(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "main/internal/dagger"
type Minimal struct{}
func (m *Minimal) Foo(dir *Directory) (*dagger.Directory) {
return dir.WithNewFile("foo", "xxx")
}
func (m *Minimal) Bar(dir *dagger.Directory) (*Directory) {
return dir.WithNewFile("bar", "yyy")
}
`,
})
out, err := modGen.With(daggerQuery(`{directory{id}}`)).Stdout(ctx)
require.NoError(t, err)
dirID := gjson.Get(out, "directory.id").String()
out, err = modGen.With(daggerQuery(`{minimal{foo(dir: "%s"){file(path: "foo"){contents}}}}`, dirID)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"foo":{"file":{"contents": "xxx"}}}}`, out)
out, err = modGen.With(daggerQuery(`{minimal{bar(dir: "%s"){file(path: "bar"){contents}}}}`, dirID)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"bar":{"file":{"contents": "yyy"}}}}`, out)
}
func TestModuleGoUtilsPkg(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"main/utils"
)
type Minimal struct{}
func (m *Minimal) Hello(ctx context.Context) (string, error) {
return utils.Foo().File("foo").Contents(ctx)
}
`,
}).
WithNewFile("utils/util.go", dagger.ContainerWithNewFileOpts{
Contents: `package utils
import "main/internal/dagger"
func Foo() *dagger.Directory {
return dagger.Connect().Directory().WithNewFile("/foo", "hello world")
}
`,
})
out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"minimal":{"hello":"hello world"}}`, out)
}
func TestModuleGoNameCase(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c))
ctr = ctr.
WithWorkdir("/toplevel/ssh").
With(daggerExec("init", "--name=ssh", "--sdk=go", "--source=.")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Ssh struct {}
func (ssh *Ssh) SayHello() string {
return "hello!"
}
`,
})
out, err := ctr.With(daggerQuery(`{ssh{sayHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"ssh":{"sayHello":"hello!"}}`, out)
ctr = ctr.
WithWorkdir("/toplevel").
With(daggerExec("init", "--name=toplevel", "--sdk=go", "--source=.")).
With(daggerExec("install", "./ssh")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Toplevel struct {}
func (t *Toplevel) SayHello(ctx context.Context) (string, error) {
return dag.SSH().SayHello(ctx)
}
`,
})
logGen(ctx, t, ctr.Directory("."))
out, err = ctr.With(daggerQuery(`{toplevel{sayHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"toplevel":{"sayHello":"hello!"}}`, out)
}
var useInner = `package main
type Dep struct{}
func (m *Dep) Hello() string {
return "hello"
}
`
var useGoOuter = `package main
import "context"
type Use struct{}
func (m *Use) UseHello(ctx context.Context) (string, error) {
return dag.Dep().Hello(ctx)
}
`
var usePythonOuter = `from dagger import dag, function
@function
def use_hello() -> str:
return dag.dep().hello()
`
var useTSOuter = `
import { dag, object, func } from '@dagger.io/dagger'
@object()
class Use {
@func()
async useHello(): Promise<string> {
return dag.dep().hello()
}
}
`
func TestModuleUseLocal(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// cannot use transitive dependency directly
_, err = modGen.With(daggerQuery(`{dep{hello}}`)).Stdout(ctx)
require.Error(t, err)
require.ErrorContains(t, err, `Query has no such field: "dep"`)
})
}
}
func TestModuleCodegenOnDepChange(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
changed string
expected string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
expected: "Hellov2",
changed: strings.ReplaceAll(useGoOuter, `Hello(ctx)`, `Hellov2(ctx)`),
},
{
sdk: "python",
source: usePythonOuter,
expected: "hellov2",
changed: strings.ReplaceAll(usePythonOuter, `.hello()`, `.hellov2()`),
},
{
sdk: "typescript",
source: useTSOuter,
expected: "hellov2",
changed: strings.ReplaceAll(useTSOuter, `.hello()`, `.hellov2()`),
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
out, err := modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
// make back-incompatible change to dep
newInner := strings.ReplaceAll(useInner, `Hello()`, `Hellov2()`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("develop"))
codegenContents, err := modGen.File(sdkCodegenFile(t, tc.sdk)).Contents(ctx)
require.NoError(t, err)
require.Contains(t, codegenContents, tc.expected)
modGen = modGen.With(sdkSource(tc.sdk, tc.changed))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
})
}
}
func TestModuleSyncDeps(t *testing.T) {
// verify that changes to deps result in a develop to the depender module
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: useGoOuter,
},
{
sdk: "python",
source: usePythonOuter,
},
{
sdk: "typescript",
source: useTSOuter,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/dep").
With(daggerExec("init", "--name=dep", "--sdk=go")).
With(sdkSource("go", useInner)).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerExec("install", "./dep"))
modGen = modGen.With(daggerQuery(`{use{useHello}}`))
out, err := modGen.Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"hello"}}`, out)
newInner := strings.ReplaceAll(useInner, `"hello"`, `"goodbye"`)
modGen = modGen.
WithWorkdir("/work/dep").
With(sdkSource("go", newInner)).
WithWorkdir("/work").
With(daggerExec("develop"))
out, err = modGen.With(daggerQuery(`{use{useHello}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"useHello":"goodbye"}}`, out)
})
}
}
func TestModuleUseLocalMulti(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import "context"
import "fmt"
type Use struct {}
func (m *Use) Names(ctx context.Context) ([]string, error) {
fooName, err := dag.Foo().Name(ctx)
if err != nil {
return nil, fmt.Errorf("foo.name: %w", err)
}
barName, err := dag.Bar().Name(ctx)
if err != nil {
return nil, fmt.Errorf("bar.name: %w", err)
}
return []string{fooName, barName}, nil
}
`,
},
{
sdk: "python",
source: `from dagger import dag, function
@function
async def names() -> list[str]:
return [
await dag.foo().name(),
await dag.bar().name(),
]
`,
},
{
sdk: "typescript",
source: `
import { dag, object, func } from '@dagger.io/dagger'
@object()
class Use {
@func()
async names(): Promise<string[]> {
return [await dag.foo().name(), await dag.bar().name()]
}
}
`,
},
} {
tc := tc
t.Run(fmt.Sprintf("%s uses go", tc.sdk), func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/foo").
WithNewFile("/work/foo/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Foo struct {}
func (m *Foo) Name() string { return "foo" }
`,
}).
With(daggerExec("init", "--source=.", "--name=foo", "--sdk=go")).
WithWorkdir("/work/bar").
WithNewFile("/work/bar/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Bar struct {}
func (m *Bar) Name() string { return "bar" }
`,
}).
With(daggerExec("init", "--source=.", "--name=bar", "--sdk=go")).
WithWorkdir("/work").
With(daggerExec("init", "--name=use", "--sdk="+tc.sdk)).
With(daggerExec("install", "./foo")).
With(daggerExec("install", "./bar")).
With(sdkSource(tc.sdk, tc.source)).
WithEnvVariable("BUST", identity.NewID()) // NB(vito): hmm...
out, err := modGen.With(daggerQuery(`{use{names}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"use":{"names":["foo", "bar"]}}`, out)
})
}
}
func TestModuleConstructor(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("basic", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(
ctx context.Context,
foo string,
bar *int, // +optional
baz []string,
dir *Directory,
) *Test {
bar2 := 42
if bar != nil {
bar2 = *bar
}
return &Test{
Foo: foo,
Bar: bar2,
Baz: baz,
Dir: dir,
}
}
type Test struct {
Foo string
Bar int
Baz []string
Dir *Directory
NeverSetDir *Directory
}
func (m *Test) GimmeFoo() string {
return m.Foo
}
func (m *Test) GimmeBar() int {
return m.Bar
}
func (m *Test) GimmeBaz() []string {
return m.Baz
}
func (m *Test) GimmeDirEnts(ctx context.Context) ([]string, error) {
return m.Dir.Entries(ctx)
}
`,
},
{
sdk: "python",
source: `import dagger
from dagger import field, function, object_type
@object_type
class Test:
foo: str = field()
dir: dagger.Directory = field()
bar: int = field(default=42)
baz: list[str] = field(default=list)
never_set_dir: dagger.Directory | None = field(default=None)
@function
def gimme_foo(self) -> str:
return self.foo
@function
def gimme_bar(self) -> int:
return self.bar
@function
def gimme_baz(self) -> list[str]:
return self.baz
@function
async def gimme_dir_ents(self) -> list[str]:
return await self.dir.entries()
`,
},
{
sdk: "typescript",
source: `
import { Directory, object, func, field } from '@dagger.io/dagger';
@object()
class Test {
@field()
foo: string
@field()
dir: Directory
@field()
bar: number
@field()
baz: string[]
@field()
neverSetDir?: Directory
constructor(foo: string, dir: Directory, bar = 42, baz: string[] = []) {
this.foo = foo;
this.dir = dir;
this.bar = bar;
this.baz = baz;
}
@func()
gimmeFoo(): string {
return this.foo;
}
@func()
gimmeBar(): number {
return this.bar;
}
@func()
gimmeBaz(): string[] {
return this.baz;
}
@func()
async gimmeDirEnts(): Promise<string[]> {
return this.dir.entries();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := modInit(ctx, t, c, tc.sdk, tc.source)
out, err := ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-foo")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "abc")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "42")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-bar")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "123")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-baz")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "x\ny\nz")
out, err = ctr.With(daggerCall("--foo=abc", "--bar=123", "--baz=x,y,z", "--dir=.", "gimme-dir-ents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, strings.TrimSpace(out), "dagger.json")
})
}
})
t.Run("fields only", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"context"
)
func New(ctx context.Context) (Test, error) {
v, err := dag.Container().From("alpine:3.18.4").File("/etc/alpine-release").Contents(ctx)
if err != nil {
return Test{}, err
}
return Test{
AlpineVersion: v,
}, nil
}
type Test struct {
AlpineVersion string
}
`,
},
{
sdk: "python",
source: `from dagger import dag, field, function, object_type
@object_type
class Test:
alpine_version: str = field()
@classmethod
async def create(cls) -> "Test":
return cls(alpine_version=await (
dag.container()
.from_("alpine:3.18.4")
.file("/etc/alpine-release")
.contents()
))
`,
},
{
sdk: "typescript",
source: `
import { dag, object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
alpineVersion: string
// NOTE: this is not standard to do async operations in the constructor.
// This is only for testing purpose but it shouldn't be done in real usage.
constructor() {
return (async () => {
this.alpineVersion = await dag.container().from("alpine:3.18.4").file("/etc/alpine-release").contents()
return this; // Return the newly-created instance
})();
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
out, err := ctr.With(daggerCall("alpine-version")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, strings.TrimSpace(out), "3.18.4")
})
}
})
t.Run("return error", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
import (
"fmt"
)
func New() (*Test, error) {
return nil, fmt.Errorf("too bad")
}
type Test struct {
Foo string
}
`,
},
{
sdk: "python",
source: `from dagger import object_type, field
@object_type
class Test:
foo: str = field()
def __init__(self):
raise ValueError("too bad")
`,
},
{
sdk: "typescript",
source: `
import { object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
foo: string
constructor() {
throw new Error("too bad")
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
var logs safeBuffer
c, ctx := connect(t, dagger.WithLogOutput(&logs))
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
_, err := ctr.With(daggerCall("foo")).Stdout(ctx)
require.Error(t, err)
require.NoError(t, c.Close())
t.Log(logs.String())
require.Contains(t, logs.String(), "too bad")
})
}
})
t.Run("python: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=python")).
With(sdkSource("python", fmt.Sprintf(`import dagger
from dagger import dag, object_type, field
@object_type
class Test:
foo: dagger.File = field(default=lambda: (
dag.directory()
.with_new_file("foo.txt", contents="%s")
.file("foo.txt")
))
bar: list[str] = field(default=list)
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "python"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
t.Run("typescript: with default factory", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
content := identity.NewID()
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/test").
With(daggerExec("init", "--name=test", "--sdk=typescript")).
With(sdkSource("typescript", fmt.Sprintf(`
import { dag, File, object, field } from "@dagger.io/dagger"
@object()
class Test {
@field()
foo: File = dag.directory().withNewFile("foo.txt", "%s").file("foo.txt")
@field()
bar: string[] = []
// Allow foo to be set through the constructor
constructor(foo?: File) {
if (foo) {
this.foo = foo
}
}
}
`, content),
))
out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Equal(t, content, strings.TrimSpace(out))
out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx)
require.NoError(t, err)
require.Contains(t, out, `"sdk": "typescript"`)
_, err = ctr.With(daggerCall("bar")).Sync(ctx)
require.NoError(t, err)
})
}
func TestModuleGoEmbedded(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c))
ctr = ctr.
WithWorkdir("/playground").
With(daggerExec("init", "--name=playground", "--sdk=go", "--source=.")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type Playground struct {
*Directory
}
func New() Playground {
return Playground{Directory: dag.Directory()}
}
func (p *Playground) SayHello() string {
return "hello!"
}
`,
})
out, err := ctr.With(daggerQuery(`{playground{sayHello, directory{entries}}}`)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"playground":{"sayHello":"hello!", "directory":{"entries": []}}}`, out)
}
func TestModuleWrapping(t *testing.T) {
t.Parallel()
type testCase struct {
sdk string
source string
}
for _, tc := range []testCase{
{
sdk: "go",
source: `package main
type Wrapper struct{}
func (m *Wrapper) Container() *WrappedContainer {
return &WrappedContainer{
dag.Container().From("` + alpineImage + `"),
}
}
type WrappedContainer struct {
Unwrap *Container` + "`" + `json:"unwrap"` + "`" + `
}
func (c *WrappedContainer) Echo(msg string) *WrappedContainer {
return &WrappedContainer{
c.Unwrap.WithExec([]string{"echo", "-n", msg}),
}
}
`,
},
{
sdk: "python",
source: `from typing import Self
import dagger
from dagger import dag, field, function, object_type
@object_type
class WrappedContainer:
unwrap: dagger.Container = field()
@function
def echo(self, msg: str) -> Self:
return WrappedContainer(unwrap=self.unwrap.with_exec(["echo", "-n", msg]))
@object_type
class Wrapper:
@function
def container(self) -> WrappedContainer:
return WrappedContainer(unwrap=dag.container().from_("` + alpineImage + `"))
`,
},
{
sdk: "typescript",
source: `
import { dag, Container, object, func, field } from "@dagger.io/dagger"
@object()
class WrappedContainer {
@field()
unwrap: Container
constructor(unwrap: Container) {
this.unwrap = unwrap
}
@func()
echo(msg: string): WrappedContainer {
return new WrappedContainer(this.unwrap.withExec(["echo", "-n", msg]))
}
}
@object()
class Wrapper {
@func()
container(): WrappedContainer {
return new WrappedContainer(dag.container().from("` + alpineImage + `"))
}
}
`,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=wrapper", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source))
id := identity.NewID()
out, err := modGen.With(daggerQuery(
fmt.Sprintf(`{wrapper{container{echo(msg:%q){unwrap{stdout}}}}}`, id),
)).Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t,
fmt.Sprintf(`{"wrapper":{"container":{"echo":{"unwrap":{"stdout":%q}}}}}`, id),
out)
})
}
}
func TestModuleLotsOfFunctions(t *testing.T) {
t.Parallel()
const funcCount = 100
t.Run("go sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
package main
type PotatoSack struct {}
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
func (m *PotatoSack) Potato%d() string {
return "potato #%d"
}
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("init", "--source=.", "--name=potatoSack", "--sdk=go"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("python sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `from dagger import function
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@function
def potato_%d() -> str:
return "potato #%d"
`, i, i)
}
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithNewFile("./src/main.py", dagger.ContainerWithNewFileOpts{
Contents: mainSrc,
}).
With(daggerExec("init", "--source=.", "--name=potatoSack", "--sdk=python"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
t.Run("typescript sdk", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
mainSrc := `
import { object, func } from "@dagger.io/dagger"
@object()
class PotatoSack {
`
for i := 0; i < funcCount; i++ {
mainSrc += fmt.Sprintf(`
@func()
potato_%d(): string {
return "potato #%d"
}
`, i, i)
}
mainSrc += "\n}"
modGen := c.
Container().
From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(sdkSource("typescript", mainSrc)).
With(daggerExec("init", "--name=potatoSack", "--sdk=typescript"))
var eg errgroup.Group
for i := 0; i < funcCount; i++ {
i := i
// just verify a subset work
if i%10 != 0 {
continue
}
eg.Go(func() error {
_, err := modGen.
With(daggerCall(fmt.Sprintf("potato%d", i))).
Sync(ctx)
return err
})
}
require.NoError(t, eg.Wait())
})
}
func TestModuleLotsOfDeps(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work")
modCount := 0
getModMainSrc := func(name string, depNames []string) string {
t.Helper()
mainSrc := fmt.Sprintf(`package main
import "context"
type %s struct {}
func (m *%s) Fn(ctx context.Context) (string, error) {
s := "%s"
var depS string
_ = depS
var err error
_ = err
`, strcase.ToCamel(name), strcase.ToCamel(name), name)
for _, depName := range depNames {
mainSrc += fmt.Sprintf(`
depS, err = dag.%s().Fn(ctx)
if err != nil {
return "", err
}
s += depS
`, strcase.ToCamel(depName))
}
mainSrc += "return s, nil\n}\n"
fmted, err := format.Source([]byte(mainSrc))
require.NoError(t, err)
return string(fmted)
}
// need to construct dagger.json directly in order to avoid excessive
// `dagger mod use` calls while constructing the huge DAG of deps
var rootCfg modules.ModuleConfig
addModulesWithDeps := func(newMods int, depNames []string) []string {
t.Helper()
var newModNames []string
for i := 0; i < newMods; i++ {
name := fmt.Sprintf("mod%d", modCount)
modCount++
newModNames = append(newModNames, name)
modGen = modGen.
WithWorkdir("/work/"+name).
WithNewFile("./main.go", dagger.ContainerWithNewFileOpts{
Contents: getModMainSrc(name, depNames),
})
var depCfgs []*modules.ModuleConfigDependency
for _, depName := range depNames {
depCfgs = append(depCfgs, &modules.ModuleConfigDependency{
Name: depName,
Source: filepath.Join("..", depName),
})
}
modGen = modGen.With(configFile(".", &modules.ModuleConfig{
Name: name,
SDK: "go",
Dependencies: depCfgs,
}))
}
return newModNames
}
// Create a base module, then add 6 layers of deps, where each layer has one more module
// than the previous layer and each module within the layer has a dep on each module
// from the previous layer. Finally add a single module at the top that depends on all
// modules from the last layer and call that.
// Basically, this creates a quadratically growing DAG of modules and verifies we
// handle it efficiently enough to be callable.
curDeps := addModulesWithDeps(1, nil)
for i := 0; i < 6; i++ {
curDeps = addModulesWithDeps(len(curDeps)+1, curDeps)
}
addModulesWithDeps(1, curDeps)
modGen = modGen.With(configFile("..", &rootCfg))
_, err := modGen.With(daggerCall("fn")).Sync(ctx)
require.NoError(t, err)
}
func TestModuleNamespacing(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
moduleSrcPath, err := filepath.Abs("./testdata/modules/go/namespacing")
require.NoError(t, err)
ctr := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithMountedDirectory("/work", c.Host().Directory(moduleSrcPath)).
WithWorkdir("/work")
out, err := ctr.
With(daggerQuery(`{test{fn(s:"yo")}}`)).
Stdout(ctx)
require.NoError(t, err)
require.JSONEq(t, `{"test":{"fn":["*dagger.Sub1Obj made 1:yo", "*dagger.Sub2Obj made 2:yo"]}}`, out)
}
func TestModuleLoops(t *testing.T) {
// verify circular module dependencies result in an error
t.Parallel()
c, ctx := connect(t)
_, err := goGitBase(t, c).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
With(daggerExec("init", "--name=depA", "--sdk=go", "depA")).
With(daggerExec("init", "--name=depB", "--sdk=go", "depB")).
With(daggerExec("init", "--name=depC", "--sdk=go", "depC")).
With(daggerExec("install", "-m=depC", "./depB")).
With(daggerExec("install", "-m=depB", "./depA")).
With(daggerExec("install", "-m=depA", "./depC")).
Sync(ctx)
require.ErrorContains(t, err, `local module at "/work/depA" has a circular dependency`)
}
//go:embed testdata/modules/go/id/arg/main.go
var badIDArgGoSrc string
//go:embed testdata/modules/python/id/arg/main.py
var badIDArgPySrc string
//go:embed testdata/modules/typescript/id/arg/index.ts
var badIDArgTSSrc string
//go:embed testdata/modules/go/id/field/main.go
var badIDFieldGoSrc string
//go:embed testdata/modules/typescript/id/field/index.ts
var badIDFieldTSSrc string
//go:embed testdata/modules/go/id/fn/main.go
var badIDFnGoSrc string
//go:embed testdata/modules/python/id/fn/main.py
var badIDFnPySrc string
//go:embed testdata/modules/typescript/id/fn/index.ts
var badIDFnTSSrc string
func TestModuleReservedWords(t *testing.T) {
// verify disallowed names are rejected
t.Parallel()
type testCase struct {
sdk string
source string
}
t.Run("id", func(t *testing.T) {
t.Parallel()
t.Run("arg", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDArgGoSrc,
},
{
sdk: "python",
source: badIDArgPySrc,
},
{
sdk: "typescript",
source: badIDArgTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := modInit(ctx, t, c, tc.sdk, tc.source).
With(daggerQuery(`{test{fn(id:"no")}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define argument with reserved name \"id\"")
})
}
})
t.Run("field", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFieldGoSrc,
},
{
sdk: "typescript",
source: badIDFieldTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{fn{id}}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define field with reserved name \"id\"")
})
}
})
t.Run("fn", func(t *testing.T) {
t.Parallel()
for _, tc := range []testCase{
{
sdk: "go",
source: badIDFnGoSrc,
},
{
sdk: "python",
source: badIDFnPySrc,
},
{
sdk: "typescript",
source: badIDFnTSSrc,
},
} {
tc := tc
t.Run(tc.sdk, func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)).
With(sdkSource(tc.sdk, tc.source)).
With(daggerQuery(`{test{id}}`)).
Sync(ctx)
require.ErrorContains(t, err, "cannot define function with reserved name \"id\"")
})
}
})
})
}
func TestModuleExecError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
modGen := c.Container().From(alpineImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=playground", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `
package main
import (
"context"
"errors"
)
type Playground struct{}
func (p *Playground) DoThing(ctx context.Context) error {
_, err := dag.Container().From("` + alpineImage + `").WithExec([]string{"sh", "-c", "exit 5"}).Sync(ctx)
var e *ExecError
if errors.As(err, &e) {
if e.ExitCode == 5 {
return nil
}
}
panic("yikes")
}
`})
_, err := modGen.
With(daggerQuery(`{playground{doThing}}`)).
Stdout(ctx)
require.NoError(t, err)
}
func TestModuleCurrentModuleAPI(t *testing.T) {
t.Parallel()
t.Run("name", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=WaCkY", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type WaCkY struct {}
func (m *WaCkY) Fn(ctx context.Context) (string, error) {
return dag.CurrentModule().Name(ctx)
}
`,
}).
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "WaCkY", strings.TrimSpace(out))
})
t.Run("source", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/subdir/coolfile.txt", dagger.ContainerWithNewFileOpts{
Contents: "nice",
}).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "context"
type Test struct {}
func (m *Test) Fn(ctx context.Context) *File {
return dag.CurrentModule().Source().File("subdir/coolfile.txt")
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("workdir", func(t *testing.T) {
t.Parallel()
t.Run("dir", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*Directory, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().Workdir("subdir/moresubdir"), nil
}
`,
}).
With(daggerCall("fn", "file", "--path=coolfile.txt", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("file", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
out, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) (*File, error) {
if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil {
return nil, err
}
return dag.CurrentModule().WorkdirFile("subdir/moresubdir/coolfile.txt"), nil
}
`,
}).
With(daggerCall("fn", "contents")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "nice", strings.TrimSpace(out))
})
t.Run("error on escape", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
"os"
)
func New() (*Test, error) {
if err := os.WriteFile("/rootfile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
if err := os.MkdirAll("/foo", 0755); err != nil {
return nil, err
}
if err := os.WriteFile("/foo/foofile.txt", []byte("notnice"), 0644); err != nil {
return nil, err
}
return &Test{}, nil
}
type Test struct {}
func (m *Test) EscapeFile(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("../rootfile.txt")
}
func (m *Test) EscapeFileAbs(ctx context.Context) *File {
return dag.CurrentModule().WorkdirFile("/rootfile.txt")
}
func (m *Test) EscapeDir(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("../foo")
}
func (m *Test) EscapeDirAbs(ctx context.Context) *Directory {
return dag.CurrentModule().Workdir("/foo")
}
`,
})
_, err := ctr.
With(daggerCall("escape-file", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-file-abs", "contents")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/rootfile.txt" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "../foo" escapes workdir`)
_, err = ctr.
With(daggerCall("escape-dir-abs", "entries")).
Stdout(ctx)
require.ErrorContains(t, err, `workdir path "/foo" escapes workdir`)
})
})
}
func TestModuleCustomSDK(t *testing.T) {
t.Parallel()
t.Run("local", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work/coolsdk").
With(daggerExec("init", "--source=.", "--name=cool-sdk", "--sdk=go")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
type CoolSdk struct {}
func (m *CoolSdk) ModuleRuntime(modSource *ModuleSource, introspectionJson string) *Container {
return modSource.WithSDK("go").AsModule().Runtime().WithEnvVariable("COOL", "true")
}
func (m *CoolSdk) Codegen(modSource *ModuleSource, introspectionJson string) *GeneratedCode {
return dag.GeneratedCode(modSource.WithSDK("go").AsModule().GeneratedContextDirectory())
}
func (m *CoolSdk) RequiredPaths() []string {
return []string{
"**/go.mod",
"**/go.sum",
"**/go.work",
"**/go.work.sum",
"**/vendor/",
"**/*.go",
}
}
`,
}).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=coolsdk")).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "os"
type Test struct {}
func (m *Test) Fn() string {
return os.Getenv("COOL")
}
`,
})
out, err := ctr.
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "true", strings.TrimSpace(out))
})
t.Run("git", func(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
ctr := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk="+testGitModuleRef("cool-sdk"))).
WithNewFile("main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import "os"
type Test struct {}
func (m *Test) Fn() string {
return os.Getenv("COOL")
}
`,
})
out, err := ctr.
With(daggerCall("fn")).
Stdout(ctx)
require.NoError(t, err)
require.Equal(t, "true", strings.TrimSpace(out))
})
}
// TestModuleHostError verifies the host api is not exposed to modules
func TestModuleHostError(t *testing.T) {
t.Parallel()
c, ctx := connect(t)
_, err := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")).
WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{
Contents: `package main
import (
"context"
)
type Test struct {}
func (m *Test) Fn(ctx context.Context) *Directory {
return dag.Host().Directory(".")
}
`,
}).
With(daggerCall("fn")).
Sync(ctx)
require.ErrorContains(t, err, "dag.Host undefined")
}
func daggerExec(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerQuery(query string, args ...any) dagger.WithContainerFunc {
return daggerQueryAt("", query, args...)
}
func daggerQueryAt(modPath string, query string, args ...any) dagger.WithContainerFunc {
query = fmt.Sprintf(query, args...)
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "query"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(execArgs, dagger.ContainerWithExecOpts{
Stdin: query,
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerCall(args ...string) dagger.WithContainerFunc {
return daggerCallAt("", args...)
}
func daggerCallAt(modPath string, args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
execArgs := []string{"dagger", "--debug", "call"}
if modPath != "" {
execArgs = append(execArgs, "-m", modPath)
}
return c.WithExec(append(execArgs, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func daggerFunctions(args ...string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
return c.WithExec(append([]string{"dagger", "--debug", "functions"}, args...), dagger.ContainerWithExecOpts{
ExperimentalPrivilegedNesting: true,
})
}
}
func configFile(dirPath string, cfg *modules.ModuleConfig) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
cfgPath := filepath.Join(dirPath, "dagger.json")
cfgBytes, err := json.Marshal(cfg)
if err != nil {
panic(err)
}
return c.WithNewFile(cfgPath, dagger.ContainerWithNewFileOpts{
Contents: string(cfgBytes),
})
}
}
// command for a dagger cli call direct on the host
func hostDaggerCommand(ctx context.Context, t testing.TB, workdir string, args ...string) *exec.Cmd {
t.Helper()
cmd := exec.CommandContext(ctx, daggerCliPath(t), args...)
cmd.Dir = workdir
return cmd
}
// runs a dagger cli command directly on the host, rather than in an exec
func hostDaggerExec(ctx context.Context, t testing.TB, workdir string, args ...string) ([]byte, error) {
t.Helper()
cmd := hostDaggerCommand(ctx, t, workdir, args...)
output, err := cmd.CombinedOutput()
if err != nil {
err = fmt.Errorf("%s: %w", string(output), err)
}
return output, err
}
func sdkSource(sdk, contents string) dagger.WithContainerFunc {
return func(c *dagger.Container) *dagger.Container {
sourcePath := sdkSourceFile(sdk)
if sourcePath == "" {
return c
}
return c.WithNewFile(sourcePath, dagger.ContainerWithNewFileOpts{
Contents: heredoc.Doc(contents),
})
}
}
func sdkSourceFile(sdk string) string {
switch sdk {
case "go":
return "dagger/main.go"
case "python":
return "dagger/src/main.py"
case "typescript":
return "dagger/src/index.ts"
default:
return ""
}
}
func sdkCodegenFile(t *testing.T, sdk string) string {
t.Helper()
switch sdk {
case "go":
// FIXME: go codegen is split up into dagger/dagger.gen.go and
// dagger/internal/dagger/dagger.gen.go
return "dagger/internal/dagger/dagger.gen.go"
case "python":
return "dagger/sdk/src/dagger/client/gen.py"
case "typescript":
return "dagger/sdk/api/client.gen.ts"
default:
return ""
}
}
func modInit(ctx context.Context, t *testing.T, c *dagger.Client, sdk, contents string) *dagger.Container {
t.Helper()
modGen := c.Container().From(golangImage).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
With(daggerExec("init", "--name=test", "--sdk="+sdk)).
With(sdkSource(sdk, contents))
return modGen
}
func currentSchema(ctx context.Context, t *testing.T, ctr *dagger.Container) *introspection.Schema {
t.Helper()
out, err := ctr.With(daggerQuery(introspection.Query)).Stdout(ctx)
require.NoError(t, err)
var schemaResp introspection.Response
err = json.Unmarshal([]byte(out), &schemaResp)
require.NoError(t, err)
return schemaResp.Schema
}
var moduleIntrospection = daggerQuery(`
query { host { directory(path: ".") { asModule { initialize {
description
objects {
asObject {
name
description
constructor {
description
args {
name
description
defaultValue
}
}
functions {
name
description
args {
name
description
defaultValue
}
}
fields {
name
description
}
}
}
} } } } }
`)
func inspectModule(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
t.Helper()
out, err := ctr.With(moduleIntrospection).Stdout(ctx)
require.NoError(t, err)
result := gjson.Get(out, "host.directory.asModule.initialize")
t.Logf("module introspection:\n%v", result.Raw)
return result
}
func inspectModuleObjects(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
t.Helper()
return inspectModule(ctx, t, ctr).Get("objects.#.asObject")
}
func goGitBase(t *testing.T, c *dagger.Client) *dagger.Container {
t.Helper()
return c.Container().From(golangImage).
WithExec([]string{"apk", "add", "git"}).
WithExec([]string{"git", "config", "--global", "user.email", "dagger@example.com"}).
WithExec([]string{"git", "config", "--global", "user.name", "Dagger Tests"}).
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)).
WithWorkdir("/work").
WithExec([]string{"git", "init"})
}
func logGen(ctx context.Context, t *testing.T, modSrc *dagger.Directory) {
t.Helper()
generated, err := modSrc.File("dagger.gen.go").Contents(ctx)
require.NoError(t, err)
t.Cleanup(func() {
t.Name()
fileName := filepath.Join(
os.TempDir(),
t.Name(),
fmt.Sprintf("dagger.gen.%d.go", time.Now().Unix()),
)
if err := os.MkdirAll(filepath.Dir(fileName), 0o755); err != nil {
t.Logf("failed to create temp dir for generated code: %v", err)
return
}
if err := os.WriteFile(fileName, []byte(generated), 0644); err != nil {
t.Logf("failed to write generated code to %s: %v", fileName, err)
} else {
t.Logf("wrote generated code to %s", fileName)
}
})
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,640 | 🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9 | ### What is the issue?
There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with:
```
Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync
```
If you run this command inside a module it also fails with the same error:
```
$ dagger mod init --name test --sdk go
$ dagger listen --disable-host-read-write
├ [0.01s] loading module
✘ directory ERROR [0.01s]
▶ directory ▶ host.directory /home/matipan/bin/test
✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s]
├ [0.00s] transferring /home/matipan/bin/test:
• Engine: 6241366fb45d (version v0.9.7)
⧗ 1.97s ✔ 6 ✘ 3
Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled
input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled
```
### Dagger version
dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64
### Steps to reproduce
```
$ dagger listen --progress plain --disable-host-read-write
```
### Log output
```
Connected to engine 5c478db0e017 (version v0.9.9)
Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync
``` | https://github.com/dagger/dagger/issues/6640 | https://github.com/dagger/dagger/pull/6732 | b966257dbc24b714e6ee39f01158f10f8fa24fd3 | ca447cd4d7ca6d25e62008d3e1f87100111709df | "2024-02-09T14:29:11Z" | go | "2024-02-26T17:12:49Z" | core/integration/suite_test.go | package core
import (
"archive/tar"
"bytes"
"context"
"crypto/md5"
"errors"
"fmt"
"io"
"os"
"os/exec"
"strings"
"sync"
"testing"
"dagger.io/dagger"
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/internal/testutil"
"github.com/moby/buildkit/identity"
"github.com/stretchr/testify/require"
)
func connect(t testing.TB, opts ...dagger.ClientOpt) (*dagger.Client, context.Context) {
ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)
opts = append([]dagger.ClientOpt{
dagger.WithLogOutput(newTWriter(t)),
}, opts...)
client, err := dagger.Connect(ctx, opts...)
require.NoError(t, err)
t.Cleanup(func() { client.Close() })
return client, ctx
}
func newCache(t testing.TB) core.CacheVolumeID {
var res struct {
CacheVolume struct {
ID core.CacheVolumeID
}
}
err := testutil.Query(`
query CreateCache($key: String!) {
cacheVolume(key: $key) {
id
}
}
`, &res, &testutil.QueryOptions{Variables: map[string]any{
"key": identity.NewID(),
}})
require.NoError(t, err)
return res.CacheVolume.ID
}
func newDirWithFile(t testing.TB, path, contents string) core.DirectoryID {
dirRes := struct {
Directory struct {
WithNewFile struct {
ID core.DirectoryID
}
}
}{}
err := testutil.Query(
`query Test($path: String!, $contents: String!) {
directory {
withNewFile(path: $path, contents: $contents) {
id
}
}
}`, &dirRes, &testutil.QueryOptions{Variables: map[string]any{
"path": path,
"contents": contents,
}})
require.NoError(t, err)
return dirRes.Directory.WithNewFile.ID
}
func newFile(t testing.TB, path, contents string) core.FileID {
var secretRes struct {
Directory struct {
WithNewFile struct {
File struct {
ID core.FileID
}
}
}
}
err := testutil.Query(
`query Test($path: String!, $contents: String!) {
directory {
withNewFile(path: $path, contents: $contents) {
file(path: "some-file") {
id
}
}
}
}`, &secretRes, &testutil.QueryOptions{Variables: map[string]any{
"path": path,
"contents": contents,
}})
require.NoError(t, err)
fileID := secretRes.Directory.WithNewFile.File.ID
require.NotEmpty(t, fileID)
return fileID
}
const (
registryHost = "registry:5000"
privateRegistryHost = "privateregistry:5000"
)
func registryRef(name string) string {
return fmt.Sprintf("%s/%s:%s", registryHost, name, identity.NewID())
}
func privateRegistryRef(name string) string {
return fmt.Sprintf("%s/%s:%s", privateRegistryHost, name, identity.NewID())
}
func ls(dir string) ([]string, error) {
ents, err := os.ReadDir(dir)
if err != nil {
return nil, err
}
names := make([]string, len(ents))
for i, ent := range ents {
names[i] = ent.Name()
}
return names, nil
}
func tarEntries(t testing.TB, path string) []string {
f, err := os.Open(path)
require.NoError(t, err)
entries := []string{}
tr := tar.NewReader(f)
for {
hdr, err := tr.Next()
if err != nil {
if errors.Is(err, io.EOF) {
break
}
require.NoError(t, err)
}
entries = append(entries, hdr.Name)
}
return entries
}
func readTarFile(t testing.TB, pathToTar, pathInTar string) []byte {
f, err := os.Open(pathToTar)
require.NoError(t, err)
tr := tar.NewReader(f)
for {
hdr, err := tr.Next()
if err != nil {
if errors.Is(err, io.EOF) {
break
}
require.NoError(t, err)
}
if hdr.Name == pathInTar {
b, err := io.ReadAll(tr)
require.NoError(t, err)
return b
}
}
return nil
}
func computeMD5FromReader(reader io.Reader) string {
h := md5.New()
io.Copy(h, reader)
return fmt.Sprintf("%x", h.Sum(nil))
}
func daggerCliPath(t testing.TB) string {
t.Helper()
cliPath := os.Getenv("_EXPERIMENTAL_DAGGER_CLI_BIN")
if cliPath == "" {
var err error
cliPath, err = exec.LookPath("dagger")
require.NoError(t, err)
}
if cliPath == "" {
t.Log("missing _EXPERIMENTAL_DAGGER_CLI_BIN")
t.FailNow()
}
return cliPath
}
func daggerCliFile(t testing.TB, c *dagger.Client) *dagger.File {
t.Helper()
return c.Host().File(daggerCliPath(t))
}
const testCLIBinPath = "/bin/dagger"
func goCache(c *dagger.Client) dagger.WithContainerFunc {
return func(ctr *dagger.Container) *dagger.Container {
return ctr.
WithMountedCache("/go/pkg/mod", c.CacheVolume("go-mod")).
WithEnvVariable("GOMODCACHE", "/go/pkg/mod").
WithMountedCache("/go/build-cache", c.CacheVolume("go-build")).
WithEnvVariable("GOCACHE", "/go/build-cache")
}
}
// tWriter is a writer that writes to testing.T
type tWriter struct {
t testing.TB
buf bytes.Buffer
mu sync.Mutex
}
// newTWriter creates a new TWriter
func newTWriter(t testing.TB) *tWriter {
tw := &tWriter{t: t}
t.Cleanup(tw.flush)
return tw
}
// Write writes data to the testing.T
func (tw *tWriter) Write(p []byte) (n int, err error) {
tw.mu.Lock()
defer tw.mu.Unlock()
tw.t.Helper()
if n, err = tw.buf.Write(p); err != nil {
return n, err
}
for {
line, err := tw.buf.ReadBytes('\n')
if err == io.EOF {
// If we've reached the end of the buffer, write it back, because it doesn't have a newline
tw.buf.Write(line)
break
}
if err != nil {
return n, err
}
tw.t.Log(strings.TrimSuffix(string(line), "\n"))
}
return n, nil
}
func (tw *tWriter) flush() {
tw.mu.Lock()
defer tw.mu.Unlock()
tw.t.Log(tw.buf.String())
}
type safeBuffer struct {
bu bytes.Buffer
mu sync.Mutex
}
func (s *safeBuffer) Write(p []byte) (n int, err error) {
s.mu.Lock()
defer s.mu.Unlock()
return s.bu.Write(p)
}
func (s *safeBuffer) String() string {
s.mu.Lock()
defer s.mu.Unlock()
return s.bu.String()
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,728 | Zenith: default to use a class instead of top-level functions in Python | ## Summary
Change the `dagger init` template for Python to use a class instead of just functions. Also update documentation snippets to do the same.
## Motivation
In an earlier iteration of Dagger modules, when the concept of objects that contain functions were introduced, the Python SDK kept the convenience of being able to define simple top-level functions, without having to convert into a class. Python allows this by transparently “creating” the object and associate the top-level functions with it, behind the scenes. It provides a nicer experience for simple use cases, where users don’t have to get the name right for the class, since it has to match the module name.
However, you can’t add a description to the main object this way. And over time we’ve added state to object types, and constructors to initialize that state. Using state has become a common pattern, so a user may **quite often need to convert the top-level functions into a class**.
That takes me back to a few years ago, working with React. You used to be able to create components using either a function or a class. Most people prefer the simplicity of functions, but in React, if you reached a point where you needed to access some lifecycle hooks, you’d need to convert the function into a class. I had to do that a lot myself.
I remember the frustration in the community around this, growing as adoption increased[^1]. I’ve found myself doing this in Python a few times too, and I’ve grown concerned that it’ll add some of the same confusion, frustration or just friction for our users.
For this reason, I think we should default to talk about Python SDK modules using the class, instead of top-level functions, in the documentation and examples. It also makes it more consistent with Go and TypeScript.
[^1]: They eventually fixed it by making classes obsolete and have full-featured hooks in functions.
## Deprecation
I have no plans, nor do I suggest, to deprecate top-level functions at this point. They’ll still be available, just more hidden. We’ll revisit at a later time.
\cc @vikram-dagger @jpadams | https://github.com/dagger/dagger/issues/6728 | https://github.com/dagger/dagger/pull/6729 | e64f185334734a37a2f18a95ec3cf21a27e32437 | 4b7ab1e217d1f2da30723905282ba3cf27de8cab | "2024-02-24T00:58:03Z" | go | "2024-02-26T19:06:17Z" | internal/mage/util/engine.go | package util
import (
"bytes"
"context"
"encoding/json"
"fmt"
"path/filepath"
"runtime"
"sort"
"strings"
"text/template"
"time"
"dagger.io/dagger"
"github.com/moby/buildkit/identity"
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
"golang.org/x/exp/maps"
"github.com/dagger/dagger/internal/distconsts"
)
const (
engineServerPath = "/usr/local/bin/dagger-engine"
engineDialStdioPath = "/usr/local/bin/dial-stdio"
engineShimPath = distconsts.EngineShimPath
golangVersion = "1.21.7"
alpineVersion = "3.18"
ubuntuVersion = "22.04"
runcVersion = "v1.1.12"
cniVersion = "v1.3.0"
qemuBinImage = "tonistiigi/binfmt@sha256:e06789462ac7e2e096b53bfd9e607412426850227afeb1d0f5dfa48a731e0ba5"
engineTomlPath = "/etc/dagger/engine.toml"
engineEntrypointPath = "/usr/local/bin/dagger-entrypoint.sh"
CacheConfigEnvName = "_EXPERIMENTAL_DAGGER_CACHE_CONFIG"
GPUSupportEnvName = "_EXPERIMENTAL_DAGGER_GPU_SUPPORT"
)
const engineEntrypointTmpl = `#!/bin/sh
set -e
# cgroup v2: enable nesting
# see https://github.com/moby/moby/blob/38805f20f9bcc5e87869d6c79d432b166e1c88b4/hack/dind#L28
if [ -f /sys/fs/cgroup/cgroup.controllers ]; then
# move the processes from the root group to the /init group,
# otherwise writing subtree_control fails with EBUSY.
# An error during moving non-existent process (i.e., "cat") is ignored.
mkdir -p /sys/fs/cgroup/init
xargs -rn1 < /sys/fs/cgroup/cgroup.procs > /sys/fs/cgroup/init/cgroup.procs || :
# enable controllers
sed -e 's/ / +/g' -e 's/^/+/' < /sys/fs/cgroup/cgroup.controllers \
> /sys/fs/cgroup/cgroup.subtree_control
fi
exec {{.EngineBin}} --config {{.EngineConfig}} {{ range $key := .EntrypointArgKeys -}}--{{ $key }}="{{ index $.EntrypointArgs $key }}" {{ end -}} "$@"
`
const engineConfigTmpl = `
debug = true
insecure-entitlements = ["security.insecure"]
{{ range $key := .ConfigKeys }}
[{{ $key }}]
{{ index $.ConfigEntries $key }}
{{ end -}}
`
// DevEngineOpts are options for the dev engine
type DevEngineOpts struct {
EntrypointArgs map[string]string
ConfigEntries map[string]string
Name string
}
func getEntrypoint(opts ...DevEngineOpts) (string, error) {
mergedOpts := map[string]string{}
for _, opt := range opts {
maps.Copy(mergedOpts, opt.EntrypointArgs)
}
keys := maps.Keys(mergedOpts)
sort.Strings(keys)
var entrypoint string
type entrypointTmplParams struct {
Bridge string
EngineBin string
EngineConfig string
EntrypointArgs map[string]string
EntrypointArgKeys []string
}
tmpl := template.Must(template.New("entrypoint").Parse(engineEntrypointTmpl))
buf := new(bytes.Buffer)
err := tmpl.Execute(buf, entrypointTmplParams{
EngineBin: engineServerPath,
EngineConfig: engineTomlPath,
EntrypointArgs: mergedOpts,
EntrypointArgKeys: keys,
})
if err != nil {
panic(err)
}
entrypoint = buf.String()
return entrypoint, nil
}
func getConfig(opts ...DevEngineOpts) (string, error) {
mergedOpts := map[string]string{}
for _, opt := range opts {
maps.Copy(mergedOpts, opt.ConfigEntries)
}
keys := maps.Keys(mergedOpts)
sort.Strings(keys)
var config string
type configTmplParams struct {
ConfigEntries map[string]string
ConfigKeys []string
}
tmpl := template.Must(template.New("config").Parse(engineConfigTmpl))
buf := new(bytes.Buffer)
err := tmpl.Execute(buf, configTmplParams{
ConfigEntries: mergedOpts,
ConfigKeys: keys,
})
if err != nil {
panic(err)
}
config = buf.String()
return config, nil
}
func CIDevEngineContainerAndEndpoint(ctx context.Context, c *dagger.Client, opts ...DevEngineOpts) (*dagger.Service, string, error) {
devEngine := CIDevEngineContainer(ctx, c, opts...).AsService()
endpoint, err := devEngine.Endpoint(ctx, dagger.ServiceEndpointOpts{Port: 1234, Scheme: "tcp"})
if err != nil {
return nil, "", err
}
return devEngine, endpoint, nil
}
var DefaultDevEngineOpts = DevEngineOpts{
EntrypointArgs: map[string]string{
"network-name": "dagger-dev",
"network-cidr": "10.88.0.0/16",
},
ConfigEntries: map[string]string{
"grpc": `address=["unix:///var/run/buildkit/buildkitd.sock", "tcp://0.0.0.0:1234"]`,
`registry."docker.io"`: `mirrors = ["mirror.gcr.io"]`,
},
}
func CIDevEngineContainer(ctx context.Context, c *dagger.Client, opts ...DevEngineOpts) *dagger.Container {
versionInfo, err := DevelVersionInfo(ctx, c)
if err != nil {
panic(err)
}
engineOpts := []DevEngineOpts{}
engineOpts = append(engineOpts, DefaultDevEngineOpts)
engineOpts = append(engineOpts, opts...)
var cacheVolumeName string
if len(opts) > 0 {
for _, opt := range opts {
if opt.Name != "" {
cacheVolumeName = opt.Name
}
}
}
if cacheVolumeName != "" {
cacheVolumeName = "dagger-dev-engine-state-" + cacheVolumeName
} else {
cacheVolumeName = "dagger-dev-engine-state"
}
cacheVolumeName = cacheVolumeName + identity.NewID()
devEngine := devEngineContainer(ctx, c, runtime.GOARCH, versionInfo.EngineVersion(), engineOpts...)
devEngine = devEngine.WithExposedPort(1234, dagger.ContainerWithExposedPortOpts{Protocol: dagger.Tcp}).
WithMountedCache(distconsts.EngineDefaultStateDir, c.CacheVolume(cacheVolumeName)).
WithExec(nil, dagger.ContainerWithExecOpts{
InsecureRootCapabilities: true,
ExperimentalPrivilegedNesting: true,
})
return devEngine
}
// DevEngineContainer returns a container that runs a dev engine
func DevEngineContainer(ctx context.Context, c *dagger.Client, arches []string, version string, opts ...DevEngineOpts) []*dagger.Container {
return devEngineContainers(ctx, c, arches, version, opts...)
}
// DevEngineContainerWithGPUSUpport returns a container that runs a dev engine
func DevEngineContainerWithGPUSupport(ctx context.Context, c *dagger.Client, arches []string, version string, opts ...DevEngineOpts) []*dagger.Container {
containers := devEngineContainersWithGPUSupport(ctx, c, arches, version, opts...)
return containers
}
func devEngineContainer(ctx context.Context, c *dagger.Client, arch string, version string, opts ...DevEngineOpts) *dagger.Container {
if version == "" {
panic("engine version must be specified")
}
engineConfig, err := getConfig(opts...)
if err != nil {
panic(err)
}
engineEntrypoint, err := getEntrypoint(opts...)
if err != nil {
panic(err)
}
container := c.Container(dagger.ContainerOpts{Platform: dagger.Platform("linux/" + arch)}).
From("alpine:"+alpineVersion).
// NOTE: wrapping the apk installs with this time based env ensures that the cache is invalidated
// once-per day. This is a very unfortunate workaround for the poor caching "apk add" as an exec
// gives us.
// Fortunately, better approaches are on the horizon w/ Zenith, for which there are already apk
// modules that fix this problem and always result in the latest apk packages for the given alpine
// version being used (with optimal caching).
WithEnvVariable("DAGGER_APK_CACHE_BUSTER", fmt.Sprintf("%d", time.Now().Truncate(24*time.Hour).Unix())).
WithExec([]string{"apk", "upgrade"}).
WithExec([]string{
"apk", "add", "--no-cache",
// for Buildkit
"git", "openssh", "pigz", "xz",
// for CNI
"iptables", "ip6tables", "dnsmasq",
}).
WithoutEnvVariable("DAGGER_APK_CACHE_BUSTER").
WithFile("/usr/local/bin/runc", runcBin(c, arch), dagger.ContainerWithFileOpts{
Permissions: 0o700,
}).
WithFile(engineShimPath, shimBin(c, arch, version)).
WithFile(engineServerPath, engineBin(c, arch, version)).
With(goSDKContent(ctx, c, arch)).
With(pythonSDKContent(ctx, c, arch)).
With(typescriptSDKContent(ctx, c, arch)).
WithDirectory("/usr/local/bin", qemuBins(c, arch)).
WithDirectory("/", cniPlugins(c, arch, false)).
WithDirectory("/", dialstdioFiles(c, arch)).
WithDirectory(distconsts.EngineDefaultStateDir, c.Directory()).
WithNewFile(engineTomlPath, dagger.ContainerWithNewFileOpts{
Contents: engineConfig,
Permissions: 0o600,
}).
WithNewFile(engineEntrypointPath, dagger.ContainerWithNewFileOpts{
Contents: engineEntrypoint,
Permissions: 0o755,
})
return container.WithEntrypoint([]string{filepath.Base(engineEntrypointPath)})
}
func devEngineContainerWithGPUSupport(ctx context.Context, c *dagger.Client, arch string, version string, opts ...DevEngineOpts) *dagger.Container {
if arch != "amd64" {
panic("unsupported architecture")
}
if version == "" {
panic("engine version must be specified")
}
engineConfig, err := getConfig(opts...)
if err != nil {
panic(err)
}
engineEntrypoint, err := getEntrypoint(opts...)
if err != nil {
panic(err)
}
container := c.Container(dagger.ContainerOpts{Platform: dagger.Platform("linux/" + arch)}).
From("ubuntu:"+ubuntuVersion).
WithEnvVariable("DEBIAN_FRONTEND", "noninteractive").
WithExec([]string{"apt-get", "update"}).
WithExec([]string{
"apt-get", "install", "-y",
"iptables", "git", "dnsmasq-base", "network-manager",
"gpg", "curl",
}).
WithFile("/usr/local/bin/runc", runcBin(c, arch), dagger.ContainerWithFileOpts{
Permissions: 0o700,
}).
WithFile(engineShimPath, shimBin(c, arch, version)).
WithFile(engineServerPath, engineBin(c, arch, version)).
With(goSDKContent(ctx, c, arch)).
With(pythonSDKContent(ctx, c, arch)).
With(typescriptSDKContent(ctx, c, arch)).
WithDirectory("/usr/local/bin", qemuBins(c, arch)).
WithDirectory("/", cniPlugins(c, arch, true)).
WithDirectory("/", dialstdioFiles(c, arch)).
WithDirectory(distconsts.EngineDefaultStateDir, c.Directory()).
WithNewFile(engineTomlPath, dagger.ContainerWithNewFileOpts{
Contents: engineConfig,
Permissions: 0o600,
}).
WithNewFile(engineEntrypointPath, dagger.ContainerWithNewFileOpts{
Contents: engineEntrypoint,
Permissions: 0o755,
}).
With(nvidiaSetup)
return container.WithEntrypoint([]string{filepath.Base(engineEntrypointPath)})
}
// install nvidia-container-toolkit in the container
func nvidiaSetup(ctr *dagger.Container) *dagger.Container {
return ctr.
With(shellExec(`curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg`)).
With(shellExec(`curl -s -L https://nvidia.github.io/libnvidia-container/experimental/"$(. /etc/os-release;echo $ID$VERSION_ID)"/libnvidia-container.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | tee /etc/apt/sources.list.d/nvidia-container-toolkit.list`)).
With(shellExec(`apt-get update && apt-get install -y nvidia-container-toolkit`))
}
func shellExec(cmd string) dagger.WithContainerFunc {
return func(ctr *dagger.Container) *dagger.Container {
return ctr.WithExec([]string{"sh", "-c", cmd})
}
}
func devEngineContainers(ctx context.Context, c *dagger.Client, arches []string, version string, opts ...DevEngineOpts) []*dagger.Container {
platformVariants := make([]*dagger.Container, 0, len(arches))
for _, arch := range arches {
platformVariants = append(platformVariants, devEngineContainer(ctx, c, arch, version, opts...))
}
return platformVariants
}
func devEngineContainersWithGPUSupport(ctx context.Context, c *dagger.Client, arches []string, version string, opts ...DevEngineOpts) []*dagger.Container {
platformVariants := make([]*dagger.Container, 0, len(arches))
// Restrict GPU images to amd64:
platformVariants = append(platformVariants, devEngineContainerWithGPUSupport(ctx, c, "amd64", version, opts...))
return platformVariants
}
// helper functions for building the dev engine container
func pythonSDKContent(ctx context.Context, c *dagger.Client, arch string) dagger.WithContainerFunc {
return func(ctr *dagger.Container) *dagger.Container {
sdkCtrTarball := c.Container().
WithRootfs(c.Host().Directory("sdk/python", dagger.HostDirectoryOpts{
Include: []string{
"pyproject.toml",
"src/**/*.py",
"src/**/*.typed",
"runtime/",
"LICENSE",
"README.md",
"dagger.json",
},
})).
WithFile("/codegen", goSDKCodegenBin(c, arch)).
AsTarball(dagger.ContainerAsTarballOpts{
ForcedCompression: dagger.Uncompressed,
})
sdkDir := c.Container().From("alpine:"+alpineVersion).
WithMountedDirectory("/out", c.Directory()).
WithMountedFile("/sdk.tar", sdkCtrTarball).
WithExec([]string{"tar", "xf", "/sdk.tar", "-C", "/out"}).
Directory("/out")
return sdkContent(ctx, ctr, sdkDir, distconsts.PythonSDKManifestDigestEnvName)
}
}
func typescriptSDKContent(ctx context.Context, c *dagger.Client, arch string) dagger.WithContainerFunc {
return func(ctr *dagger.Container) *dagger.Container {
sdkCtrTarball := c.Container().
WithRootfs(c.Host().Directory("sdk/typescript", dagger.HostDirectoryOpts{
Include: []string{
"**/*.ts",
"LICENSE",
"README.md",
"runtime",
"package.json",
"dagger.json",
},
Exclude: []string{
"node_modules",
"dist",
"**/test",
"**/*.spec.ts",
"dev",
},
})).
WithFile("/codegen", goSDKCodegenBin(c, arch)).
AsTarball(dagger.ContainerAsTarballOpts{
ForcedCompression: dagger.Uncompressed,
})
sdkDir := c.Container().From("alpine:"+alpineVersion).
WithMountedDirectory("/out", c.Directory()).
WithMountedFile("/sdk.tar", sdkCtrTarball).
WithExec([]string{"tar", "xf", "/sdk.tar", "-C", "/out"}).
Directory("/out")
return sdkContent(ctx, ctr, sdkDir, distconsts.TypescriptSDKManifestDigestEnvName)
}
}
func goSDKContent(ctx context.Context, c *dagger.Client, arch string) dagger.WithContainerFunc {
return func(ctr *dagger.Container) *dagger.Container {
base := c.Container(dagger.ContainerOpts{Platform: dagger.Platform("linux/" + arch)}).
From(fmt.Sprintf("golang:%s-alpine%s", golangVersion, alpineVersion))
sdkCtrTarball := base.
WithEnvVariable("GOTOOLCHAIN", "auto").
WithFile("/usr/local/bin/codegen", goSDKCodegenBin(c, arch)).
WithEntrypoint([]string{"/usr/local/bin/codegen"}).
AsTarball(dagger.ContainerAsTarballOpts{
ForcedCompression: dagger.Uncompressed,
})
sdkDir := base.
WithMountedDirectory("/out", c.Directory()).
WithMountedFile("/sdk.tar", sdkCtrTarball).
WithExec([]string{"tar", "xf", "/sdk.tar", "-C", "/out"}).
Directory("/out")
return sdkContent(ctx, ctr, sdkDir, distconsts.GoSDKManifestDigestEnvName)
}
}
func sdkContent(ctx context.Context, ctr *dagger.Container, sdkDir *dagger.Directory, envName string) *dagger.Container {
var index ocispecs.Index
indexContents, err := sdkDir.File("index.json").Contents(ctx)
if err != nil {
panic(err)
}
if err := json.Unmarshal([]byte(indexContents), &index); err != nil {
panic(err)
}
manifest := index.Manifests[0]
manifestDgst := manifest.Digest.String()
return ctr.
WithEnvVariable(envName, manifestDgst).
WithDirectory(distconsts.EngineContainerBuiltinContentDir, sdkDir, dagger.ContainerWithDirectoryOpts{
Include: []string{"blobs/"},
})
}
func goSDKCodegenBin(c *dagger.Client, arch string) *dagger.File {
return goBase(c).
WithEnvVariable("GOOS", "linux").
WithEnvVariable("GOARCH", arch).
WithExec([]string{
"go", "build",
"-o", "./bin/codegen",
"./cmd/codegen",
}).
File("./bin/codegen")
}
func cniPlugins(c *dagger.Client, arch string, gpuSupportEnabled bool) *dagger.Directory {
// We build the CNI plugins from source to enable upgrades to go and other dependencies that
// can contain CVEs in the builds on github releases
// If GPU support is enabled use a Debian image:
ctr := c.Container()
if gpuSupportEnabled {
// TODO: there's no guarantee the bullseye libc is compatible with the ubuntu image w/ rebase this onto
ctr = ctr.From(fmt.Sprintf("golang:%s-bullseye", golangVersion)).
WithExec([]string{"apt-get", "update"}).
WithExec([]string{"apt-get", "install", "-y", "git", "build-essential"})
} else {
ctr = ctr.From(fmt.Sprintf("golang:%s-alpine%s", golangVersion, alpineVersion)).
WithExec([]string{"apk", "add", "build-base", "go", "git"})
}
ctr = ctr.WithMountedCache("/root/go/pkg/mod", c.CacheVolume("go-mod")).
WithMountedCache("/root/.cache/go-build", c.CacheVolume("go-build")).
WithMountedDirectory("/src", c.Git("github.com/containernetworking/plugins").Tag(cniVersion).Tree()).
WithWorkdir("/src").
WithEnvVariable("GOARCH", arch)
pluginDir := c.Directory().WithFile("/opt/cni/bin/dnsname", dnsnameBinary(c, arch))
for _, pluginPath := range []string{
"plugins/main/bridge",
"plugins/main/loopback",
"plugins/meta/firewall",
"plugins/ipam/host-local",
} {
pluginName := filepath.Base(pluginPath)
pluginDir = pluginDir.WithFile(filepath.Join("/opt/cni/bin", pluginName), ctr.
WithWorkdir(pluginPath).
WithExec([]string{"go", "build", "-o", pluginName, "-ldflags", "-s -w", "."}).
File(pluginName))
}
return pluginDir
}
func dnsnameBinary(c *dagger.Client, arch string) *dagger.File {
return goBase(c).
WithEnvVariable("GOOS", "linux").
WithEnvVariable("GOARCH", arch).
WithExec([]string{
"go", "build",
"-o", "./bin/dnsname",
"-ldflags", "-s -w",
"/app/cmd/dnsname",
}).
File("./bin/dnsname")
}
func dialstdioFiles(c *dagger.Client, arch string) *dagger.Directory {
outDir := "/out"
installPath := filepath.Dir(engineDialStdioPath)
buildArgs := []string{
"go", "build",
"-o", filepath.Join(outDir, installPath, filepath.Base(engineDialStdioPath)),
"-ldflags",
}
ldflags := []string{"-s", "-w"}
buildArgs = append(buildArgs, strings.Join(ldflags, " "))
buildArgs = append(buildArgs, "/app/cmd/dialstdio")
return goBase(c).
WithEnvVariable("GOOS", "linux").
WithEnvVariable("GOARCH", arch).
WithEnvVariable("CGO_ENABLED", "0").
WithMountedDirectory(outDir, c.Directory()).
WithExec(buildArgs).
// include a symlink from buildctl to dialstdio to be compatible w/ connhelper implementations from buildkit
WithExec([]string{"ln", "-s", filepath.Base(engineDialStdioPath), filepath.Join(outDir, installPath, "buildctl")}).
Directory(outDir)
}
func runcBin(c *dagger.Client, arch string) *dagger.File {
// We build runc from source to enable upgrades to go and other dependencies that
// can contain CVEs in the builds on github releases
buildCtr := c.Container().
From(fmt.Sprintf("golang:%s-alpine%s", golangVersion, alpineVersion)).
WithEnvVariable("GOARCH", arch).
WithEnvVariable("BUILDPLATFORM", "linux/"+runtime.GOARCH).
WithEnvVariable("TARGETPLATFORM", "linux/"+arch).
WithEnvVariable("CGO_ENABLED", "1").
WithExec([]string{"apk", "add", "clang", "lld", "git", "pkgconf"}).
WithDirectory("/", c.Container().From("tonistiigi/xx:1.2.1").Rootfs()).
WithExec([]string{"xx-apk", "update"}).
WithExec([]string{"xx-apk", "add", "build-base", "pkgconf", "libseccomp-dev", "libseccomp-static"}).
WithMountedCache("/go/pkg/mod", c.CacheVolume("go-mod")).
WithMountedCache("/root/.cache/go-build", c.CacheVolume("go-build")).
WithMountedDirectory("/src", c.Git("github.com/opencontainers/runc").Tag(runcVersion).Tree()).
WithWorkdir("/src")
// TODO: runc v1.1.x uses an old version of golang.org/x/net, which has a CVE:
// https://github.com/advisories/GHSA-4374-p667-p6c8
// We upgrade it here to avoid that showing up in our image scans. This can be removed
// once runc has released a new minor version and we upgrade to it (the go.mod in runc
// main branch already has the updated version).
buildCtr = buildCtr.WithExec([]string{"go", "get", "golang.org/x/net"}).
WithExec([]string{"go", "mod", "tidy"}).
WithExec([]string{"go", "mod", "vendor"})
return buildCtr.
WithExec([]string{"xx-go", "build", "-trimpath", "-buildmode=pie", "-tags", "seccomp netgo osusergo", "-ldflags", "-X main.version=" + runcVersion + " -linkmode external -extldflags -static-pie", "-o", "runc", "."}).
File("runc")
}
func shimBin(c *dagger.Client, arch string, version string) *dagger.File {
return goBase(c).
WithEnvVariable("GOOS", "linux").
WithEnvVariable("GOARCH", arch).
WithExec([]string{
"go", "build",
"-o", "./bin/" + filepath.Base(engineShimPath),
"-ldflags", "-s -w -X github.com/dagger/dagger/engine.Version=" + version,
"/app/cmd/shim",
}).
File("./bin/" + filepath.Base(engineShimPath))
}
func engineBin(c *dagger.Client, arch string, version string) *dagger.File {
buildArgs := []string{
"go", "build",
"-o", "/app/bin/" + filepath.Base(engineServerPath),
}
ldflags := []string{
"-s", "-w",
"-X", "github.com/dagger/dagger/engine.Version=" + version,
}
buildArgs = append(buildArgs, "-ldflags", strings.Join(ldflags, " "))
return goBase(c).
WithEnvVariable("GOOS", "linux").
WithEnvVariable("GOARCH", arch).
WithWorkdir("/app/cmd/engine").
WithExec(buildArgs).
File("/app/bin/" + filepath.Base(engineServerPath))
}
func qemuBins(c *dagger.Client, arch string) *dagger.Directory {
return c.
Container(dagger.ContainerOpts{Platform: dagger.Platform("linux/" + arch)}).
From(qemuBinImage).
Rootfs()
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,728 | Zenith: default to use a class instead of top-level functions in Python | ## Summary
Change the `dagger init` template for Python to use a class instead of just functions. Also update documentation snippets to do the same.
## Motivation
In an earlier iteration of Dagger modules, when the concept of objects that contain functions were introduced, the Python SDK kept the convenience of being able to define simple top-level functions, without having to convert into a class. Python allows this by transparently “creating” the object and associate the top-level functions with it, behind the scenes. It provides a nicer experience for simple use cases, where users don’t have to get the name right for the class, since it has to match the module name.
However, you can’t add a description to the main object this way. And over time we’ve added state to object types, and constructors to initialize that state. Using state has become a common pattern, so a user may **quite often need to convert the top-level functions into a class**.
That takes me back to a few years ago, working with React. You used to be able to create components using either a function or a class. Most people prefer the simplicity of functions, but in React, if you reached a point where you needed to access some lifecycle hooks, you’d need to convert the function into a class. I had to do that a lot myself.
I remember the frustration in the community around this, growing as adoption increased[^1]. I’ve found myself doing this in Python a few times too, and I’ve grown concerned that it’ll add some of the same confusion, frustration or just friction for our users.
For this reason, I think we should default to talk about Python SDK modules using the class, instead of top-level functions, in the documentation and examples. It also makes it more consistent with Go and TypeScript.
[^1]: They eventually fixed it by making classes obsolete and have full-featured hooks in functions.
## Deprecation
I have no plans, nor do I suggest, to deprecate top-level functions at this point. They’ll still be available, just more hidden. We’ll revisit at a later time.
\cc @vikram-dagger @jpadams | https://github.com/dagger/dagger/issues/6728 | https://github.com/dagger/dagger/pull/6729 | e64f185334734a37a2f18a95ec3cf21a27e32437 | 4b7ab1e217d1f2da30723905282ba3cf27de8cab | "2024-02-24T00:58:03Z" | go | "2024-02-26T19:06:17Z" | sdk/python/runtime/.gitignore | /dagger.gen.go
/internal/querybuilder/
/querybuilder/
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,728 | Zenith: default to use a class instead of top-level functions in Python | ## Summary
Change the `dagger init` template for Python to use a class instead of just functions. Also update documentation snippets to do the same.
## Motivation
In an earlier iteration of Dagger modules, when the concept of objects that contain functions were introduced, the Python SDK kept the convenience of being able to define simple top-level functions, without having to convert into a class. Python allows this by transparently “creating” the object and associate the top-level functions with it, behind the scenes. It provides a nicer experience for simple use cases, where users don’t have to get the name right for the class, since it has to match the module name.
However, you can’t add a description to the main object this way. And over time we’ve added state to object types, and constructors to initialize that state. Using state has become a common pattern, so a user may **quite often need to convert the top-level functions into a class**.
That takes me back to a few years ago, working with React. You used to be able to create components using either a function or a class. Most people prefer the simplicity of functions, but in React, if you reached a point where you needed to access some lifecycle hooks, you’d need to convert the function into a class. I had to do that a lot myself.
I remember the frustration in the community around this, growing as adoption increased[^1]. I’ve found myself doing this in Python a few times too, and I’ve grown concerned that it’ll add some of the same confusion, frustration or just friction for our users.
For this reason, I think we should default to talk about Python SDK modules using the class, instead of top-level functions, in the documentation and examples. It also makes it more consistent with Go and TypeScript.
[^1]: They eventually fixed it by making classes obsolete and have full-featured hooks in functions.
## Deprecation
I have no plans, nor do I suggest, to deprecate top-level functions at this point. They’ll still be available, just more hidden. We’ll revisit at a later time.
\cc @vikram-dagger @jpadams | https://github.com/dagger/dagger/issues/6728 | https://github.com/dagger/dagger/pull/6729 | e64f185334734a37a2f18a95ec3cf21a27e32437 | 4b7ab1e217d1f2da30723905282ba3cf27de8cab | "2024-02-24T00:58:03Z" | go | "2024-02-26T19:06:17Z" | sdk/python/runtime/dagger.json | {
"name": "python-sdk",
"sdk": "go"
}
|
closed | dagger/dagger | https://github.com/dagger/dagger | 6,728 | Zenith: default to use a class instead of top-level functions in Python | ## Summary
Change the `dagger init` template for Python to use a class instead of just functions. Also update documentation snippets to do the same.
## Motivation
In an earlier iteration of Dagger modules, when the concept of objects that contain functions were introduced, the Python SDK kept the convenience of being able to define simple top-level functions, without having to convert into a class. Python allows this by transparently “creating” the object and associate the top-level functions with it, behind the scenes. It provides a nicer experience for simple use cases, where users don’t have to get the name right for the class, since it has to match the module name.
However, you can’t add a description to the main object this way. And over time we’ve added state to object types, and constructors to initialize that state. Using state has become a common pattern, so a user may **quite often need to convert the top-level functions into a class**.
That takes me back to a few years ago, working with React. You used to be able to create components using either a function or a class. Most people prefer the simplicity of functions, but in React, if you reached a point where you needed to access some lifecycle hooks, you’d need to convert the function into a class. I had to do that a lot myself.
I remember the frustration in the community around this, growing as adoption increased[^1]. I’ve found myself doing this in Python a few times too, and I’ve grown concerned that it’ll add some of the same confusion, frustration or just friction for our users.
For this reason, I think we should default to talk about Python SDK modules using the class, instead of top-level functions, in the documentation and examples. It also makes it more consistent with Go and TypeScript.
[^1]: They eventually fixed it by making classes obsolete and have full-featured hooks in functions.
## Deprecation
I have no plans, nor do I suggest, to deprecate top-level functions at this point. They’ll still be available, just more hidden. We’ll revisit at a later time.
\cc @vikram-dagger @jpadams | https://github.com/dagger/dagger/issues/6728 | https://github.com/dagger/dagger/pull/6729 | e64f185334734a37a2f18a95ec3cf21a27e32437 | 4b7ab1e217d1f2da30723905282ba3cf27de8cab | "2024-02-24T00:58:03Z" | go | "2024-02-26T19:06:17Z" | sdk/python/runtime/go.mod | module python-sdk
go 1.21
require (
github.com/99designs/gqlgen v0.17.31
github.com/Khan/genqlient v0.6.0
github.com/vektah/gqlparser/v2 v2.5.6
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
golang.org/x/sync v0.4.0
)
require github.com/stretchr/testify v1.8.3 // indirect
|