Compare commits

..

No commits in common. "master" and "v0.20.0" have entirely different histories.

1202 changed files with 39312 additions and 97914 deletions

View file

@ -1,15 +0,0 @@
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write|MultiEdit",
"hooks": [
{
"type": "command",
"command": "jq -r '.tool_input.file_path // empty' | { read -r f; case \"$f\" in *.go) gofumpt -w \"$f\" ;; esac; } 2>/dev/null || true"
}
]
}
]
}
}

View file

@ -1,11 +0,0 @@
FROM mcr.microsoft.com/devcontainers/go:bullseye
RUN apt-get update && apt-get install -y \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
RUN go install mvdan.cc/gofumpt@latest
ENV PATH="/root/go/bin:${PATH}"
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.0
RUN golangci-lint --version

View file

@ -1,54 +0,0 @@
{
"name": "Docker in Docker",
"build": {
"dockerfile": "./Dockerfile",
"context": "."
},
"features": {
"ghcr.io/devcontainers/features/common-utils:1": {
"installZsh": "true",
"upgradePackages": "false",
"uid": "1000",
"gid": "1000",
"installOhMyZsh": "true",
"nonFreePackages": "true"
},
"ghcr.io/devcontainers/features/docker-from-docker:1": {
"version": "latest",
"enableNonRootDocker": "true",
"moby": "true"
},
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/go:1": {}
},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "~/go",
"[go]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"go.lintTool": "golangci-lint",
"gopls": {
"formatting.gofumpt": true,
"usePlaceholders": false // add parameter placeholders when completing a function
},
"files.eol": "\n"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"golang.Go"
]
}
}
// TODO: make this work.
// "postStartCommand": "echo \"alias gr=\\\"go run /workspaces/lazydocker/main.go\\\"\" >> ~/.zhsrc"
}

View file

@ -3,7 +3,7 @@ name: Continuous Delivery
on: on:
push: push:
tags: tags:
- "v*" - 'v*'
jobs: jobs:
goreleaser: goreleaser:
@ -14,14 +14,18 @@ jobs:
- name: Unshallow repo - name: Unshallow repo
run: git fetch --prune --unshallow run: git fetch --prune --unshallow
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v6 uses: actions/setup-go@v1
with: with:
go-version: 1.24.x go-version: 1.18.x
- name: Run goreleaser - name: Run goreleaser
uses: goreleaser/goreleaser-action@v1 uses: goreleaser/goreleaser-action@v1
with:
distribution: goreleaser
version: v1.17.2
args: release --clean
env: env:
GITHUB_TOKEN: ${{secrets.TOKEN_GITHUB}} GITHUB_TOKEN: ${{secrets.GORELEASER_TOKEN}}
homebrew:
runs-on: ubuntu-latest
steps:
- name: Bump Homebrew formula
uses: dawidd6/action-homebrew-bump-formula@v3
with:
token: ${{secrets.HOMEBREW_TOKEN}}
formula: lazydocker

View file

@ -1,7 +1,7 @@
name: Continuous Integration name: Continuous Integration
env: env:
GO_VERSION: 1.24 GO_VERSION: 1.18
on: on:
push: push:
@ -25,11 +25,11 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v6 uses: actions/setup-go@v1
with: with:
go-version: 1.24.x go-version: 1.18.x
- name: Cache build - name: Cache build
uses: actions/cache@v4 uses: actions/cache@v1
with: with:
path: ~/.cache/go-build path: ~/.cache/go-build
key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}-test key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}-test
@ -47,11 +47,11 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v6 uses: actions/setup-go@v1
with: with:
go-version: 1.24.x go-version: 1.18.x
- name: Cache build - name: Cache build
uses: actions/cache@v4 uses: actions/cache@v1
with: with:
path: ~/.cache/go-build path: ~/.cache/go-build
key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}-build key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}-build
@ -75,11 +75,11 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v6 uses: actions/setup-go@v1
with: with:
go-version: 1.24.x go-version: 1.18.x
- name: Cache build - name: Cache build
uses: actions/cache@v4 uses: actions/cache@v1
with: with:
path: | path: |
~/.cache/go-build ~/.cache/go-build
@ -102,11 +102,11 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v6 uses: actions/setup-go@v1
with: with:
go-version: 1.24.x go-version: 1.18.x
- name: Cache build - name: Cache build
uses: actions/cache@v4 uses: actions/cache@v1
with: with:
path: ~/.cache/go-build path: ~/.cache/go-build
key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}-test key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}-test

View file

@ -9,20 +9,19 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout 🛎️ - name: Checkout 🛎️
uses: actions/checkout@v3 uses: actions/checkout@v2
- name: Generate Sponsors 💖 - name: Generate Sponsors 💖
uses: JamesIves/github-sponsors-readme-action@v1.2.2 uses: JamesIves/github-sponsors-readme-action@v1.0.8
with: with:
token: ${{ secrets.TOKEN_GITHUB }} token: ${{ secrets.SPONSORS_TOKEN }}
file: "README.md" file: 'README.md'
if: ${{ github.repository == 'jesseduffield/lazydocker' }}
- name: Create Pull Request 🚀 - name: Commit and push if changed
uses: peter-evans/create-pull-request@v6 run: |-
with: git diff
commit-message: "README.md: Update Sponsors" git config --global user.email "actions@users.noreply.github.com"
title: "README.md: Update Sponsors" git config --global user.name "README-bot"
author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" git add README.md
labels: "ignore-for-release" git commit -m "Updated README.md" || exit 0
delete-branch: true git push

1
.gitignore vendored
View file

@ -2,4 +2,3 @@ lazydocker*
TODO.md TODO.md
Lazydocker.code-workspace Lazydocker.code-workspace
.vscode .vscode
.idea

View file

@ -1,10 +1,13 @@
linters: linters:
disable:
- structcheck # gives false positives
enable: enable:
- gofumpt - gofumpt
- thelper - thelper
- goimports - goimports
- tparallel - tparallel
- wastedassign - wastedassign
- exportloopref
- unparam - unparam
- prealloc - prealloc
- unconvert - unconvert
@ -23,5 +26,4 @@ linters-settings:
max-func-lines: 0 max-func-lines: 0
run: run:
go: '1.21' go: 1.18
timeout: 10m

View file

@ -1,5 +0,0 @@
# CLAUDE.md
## Build & test
- All Go commands need `GOFLAGS=-mod=vendor` (deps are vendored, including the `jesseduffield/gocui` fork and the Docker SDK).
- Unit tests: `GOFLAGS=-mod=vendor go test ./...`

View file

@ -1,6 +1,6 @@
ARG BASE_IMAGE_BUILDER=golang ARG BASE_IMAGE_BUILDER=golang
ARG ALPINE_VERSION=3.20 ARG ALPINE_VERSION=3.15
ARG GO_VERSION=1.23 ARG GO_VERSION=1.18
FROM ${BASE_IMAGE_BUILDER}:${GO_VERSION}-alpine${ALPINE_VERSION} AS builder FROM ${BASE_IMAGE_BUILDER}:${GO_VERSION}-alpine${ALPINE_VERSION} AS builder
ARG GOARCH=amd64 ARG GOARCH=amd64
@ -19,7 +19,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${GOARCH} GOARM=${GOARM} \
FROM ${BASE_IMAGE_BUILDER}:${GO_VERSION}-alpine${ALPINE_VERSION} AS docker-builder FROM ${BASE_IMAGE_BUILDER}:${GO_VERSION}-alpine${ALPINE_VERSION} AS docker-builder
ARG GOARCH=amd64 ARG GOARCH=amd64
ARG GOARM ARG GOARM
ARG DOCKER_VERSION=v27.0.3 ARG DOCKER_VERSION=v20.10.13
RUN apk add -U -q --progress --no-cache git bash coreutils gcc musl-dev RUN apk add -U -q --progress --no-cache git bash coreutils gcc musl-dev
WORKDIR /go/src/github.com/docker/cli WORKDIR /go/src/github.com/docker/cli
RUN git clone --branch ${DOCKER_VERSION} --single-branch --depth 1 https://github.com/docker/cli.git . > /dev/null 2>&1 RUN git clone --branch ${DOCKER_VERSION} --single-branch --depth 1 https://github.com/docker/cli.git . > /dev/null 2>&1

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 KiB

View file

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,4 @@
version: '3'
services: services:
lazydocker: lazydocker:
build: build:

View file

@ -10,38 +10,20 @@ Changes to the user config will only take place after closing and re-opening laz
- OSX: `~/Library/Application Support/jesseduffield/lazydocker/config.yml` - OSX: `~/Library/Application Support/jesseduffield/lazydocker/config.yml`
- Linux: `~/.config/lazydocker/config.yml` - Linux: `~/.config/lazydocker/config.yml`
- Windows: `C:\Users\<User>\AppData\Roaming\lazydocker\config.yml` - Windows: `C:\\Users\\<User>\\AppData\\Roaming\\jesseduffield\\lazydocker\\config.yml` (I think)
JSON schema is available for `config.yml` so that IntelliSense in Visual Studio Code
(completion and error checking) is automatically enabled when the [YAML Red Hat][yaml]
extension is installed. However, note that automatic schema detection only works
if your config file is in one of the standard paths mentioned above. If you
override the path to the file, you can still make IntelliSense work by adding
```yaml
# yaml-language-server: $schema=https://json.schemastore.org/lazydocker.json
```
to the top of your config file or via [Visual Studio Code settings.json config][settings].
[yaml]: https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml
[settings]: https://github.com/redhat-developer/vscode-yaml#associating-a-schema-to-a-glob-pattern-via-yamlschemas
## Default: ## Default:
```yml ```yml
gui: gui:
scrollHeight: 2 scrollHeight: 2
language: "auto" # one of 'auto' | 'en' | 'pl' | 'nl' | 'de' | 'tr' language: 'auto' # one of 'auto' | 'en' | 'pl' | 'nl' | 'de' | 'tr'
border: "rounded" # one of 'rounded' | 'single' | 'double' | 'hidden'
theme: theme:
activeBorderColor: activeBorderColor:
- green - green
- bold - bold
inactiveBorderColor: inactiveBorderColor:
- white - white
selectedLineBgColor:
- blue
optionsTextColor: optionsTextColor:
- blue - blue
returnImmediately: false returnImmediately: false
@ -54,18 +36,11 @@ gui:
# When true, increases vertical space used by focused side panel, # When true, increases vertical space used by focused side panel,
# creating an accordion effect # creating an accordion effect
expandFocusedSidePanel: false expandFocusedSidePanel: false
# Determines which screen mode will be used on startup
screenMode: "normal" # one of 'normal' | 'half' | 'fullscreen'
# Determines the style of the container status and container health display in the
# containers panel. "long": full words (default), "short": one or two characters,
# "icon": unicode emoji.
containerStatusHealthStyle: "long"
logs: logs:
timestamps: false timestamps: false
since: '60m' # set to '' to show all logs since: '60m'
tail: '' # set to 200 to show last 200 lines of logs
commandTemplates: commandTemplates:
dockerCompose: docker compose # Determines the Docker Compose command to run, referred to as .DockerCompose in commandTemplates dockerCompose: docker-compose
restartService: '{{ .DockerCompose }} restart {{ .Service.Name }}' restartService: '{{ .DockerCompose }} restart {{ .Service.Name }}'
up: '{{ .DockerCompose }} up -d' up: '{{ .DockerCompose }} up -d'
down: '{{ .DockerCompose }} down' down: '{{ .DockerCompose }} down'
@ -128,11 +103,6 @@ customCommands:
serviceNames: [] serviceNames: []
``` ```
You may use the following go templates (such as `{{ .Container.ID }}` above) in your commands:
- `{{ .DockerCompose }}`: the docker compose command (default: `docker-compose`)
- [`{{ .Container }}`](https://pkg.go.dev/github.com/jesseduffield/lazydocker@v0.20.0/pkg/commands#Container) and its fields. For example: `{{ .Container.Container.ImageID }}`
- [`{{ .Service }}`](https://pkg.go.dev/github.com/jesseduffield/lazydocker@v0.20.0/pkg/commands#Service) and its fields. For example: `{{ .Service.Name }}`
## Replacements ## Replacements
You can add replacements like so: You can add replacements like so:

View file

@ -11,7 +11,6 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>enter</kbd>: fokussieren aufs Hauptpanel <kbd>enter</kbd>: fokussieren aufs Hauptpanel
<kbd>[</kbd>: vorheriges Tab <kbd>[</kbd>: vorheriges Tab
<kbd>]</kbd>: nächstes Tab <kbd>]</kbd>: nächstes Tab
<kbd>/</kbd>: filter list
</pre> </pre>
## Container ## Container
@ -82,18 +81,6 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>/</kbd>: filter list <kbd>/</kbd>: filter list
</pre> </pre>
## Netzwerk
<pre>
<kbd>c</kbd>: führe vordefinierten benutzerdefinierten Befehl aus
<kbd>d</kbd>: entferne Netzwerk
<kbd>b</kbd>: view bulk commands
<kbd>enter</kbd>: fokussieren aufs Hauptpanel
<kbd>[</kbd>: vorheriges Tab
<kbd>]</kbd>: nächstes Tab
<kbd>/</kbd>: filter list
</pre>
## Haupt ## Haupt
<pre> <pre>
@ -105,10 +92,4 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<pre> <pre>
<kbd>+</kbd>: next screen mode (normal/half/fullscreen) <kbd>+</kbd>: next screen mode (normal/half/fullscreen)
<kbd>_</kbd>: prev screen mode <kbd>_</kbd>: prev screen mode
<kbd>1</kbd>: focus projects panel
<kbd>2</kbd>: focus services panel
<kbd>3</kbd>: focus containers panel
<kbd>4</kbd>: focus images panel
<kbd>5</kbd>: focus volumes panel
<kbd>6</kbd>: focus networks panel
</pre> </pre>

View file

@ -11,7 +11,6 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>enter</kbd>: focus main panel <kbd>enter</kbd>: focus main panel
<kbd>[</kbd>: previous tab <kbd>[</kbd>: previous tab
<kbd>]</kbd>: next tab <kbd>]</kbd>: next tab
<kbd>/</kbd>: filter list
</pre> </pre>
## Containers ## Containers
@ -82,18 +81,6 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>/</kbd>: filter list <kbd>/</kbd>: filter list
</pre> </pre>
## Networks
<pre>
<kbd>c</kbd>: run predefined custom command
<kbd>d</kbd>: remove network
<kbd>b</kbd>: view bulk commands
<kbd>enter</kbd>: focus main panel
<kbd>[</kbd>: previous tab
<kbd>]</kbd>: next tab
<kbd>/</kbd>: filter list
</pre>
## Main ## Main
<pre> <pre>
@ -105,10 +92,4 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<pre> <pre>
<kbd>+</kbd>: next screen mode (normal/half/fullscreen) <kbd>+</kbd>: next screen mode (normal/half/fullscreen)
<kbd>_</kbd>: prev screen mode <kbd>_</kbd>: prev screen mode
<kbd>1</kbd>: focus projects panel
<kbd>2</kbd>: focus services panel
<kbd>3</kbd>: focus containers panel
<kbd>4</kbd>: focus images panel
<kbd>5</kbd>: focus volumes panel
<kbd>6</kbd>: focus networks panel
</pre> </pre>

View file

@ -1,114 +0,0 @@
_This file is auto-generated. To update, make the changes in the pkg/i18n directory and then run `go run scripts/cheatsheet/main.go generate` from the project root._
# Lazydocker menú
## Proyecto
<pre>
<kbd>e</kbd>: editar configuración de lazydocker
<kbd>o</kbd>: abrir configuración de lazydocker
<kbd>m</kbd>: ver logs
<kbd>enter</kbd>: enfocar panel principal
<kbd>[</kbd>: anterior pestaña
<kbd>]</kbd>: siguiente pestaña
<kbd>/</kbd>: filtrar lista
</pre>
## Contenedores
<pre>
<kbd>d</kbd>: borrar
<kbd>e</kbd>: esconder/mostrar contenedores parados
<kbd>p</kbd>: pausa
<kbd>s</kbd>: parar
<kbd>r</kbd>: reiniciar
<kbd>a</kbd>: attach
<kbd>m</kbd>: ver logs
<kbd>E</kbd>: ejecutar shell
<kbd>c</kbd>: ejecutar comando personalizado
<kbd>b</kbd>: ver comandos masivos
<kbd>w</kbd>: abrir en navegador (first port is http)
<kbd>enter</kbd>: enfocar panel principal
<kbd>[</kbd>: anterior pestaña
<kbd>]</kbd>: siguiente pestaña
<kbd>/</kbd>: filtrar lista
</pre>
## Servicios
<pre>
<kbd>u</kbd>: levantar servicio
<kbd>d</kbd>: borrar contenedores
<kbd>s</kbd>: parar
<kbd>p</kbd>: pausa
<kbd>r</kbd>: reiniciar
<kbd>S</kbd>: iniciar
<kbd>a</kbd>: attach
<kbd>m</kbd>: ver logs
<kbd>U</kbd>: levantar proyecto
<kbd>D</kbd>: dar de baja el proyecto
<kbd>R</kbd>: ver opciones de reinicio
<kbd>c</kbd>: ejecutar comando personalizado
<kbd>b</kbd>: ver comandos masivos
<kbd>E</kbd>: ejecutar shell
<kbd>w</kbd>: abrir en navegador (first port is http)
<kbd>enter</kbd>: enfocar panel principal
<kbd>[</kbd>: anterior pestaña
<kbd>]</kbd>: siguiente pestaña
<kbd>/</kbd>: filtrar lista
</pre>
## Imágenes
<pre>
<kbd>c</kbd>: ejecutar comando personalizado
<kbd>d</kbd>: limpiar imagen
<kbd>b</kbd>: ver comandos masivos
<kbd>enter</kbd>: enfocar panel principal
<kbd>[</kbd>: anterior pestaña
<kbd>]</kbd>: siguiente pestaña
<kbd>/</kbd>: filtrar lista
</pre>
## Volúmenes
<pre>
<kbd>c</kbd>: ejecutar comando personalizado
<kbd>d</kbd>: limpiar volúmen
<kbd>b</kbd>: ver comandos masivos
<kbd>enter</kbd>: enfocar panel principal
<kbd>[</kbd>: anterior pestaña
<kbd>]</kbd>: siguiente pestaña
<kbd>/</kbd>: filtrar lista
</pre>
## Redes
<pre>
<kbd>c</kbd>: ejecutar comando personalizado
<kbd>d</kbd>: limpiar red
<kbd>b</kbd>: ver comandos masivos
<kbd>enter</kbd>: enfocar panel principal
<kbd>[</kbd>: anterior pestaña
<kbd>]</kbd>: siguiente pestaña
<kbd>/</kbd>: filtrar lista
</pre>
## Inicio
<pre>
<kbd>esc</kbd>: regresar
</pre>
## Global
<pre>
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
<kbd>_</kbd>: prev screen mode
<kbd>1</kbd>: focus projects panel
<kbd>2</kbd>: focus services panel
<kbd>3</kbd>: focus containers panel
<kbd>4</kbd>: focus images panel
<kbd>5</kbd>: focus volumes panel
<kbd>6</kbd>: focus networks panel
</pre>

View file

@ -6,12 +6,11 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<pre> <pre>
<kbd>e</kbd>: modifier la configuration lazydocker <kbd>e</kbd>: modifier la configuration lazydocker
<kbd>o</kbd>: ouvrir la configuration lazydocker <kbd>o</kbd>: ouvrire la configuration lazydocker
<kbd>m</kbd>: voir les enregistrements <kbd>m</kbd>: voir les enregistrements
<kbd>enter</kbd>: focus panneau principal <kbd>enter</kbd>: focus paneau principal
<kbd>[</kbd>: onglet précédent <kbd>[</kbd>: onglet précédent
<kbd>]</kbd>: onglet suivant <kbd>]</kbd>: onglet suivant
<kbd>/</kbd>: filter list
</pre> </pre>
## Conteneurs ## Conteneurs
@ -24,11 +23,11 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>r</kbd>: redémarrer <kbd>r</kbd>: redémarrer
<kbd>a</kbd>: attacher <kbd>a</kbd>: attacher
<kbd>m</kbd>: voir les enregistrements <kbd>m</kbd>: voir les enregistrements
<kbd>E</kbd>: exécuter le shell <kbd>E</kbd>: executer le shell
<kbd>c</kbd>: exécuter une commande prédéfinie <kbd>c</kbd>: executer une commande prédéfinie
<kbd>b</kbd>: voir les commandes groupées <kbd>b</kbd>: voir les commandes groupés
<kbd>w</kbd>: ouvrir dans le navigateur (le premier port est http) <kbd>w</kbd>: ouvrir dans le navgateur (le premier port est http)
<kbd>enter</kbd>: focus panneau principal <kbd>enter</kbd>: focus paneau principal
<kbd>[</kbd>: onglet précédent <kbd>[</kbd>: onglet précédent
<kbd>]</kbd>: onglet suivant <kbd>]</kbd>: onglet suivant
<kbd>/</kbd>: filter list <kbd>/</kbd>: filter list
@ -48,11 +47,11 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>U</kbd>: up project <kbd>U</kbd>: up project
<kbd>D</kbd>: down project <kbd>D</kbd>: down project
<kbd>R</kbd>: voir les options de redémarrage <kbd>R</kbd>: voir les options de redémarrage
<kbd>c</kbd>: exécuter une commande prédéfinie <kbd>c</kbd>: executer une commande prédéfinie
<kbd>b</kbd>: voir les commandes groupées <kbd>b</kbd>: voir les commandes groupés
<kbd>E</kbd>: exécuter le shell <kbd>E</kbd>: executer le shell
<kbd>w</kbd>: ouvrir dans le navigateur (le premier port est http) <kbd>w</kbd>: ouvrir dans le navgateur (le premier port est http)
<kbd>enter</kbd>: focus panneau principal <kbd>enter</kbd>: focus paneau principal
<kbd>[</kbd>: onglet précédent <kbd>[</kbd>: onglet précédent
<kbd>]</kbd>: onglet suivant <kbd>]</kbd>: onglet suivant
<kbd>/</kbd>: filter list <kbd>/</kbd>: filter list
@ -61,10 +60,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
## Images ## Images
<pre> <pre>
<kbd>c</kbd>: exécuter une commande prédéfinie <kbd>c</kbd>: executer une commande prédéfinie
<kbd>d</kbd>: supprimer l'image <kbd>d</kbd>: supprimer l'image
<kbd>b</kbd>: voir les commandes groupées <kbd>b</kbd>: voir les commandes groupés
<kbd>enter</kbd>: focus panneau principal <kbd>enter</kbd>: focus paneau principal
<kbd>[</kbd>: onglet précédent <kbd>[</kbd>: onglet précédent
<kbd>]</kbd>: onglet suivant <kbd>]</kbd>: onglet suivant
<kbd>/</kbd>: filter list <kbd>/</kbd>: filter list
@ -73,22 +72,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
## Volumes ## Volumes
<pre> <pre>
<kbd>c</kbd>: exécuter une commande prédéfinie <kbd>c</kbd>: executer une commande prédéfinie
<kbd>d</kbd>: supprimer le volume <kbd>d</kbd>: supprimer le volume
<kbd>b</kbd>: voir les commandes groupées <kbd>b</kbd>: voir les commandes groupés
<kbd>enter</kbd>: focus panneau principal <kbd>enter</kbd>: focus paneau principal
<kbd>[</kbd>: onglet précédent
<kbd>]</kbd>: onglet suivant
<kbd>/</kbd>: filter list
</pre>
## Réseaux
<pre>
<kbd>c</kbd>: exécuter une commande prédéfinie
<kbd>d</kbd>: supprimer le réseau
<kbd>b</kbd>: voir les commandes groupées
<kbd>enter</kbd>: focus panneau principal
<kbd>[</kbd>: onglet précédent <kbd>[</kbd>: onglet précédent
<kbd>]</kbd>: onglet suivant <kbd>]</kbd>: onglet suivant
<kbd>/</kbd>: filter list <kbd>/</kbd>: filter list
@ -105,10 +92,4 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<pre> <pre>
<kbd>+</kbd>: next screen mode (normal/half/fullscreen) <kbd>+</kbd>: next screen mode (normal/half/fullscreen)
<kbd>_</kbd>: prev screen mode <kbd>_</kbd>: prev screen mode
<kbd>1</kbd>: focus projects panel
<kbd>2</kbd>: focus services panel
<kbd>3</kbd>: focus containers panel
<kbd>4</kbd>: focus images panel
<kbd>5</kbd>: focus volumes panel
<kbd>6</kbd>: focus networks panel
</pre> </pre>

View file

@ -11,7 +11,6 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>enter</kbd>: focus hoofdpaneel <kbd>enter</kbd>: focus hoofdpaneel
<kbd>[</kbd>: vorige tab <kbd>[</kbd>: vorige tab
<kbd>]</kbd>: volgende tab <kbd>]</kbd>: volgende tab
<kbd>/</kbd>: filter list
</pre> </pre>
## Containers ## Containers
@ -82,18 +81,6 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>/</kbd>: filter list <kbd>/</kbd>: filter list
</pre> </pre>
## Networks
<pre>
<kbd>c</kbd>: draai een vooraf bedacht aangepaste opdracht
<kbd>d</kbd>: verwijder network
<kbd>b</kbd>: view bulk commands
<kbd>enter</kbd>: focus hoofdpaneel
<kbd>[</kbd>: vorige tab
<kbd>]</kbd>: volgende tab
<kbd>/</kbd>: filter list
</pre>
## Hoofd ## Hoofd
<pre> <pre>
@ -105,10 +92,4 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<pre> <pre>
<kbd>+</kbd>: next screen mode (normal/half/fullscreen) <kbd>+</kbd>: next screen mode (normal/half/fullscreen)
<kbd>_</kbd>: prev screen mode <kbd>_</kbd>: prev screen mode
<kbd>1</kbd>: focus projects panel
<kbd>2</kbd>: focus services panel
<kbd>3</kbd>: focus containers panel
<kbd>4</kbd>: focus images panel
<kbd>5</kbd>: focus volumes panel
<kbd>6</kbd>: focus networks panel
</pre> </pre>

View file

@ -11,7 +11,6 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>enter</kbd>: skup na głównym panelu <kbd>enter</kbd>: skup na głównym panelu
<kbd>[</kbd>: poprzednia zakładka <kbd>[</kbd>: poprzednia zakładka
<kbd>]</kbd>: następna zakładka <kbd>]</kbd>: następna zakładka
<kbd>/</kbd>: filter list
</pre> </pre>
## Kontenery ## Kontenery
@ -82,18 +81,6 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>/</kbd>: filter list <kbd>/</kbd>: filter list
</pre> </pre>
## Sieci
<pre>
<kbd>c</kbd>: wykonaj predefiniowaną własną komende
<kbd>d</kbd>: usuń sieci
<kbd>b</kbd>: view bulk commands
<kbd>enter</kbd>: skup na głównym panelu
<kbd>[</kbd>: poprzednia zakładka
<kbd>]</kbd>: następna zakładka
<kbd>/</kbd>: filter list
</pre>
## Główne ## Główne
<pre> <pre>
@ -105,10 +92,4 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<pre> <pre>
<kbd>+</kbd>: next screen mode (normal/half/fullscreen) <kbd>+</kbd>: next screen mode (normal/half/fullscreen)
<kbd>_</kbd>: prev screen mode <kbd>_</kbd>: prev screen mode
<kbd>1</kbd>: focus projects panel
<kbd>2</kbd>: focus services panel
<kbd>3</kbd>: focus containers panel
<kbd>4</kbd>: focus images panel
<kbd>5</kbd>: focus volumes panel
<kbd>6</kbd>: focus networks panel
</pre> </pre>

View file

@ -1,114 +0,0 @@
_This file is auto-generated. To update, make the changes in the pkg/i18n directory and then run `go run scripts/cheatsheet/main.go generate` from the project root._
# Lazydocker menu
## Projeto
<pre>
<kbd>e</kbd>: editar configuração do lazydocker
<kbd>o</kbd>: abrir configuração do lazydocker
<kbd>m</kbd>: ver logs
<kbd>enter</kbd>: focar no painel principal
<kbd>[</kbd>: aba anterior
<kbd>]</kbd>: próxima aba
<kbd>/</kbd>: filtrar lista
</pre>
## Contêineres
<pre>
<kbd>d</kbd>: remover
<kbd>e</kbd>: ocultar/mostrar contêineres parados
<kbd>p</kbd>: pausar
<kbd>s</kbd>: parar
<kbd>r</kbd>: reiniciar
<kbd>a</kbd>: anexar
<kbd>m</kbd>: ver logs
<kbd>E</kbd>: executar shell
<kbd>c</kbd>: executar comando personalizado predefinido
<kbd>b</kbd>: ver comandos em massa
<kbd>w</kbd>: abrir no navegador (primeira porta é http)
<kbd>enter</kbd>: focar no painel principal
<kbd>[</kbd>: aba anterior
<kbd>]</kbd>: próxima aba
<kbd>/</kbd>: filtrar lista
</pre>
## Serviços
<pre>
<kbd>u</kbd>: subir serviço
<kbd>d</kbd>: remover contêineres
<kbd>s</kbd>: parar
<kbd>p</kbd>: pausar
<kbd>r</kbd>: reiniciar
<kbd>S</kbd>: iniciar
<kbd>a</kbd>: anexar
<kbd>m</kbd>: ver logs
<kbd>U</kbd>: subir projeto
<kbd>D</kbd>: derrubar projeto
<kbd>R</kbd>: ver opções de reinício
<kbd>c</kbd>: executar comando personalizado predefinido
<kbd>b</kbd>: ver comandos em massa
<kbd>E</kbd>: executar shell
<kbd>w</kbd>: abrir no navegador (primeira porta é http)
<kbd>enter</kbd>: focar no painel principal
<kbd>[</kbd>: aba anterior
<kbd>]</kbd>: próxima aba
<kbd>/</kbd>: filtrar lista
</pre>
## Imagens
<pre>
<kbd>c</kbd>: executar comando personalizado predefinido
<kbd>d</kbd>: remover imagem
<kbd>b</kbd>: ver comandos em massa
<kbd>enter</kbd>: focar no painel principal
<kbd>[</kbd>: aba anterior
<kbd>]</kbd>: próxima aba
<kbd>/</kbd>: filtrar lista
</pre>
## Volumes
<pre>
<kbd>c</kbd>: executar comando personalizado predefinido
<kbd>d</kbd>: remover volume
<kbd>b</kbd>: ver comandos em massa
<kbd>enter</kbd>: focar no painel principal
<kbd>[</kbd>: aba anterior
<kbd>]</kbd>: próxima aba
<kbd>/</kbd>: filtrar lista
</pre>
## Redes
<pre>
<kbd>c</kbd>: executar comando personalizado predefinido
<kbd>d</kbd>: remover rede
<kbd>b</kbd>: ver comandos em massa
<kbd>enter</kbd>: focar no painel principal
<kbd>[</kbd>: aba anterior
<kbd>]</kbd>: próxima aba
<kbd>/</kbd>: filtrar lista
</pre>
## Principal
<pre>
<kbd>esc</kbd>: retornar
</pre>
## Global
<pre>
<kbd>+</kbd>: modo de tela seguinte (normal/meia/tela cheia)
<kbd>_</kbd>: modo de tela anterior
<kbd>1</kbd>: focus projects panel
<kbd>2</kbd>: focus services panel
<kbd>3</kbd>: focus containers panel
<kbd>4</kbd>: focus images panel
<kbd>5</kbd>: focus volumes panel
<kbd>6</kbd>: focus networks panel
</pre>

View file

@ -11,7 +11,6 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>enter</kbd>: ana panele odaklan <kbd>enter</kbd>: ana panele odaklan
<kbd>[</kbd>: önceki sekme <kbd>[</kbd>: önceki sekme
<kbd>]</kbd>: sonraki sekme <kbd>]</kbd>: sonraki sekme
<kbd>/</kbd>: filter list
</pre> </pre>
## Konteynerler ## Konteynerler
@ -82,18 +81,6 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<kbd>/</kbd>: filter list <kbd>/</kbd>: filter list
</pre> </pre>
## Ağları
<pre>
<kbd>c</kbd>: önceden tanımlanmış özel komutu çalıştır
<kbd>d</kbd>: ağı kaldır
<kbd>b</kbd>: view bulk commands
<kbd>enter</kbd>: ana panele odaklan
<kbd>[</kbd>: önceki sekme
<kbd>]</kbd>: sonraki sekme
<kbd>/</kbd>: filter list
</pre>
## Ana ## Ana
<pre> <pre>
@ -105,10 +92,4 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
<pre> <pre>
<kbd>+</kbd>: next screen mode (normal/half/fullscreen) <kbd>+</kbd>: next screen mode (normal/half/fullscreen)
<kbd>_</kbd>: prev screen mode <kbd>_</kbd>: prev screen mode
<kbd>1</kbd>: focus projects panel
<kbd>2</kbd>: focus services panel
<kbd>3</kbd>: focus containers panel
<kbd>4</kbd>: focus images panel
<kbd>5</kbd>: focus volumes panel
<kbd>6</kbd>: focus networks panel
</pre> </pre>

View file

@ -1,114 +0,0 @@
_This file is auto-generated. To update, make the changes in the pkg/i18n directory and then run `go run scripts/cheatsheet/main.go generate` from the project root._
# Lazydocker 菜单
## 项目
<pre>
<kbd>e</kbd>: 编辑lazydocker配置
<kbd>o</kbd>: 打开lazydocker配置
<kbd>m</kbd>: 查看日志
<kbd>enter</kbd>: 聚焦主面板
<kbd>[</kbd>: 上一个选项卡
<kbd>]</kbd>: 下一个选项卡
<kbd>/</kbd>: 过滤列表
</pre>
## 容器
<pre>
<kbd>d</kbd>: 移除
<kbd>e</kbd>: 隐藏/显示已停止的容器
<kbd>p</kbd>: 暂停
<kbd>s</kbd>: 停止
<kbd>r</kbd>: 重新启动
<kbd>a</kbd>: attach
<kbd>m</kbd>: 查看日志
<kbd>E</kbd>: 执行shell
<kbd>c</kbd>: 运行预定义的自定义命令
<kbd>b</kbd>: 查看批量命令
<kbd>w</kbd>: 在浏览器中打开(第一个端口为http)
<kbd>enter</kbd>: 聚焦主面板
<kbd>[</kbd>: 上一个选项卡
<kbd>]</kbd>: 下一个选项卡
<kbd>/</kbd>: 过滤列表
</pre>
## 服务
<pre>
<kbd>u</kbd>: 启动服务
<kbd>d</kbd>: 移除容器
<kbd>s</kbd>: 停止
<kbd>p</kbd>: 暂停
<kbd>r</kbd>: 重新启动
<kbd>S</kbd>: 启动项目
<kbd>a</kbd>: attach
<kbd>m</kbd>: 查看日志
<kbd>U</kbd>: 创建并启动容器
<kbd>D</kbd>: 停止并移除容器
<kbd>R</kbd>: 查看重启选项
<kbd>c</kbd>: 运行预定义的自定义命令
<kbd>b</kbd>: 查看批量命令
<kbd>E</kbd>: 执行shell
<kbd>w</kbd>: 在浏览器中打开(第一个端口为http)
<kbd>enter</kbd>: 聚焦主面板
<kbd>[</kbd>: 上一个选项卡
<kbd>]</kbd>: 下一个选项卡
<kbd>/</kbd>: 过滤列表
</pre>
## 镜像
<pre>
<kbd>c</kbd>: 运行预定义的自定义命令
<kbd>d</kbd>: 移除镜像
<kbd>b</kbd>: 查看批量命令
<kbd>enter</kbd>: 聚焦主面板
<kbd>[</kbd>: 上一个选项卡
<kbd>]</kbd>: 下一个选项卡
<kbd>/</kbd>: 过滤列表
</pre>
## 卷
<pre>
<kbd>c</kbd>: 运行预定义的自定义命令
<kbd>d</kbd>: 移除卷
<kbd>b</kbd>: 查看批量命令
<kbd>enter</kbd>: 聚焦主面板
<kbd>[</kbd>: 上一个选项卡
<kbd>]</kbd>: 下一个选项卡
<kbd>/</kbd>: 过滤列表
</pre>
## 网络
<pre>
<kbd>c</kbd>: 运行预定义的自定义命令
<kbd>d</kbd>: 移除网络
<kbd>b</kbd>: 查看批量命令
<kbd>enter</kbd>: 聚焦主面板
<kbd>[</kbd>: 上一个选项卡
<kbd>]</kbd>: 下一个选项卡
<kbd>/</kbd>: 过滤列表
</pre>
## 主要
<pre>
<kbd>esc</kbd>: 返回
</pre>
## 全局
<pre>
<kbd>+</kbd>: 下一个屏幕模式(正常/半屏/全屏)
<kbd>_</kbd>: 上一个屏幕模式
<kbd>1</kbd>: focus projects panel
<kbd>2</kbd>: focus services panel
<kbd>3</kbd>: focus containers panel
<kbd>4</kbd>: focus images panel
<kbd>5</kbd>: focus volumes panel
<kbd>6</kbd>: focus networks panel
</pre>

85
go.mod
View file

@ -1,85 +1,64 @@
module github.com/jesseduffield/lazydocker module github.com/jesseduffield/lazydocker
go 1.22 go 1.18
toolchain go1.23.6
require ( require (
github.com/OpenPeeDeeP/xdg v0.2.1-0.20190312153938-4ba9e1eb294c github.com/OpenPeeDeeP/xdg v0.2.1-0.20190312153938-4ba9e1eb294c
github.com/boz/go-throttle v0.0.0-20160922054636-fdc4eab740c1 github.com/boz/go-throttle v0.0.0-20160922054636-fdc4eab740c1
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
github.com/docker/cli v27.1.1+incompatible github.com/docker/docker v20.10.15+incompatible
github.com/docker/docker v28.5.2+incompatible github.com/fatih/color v1.7.0
github.com/fatih/color v1.10.0 github.com/go-errors/errors v1.4.2
github.com/go-errors/errors v1.5.1
github.com/gookit/color v1.5.0 github.com/gookit/color v1.5.0
github.com/imdario/mergo v0.3.16 github.com/imdario/mergo v0.3.8
github.com/integrii/flaggy v1.4.0 github.com/integrii/flaggy v1.4.0
github.com/jesseduffield/asciigraph v0.0.0-20190605104717-6d88e39309ee github.com/jesseduffield/asciigraph v0.0.0-20190605104717-6d88e39309ee
github.com/jesseduffield/gocui v0.3.1-0.20240418080333-8cd33929c513 github.com/jesseduffield/gocui v0.3.1-0.20221023185936-ef06450f4fdc
github.com/jesseduffield/kill v0.0.0-20220618033138-bfbe04675d10 github.com/jesseduffield/kill v0.0.0-20220618033138-bfbe04675d10
github.com/jesseduffield/lazycore v0.0.0-20221023210126-718a4caea996 github.com/jesseduffield/lazycore v0.0.0-20221023210126-718a4caea996
github.com/jesseduffield/yaml v0.0.0-20190702115811-b900b7e08b56 github.com/jesseduffield/yaml v0.0.0-20190702115811-b900b7e08b56
github.com/mattn/go-runewidth v0.0.15 github.com/mattn/go-runewidth v0.0.14
github.com/mcuadros/go-lookup v0.0.0-20171110082742-5650f26be767 github.com/mcuadros/go-lookup v0.0.0-20171110082742-5650f26be767
github.com/mgutz/str v1.2.0 github.com/mgutz/str v1.2.0
github.com/pmezard/go-difflib v1.0.0 github.com/pmezard/go-difflib v1.0.0
github.com/samber/lo v1.31.0 github.com/samber/lo v1.31.0
github.com/sasha-s/go-deadlock v0.3.1 github.com/sasha-s/go-deadlock v0.3.1
github.com/sirupsen/logrus v1.9.3 github.com/sirupsen/logrus v1.4.2
github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad
github.com/stretchr/testify v1.9.0 github.com/stretchr/testify v1.8.0
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
) )
require ( require (
github.com/containerd/errdefs v1.0.0 // indirect github.com/Microsoft/go-winio v0.4.14 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/moby/sys/atomicwriter v0.1.0 // indirect
github.com/moby/sys/sequential v0.6.0 // indirect
)
require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/distribution/reference v0.6.0 // indirect github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.2 // indirect github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect github.com/gdamore/encoding v1.0.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect github.com/gdamore/tcell/v2 v2.5.3 // indirect
github.com/fvbommel/sortorder v1.1.0 // indirect github.com/gogo/protobuf v1.3.1 // indirect
github.com/gdamore/encoding v1.0.1 // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/gdamore/tcell/v2 v2.7.4 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/goccy/go-yaml v1.11.0
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect github.com/mattn/go-isatty v0.0.11 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/moby/term v0.5.0 // indirect github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/onsi/ginkgo v1.8.0 // indirect github.com/onsi/ginkgo v1.8.0 // indirect
github.com/onsi/gomega v1.5.0 // indirect github.com/onsi/gomega v1.5.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect github.com/rivo/uniseg v0.4.2 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect golang.org/x/exp v0.0.0-20220428152302-39d4317da171 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 // indirect golang.org/x/sys v0.1.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect golang.org/x/term v0.1.0 // indirect
go.opentelemetry.io/otel/sdk v1.28.0 // indirect golang.org/x/text v0.4.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
golang.org/x/crypto v0.24.0 // indirect gopkg.in/yaml.v2 v2.2.2 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.1 // indirect gotest.tools/v3 v3.2.0 // indirect
) )

263
go.sum
View file

@ -1,247 +1,194 @@
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/OpenPeeDeeP/xdg v0.2.1-0.20190312153938-4ba9e1eb294c h1:YDsGA6tou+tAxVe0Dre29iSbQ8TrWdWfwOisKArJT5E= github.com/OpenPeeDeeP/xdg v0.2.1-0.20190312153938-4ba9e1eb294c h1:YDsGA6tou+tAxVe0Dre29iSbQ8TrWdWfwOisKArJT5E=
github.com/OpenPeeDeeP/xdg v0.2.1-0.20190312153938-4ba9e1eb294c/go.mod h1:tMoSueLQlMf0TCldjrJLNIjAc5qAOIcHt5REi88/Ygo= github.com/OpenPeeDeeP/xdg v0.2.1-0.20190312153938-4ba9e1eb294c/go.mod h1:tMoSueLQlMf0TCldjrJLNIjAc5qAOIcHt5REi88/Ygo=
github.com/boz/go-throttle v0.0.0-20160922054636-fdc4eab740c1 h1:1fx+RA5lk1ZkzPAUP7DEgZnVHYxEcHO77vQO/V8z/2Q= github.com/boz/go-throttle v0.0.0-20160922054636-fdc4eab740c1 h1:1fx+RA5lk1ZkzPAUP7DEgZnVHYxEcHO77vQO/V8z/2Q=
github.com/boz/go-throttle v0.0.0-20160922054636-fdc4eab740c1/go.mod h1:z0nyIb42Zs97wyX1V+8MbEFhHeTw1OgFQfR6q57ZuHc= github.com/boz/go-throttle v0.0.0-20160922054636-fdc4eab740c1/go.mod h1:z0nyIb42Zs97wyX1V+8MbEFhHeTw1OgFQfR6q57ZuHc=
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 h1:tuijfIjZyjZaHq9xDUh0tNitwXshJpbLkqMOJv4H3do= github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 h1:tuijfIjZyjZaHq9xDUh0tNitwXshJpbLkqMOJv4H3do=
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21/go.mod h1:po7NpZ/QiTKzBKyrsEAxwnTamCoh8uDk/egRpQ7siIc= github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21/go.mod h1:po7NpZ/QiTKzBKyrsEAxwnTamCoh8uDk/egRpQ7siIc=
github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M=
github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE=
github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk=
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/cli v27.1.1+incompatible h1:goaZxOqs4QKxznZjjBWKONQci/MywhtRv2oNn0GkeZE= github.com/docker/docker v20.10.15+incompatible h1:dk9FewY/9Xwm4ay/HViEEHSQuM/kL4F+JaG6GQdgmGo=
github.com/docker/cli v27.1.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker v20.10.15+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v28.5.2+incompatible h1:DBX0Y0zAjZbSrm1uzOkdr1onVghKaftjlSWt4AFexzM= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
github.com/docker/docker v28.5.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
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/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw= github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
github.com/gdamore/encoding v1.0.1 h1:YzKZckdBL6jVt2Gc+5p82qhrGiqMdG/eNs6Wy0u3Uhw= github.com/gdamore/tcell/v2 v2.4.0/go.mod h1:cTTuF84Dlj/RqmaCIV5p4w8uG1zWdk0SF6oBpwHp4fU=
github.com/gdamore/encoding v1.0.1/go.mod h1:0Z0cMFinngz9kS1QfMjCP8TY7em3bZYeeklsSDPivEo= github.com/gdamore/tcell/v2 v2.5.3 h1:b9XQrT6QGbgI7JvZOJXFNczOQeIYbo8BfeSMzt2sAV0=
github.com/gdamore/tcell/v2 v2.7.4 h1:sg6/UnTM9jGpZU+oFYAsDahfchWAFW8Xx2yFinNSAYU= github.com/gdamore/tcell/v2 v2.5.3/go.mod h1:wSkrPaXoiIWZqW/g7Px4xc79di6FTcpB8tvaKJ6uGBo=
github.com/gdamore/tcell/v2 v2.7.4/go.mod h1:dSXtXTSK0VsW1biw65DZLZ2NKr7j0qP/0J7ONmsraWg=
github.com/go-errors/errors v1.0.2/go.mod h1:psDX2osz5VnTOnFWbDeWwS7yejl+uV3FEWEp4lssFEs= github.com/go-errors/errors v1.0.2/go.mod h1:psDX2osz5VnTOnFWbDeWwS7yejl+uV3FEWEp4lssFEs=
github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/go-logr/logr v1.4.2/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-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
github.com/goccy/go-yaml v1.11.0 h1:n7Z+zx8S9f9KgzG6KtQKf+kwqXZlLNR2F6018Dgau54=
github.com/goccy/go-yaml v1.11.0/go.mod h1:H+mJrWtjPTJAHvRbV09MCK9xYwODM+wRTVFFTWckfng=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/gookit/color v1.5.0 h1:1Opow3+BWDwqor78DcJkJCIwnkviFi+rrOANki9BUFw= github.com/gookit/color v1.5.0 h1:1Opow3+BWDwqor78DcJkJCIwnkviFi+rrOANki9BUFw=
github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo= github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ=
github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/integrii/flaggy v1.4.0 h1:A1x7SYx4jqu5NSrY14z8Z+0UyX2S5ygfJJrfolWR3zM= github.com/integrii/flaggy v1.4.0 h1:A1x7SYx4jqu5NSrY14z8Z+0UyX2S5ygfJJrfolWR3zM=
github.com/integrii/flaggy v1.4.0/go.mod h1:tnTxHeTJbah0gQ6/K0RW0J7fMUBk9MCF5blhm43LNpI= github.com/integrii/flaggy v1.4.0/go.mod h1:tnTxHeTJbah0gQ6/K0RW0J7fMUBk9MCF5blhm43LNpI=
github.com/jesseduffield/asciigraph v0.0.0-20190605104717-6d88e39309ee h1:7Zi/OQlGbMz4MT2V1+prN/gv1C64NDyVb/MbJnS0ZfA= github.com/jesseduffield/asciigraph v0.0.0-20190605104717-6d88e39309ee h1:7Zi/OQlGbMz4MT2V1+prN/gv1C64NDyVb/MbJnS0ZfA=
github.com/jesseduffield/asciigraph v0.0.0-20190605104717-6d88e39309ee/go.mod h1:Z9UKHveKXXgyo8ME7R8yxh/BUTFOK+FgfWKlhy8oOAg= github.com/jesseduffield/asciigraph v0.0.0-20190605104717-6d88e39309ee/go.mod h1:Z9UKHveKXXgyo8ME7R8yxh/BUTFOK+FgfWKlhy8oOAg=
github.com/jesseduffield/gocui v0.3.1-0.20240418080333-8cd33929c513 h1:Y1bw5iItrsDCumATc/rklIJ/6K+68ieiWZJedhrNuXo= github.com/jesseduffield/gocui v0.3.1-0.20221023185936-ef06450f4fdc h1:Gi/uDpmlB5XbyAzqr0RUFtK+2bVpUKkdR4soj/JKU1c=
github.com/jesseduffield/gocui v0.3.1-0.20240418080333-8cd33929c513/go.mod h1:XtEbqCbn45keRXEu+OMZkjN5gw6AEob59afsgHjokZ8= github.com/jesseduffield/gocui v0.3.1-0.20221023185936-ef06450f4fdc/go.mod h1:znJuCDnF2Ph40YZSlBwdX/4GEofnIoWLGdT4mK5zRAU=
github.com/jesseduffield/kill v0.0.0-20220618033138-bfbe04675d10 h1:jmpr7KpX2+2GRiE91zTgfq49QvgiqB0nbmlwZ8UnOx0= github.com/jesseduffield/kill v0.0.0-20220618033138-bfbe04675d10 h1:jmpr7KpX2+2GRiE91zTgfq49QvgiqB0nbmlwZ8UnOx0=
github.com/jesseduffield/kill v0.0.0-20220618033138-bfbe04675d10/go.mod h1:aA97kHeNA+sj2Hbki0pvLslmE4CbDyhBeSSTUUnOuVo= github.com/jesseduffield/kill v0.0.0-20220618033138-bfbe04675d10/go.mod h1:aA97kHeNA+sj2Hbki0pvLslmE4CbDyhBeSSTUUnOuVo=
github.com/jesseduffield/lazycore v0.0.0-20221023210126-718a4caea996 h1:CH1en6GpXSwnXl5Ehc4WX1NpS3uw9qbi7o9A4T2YYmA= github.com/jesseduffield/lazycore v0.0.0-20221023210126-718a4caea996 h1:CH1en6GpXSwnXl5Ehc4WX1NpS3uw9qbi7o9A4T2YYmA=
github.com/jesseduffield/lazycore v0.0.0-20221023210126-718a4caea996/go.mod h1:qxN4mHOAyeIDLP7IK7defgPClM/z1Kze8VVQiaEjzsQ= github.com/jesseduffield/lazycore v0.0.0-20221023210126-718a4caea996/go.mod h1:qxN4mHOAyeIDLP7IK7defgPClM/z1Kze8VVQiaEjzsQ=
github.com/jesseduffield/yaml v0.0.0-20190702115811-b900b7e08b56 h1:33wSxJWU/f2TAozHYtJ8zqBxEnEVYM+22moLoiAkxvg= github.com/jesseduffield/yaml v0.0.0-20190702115811-b900b7e08b56 h1:33wSxJWU/f2TAozHYtJ8zqBxEnEVYM+22moLoiAkxvg=
github.com/jesseduffield/yaml v0.0.0-20190702115811-b900b7e08b56/go.mod h1:FZJBwOhE+RXz8EVZfY+xnbCw2cVOwxlK3/aIi581z/s= github.com/jesseduffield/yaml v0.0.0-20190702115811-b900b7e08b56/go.mod h1:FZJBwOhE+RXz8EVZfY+xnbCw2cVOwxlK3/aIi581z/s=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
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 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= 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/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mcuadros/go-lookup v0.0.0-20171110082742-5650f26be767 h1:BrhJNdEFWGuiJk/3/SwsG5Rex3zjFxYsDi2bpd7382Y= github.com/mcuadros/go-lookup v0.0.0-20171110082742-5650f26be767 h1:BrhJNdEFWGuiJk/3/SwsG5Rex3zjFxYsDi2bpd7382Y=
github.com/mcuadros/go-lookup v0.0.0-20171110082742-5650f26be767/go.mod h1:ct+byCpkFokm4J0tiuAvB8cf2ttm6GcCe89Yr25nGKg= github.com/mcuadros/go-lookup v0.0.0-20171110082742-5650f26be767/go.mod h1:ct+byCpkFokm4J0tiuAvB8cf2ttm6GcCe89Yr25nGKg=
github.com/mgutz/str v1.2.0 h1:4IzWSdIz9qPQWLfKZ0rJcV0jcUDpxvP4JVZ4GXQyvSw= github.com/mgutz/str v1.2.0 h1:4IzWSdIz9qPQWLfKZ0rJcV0jcUDpxvP4JVZ4GXQyvSw=
github.com/mgutz/str v1.2.0/go.mod h1:w1v0ofgLaJdoD0HpQ3fycxKD1WtxpjSo151pK/31q6w= github.com/mgutz/str v1.2.0/go.mod h1:w1v0ofgLaJdoD0HpQ3fycxKD1WtxpjSo151pK/31q6w=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw=
github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw= github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c h1:nXxl5PrvVm2L/wCy8dQu6DMTwH4oIuGN8GJDAlqDdVE=
github.com/moby/sys/atomicwriter v0.1.0/go.mod h1:Ul8oqv2ZMNHOceF643P6FKPXeCmYtlQMvpizfsSoaWs= github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU=
github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w=
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ=
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o=
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 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
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.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/samber/lo v1.31.0 h1:Sfa+/064Tdo4SvlohQUQzBhgSer9v/coGvKQI/XLWAM= github.com/samber/lo v1.31.0 h1:Sfa+/064Tdo4SvlohQUQzBhgSer9v/coGvKQI/XLWAM=
github.com/samber/lo v1.31.0/go.mod h1:HLeWcJRRyLKp3+/XBJvOrerCQn9mhdKMHyd7IRlgeQ8= github.com/samber/lo v1.31.0/go.mod h1:HLeWcJRRyLKp3+/XBJvOrerCQn9mhdKMHyd7IRlgeQ8=
github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0=
github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad h1:fiWzISvDn0Csy5H0iwgAuJGQTUpVfEMJJd4nRFXogbc= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad h1:fiWzISvDn0Csy5H0iwgAuJGQTUpVfEMJJd4nRFXogbc=
github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0=
github.com/stretchr/objx v0.1.0/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.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/thoas/go-funk v0.9.1 h1:O549iLZqPpTUQ10ykd26sZhzD+rmR5pWhuElrhbC20M= github.com/thoas/go-funk v0.9.1 h1:O549iLZqPpTUQ10ykd26sZhzD+rmR5pWhuElrhbC20M=
github.com/thoas/go-funk v0.9.1/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg=
go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 h1:j9+03ymgYhPKmeXGk5Zu+cIZOlVzd9Zv7QIiyItjFBU=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0/go.mod h1:Y5+XiUG4Emn1hTfciPzGPJaSI+RpDts6BnCIir0SLqk=
go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q=
go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s=
go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE=
go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg=
go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g=
go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI=
go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0=
go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20220428152302-39d4317da171 h1:TfdoLivD44QwvssI9Sv1xwa5DcL5XQr4au4sZ2F2NV4=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= golang.org/x/exp v0.0.0-20220428152302-39d4317da171/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/mod v0.3.0/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/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
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-20190620200207-3b0461eec859/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-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/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.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-20180909124046-d0be0721c37e/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-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/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-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/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-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220318055525-2edf467146b5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA=
golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/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-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/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.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0=
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= 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/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I=
gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A=

View file

@ -29,7 +29,6 @@ var (
configFlag = false configFlag = false
debuggingFlag = false debuggingFlag = false
composeFiles []string composeFiles []string
projectName string
) )
func main() { func main() {
@ -52,7 +51,6 @@ func main() {
flaggy.Bool(&configFlag, "c", "config", "Print the current default config") flaggy.Bool(&configFlag, "c", "config", "Print the current default config")
flaggy.Bool(&debuggingFlag, "d", "debug", "a boolean") flaggy.Bool(&debuggingFlag, "d", "debug", "a boolean")
flaggy.StringSlice(&composeFiles, "f", "file", "Specify alternate compose files") flaggy.StringSlice(&composeFiles, "f", "file", "Specify alternate compose files")
flaggy.String(&projectName, "p", "project", "Specify a docker compose project name")
flaggy.SetVersion(info) flaggy.SetVersion(info)
flaggy.Parse() flaggy.Parse()
@ -73,7 +71,7 @@ func main() {
log.Fatal(err.Error()) log.Fatal(err.Error())
} }
appConfig, err := config.NewAppConfig("lazydocker", version, commit, date, buildSource, debuggingFlag, composeFiles, projectDir, projectName) appConfig, err := config.NewAppConfig("lazydocker", version, commit, date, buildSource, debuggingFlag, composeFiles, projectDir)
if err != nil { if err != nil {
log.Fatal(err.Error()) log.Fatal(err.Error())
} }

View file

@ -33,7 +33,7 @@ func Generate() {
} }
func generateAtDir(dir string) { func generateAtDir(dir string) {
mConfig, err := config.NewAppConfig("lazydocker", "", "", "", "", true, nil, "", "") mConfig, err := config.NewAppConfig("lazydocker", "", "", "", "", true, nil, "")
if err != nil { if err != nil {
panic(err) panic(err)
} }
@ -96,7 +96,6 @@ func getBindingSections(mApp *app.App) []*bindingSection {
"containers": mApp.Tr.ContainersTitle, "containers": mApp.Tr.ContainersTitle,
"images": mApp.Tr.ImagesTitle, "images": mApp.Tr.ImagesTitle,
"volumes": mApp.Tr.VolumesTitle, "volumes": mApp.Tr.VolumesTitle,
"networks": mApp.Tr.NetworksTitle,
} }
bindingSections = addBinding(titleMap[viewName], bindingSections, binding) bindingSections = addBinding(titleMap[viewName], bindingSections, binding)

View file

@ -7,12 +7,14 @@ import (
"strings" "strings"
"github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/container"
"github.com/sasha-s/go-deadlock"
dockerTypes "github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client" "github.com/docker/docker/client"
"github.com/go-errors/errors" "github.com/go-errors/errors"
"github.com/jesseduffield/lazydocker/pkg/i18n" "github.com/jesseduffield/lazydocker/pkg/i18n"
"github.com/jesseduffield/lazydocker/pkg/utils" "github.com/jesseduffield/lazydocker/pkg/utils"
"github.com/sasha-s/go-deadlock"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"golang.org/x/xerrors" "golang.org/x/xerrors"
) )
@ -27,12 +29,12 @@ type Container struct {
OneOff bool OneOff bool
ProjectName string ProjectName string
ID string ID string
Container container.Summary Container dockerTypes.Container
Client *client.Client Client *client.Client
OSCommand *OSCommand OSCommand *OSCommand
Log *logrus.Entry Log *logrus.Entry
StatHistory []*RecordedStats StatHistory []*RecordedStats
Details container.InspectResponse Details dockerTypes.ContainerJSON
MonitoringStats bool MonitoringStats bool
DockerCommand LimitedDockerCommand DockerCommand LimitedDockerCommand
Tr *i18n.TranslationSet Tr *i18n.TranslationSet
@ -41,7 +43,7 @@ type Container struct {
} }
// Remove removes the container // Remove removes the container
func (c *Container) Remove(options container.RemoveOptions) error { func (c *Container) Remove(options dockerTypes.ContainerRemoveOptions) error {
c.Log.Warn(fmt.Sprintf("removing container %s", c.Name)) c.Log.Warn(fmt.Sprintf("removing container %s", c.Name))
if err := c.Client.ContainerRemove(context.Background(), c.ID, options); err != nil { if err := c.Client.ContainerRemove(context.Background(), c.ID, options); err != nil {
if strings.Contains(err.Error(), "Stop the container before attempting removal or force remove") { if strings.Contains(err.Error(), "Stop the container before attempting removal or force remove") {
@ -57,16 +59,10 @@ func (c *Container) Remove(options container.RemoveOptions) error {
return nil return nil
} }
// Start starts the container
func (c *Container) Start() error {
c.Log.Warn(fmt.Sprintf("starting container %s", c.Name))
return c.Client.ContainerStart(context.Background(), c.ID, container.StartOptions{})
}
// Stop stops the container // Stop stops the container
func (c *Container) Stop() error { func (c *Container) Stop() error {
c.Log.Warn(fmt.Sprintf("stopping container %s", c.Name)) c.Log.Warn(fmt.Sprintf("stopping container %s", c.Name))
return c.Client.ContainerStop(context.Background(), c.ID, container.StopOptions{}) return c.Client.ContainerStop(context.Background(), c.ID, nil)
} }
// Pause pauses the container // Pause pauses the container
@ -84,7 +80,7 @@ func (c *Container) Unpause() error {
// Restart restarts the container // Restart restarts the container
func (c *Container) Restart() error { func (c *Container) Restart() error {
c.Log.Warn(fmt.Sprintf("restarting container %s", c.Name)) c.Log.Warn(fmt.Sprintf("restarting container %s", c.Name))
return c.Client.ContainerRestart(context.Background(), c.ID, container.StopOptions{}) return c.Client.ContainerRestart(context.Background(), c.ID, nil)
} }
// Attach attaches the container // Attach attaches the container
@ -104,20 +100,20 @@ func (c *Container) Attach() (*exec.Cmd, error) {
c.Log.Warn(fmt.Sprintf("attaching to container %s", c.Name)) c.Log.Warn(fmt.Sprintf("attaching to container %s", c.Name))
// TODO: use SDK // TODO: use SDK
cmd := c.OSCommand.NewCmd("docker", "attach", "--sig-proxy=false", c.ID) cmd := c.OSCommand.PrepareSubProcess("docker", "attach", "--sig-proxy=false", c.ID)
return cmd, nil return cmd, nil
} }
// Top returns process information // Top returns process information
func (c *Container) Top(ctx context.Context) (container.TopResponse, error) { func (c *Container) Top(ctx context.Context) (container.ContainerTopOKBody, error) {
detail, err := c.Inspect() detail, err := c.Inspect()
if err != nil { if err != nil {
return container.TopResponse{}, err return container.ContainerTopOKBody{}, err
} }
// check container status // check container status
if !detail.State.Running { if !detail.State.Running {
return container.TopResponse{}, errors.New("container is not running") return container.ContainerTopOKBody{}, errors.New("container is not running")
} }
return c.Client.ContainerTop(ctx, c.ID, []string{}) return c.Client.ContainerTop(ctx, c.ID, []string{})
@ -130,7 +126,7 @@ func (c *DockerCommand) PruneContainers() error {
} }
// Inspect returns details about the container // Inspect returns details about the container
func (c *Container) Inspect() (container.InspectResponse, error) { func (c *Container) Inspect() (dockerTypes.ContainerJSON, error) {
return c.Client.ContainerInspect(context.Background(), c.ID) return c.Client.ContainerInspect(context.Background(), c.ID)
} }
@ -144,9 +140,7 @@ func (c *Container) RenderTop(ctx context.Context) (string, error) {
return utils.RenderTable(append([][]string{result.Titles}, result.Processes...)) return utils.RenderTable(append([][]string{result.Titles}, result.Processes...))
} }
// DetailsLoaded tells us whether we have yet loaded the details for a container. // DetailsLoaded tells us whether we have yet loaded the details for a container. Because this is an asynchronous operation, sometimes we have the container before we have its details.
// Sometimes it takes some time for a container to have its details loaded
// after it starts.
func (c *Container) DetailsLoaded() bool { func (c *Container) DetailsLoaded() bool {
return c.Details.ContainerJSONBase != nil return c.Details.ContainerJSONBase != nil
} }

View file

@ -7,18 +7,11 @@ import (
"fmt" "fmt"
"io" "io"
ogLog "log" ogLog "log"
"os"
"os/exec" "os/exec"
"path/filepath"
"sort"
"strings" "strings"
"sync"
"time" "time"
cliconfig "github.com/docker/cli/cli/config" dockerTypes "github.com/docker/docker/api/types"
ddocker "github.com/docker/cli/cli/context/docker"
ctxstore "github.com/docker/cli/cli/context/store"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client" "github.com/docker/docker/client"
"github.com/imdario/mergo" "github.com/imdario/mergo"
"github.com/jesseduffield/lazydocker/pkg/commands/ssh" "github.com/jesseduffield/lazydocker/pkg/commands/ssh"
@ -30,7 +23,7 @@ import (
) )
const ( const (
dockerHostEnvKey = "DOCKER_HOST" APIVersion = "1.25"
) )
// DockerCommand is our main docker interface // DockerCommand is our main docker interface
@ -41,8 +34,6 @@ type DockerCommand struct {
Config *config.AppConfig Config *config.AppConfig
Client *client.Client Client *client.Client
InDockerComposeProject bool InDockerComposeProject bool
// LocalProjectName is the compose project name for the directory where lazydocker was launched.
LocalProjectName string
ErrorChan chan error ErrorChan chan error
ContainerMutex deadlock.Mutex ContainerMutex deadlock.Mutex
ServiceMutex deadlock.Mutex ServiceMutex deadlock.Mutex
@ -64,68 +55,23 @@ type CommandObject struct {
Container *Container Container *Container
Image *Image Image *Image
Volume *Volume Volume *Volume
Network *Network
Project *Project
} }
// NewCommandObject takes a command object and returns a default command object with the passed command object merged in // NewCommandObject takes a command object and returns a default command object with the passed command object merged in
func (c *DockerCommand) NewCommandObject(obj CommandObject) CommandObject { func (c *DockerCommand) NewCommandObject(obj CommandObject) CommandObject {
defaultObj := CommandObject{DockerCompose: c.Config.UserConfig.CommandTemplates.DockerCompose} defaultObj := CommandObject{DockerCompose: c.Config.UserConfig.CommandTemplates.DockerCompose}
_ = mergo.Merge(&defaultObj, obj) _ = mergo.Merge(&defaultObj, obj)
// When operating on a specific project, include -p flag so that
// docker compose targets the correct project.
if obj.Service != nil && obj.Service.ProjectName != "" {
defaultObj.DockerCompose = fmt.Sprintf("%s -p %s", defaultObj.DockerCompose, obj.Service.ProjectName)
} else if obj.Project != nil && obj.Project.Name != "" {
defaultObj.DockerCompose = fmt.Sprintf("%s -p %s", defaultObj.DockerCompose, obj.Project.Name)
}
return defaultObj return defaultObj
} }
// newDockerClient creates a Docker client with the given host.
// We avoid using client.FromEnv because it includes WithVersionFromEnv() which
// sets manualOverride=true when DOCKER_API_VERSION is set, preventing API version
// negotiation even when WithAPIVersionNegotiation() is specified.
// Instead, we explicitly configure only what we need, and rely on proper
// API version negotiation to support older Docker daemons.
// See https://github.com/jesseduffield/lazydocker/issues/715
func newDockerClient(dockerHost string) (*client.Client, error) {
return client.NewClientWithOpts(
client.WithTLSClientConfigFromEnv(),
client.WithAPIVersionNegotiation(),
client.WithHost(dockerHost),
)
}
// NewDockerCommand it runs docker commands // NewDockerCommand it runs docker commands
func NewDockerCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*DockerCommand, error) { func NewDockerCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*DockerCommand, error) {
dockerHost, err := determineDockerHost()
if err != nil {
ogLog.Printf("> could not determine host %v", err)
}
// NOTE: Inject the determined docker host to the environment. This allows the
// `SSHHandler.HandleSSHDockerHost()` to create a local unix socket tunneled
// over SSH to the specified ssh host.
if strings.HasPrefix(dockerHost, "ssh://") {
os.Setenv(dockerHostEnvKey, dockerHost)
}
tunnelCloser, err := ssh.NewSSHHandler(osCommand).HandleSSHDockerHost() tunnelCloser, err := ssh.NewSSHHandler(osCommand).HandleSSHDockerHost()
if err != nil { if err != nil {
ogLog.Fatal(err) ogLog.Fatal(err)
} }
// Retrieve the docker host from the environment which could have been set by cli, err := client.NewClientWithOpts(client.FromEnv, client.WithVersion(APIVersion))
// the `SSHHandler.HandleSSHDockerHost()` and override `dockerHost`.
dockerHostFromEnv := os.Getenv(dockerHostEnvKey)
if dockerHostFromEnv != "" {
dockerHost = dockerHostFromEnv
}
cli, err := newDockerClient(dockerHost)
if err != nil { if err != nil {
ogLog.Fatal(err) ogLog.Fatal(err)
} }
@ -141,7 +87,12 @@ func NewDockerCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.Translat
Closers: []io.Closer{tunnelCloser}, Closers: []io.Closer{tunnelCloser},
} }
dockerCommand.setDockerComposeCommand(config) command := utils.ApplyTemplate(
config.UserConfig.CommandTemplates.CheckDockerComposeConfig,
dockerCommand.NewCommandObject(CommandObject{}),
)
log.Warn(command)
err = osCommand.RunCommand( err = osCommand.RunCommand(
utils.ApplyTemplate( utils.ApplyTemplate(
@ -154,37 +105,9 @@ func NewDockerCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.Translat
log.Warn(err.Error()) log.Warn(err.Error())
} }
// When the user passes -p outside of a compose directory, treat it as the
// local project so the project/services panels still appear and filtering
// is applied. Inside a compose dir, LocalProjectName is derived from
// container labels later in RefreshContainersAndServices.
if !dockerCommand.InDockerComposeProject && config.ProjectName != "" {
dockerCommand.LocalProjectName = config.ProjectName
}
return dockerCommand, nil return dockerCommand, nil
} }
// IsProjectScoped reports whether lazydocker should be scoped to a single
// compose project — either because we're inside a compose directory or
// because the user passed -p. When false, the project/services panels are
// hidden and all containers are shown in a flat list.
func (c *DockerCommand) IsProjectScoped() bool {
return c.InDockerComposeProject || c.Config.ProjectName != ""
}
func (c *DockerCommand) setDockerComposeCommand(config *config.AppConfig) {
if config.UserConfig.CommandTemplates.DockerCompose != "docker compose" {
return
}
// it's possible that a user is still using docker-compose, so we'll check if 'docker comopose' is available, and if not, we'll fall back to 'docker-compose'
err := c.OSCommand.RunCommand("docker compose version")
if err != nil {
config.UserConfig.CommandTemplates.DockerCompose = "docker-compose"
}
}
func (c *DockerCommand) Close() error { func (c *DockerCommand) Close() error {
return utils.CloseMany(c.Closers) return utils.CloseMany(c.Closers)
} }
@ -223,7 +146,7 @@ func (c *DockerCommand) CreateClientStatMonitor(container *Container) {
container.MonitoringStats = false container.MonitoringStats = false
} }
func (c *DockerCommand) RefreshContainersAndServices(currentContainers []*Container) ([]*Container, []*Service, error) { func (c *DockerCommand) RefreshContainersAndServices(currentServices []*Service, currentContainers []*Container) ([]*Container, []*Service, error) {
c.ServiceMutex.Lock() c.ServiceMutex.Lock()
defer c.ServiceMutex.Unlock() defer c.ServiceMutex.Unlock()
@ -232,137 +155,28 @@ func (c *DockerCommand) RefreshContainersAndServices(currentContainers []*Contai
return nil, nil, err return nil, nil, err
} }
// Derive services from container labels (covers all projects) var services []*Service
services := c.GetServicesFromContainers(containers) // we only need to get these services once because they won't change in the runtime of the program
if currentServices != nil {
var composeServices []*Service services = currentServices
if c.InDockerComposeProject { } else {
composeServices, err = c.GetServices() services, err = c.GetServices()
if err != nil { if err != nil {
c.Log.Warn("Failed to get compose services: " + err.Error()) return nil, nil, err
} }
} }
// Determine the local project name before merging services, since
// mergeServices needs it. We match compose service names against container
// labels to handle cases where the project name differs from the directory
// name (e.g. a `name:` directive in the compose file).
if c.LocalProjectName == "" && c.InDockerComposeProject && composeServices != nil {
for _, ctr := range containers {
if ctr.ProjectName == "" || ctr.ServiceName == "" {
continue
}
for _, svc := range composeServices {
if ctr.ServiceName == svc.Name {
c.LocalProjectName = ctr.ProjectName
break
}
}
if c.LocalProjectName != "" {
break
}
}
// Fall back to directory name
if c.LocalProjectName == "" && c.Config.ProjectDir != "" {
c.LocalProjectName = filepath.Base(c.Config.ProjectDir)
}
}
// Merge compose services (which include stopped services) with
// container-derived services from all projects
if composeServices != nil {
services = c.mergeServices(services, composeServices)
}
c.assignContainersToServices(containers, services) c.assignContainersToServices(containers, services)
return containers, services, nil return containers, services, nil
} }
// GetServicesFromContainers derives services from container labels for all projects
func (c *DockerCommand) GetServicesFromContainers(containers []*Container) []*Service {
// Use project+service as key to avoid duplicates
type serviceKey struct {
project string
service string
}
seen := make(map[serviceKey]bool)
services := make([]*Service, 0, len(containers))
for _, ctr := range containers {
if ctr.ServiceName == "" || ctr.OneOff {
continue
}
key := serviceKey{project: ctr.ProjectName, service: ctr.ServiceName}
if seen[key] {
continue
}
seen[key] = true
services = append(services, &Service{
Name: ctr.ServiceName,
ID: ctr.ProjectName + "-" + ctr.ServiceName,
ProjectName: ctr.ProjectName,
OSCommand: c.OSCommand,
Log: c.Log,
DockerCommand: c,
})
}
return services
}
// mergeServices merges compose services (which may lack ProjectName) with
// container-derived services. Compose services take priority because they
// include services without running containers.
func (c *DockerCommand) mergeServices(containerServices []*Service, composeServices []*Service) []*Service {
// Set project name on compose services
for _, svc := range composeServices {
if svc.ProjectName == "" {
svc.ProjectName = c.LocalProjectName
}
}
// Build a set of compose service names for the local project
composeServiceNames := make(map[string]bool)
for _, svc := range composeServices {
composeServiceNames[svc.Name] = true
}
// Start with compose services, then add container-derived services
// that aren't already covered by compose (i.e. from other projects)
result := make([]*Service, 0, len(composeServices)+len(containerServices))
result = append(result, composeServices...)
for _, svc := range containerServices {
if svc.ProjectName == c.LocalProjectName && composeServiceNames[svc.Name] {
continue // already covered by compose service
}
result = append(result, svc)
}
return result
}
// GetProjectNames returns all unique project names from containers
func (c *DockerCommand) GetProjectNames(containers []*Container) []string {
seen := make(map[string]bool)
var names []string
for _, ctr := range containers {
if ctr.ProjectName != "" && !seen[ctr.ProjectName] {
seen[ctr.ProjectName] = true
names = append(names, ctr.ProjectName)
}
}
sort.Strings(names)
return names
}
func (c *DockerCommand) assignContainersToServices(containers []*Container, services []*Service) { func (c *DockerCommand) assignContainersToServices(containers []*Container, services []*Service) {
L: L:
for _, service := range services { for _, service := range services {
for _, ctr := range containers { for _, container := range containers {
if !ctr.OneOff && ctr.ServiceName == service.Name && ctr.ProjectName == service.ProjectName { if !container.OneOff && container.ServiceName == service.Name {
service.Container = ctr service.Container = container
continue L continue L
} }
} }
@ -375,19 +189,19 @@ func (c *DockerCommand) GetContainers(existingContainers []*Container) ([]*Conta
c.ContainerMutex.Lock() c.ContainerMutex.Lock()
defer c.ContainerMutex.Unlock() defer c.ContainerMutex.Unlock()
containers, err := c.Client.ContainerList(context.Background(), container.ListOptions{All: true}) containers, err := c.Client.ContainerList(context.Background(), dockerTypes.ContainerListOptions{All: true})
if err != nil { if err != nil {
return nil, err return nil, err
} }
ownContainers := make([]*Container, len(containers)) ownContainers := make([]*Container, len(containers))
for i, ctr := range containers { for i, container := range containers {
var newContainer *Container var newContainer *Container
// check if we already have data stored against the container // check if we already data stored against the container
for _, existingContainer := range existingContainers { for _, existingContainer := range existingContainers {
if existingContainer.ID == ctr.ID { if existingContainer.ID == container.ID {
newContainer = existingContainer newContainer = existingContainer
break break
} }
@ -396,7 +210,7 @@ func (c *DockerCommand) GetContainers(existingContainers []*Container) ([]*Conta
// initialise the container if it's completely new // initialise the container if it's completely new
if newContainer == nil { if newContainer == nil {
newContainer = &Container{ newContainer = &Container{
ID: ctr.ID, ID: container.ID,
Client: c.Client, Client: c.Client,
OSCommand: c.OSCommand, OSCommand: c.OSCommand,
Log: c.Log, Log: c.Log,
@ -405,27 +219,21 @@ func (c *DockerCommand) GetContainers(existingContainers []*Container) ([]*Conta
} }
} }
newContainer.Container = ctr newContainer.Container = container
// if the container is made with a name label we will use that // if the container is made with a name label we will use that
if name, ok := ctr.Labels["name"]; ok { if name, ok := container.Labels["name"]; ok {
newContainer.Name = name newContainer.Name = name
} else { } else {
if len(ctr.Names) > 0 { newContainer.Name = strings.TrimLeft(container.Names[0], "/")
newContainer.Name = strings.TrimLeft(ctr.Names[0], "/")
} else {
newContainer.Name = ctr.ID
} }
} newContainer.ServiceName = container.Labels["com.docker.compose.service"]
newContainer.ServiceName = ctr.Labels["com.docker.compose.service"] newContainer.ProjectName = container.Labels["com.docker.compose.project"]
newContainer.ProjectName = ctr.Labels["com.docker.compose.project"] newContainer.ContainerNumber = container.Labels["com.docker.compose.container"]
newContainer.ContainerNumber = ctr.Labels["com.docker.compose.container"] newContainer.OneOff = container.Labels["com.docker.compose.oneoff"] == "True"
newContainer.OneOff = ctr.Labels["com.docker.compose.oneoff"] == "True"
ownContainers[i] = newContainer ownContainers[i] = newContainer
} }
c.SetContainerDetails(ownContainers)
return ownContainers, nil return ownContainers, nil
} }
@ -436,22 +244,22 @@ func (c *DockerCommand) GetServices() ([]*Service, error) {
} }
composeCommand := c.Config.UserConfig.CommandTemplates.DockerCompose composeCommand := c.Config.UserConfig.CommandTemplates.DockerCompose
output, err := c.OSCommand.RunCommandWithOutput(fmt.Sprintf("%s config --services", composeCommand)) output, err := c.OSCommand.RunCommandWithOutput(fmt.Sprintf("%s config --hash=*", composeCommand))
if err != nil { if err != nil {
return nil, err return nil, err
} }
// output looks like: // output looks like:
// service1 // service1 998d6d286b0499e0ff23d66302e720991a2asdkf9c30d0542034f610daf8a971
// service2 // service2 asdld98asdklasd9bccd02438de0994f8e19cbe691feb3755336ec5ca2c55971
lines := utils.SplitLines(output) lines := utils.SplitLines(output)
services := make([]*Service, len(lines)) services := make([]*Service, len(lines))
for i, str := range lines { for i, str := range lines {
arr := strings.Split(str, " ")
services[i] = &Service{ services[i] = &Service{
Name: str, Name: arr[0],
ID: c.LocalProjectName + "-" + str, ID: arr[1],
ProjectName: c.LocalProjectName,
OSCommand: c.OSCommand, OSCommand: c.OSCommand,
Log: c.Log, Log: c.Log,
DockerCommand: c, DockerCommand: c,
@ -461,41 +269,30 @@ func (c *DockerCommand) GetServices() ([]*Service, error) {
return services, nil return services, nil
} }
func (c *DockerCommand) RefreshContainerDetails(containers []*Container) error { // UpdateContainerDetails attaches the details returned from docker inspect to each of the containers
// this contains a bit more info than what you get from the go-docker client
func (c *DockerCommand) UpdateContainerDetails(containers []*Container) error {
c.ContainerMutex.Lock() c.ContainerMutex.Lock()
defer c.ContainerMutex.Unlock() defer c.ContainerMutex.Unlock()
c.SetContainerDetails(containers) for _, container := range containers {
details, err := c.Client.ContainerInspect(context.Background(), container.ID)
if err != nil {
c.Log.Error(err)
} else {
container.Details = details
}
}
return nil return nil
} }
// Attaches the details returned from docker inspect to each of the containers
// this contains a bit more info than what you get from the go-docker client
func (c *DockerCommand) SetContainerDetails(containers []*Container) {
wg := sync.WaitGroup{}
for _, ctr := range containers {
ctr := ctr
wg.Add(1)
go func() {
details, err := c.Client.ContainerInspect(context.Background(), ctr.ID)
if err != nil {
c.Log.Error(err)
} else {
ctr.Details = details
}
wg.Done()
}()
}
wg.Wait()
}
// ViewAllLogs attaches to a subprocess viewing all the logs from docker-compose // ViewAllLogs attaches to a subprocess viewing all the logs from docker-compose
func (c *DockerCommand) ViewAllLogs(project *Project) (*exec.Cmd, error) { func (c *DockerCommand) ViewAllLogs() (*exec.Cmd, error) {
cmd := c.OSCommand.ExecutableFromString( cmd := c.OSCommand.ExecutableFromString(
utils.ApplyTemplate( utils.ApplyTemplate(
c.OSCommand.Config.UserConfig.CommandTemplates.ViewAllLogs, c.OSCommand.Config.UserConfig.CommandTemplates.ViewAllLogs,
c.NewCommandObject(CommandObject{Project: project}), c.NewCommandObject(CommandObject{}),
), ),
) )
@ -506,15 +303,10 @@ func (c *DockerCommand) ViewAllLogs(project *Project) (*exec.Cmd, error) {
// DockerComposeConfig returns the result of 'docker-compose config' // DockerComposeConfig returns the result of 'docker-compose config'
func (c *DockerCommand) DockerComposeConfig() string { func (c *DockerCommand) DockerComposeConfig() string {
return c.DockerComposeConfigForProject(nil)
}
// DockerComposeConfigForProject returns the result of 'docker-compose config' for a specific project
func (c *DockerCommand) DockerComposeConfigForProject(project *Project) string {
output, err := c.OSCommand.RunCommandWithOutput( output, err := c.OSCommand.RunCommandWithOutput(
utils.ApplyTemplate( utils.ApplyTemplate(
c.OSCommand.Config.UserConfig.CommandTemplates.DockerComposeConfig, c.OSCommand.Config.UserConfig.CommandTemplates.DockerComposeConfig,
c.NewCommandObject(CommandObject{Project: project}), c.NewCommandObject(CommandObject{}),
), ),
) )
if err != nil { if err != nil {
@ -522,64 +314,3 @@ func (c *DockerCommand) DockerComposeConfigForProject(project *Project) string {
} }
return output return output
} }
// determineDockerHost tries to the determine the docker host that we should connect to
// in the following order of decreasing precedence:
// - value of "DOCKER_HOST" environment variable
// - host retrieved from the current context (specified via DOCKER_CONTEXT)
// - "default docker host" for the host operating system, otherwise
func determineDockerHost() (string, error) {
// If the docker host is explicitly set via the "DOCKER_HOST" environment variable,
// then its a no-brainer :shrug:
if os.Getenv("DOCKER_HOST") != "" {
return os.Getenv("DOCKER_HOST"), nil
}
currentContext := os.Getenv("DOCKER_CONTEXT")
if currentContext == "" {
cf, err := cliconfig.Load(cliconfig.Dir())
if err != nil {
return "", err
}
currentContext = cf.CurrentContext
}
// On some systems (windows) `default` is stored in the docker config as the currentContext.
if currentContext == "" || currentContext == "default" {
// If a docker context is neither specified via the "DOCKER_CONTEXT" environment variable nor via the
// $HOME/.docker/config file, then we fall back to connecting to the "default docker host" meant for
// the host operating system.
return defaultDockerHost, nil
}
storeConfig := ctxstore.NewConfig(
func() interface{} { return &ddocker.EndpointMeta{} },
ctxstore.EndpointTypeGetter(ddocker.DockerEndpoint, func() interface{} { return &ddocker.EndpointMeta{} }),
)
st := ctxstore.New(cliconfig.ContextStoreDir(), storeConfig)
md, err := st.GetMetadata(currentContext)
if err != nil {
return "", err
}
dockerEP, ok := md.Endpoints[ddocker.DockerEndpoint]
if !ok {
return "", err
}
dockerEPMeta, ok := dockerEP.(ddocker.EndpointMeta)
if !ok {
return "", fmt.Errorf("expected docker.EndpointMeta, got %T", dockerEP)
}
if dockerEPMeta.Host != "" {
return dockerEPMeta.Host, nil
}
// We might end up here, if the context was created with the `host` set to an empty value (i.e. '').
// For example:
// ```sh
// docker context create foo --docker "host="
// ```
// In such scenario, we mimic the `docker` cli and try to connect to the "default docker host".
return defaultDockerHost, nil
}

View file

@ -1,7 +0,0 @@
//go:build !windows
package commands
const (
defaultDockerHost = "unix:///var/run/docker.sock"
)

View file

@ -1,5 +0,0 @@
package commands
const (
defaultDockerHost = "npipe:////./pipe/docker_engine"
)

View file

@ -1,91 +0,0 @@
package commands
import (
"os"
"testing"
"github.com/docker/docker/client"
"github.com/jesseduffield/lazydocker/pkg/config"
"github.com/stretchr/testify/assert"
)
// TestNewDockerClientVersionNegotiation verifies that newDockerClient allows
// API version negotiation even when DOCKER_API_VERSION is set.
//
// This is a regression test for https://github.com/jesseduffield/lazydocker/issues/715
// where users got "client version 1.25 is too old" errors because FromEnv()
// includes WithVersionFromEnv() which sets manualOverride=true, preventing
// API version negotiation.
func TestNewDockerClientVersionNegotiation(t *testing.T) {
// Save original env var and restore after test
originalAPIVersion := os.Getenv("DOCKER_API_VERSION")
defer func() {
if originalAPIVersion == "" {
os.Unsetenv("DOCKER_API_VERSION")
} else {
os.Setenv("DOCKER_API_VERSION", originalAPIVersion)
}
}()
// Set DOCKER_API_VERSION to an old version that would cause
// "client version 1.25 is too old" errors if negotiation is disabled
os.Setenv("DOCKER_API_VERSION", "1.25")
t.Run("FromEnv locks version preventing negotiation", func(t *testing.T) {
// This demonstrates the problematic behavior we're avoiding.
// When using FromEnv with DOCKER_API_VERSION set, the client
// version gets locked to 1.25 and negotiation is disabled.
cli, err := client.NewClientWithOpts(
client.FromEnv,
client.WithAPIVersionNegotiation(),
)
assert.NoError(t, err)
defer cli.Close()
// Version is locked to the env var value
assert.Equal(t, "1.25", cli.ClientVersion())
})
t.Run("newDockerClient allows version negotiation", func(t *testing.T) {
// Test the actual production function.
// Use DefaultDockerHost for cross-platform compatibility
// (unix socket on Linux/macOS, named pipe on Windows).
cli, err := newDockerClient(client.DefaultDockerHost)
assert.NoError(t, err)
defer cli.Close()
// Version is NOT locked to the env var value (1.25).
// Instead, it uses the library's default version and will negotiate
// with the server on first request. This is the key difference that
// fixes the "version too old" error.
assert.NotEqual(t, "1.25", cli.ClientVersion(),
"client version should not be locked to DOCKER_API_VERSION env var")
})
}
// TestIsProjectScoped covers the predicate that drives whether the
// project/services panels appear and whether the containers panel filters by
// project. The "outside compose dir + -p" case is the regression we fixed
// after PR #776 silently disabled it.
func TestIsProjectScoped(t *testing.T) {
cases := []struct {
name string
inDockerComposeProject bool
projectName string
want bool
}{
{"inside compose dir, no -p", true, "", true},
{"inside compose dir, with -p", true, "myproject", true},
{"outside compose dir, no -p", false, "", false},
{"outside compose dir, with -p", false, "myproject", true},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
c := &DockerCommand{
InDockerComposeProject: tc.inDockerComposeProject,
Config: &config.AppConfig{ProjectName: tc.projectName},
}
assert.Equal(t, tc.want, c.IsProjectScoped())
})
}
}

View file

@ -1,7 +1,7 @@
package commands package commands
import ( import (
"io" "io/ioutil"
"github.com/jesseduffield/lazydocker/pkg/config" "github.com/jesseduffield/lazydocker/pkg/config"
"github.com/jesseduffield/lazydocker/pkg/i18n" "github.com/jesseduffield/lazydocker/pkg/i18n"
@ -31,7 +31,7 @@ func NewDummyAppConfig() *config.AppConfig {
// NewDummyLog creates a new dummy Log for testing // NewDummyLog creates a new dummy Log for testing
func NewDummyLog() *logrus.Entry { func NewDummyLog() *logrus.Entry {
log := logrus.New() log := logrus.New()
log.Out = io.Discard log.Out = ioutil.Discard
return log.WithField("test", "test") return log.WithField("test", "test")
} }

View file

@ -4,12 +4,14 @@ import (
"context" "context"
"strings" "strings"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/image" "github.com/docker/docker/api/types/image"
"github.com/samber/lo"
dockerTypes "github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client" "github.com/docker/docker/client"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/jesseduffield/lazydocker/pkg/utils" "github.com/jesseduffield/lazydocker/pkg/utils"
"github.com/samber/lo"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
@ -18,7 +20,7 @@ type Image struct {
Name string Name string
Tag string Tag string
ID string ID string
Image image.Summary Image dockerTypes.ImageSummary
Client *client.Client Client *client.Client
OSCommand *OSCommand OSCommand *OSCommand
Log *logrus.Entry Log *logrus.Entry
@ -26,7 +28,7 @@ type Image struct {
} }
// Remove removes the image // Remove removes the image
func (i *Image) Remove(options image.RemoveOptions) error { func (i *Image) Remove(options dockerTypes.ImageRemoveOptions) error {
if _, err := i.Client.ImageRemove(context.Background(), i.ID, options); err != nil { if _, err := i.Client.ImageRemove(context.Background(), i.ID, options); err != nil {
return err return err
} }
@ -92,16 +94,16 @@ func (i *Image) RenderHistory() (string, error) {
// RefreshImages returns a slice of docker images // RefreshImages returns a slice of docker images
func (c *DockerCommand) RefreshImages() ([]*Image, error) { func (c *DockerCommand) RefreshImages() ([]*Image, error) {
images, err := c.Client.ImageList(context.Background(), image.ListOptions{}) images, err := c.Client.ImageList(context.Background(), dockerTypes.ImageListOptions{})
if err != nil { if err != nil {
return nil, err return nil, err
} }
ownImages := make([]*Image, len(images)) ownImages := make([]*Image, len(images))
for i, img := range images { for i, image := range images {
firstTag := "" firstTag := ""
tags := img.RepoTags tags := image.RepoTags
if len(tags) > 0 { if len(tags) > 0 {
firstTag = tags[0] firstTag = tags[0]
} }
@ -122,10 +124,10 @@ func (c *DockerCommand) RefreshImages() ([]*Image, error) {
} }
ownImages[i] = &Image{ ownImages[i] = &Image{
ID: img.ID, ID: image.ID,
Name: name, Name: name,
Tag: tag, Tag: tag,
Image: img, Image: image,
Client: c.Client, Client: c.Client,
OSCommand: c.OSCommand, OSCommand: c.OSCommand,
Log: c.Log, Log: c.Log,

View file

@ -1,54 +0,0 @@
package commands
import (
"context"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/client"
"github.com/sirupsen/logrus"
)
// Network : A docker Network
type Network struct {
Name string
Network network.Inspect
Client *client.Client
OSCommand *OSCommand
Log *logrus.Entry
DockerCommand LimitedDockerCommand
}
// RefreshNetworks gets the networks and stores them
func (c *DockerCommand) RefreshNetworks() ([]*Network, error) {
networks, err := c.Client.NetworkList(context.Background(), network.ListOptions{})
if err != nil {
return nil, err
}
ownNetworks := make([]*Network, len(networks))
for i, nw := range networks {
ownNetworks[i] = &Network{
Name: nw.Name,
Network: nw,
Client: c.Client,
OSCommand: c.OSCommand,
Log: c.Log,
DockerCommand: c,
}
}
return ownNetworks, nil
}
// PruneNetworks prunes networks
func (c *DockerCommand) PruneNetworks() error {
_, err := c.Client.NetworksPrune(context.Background(), filters.Args{})
return err
}
// Remove removes the network
func (v *Network) Remove() error {
return v.Client.NetworkRemove(context.Background(), v.Name)
}

View file

@ -3,7 +3,7 @@ package commands
import ( import (
"context" "context"
"fmt" "fmt"
"io" "io/ioutil"
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
@ -25,8 +25,10 @@ type Platform struct {
os string os string
shell string shell string
shellArg string shellArg string
escapedQuote string
openCommand string openCommand string
openLinkCommand string openLinkCommand string
fallbackEscapedQuote string
} }
// OSCommand holds all the os commands // OSCommand holds all the os commands
@ -87,7 +89,7 @@ func (c *OSCommand) RunExecutable(cmd *exec.Cmd) error {
// ExecutableFromString takes a string like `docker ps -a` and returns an executable command for it // ExecutableFromString takes a string like `docker ps -a` and returns an executable command for it
func (c *OSCommand) ExecutableFromString(commandStr string) *exec.Cmd { func (c *OSCommand) ExecutableFromString(commandStr string) *exec.Cmd {
splitCmd := str.ToArgv(commandStr) splitCmd := str.ToArgv(commandStr)
return c.NewCmd(splitCmd[0], splitCmd[1:]...) return c.command(splitCmd[0], splitCmd[1:]...)
} }
// Same as ExecutableFromString but cancellable via a context // Same as ExecutableFromString but cancellable via a context
@ -96,31 +98,6 @@ func (c *OSCommand) ExecutableFromStringContext(ctx context.Context, commandStr
return exec.CommandContext(ctx, splitCmd[0], splitCmd[1:]...) return exec.CommandContext(ctx, splitCmd[0], splitCmd[1:]...)
} }
func (c *OSCommand) NewCmd(cmdName string, commandArgs ...string) *exec.Cmd {
cmd := c.command(cmdName, commandArgs...)
cmd.Env = os.Environ()
return cmd
}
func (c *OSCommand) NewCommandStringWithShell(commandStr string) string {
var quotedCommand string
// Windows does not seem to like quotes around the command
if c.Platform.os == "windows" {
quotedCommand = strings.NewReplacer(
"^", "^^",
"&", "^&",
"|", "^|",
"<", "^<",
">", "^>",
"%", "^%",
).Replace(commandStr)
} else {
quotedCommand = c.Quote(commandStr)
}
return fmt.Sprintf("%s %s %s", c.Platform.shell, c.Platform.shellArg, quotedCommand)
}
// RunCommand runs a command and just returns the error // RunCommand runs a command and just returns the error
func (c *OSCommand) RunCommand(command string) error { func (c *OSCommand) RunCommand(command string) error {
_, err := c.RunCommandWithOutput(command) _, err := c.RunCommandWithOutput(command)
@ -139,6 +116,16 @@ func (c *OSCommand) FileType(path string) string {
return "file" return "file"
} }
// RunDirectCommand wrapper around direct commands
func (c *OSCommand) RunDirectCommand(command string) (string, error) {
c.Log.WithField("command", command).Info("RunDirectCommand")
return sanitisedCommandOutput(
c.command(c.Platform.shell, c.Platform.shellArg, command).
CombinedOutput(),
)
}
func sanitisedCommandOutput(output []byte, err error) (string, error) { func sanitisedCommandOutput(output []byte, err error) (string, error) {
outputString := string(output) outputString := string(output)
if err != nil { if err != nil {
@ -193,28 +180,22 @@ func (c *OSCommand) EditFile(filename string) (*exec.Cmd, error) {
return nil, errors.New("No editor defined in $VISUAL or $EDITOR") return nil, errors.New("No editor defined in $VISUAL or $EDITOR")
} }
return c.NewCmd(editor, filename), nil return c.PrepareSubProcess(editor, filename), nil
}
// PrepareSubProcess iniPrepareSubProcessrocess then tells the Gui to switch to it
func (c *OSCommand) PrepareSubProcess(cmdName string, commandArgs ...string) *exec.Cmd {
return c.command(cmdName, commandArgs...)
} }
// Quote wraps a message in platform-specific quotation marks // Quote wraps a message in platform-specific quotation marks
func (c *OSCommand) Quote(message string) string { func (c *OSCommand) Quote(message string) string {
var quote string message = strings.Replace(message, "`", "\\`", -1)
if c.Platform.os == "windows" { escapedQuote := c.Platform.escapedQuote
quote = `\"` if strings.Contains(message, c.Platform.escapedQuote) {
message = strings.NewReplacer( escapedQuote = c.Platform.fallbackEscapedQuote
`"`, `"'"'"`,
`\"`, `\\"`,
).Replace(message)
} else {
quote = `"`
message = strings.NewReplacer(
`\`, `\\`,
`"`, `\"`,
`$`, `\$`,
"`", "\\`",
).Replace(message)
} }
return quote + message + quote return escapedQuote + message + escapedQuote
} }
// Unquote removes wrapping quotations marks if they are present // Unquote removes wrapping quotations marks if they are present
@ -240,7 +221,7 @@ func (c *OSCommand) AppendLineToFile(filename, line string) error {
// CreateTempFile writes a string to a new temp file and returns the file's name // CreateTempFile writes a string to a new temp file and returns the file's name
func (c *OSCommand) CreateTempFile(filename, content string) (string, error) { func (c *OSCommand) CreateTempFile(filename, content string) (string, error) {
tmpfile, err := os.CreateTemp("", filename) tmpfile, err := ioutil.TempFile("", filename)
if err != nil { if err != nil {
c.Log.Error(err) c.Log.Error(err)
return "", WrapError(err) return "", WrapError(err)
@ -302,7 +283,7 @@ func (c *OSCommand) GetLazydockerPath() string {
// RunCustomCommand returns the pointer to a custom command // RunCustomCommand returns the pointer to a custom command
func (c *OSCommand) RunCustomCommand(command string) *exec.Cmd { func (c *OSCommand) RunCustomCommand(command string) *exec.Cmd {
return c.NewCmd(c.Platform.shell, c.Platform.shellArg, command) return c.PrepareSubProcess(c.Platform.shell, c.Platform.shellArg, command)
} }
// PipeCommands runs a heap of commands and pipes their inputs/outputs together like A | B | C // PipeCommands runs a heap of commands and pipes their inputs/outputs together like A | B | C
@ -342,7 +323,7 @@ func (c *OSCommand) PipeCommands(commandStrings ...string) error {
c.Log.Error(err) c.Log.Error(err)
} }
if b, err := io.ReadAll(stderr); err == nil { if b, err := ioutil.ReadAll(stderr); err == nil {
if len(b) > 0 { if len(b) > 0 {
finalErrors = append(finalErrors, string(b)) finalErrors = append(finalErrors, string(b))
} }

View file

@ -12,7 +12,9 @@ func getPlatform() *Platform {
os: runtime.GOOS, os: runtime.GOOS,
shell: "bash", shell: "bash",
shellArg: "-c", shellArg: "-c",
escapedQuote: "'",
openCommand: "open {{filename}}", openCommand: "open {{filename}}",
openLinkCommand: "open {{link}}", openLinkCommand: "open {{link}}",
fallbackEscapedQuote: "\"",
} }
} }

View file

@ -1,7 +1,7 @@
package commands package commands
import ( import (
"fmt" "io/ioutil"
"os" "os"
"os/exec" "os/exec"
"testing" "testing"
@ -89,7 +89,7 @@ func TestOSCommandEditFile(t *testing.T) {
assert.EqualValues(t, "nano", name) assert.EqualValues(t, "nano", name)
return exec.Command("exit", "0") return nil
}, },
func(env string) string { func(env string) string {
if env == "VISUAL" { if env == "VISUAL" {
@ -111,7 +111,7 @@ func TestOSCommandEditFile(t *testing.T) {
assert.EqualValues(t, "emacs", name) assert.EqualValues(t, "emacs", name)
return exec.Command("exit", "0") return nil
}, },
func(env string) string { func(env string) string {
if env == "EDITOR" { if env == "EDITOR" {
@ -133,7 +133,7 @@ func TestOSCommandEditFile(t *testing.T) {
assert.EqualValues(t, "vi", name) assert.EqualValues(t, "vi", name)
return exec.Command("exit", "0") return nil
}, },
func(env string) string { func(env string) string {
return "" return ""
@ -153,14 +153,13 @@ func TestOSCommandEditFile(t *testing.T) {
} }
} }
// TestOSCommandQuote is a function.
func TestOSCommandQuote(t *testing.T) { func TestOSCommandQuote(t *testing.T) {
osCommand := NewDummyOSCommand() osCommand := NewDummyOSCommand()
osCommand.Platform.os = "linux"
actual := osCommand.Quote("hello `test`") actual := osCommand.Quote("hello `test`")
expected := "\"hello \\`test\\`\"" expected := osCommand.Platform.escapedQuote + "hello \\`test\\`" + osCommand.Platform.escapedQuote
assert.EqualValues(t, expected, actual) assert.EqualValues(t, expected, actual)
} }
@ -170,10 +169,12 @@ func TestOSCommandQuoteSingleQuote(t *testing.T) {
osCommand := NewDummyOSCommand() osCommand := NewDummyOSCommand()
osCommand.Platform.os = "linux" osCommand.Platform.os = "linux"
osCommand.Platform.fallbackEscapedQuote = "\""
osCommand.Platform.escapedQuote = "'"
actual := osCommand.Quote("hello 'test'") actual := osCommand.Quote("hello 'test'")
expected := `"hello 'test'"` expected := osCommand.Platform.fallbackEscapedQuote + "hello 'test'" + osCommand.Platform.fallbackEscapedQuote
assert.EqualValues(t, expected, actual) assert.EqualValues(t, expected, actual)
} }
@ -186,20 +187,7 @@ func TestOSCommandQuoteDoubleQuote(t *testing.T) {
actual := osCommand.Quote(`hello "test"`) actual := osCommand.Quote(`hello "test"`)
expected := `"hello \"test\""` expected := osCommand.Platform.escapedQuote + "hello \"test\"" + osCommand.Platform.escapedQuote
assert.EqualValues(t, expected, actual)
}
// TestOSCommandQuoteWindows tests the quote function for Windows
func TestOSCommandQuoteWindows(t *testing.T) {
osCommand := NewDummyOSCommand()
osCommand.Platform.os = "windows"
actual := osCommand.Quote(`hello "test" 'test2'`)
expected := `\"hello "'"'"test"'"'" 'test2'\"`
assert.EqualValues(t, expected, actual) assert.EqualValues(t, expected, actual)
} }
@ -289,7 +277,7 @@ func TestOSCommandCreateTempFile(t *testing.T) {
func(path string, err error) { func(path string, err error) {
assert.NoError(t, err) assert.NoError(t, err)
content, err := os.ReadFile(path) content, err := ioutil.ReadFile(path)
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, "content", string(content)) assert.Equal(t, "content", string(content))
@ -303,53 +291,3 @@ func TestOSCommandCreateTempFile(t *testing.T) {
}) })
} }
} }
func TestOSCommandExecutableFromStringWithShellLinux(t *testing.T) {
osCommand := NewDummyOSCommand()
osCommand.Platform.os = "linux"
tests := []struct {
name string
commandStr string
want string
}{
{
"success",
"pwd",
fmt.Sprintf("%v %v %v", osCommand.Platform.shell, osCommand.Platform.shellArg, "\"pwd\""),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := osCommand.NewCommandStringWithShell(tt.commandStr)
assert.Equal(t, tt.want, got)
})
}
}
func TestOSCommandNewCommandStringWithShellWindows(t *testing.T) {
osCommand := NewDummyOSCommand()
osCommand.Platform.os = "windows"
tests := []struct {
name string
commandStr string
want string
}{
{
"success",
"pwd",
fmt.Sprintf("%v %v %v", osCommand.Platform.shell, osCommand.Platform.shellArg, "pwd"),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := osCommand.NewCommandStringWithShell(tt.commandStr)
assert.Equal(t, tt.want, got)
})
}
}

View file

@ -5,5 +5,7 @@ func getPlatform() *Platform {
os: "windows", os: "windows",
shell: "cmd", shell: "cmd",
shellArg: "/c", shellArg: "/c",
escapedQuote: `\"`,
fallbackEscapedQuote: "\\'",
} }
} }

View file

@ -4,7 +4,7 @@ import (
"context" "context"
"os/exec" "os/exec"
"github.com/docker/docker/api/types/container" dockerTypes "github.com/docker/docker/api/types"
"github.com/jesseduffield/lazydocker/pkg/utils" "github.com/jesseduffield/lazydocker/pkg/utils"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
@ -13,7 +13,6 @@ import (
type Service struct { type Service struct {
Name string Name string
ID string ID string
ProjectName string
OSCommand *OSCommand OSCommand *OSCommand
Log *logrus.Entry Log *logrus.Entry
Container *Container Container *Container
@ -21,7 +20,7 @@ type Service struct {
} }
// Remove removes the service's containers // Remove removes the service's containers
func (s *Service) Remove(options container.RemoveOptions) error { func (s *Service) Remove(options dockerTypes.ContainerRemoveOptions) error {
return s.Container.Remove(options) return s.Container.Remove(options)
} }
@ -40,7 +39,7 @@ func (s *Service) Restart() error {
return s.runCommand(s.OSCommand.Config.UserConfig.CommandTemplates.RestartService) return s.runCommand(s.OSCommand.Config.UserConfig.CommandTemplates.RestartService)
} }
// Start starts the service // Restart starts the service
func (s *Service) Start() error { func (s *Service) Start() error {
return s.runCommand(s.OSCommand.Config.UserConfig.CommandTemplates.StartService) return s.runCommand(s.OSCommand.Config.UserConfig.CommandTemplates.StartService)
} }

View file

@ -4,6 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"net" "net"
"net/url" "net/url"
"os" "os"
@ -36,7 +37,7 @@ func NewSSHHandler(oSCommand CmdKiller) *SSHHandler {
return (&net.Dialer{}).DialContext(ctx, network, addr) return (&net.Dialer{}).DialContext(ctx, network, addr)
}, },
startCmd: func(cmd *exec.Cmd) error { return cmd.Start() }, startCmd: func(cmd *exec.Cmd) error { return cmd.Start() },
tempDir: os.MkdirTemp, tempDir: ioutil.TempDir,
getenv: os.Getenv, getenv: os.Getenv,
setenv: os.Setenv, setenv: os.Setenv,
} }

View file

@ -3,8 +3,8 @@ package commands
import ( import (
"context" "context"
dockerTypes "github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/volume"
"github.com/docker/docker/client" "github.com/docker/docker/client"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
@ -12,7 +12,7 @@ import (
// Volume : A docker Volume // Volume : A docker Volume
type Volume struct { type Volume struct {
Name string Name string
Volume *volume.Volume Volume *dockerTypes.Volume
Client *client.Client Client *client.Client
OSCommand *OSCommand OSCommand *OSCommand
Log *logrus.Entry Log *logrus.Entry
@ -21,7 +21,7 @@ type Volume struct {
// RefreshVolumes gets the volumes and stores them // RefreshVolumes gets the volumes and stores them
func (c *DockerCommand) RefreshVolumes() ([]*Volume, error) { func (c *DockerCommand) RefreshVolumes() ([]*Volume, error) {
result, err := c.Client.VolumeList(context.Background(), volume.ListOptions{}) result, err := c.Client.VolumeList(context.Background(), filters.Args{})
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -30,10 +30,10 @@ func (c *DockerCommand) RefreshVolumes() ([]*Volume, error) {
ownVolumes := make([]*Volume, len(volumes)) ownVolumes := make([]*Volume, len(volumes))
for i, vol := range volumes { for i, volume := range volumes {
ownVolumes[i] = &Volume{ ownVolumes[i] = &Volume{
Name: vol.Name, Name: volume.Name,
Volume: vol, Volume: volume,
Client: c.Client, Client: c.Client,
OSCommand: c.OSCommand, OSCommand: c.OSCommand,
Log: c.Log, Log: c.Log,

View file

@ -13,6 +13,7 @@
package config package config
import ( import (
"io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
@ -70,7 +71,6 @@ type UserConfig struct {
type ThemeConfig struct { type ThemeConfig struct {
ActiveBorderColor []string `yaml:"activeBorderColor,omitempty"` ActiveBorderColor []string `yaml:"activeBorderColor,omitempty"`
InactiveBorderColor []string `yaml:"inactiveBorderColor,omitempty"` InactiveBorderColor []string `yaml:"inactiveBorderColor,omitempty"`
SelectedLineBgColor []string `yaml:"selectedLineBgColor,omitempty"`
OptionsTextColor []string `yaml:"optionsTextColor,omitempty"` OptionsTextColor []string `yaml:"optionsTextColor,omitempty"`
} }
@ -130,18 +130,6 @@ type GuiConfig struct {
// When true, increases vertical space used by focused side panel, // When true, increases vertical space used by focused side panel,
// creating an accordion effect // creating an accordion effect
ExpandFocusedSidePanel bool `yaml:"expandFocusedSidePanel"` ExpandFocusedSidePanel bool `yaml:"expandFocusedSidePanel"`
// ScreenMode allow user to specify which screen mode will be used on startup
ScreenMode string `yaml:"screenMode,omitempty"`
// Determines the style of the container status and container health display in the
// containers panel. "long": full words (default), "short": one or two characters,
// "icon": unicode emoji.
ContainerStatusHealthStyle string `yaml:"containerStatusHealthStyle"`
// Window border style.
// One of 'rounded' (default) | 'single' | 'double' | 'hidden'
Border string `yaml:"border"`
} }
// CommandTemplatesConfig determines what commands actually get called when we // CommandTemplatesConfig determines what commands actually get called when we
@ -168,7 +156,7 @@ type CommandTemplatesConfig struct {
// DockerCompose is for your docker-compose command. You may want to combine a // DockerCompose is for your docker-compose command. You may want to combine a
// few different docker-compose.yml files together, in which case you can set // few different docker-compose.yml files together, in which case you can set
// this to "docker compose -f foo/docker-compose.yml -f // this to "docker-compose -f foo/docker-compose.yml -f
// bah/docker-compose.yml". The reason that the other docker-compose command // bah/docker-compose.yml". The reason that the other docker-compose command
// templates all start with {{ .DockerCompose }} is so that they can make use // templates all start with {{ .DockerCompose }} is so that they can make use
// of whatever you've set in this value rather than you having to copy and // of whatever you've set in this value rather than you having to copy and
@ -200,7 +188,7 @@ type CommandTemplatesConfig struct {
// and ensure they're running before trying to run the service at hand // and ensure they're running before trying to run the service at hand
RecreateService string `yaml:"recreateService,omitempty"` RecreateService string `yaml:"recreateService,omitempty"`
// AllLogs is for showing what you get from doing `docker compose logs`. It // AllLogs is for showing what you get from doing `docker-compose logs`. It
// combines all the logs together // combines all the logs together
AllLogs string `yaml:"allLogs,omitempty"` AllLogs string `yaml:"allLogs,omitempty"`
@ -298,9 +286,6 @@ type CustomCommands struct {
// Volumes contains the custom commands for volumes // Volumes contains the custom commands for volumes
Volumes []CustomCommand `yaml:"volumes,omitempty"` Volumes []CustomCommand `yaml:"volumes,omitempty"`
// Networks contains the custom commands for networks
Networks []CustomCommand `yaml:"networks,omitempty"`
} }
// Replacements contains the stuff relating to rendering a container's info // Replacements contains the stuff relating to rendering a container's info
@ -321,10 +306,6 @@ type CustomCommand struct {
// option where the output plays in the main panel. // option where the output plays in the main panel.
Attach bool `yaml:"attach"` Attach bool `yaml:"attach"`
// Shell indicates whether to invoke the Command on a shell or not.
// Example of a bash invoked command: `/bin/bash -c "{Command}".
Shell bool `yaml:"shell"`
// Command is the command we want to run. We can use the go templates here as // Command is the command we want to run. We can use the go templates here as
// well. One example might be `{{ .DockerCompose }} exec {{ .Service.Name }} // well. One example might be `{{ .DockerCompose }} exec {{ .Service.Name }}
// /bin/sh` // /bin/sh`
@ -343,7 +324,6 @@ type CustomCommand struct {
type LogsConfig struct { type LogsConfig struct {
Timestamps bool `yaml:"timestamps,omitempty"` Timestamps bool `yaml:"timestamps,omitempty"`
Since string `yaml:"since,omitempty"` Since string `yaml:"since,omitempty"`
Tail string `yaml:"tail,omitempty"`
} }
// GetDefaultConfig returns the application default configuration NOTE (to // GetDefaultConfig returns the application default configuration NOTE (to
@ -365,7 +345,6 @@ func GetDefaultConfig() UserConfig {
Theme: ThemeConfig{ Theme: ThemeConfig{
ActiveBorderColor: []string{"green", "bold"}, ActiveBorderColor: []string{"green", "bold"},
InactiveBorderColor: []string{"default"}, InactiveBorderColor: []string{"default"},
SelectedLineBgColor: []string{"blue"},
OptionsTextColor: []string{"blue"}, OptionsTextColor: []string{"blue"},
}, },
ShowAllContainers: false, ShowAllContainers: false,
@ -375,17 +354,14 @@ func GetDefaultConfig() UserConfig {
SidePanelWidth: 0.3333, SidePanelWidth: 0.3333,
ShowBottomLine: true, ShowBottomLine: true,
ExpandFocusedSidePanel: false, ExpandFocusedSidePanel: false,
ScreenMode: "normal",
ContainerStatusHealthStyle: "long",
}, },
ConfirmOnQuit: false, ConfirmOnQuit: false,
Logs: LogsConfig{ Logs: LogsConfig{
Timestamps: false, Timestamps: false,
Since: "60m", Since: "60m",
Tail: "",
}, },
CommandTemplates: CommandTemplatesConfig{ CommandTemplates: CommandTemplatesConfig{
DockerCompose: "docker compose", DockerCompose: "docker-compose",
RestartService: "{{ .DockerCompose }} restart {{ .Service.Name }}", RestartService: "{{ .DockerCompose }} restart {{ .Service.Name }}",
StartService: "{{ .DockerCompose }} start {{ .Service.Name }}", StartService: "{{ .DockerCompose }} start {{ .Service.Name }}",
Up: "{{ .DockerCompose }} up -d", Up: "{{ .DockerCompose }} up -d",
@ -488,11 +464,10 @@ type AppConfig struct {
UserConfig *UserConfig UserConfig *UserConfig
ConfigDir string ConfigDir string
ProjectDir string ProjectDir string
ProjectName string
} }
// NewAppConfig makes a new app config // NewAppConfig makes a new app config
func NewAppConfig(name, version, commit, date string, buildSource string, debuggingFlag bool, composeFiles []string, projectDir string, projectName string) (*AppConfig, error) { func NewAppConfig(name, version, commit, date string, buildSource string, debuggingFlag bool, composeFiles []string, projectDir string) (*AppConfig, error) {
configDir, err := findOrCreateConfigDir(name) configDir, err := findOrCreateConfigDir(name)
if err != nil { if err != nil {
return nil, err return nil, err
@ -503,7 +478,7 @@ func NewAppConfig(name, version, commit, date string, buildSource string, debugg
return nil, err return nil, err
} }
// Pass compose files as individual -f flags to docker compose // Pass compose files as individual -f flags to docker-compose
if len(composeFiles) > 0 { if len(composeFiles) > 0 {
userConfig.CommandTemplates.DockerCompose += " -f " + strings.Join(composeFiles, " -f ") userConfig.CommandTemplates.DockerCompose += " -f " + strings.Join(composeFiles, " -f ")
} }
@ -518,7 +493,6 @@ func NewAppConfig(name, version, commit, date string, buildSource string, debugg
UserConfig: userConfig, UserConfig: userConfig,
ConfigDir: configDir, ConfigDir: configDir,
ProjectDir: projectDir, ProjectDir: projectDir,
ProjectName: projectName,
} }
return appConfig, nil return appConfig, nil
@ -574,7 +548,7 @@ func loadUserConfig(configDir string, base *UserConfig) (*UserConfig, error) {
} }
} }
content, err := os.ReadFile(fileName) content, err := ioutil.ReadFile(fileName)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View file

@ -9,13 +9,13 @@ import (
func TestDockerComposeCommandNoFiles(t *testing.T) { func TestDockerComposeCommandNoFiles(t *testing.T) {
composeFiles := []string{} composeFiles := []string{}
conf, err := NewAppConfig("name", "version", "commit", "date", "buildSource", false, composeFiles, "projectDir", "") conf, err := NewAppConfig("name", "version", "commit", "date", "buildSource", false, composeFiles, "projectDir")
if err != nil { if err != nil {
t.Fatalf("Unexpected error: %s", err) t.Fatalf("Unexpected error: %s", err)
} }
actual := conf.UserConfig.CommandTemplates.DockerCompose actual := conf.UserConfig.CommandTemplates.DockerCompose
expected := "docker compose" expected := "docker-compose"
if actual != expected { if actual != expected {
t.Fatalf("Expected %s but got %s", expected, actual) t.Fatalf("Expected %s but got %s", expected, actual)
} }
@ -23,13 +23,13 @@ func TestDockerComposeCommandNoFiles(t *testing.T) {
func TestDockerComposeCommandSingleFile(t *testing.T) { func TestDockerComposeCommandSingleFile(t *testing.T) {
composeFiles := []string{"one.yml"} composeFiles := []string{"one.yml"}
conf, err := NewAppConfig("name", "version", "commit", "date", "buildSource", false, composeFiles, "projectDir", "") conf, err := NewAppConfig("name", "version", "commit", "date", "buildSource", false, composeFiles, "projectDir")
if err != nil { if err != nil {
t.Fatalf("Unexpected error: %s", err) t.Fatalf("Unexpected error: %s", err)
} }
actual := conf.UserConfig.CommandTemplates.DockerCompose actual := conf.UserConfig.CommandTemplates.DockerCompose
expected := "docker compose -f one.yml" expected := "docker-compose -f one.yml"
if actual != expected { if actual != expected {
t.Fatalf("Expected %s but got %s", expected, actual) t.Fatalf("Expected %s but got %s", expected, actual)
} }
@ -37,13 +37,13 @@ func TestDockerComposeCommandSingleFile(t *testing.T) {
func TestDockerComposeCommandMultipleFiles(t *testing.T) { func TestDockerComposeCommandMultipleFiles(t *testing.T) {
composeFiles := []string{"one.yml", "two.yml", "three.yml"} composeFiles := []string{"one.yml", "two.yml", "three.yml"}
conf, err := NewAppConfig("name", "version", "commit", "date", "buildSource", false, composeFiles, "projectDir", "") conf, err := NewAppConfig("name", "version", "commit", "date", "buildSource", false, composeFiles, "projectDir")
if err != nil { if err != nil {
t.Fatalf("Unexpected error: %s", err) t.Fatalf("Unexpected error: %s", err)
} }
actual := conf.UserConfig.CommandTemplates.DockerCompose actual := conf.UserConfig.CommandTemplates.DockerCompose
expected := "docker compose -f one.yml -f two.yml -f three.yml" expected := "docker-compose -f one.yml -f two.yml -f three.yml"
if actual != expected { if actual != expected {
t.Fatalf("Expected %s but got %s", expected, actual) t.Fatalf("Expected %s but got %s", expected, actual)
} }
@ -52,7 +52,7 @@ func TestDockerComposeCommandMultipleFiles(t *testing.T) {
func TestWritingToConfigFile(t *testing.T) { func TestWritingToConfigFile(t *testing.T) {
// init the AppConfig // init the AppConfig
emptyComposeFiles := []string{} emptyComposeFiles := []string{}
conf, err := NewAppConfig("name", "version", "commit", "date", "buildSource", false, emptyComposeFiles, "projectDir", "") conf, err := NewAppConfig("name", "version", "commit", "date", "buildSource", false, emptyComposeFiles, "projectDir")
if err != nil { if err != nil {
t.Fatalf("Unexpected error: %s", err) t.Fatalf("Unexpected error: %s", err)
} }

View file

@ -175,31 +175,14 @@ func (gui *Gui) sidePanelChildren(width int, height int) []*boxlayout.Box {
return defaultBox return defaultBox
} }
// The project panel is compact (Size: 3) when not focused, but expands return append([]*boxlayout.Box{
// when focused to show the list of projects. This only applies when the {
// project panel is actually visible (i.e. we are inside a compose project).
if len(sideWindowNames) > 0 && sideWindowNames[0] == "project" {
projectBox := &boxlayout.Box{
Window: sideWindowNames[0], Window: sideWindowNames[0],
Size: 3, Size: 3,
} },
if currentWindow == sideWindowNames[0] {
projectBox = &boxlayout.Box{
Window: sideWindowNames[0],
Weight: 2,
}
}
return append([]*boxlayout.Box{
projectBox,
}, lo.Map(sideWindowNames[1:], func(window string, _ int) *boxlayout.Box { }, lo.Map(sideWindowNames[1:], func(window string, _ int) *boxlayout.Box {
return accordionBox(&boxlayout.Box{Window: window, Weight: 1}) return accordionBox(&boxlayout.Box{Window: window, Weight: 1})
})...) })...)
}
return lo.Map(sideWindowNames, func(window string, _ int) *boxlayout.Box {
return accordionBox(&boxlayout.Box{Window: window, Weight: 1})
})
} else { } else {
squashedHeight := 1 squashedHeight := 1
if height >= 21 { if height >= 21 {

View file

@ -64,7 +64,7 @@ func (gui *Gui) getConfirmationPanelDimensions(wrap bool, prompt string) (int, i
func (gui *Gui) createPromptPanel(title string, handleConfirm func(*gocui.Gui, *gocui.View) error) error { func (gui *Gui) createPromptPanel(title string, handleConfirm func(*gocui.Gui, *gocui.View) error) error {
gui.onNewPopupPanel() gui.onNewPopupPanel()
err := gui.prepareConfirmationPanel(title, "") err := gui.prepareConfirmationPanel(title, "", false)
if err != nil { if err != nil {
return err return err
} }
@ -72,13 +72,17 @@ func (gui *Gui) createPromptPanel(title string, handleConfirm func(*gocui.Gui, *
return gui.setKeyBindings(gui.g, handleConfirm, nil) return gui.setKeyBindings(gui.g, handleConfirm, nil)
} }
func (gui *Gui) prepareConfirmationPanel(title, prompt string) error { func (gui *Gui) prepareConfirmationPanel(title, prompt string, hasLoader bool) error {
x0, y0, x1, y1 := gui.getConfirmationPanelDimensions(true, prompt) x0, y0, x1, y1 := gui.getConfirmationPanelDimensions(true, prompt)
confirmationView := gui.Views.Confirmation confirmationView := gui.Views.Confirmation
_, err := gui.g.SetView("confirmation", x0, y0, x1, y1, 0) _, err := gui.g.SetView("confirmation", x0, y0, x1, y1, 0)
if err != nil { if err != nil {
return err return err
} }
confirmationView.HasLoader = hasLoader
if hasLoader {
gui.g.StartTicking()
}
confirmationView.Title = title confirmationView.Title = title
confirmationView.Visible = true confirmationView.Visible = true
gui.g.Update(func(g *gocui.Gui) error { gui.g.Update(func(g *gocui.Gui) error {
@ -96,10 +100,10 @@ func (gui *Gui) onNewPopupPanel() {
// The golangcilint unparam linter complains that handleClose is alwans nil but one day it won't be nil. // The golangcilint unparam linter complains that handleClose is alwans nil but one day it won't be nil.
// nolint:unparam // nolint:unparam
func (gui *Gui) createConfirmationPanel(title, prompt string, handleConfirm, handleClose func(*gocui.Gui, *gocui.View) error) error { func (gui *Gui) createConfirmationPanel(title, prompt string, handleConfirm, handleClose func(*gocui.Gui, *gocui.View) error) error {
return gui.createPopupPanel(title, prompt, handleConfirm, handleClose) return gui.createPopupPanel(title, prompt, false, handleConfirm, handleClose)
} }
func (gui *Gui) createPopupPanel(title, prompt string, handleConfirm, handleClose func(*gocui.Gui, *gocui.View) error) error { func (gui *Gui) createPopupPanel(title, prompt string, hasLoader bool, handleConfirm, handleClose func(*gocui.Gui, *gocui.View) error) error {
gui.onNewPopupPanel() gui.onNewPopupPanel()
gui.g.Update(func(g *gocui.Gui) error { gui.g.Update(func(g *gocui.Gui) error {
if gui.currentViewName() == "confirmation" { if gui.currentViewName() == "confirmation" {
@ -107,7 +111,7 @@ func (gui *Gui) createPopupPanel(title, prompt string, handleConfirm, handleClos
gui.Log.Error(err.Error()) gui.Log.Error(err.Error())
} }
} }
err := gui.prepareConfirmationPanel(title, prompt) err := gui.prepareConfirmationPanel(title, prompt, hasLoader)
if err != nil { if err != nil {
return err return err
} }

View file

@ -8,7 +8,7 @@ import (
"os/signal" "os/signal"
"time" "time"
"github.com/docker/docker/api/types/container" dockerTypes "github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stdcopy" "github.com/docker/docker/pkg/stdcopy"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/jesseduffield/lazydocker/pkg/commands" "github.com/jesseduffield/lazydocker/pkg/commands"
@ -104,39 +104,19 @@ func (gui *Gui) promptToReturn() {
} }
} }
func (gui *Gui) writeContainerLogs(ctr *commands.Container, ctx context.Context, writer io.Writer) error { func (gui *Gui) writeContainerLogs(container *commands.Container, ctx context.Context, writer io.Writer) error {
readCloser, err := gui.DockerCommand.Client.ContainerLogs(ctx, ctr.ID, container.LogsOptions{ readCloser, err := gui.DockerCommand.Client.ContainerLogs(ctx, container.ID, dockerTypes.ContainerLogsOptions{
ShowStdout: true, ShowStdout: true,
ShowStderr: true, ShowStderr: true,
Timestamps: gui.Config.UserConfig.Logs.Timestamps, Timestamps: gui.Config.UserConfig.Logs.Timestamps,
Since: gui.Config.UserConfig.Logs.Since, Since: gui.Config.UserConfig.Logs.Since,
Tail: gui.Config.UserConfig.Logs.Tail,
Follow: true, Follow: true,
}) })
if err != nil { if err != nil {
gui.Log.Error(err)
return err return err
} }
defer readCloser.Close()
if !ctr.DetailsLoaded() { if container.DetailsLoaded() && container.Details.Config.Tty {
// loop until the details load or context is cancelled, using timer
ticker := time.NewTicker(time.Millisecond * 100)
defer ticker.Stop()
outer:
for {
select {
case <-ctx.Done():
return nil
case <-ticker.C:
if ctr.DetailsLoaded() {
break outer
}
}
}
}
if ctr.Details.Config.Tty {
_, err = io.Copy(writer, readCloser) _, err = io.Copy(writer, readCloser)
if err != nil { if err != nil {
return err return err

View file

@ -2,11 +2,12 @@ package gui
import ( import (
"context" "context"
"encoding/json"
"fmt" "fmt"
"strings" "strings"
"time" "time"
"github.com/docker/docker/api/types/container" dockerTypes "github.com/docker/docker/api/types"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/jesseduffield/gocui" "github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazydocker/pkg/commands" "github.com/jesseduffield/lazydocker/pkg/commands"
@ -27,7 +28,7 @@ func (gui *Gui) getContainersPanel() *panels.SideListPanel[*commands.Container]
} }
return !lo.SomeBy(gui.Panels.Services.List.GetAllItems(), func(service *commands.Service) bool { return !lo.SomeBy(gui.Panels.Services.List.GetAllItems(), func(service *commands.Service) bool {
return service.Name == container.ServiceName && service.ProjectName == container.ProjectName return service.Name == container.ServiceName
}) })
} }
@ -83,19 +84,6 @@ func (gui *Gui) getContainersPanel() *panels.SideListPanel[*commands.Container]
return sortContainers(a, b, gui.Config.UserConfig.Gui.LegacySortContainers) return sortContainers(a, b, gui.Config.UserConfig.Gui.LegacySortContainers)
}, },
Filter: func(container *commands.Container) bool { Filter: func(container *commands.Container) bool {
if !gui.State.ShowExitedContainers && container.Container.State == "exited" {
return false
}
// When project-scoped, apply project and standalone filtering.
// Otherwise all containers are shown in a flat list regardless
// of which compose project they belong to.
if gui.DockerCommand.IsProjectScoped() {
// This check must be inside the IsProjectScoped guard: when
// not project-scoped, services are still derived from container
// labels, so compose-managed containers from other projects
// would be incorrectly hidden.
//
// Note that this is O(N*M) time complexity where N is the number of services // Note that this is O(N*M) time complexity where N is the number of services
// and M is the number of containers. We expect N to be small but M may be large, // and M is the number of containers. We expect N to be small but M may be large,
// so we will need to keep an eye on this. // so we will need to keep an eye on this.
@ -103,22 +91,13 @@ func (gui *Gui) getContainersPanel() *panels.SideListPanel[*commands.Container]
return false return false
} }
// Filter by selected project. Containers with no project (truly if !gui.State.ShowExitedContainers && container.Container.State == "exited" {
// standalone, not from any compose project) are always shown.
selectedProject := gui.getSelectedProjectName()
if selectedProject == "" {
selectedProject = gui.DockerCommand.LocalProjectName
}
if selectedProject != "" && container.ProjectName != "" && container.ProjectName != selectedProject {
return false return false
} }
}
return true return true
}, },
GetTableCells: func(container *commands.Container) []string { GetTableCells: presentation.GetContainerDisplayStrings,
return presentation.GetContainerDisplayStrings(&gui.Config.UserConfig.Gui, container)
},
} }
} }
@ -221,12 +200,12 @@ func (gui *Gui) containerConfigStr(container *commands.Container) string {
output += "none\n" output += "none\n"
} }
data, err := utils.MarshalIntoYaml(&container.Details) data, err := json.MarshalIndent(&container.Details, "", " ")
if err != nil { if err != nil {
return fmt.Sprintf("Error marshalling container details: %v", err) return fmt.Sprintf("Error marshalling container details: %v", err)
} }
output += fmt.Sprintf("\nFull details:\n\n%s", utils.ColoredYamlString(string(data))) output += fmt.Sprintf("\nFull details:\n\n%s", string(data))
return output return output
} }
@ -276,6 +255,7 @@ func (gui *Gui) refreshContainersAndServices() error {
selectedService, isServiceSelected := gui.Panels.Services.List.TryGet(originalSelectedLineIdx) selectedService, isServiceSelected := gui.Panels.Services.List.TryGet(originalSelectedLineIdx)
containers, services, err := gui.DockerCommand.RefreshContainersAndServices( containers, services, err := gui.DockerCommand.RefreshContainersAndServices(
gui.Panels.Services.List.GetAllItems(),
gui.Panels.Containers.List.GetAllItems(), gui.Panels.Containers.List.GetAllItems(),
) )
if err != nil { if err != nil {
@ -302,9 +282,11 @@ func (gui *Gui) refreshContainersAndServices() error {
} }
func (gui *Gui) renderContainersAndServices() error { func (gui *Gui) renderContainersAndServices() error {
if gui.DockerCommand.InDockerComposeProject {
if err := gui.Panels.Services.RerenderList(); err != nil { if err := gui.Panels.Services.RerenderList(); err != nil {
return err return err
} }
}
if err := gui.Panels.Containers.RerenderList(); err != nil { if err := gui.Panels.Containers.RerenderList(); err != nil {
return err return err
@ -320,19 +302,19 @@ func (gui *Gui) handleHideStoppedContainers(g *gocui.Gui, v *gocui.View) error {
} }
func (gui *Gui) handleContainersRemoveMenu(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleContainersRemoveMenu(g *gocui.Gui, v *gocui.View) error {
ctr, err := gui.Panels.Containers.GetSelectedItem() container, err := gui.Panels.Containers.GetSelectedItem()
if err != nil { if err != nil {
return nil return nil
} }
handleMenuPress := func(configOptions container.RemoveOptions) error { handleMenuPress := func(configOptions dockerTypes.ContainerRemoveOptions) error {
return gui.WithWaitingStatus(gui.Tr.RemovingStatus, func() error { return gui.WithWaitingStatus(gui.Tr.RemovingStatus, func() error {
if err := ctr.Remove(configOptions); err != nil { if err := container.Remove(configOptions); err != nil {
if commands.HasErrorCode(err, commands.MustStopContainer) { if commands.HasErrorCode(err, commands.MustStopContainer) {
return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.MustForceToRemoveContainer, func(g *gocui.Gui, v *gocui.View) error { return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.MustForceToRemoveContainer, func(g *gocui.Gui, v *gocui.View) error {
return gui.WithWaitingStatus(gui.Tr.RemovingStatus, func() error { return gui.WithWaitingStatus(gui.Tr.RemovingStatus, func() error {
configOptions.Force = true configOptions.Force = true
return ctr.Remove(configOptions) return container.Remove(configOptions)
}) })
}, nil) }, nil)
} }
@ -344,12 +326,12 @@ func (gui *Gui) handleContainersRemoveMenu(g *gocui.Gui, v *gocui.View) error {
menuItems := []*types.MenuItem{ menuItems := []*types.MenuItem{
{ {
LabelColumns: []string{gui.Tr.Remove, "docker rm " + ctr.ID[1:10]}, LabelColumns: []string{gui.Tr.Remove, "docker rm " + container.ID[1:10]},
OnPress: func() error { return handleMenuPress(container.RemoveOptions{}) }, OnPress: func() error { return handleMenuPress(dockerTypes.ContainerRemoveOptions{}) },
}, },
{ {
LabelColumns: []string{gui.Tr.RemoveWithVolumes, "docker rm --volumes " + ctr.ID[1:10]}, LabelColumns: []string{gui.Tr.RemoveWithVolumes, "docker rm --volumes " + container.ID[1:10]},
OnPress: func() error { return handleMenuPress(container.RemoveOptions{RemoveVolumes: true}) }, OnPress: func() error { return handleMenuPress(dockerTypes.ContainerRemoveOptions{RemoveVolumes: true}) },
}, },
} }
@ -376,23 +358,23 @@ func (gui *Gui) PauseContainer(container *commands.Container) error {
} }
func (gui *Gui) handleContainerPause(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleContainerPause(g *gocui.Gui, v *gocui.View) error {
ctr, err := gui.Panels.Containers.GetSelectedItem() container, err := gui.Panels.Containers.GetSelectedItem()
if err != nil { if err != nil {
return nil return nil
} }
return gui.PauseContainer(ctr) return gui.PauseContainer(container)
} }
func (gui *Gui) handleContainerStop(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleContainerStop(g *gocui.Gui, v *gocui.View) error {
ctr, err := gui.Panels.Containers.GetSelectedItem() container, err := gui.Panels.Containers.GetSelectedItem()
if err != nil { if err != nil {
return nil return nil
} }
return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.StopContainer, func(g *gocui.Gui, v *gocui.View) error { return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.StopContainer, func(g *gocui.Gui, v *gocui.View) error {
return gui.WithWaitingStatus(gui.Tr.StoppingStatus, func() error { return gui.WithWaitingStatus(gui.Tr.StoppingStatus, func() error {
if err := ctr.Stop(); err != nil { if err := container.Stop(); err != nil {
return gui.createErrorPanel(err.Error()) return gui.createErrorPanel(err.Error())
} }
@ -402,13 +384,13 @@ func (gui *Gui) handleContainerStop(g *gocui.Gui, v *gocui.View) error {
} }
func (gui *Gui) handleContainerRestart(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleContainerRestart(g *gocui.Gui, v *gocui.View) error {
ctr, err := gui.Panels.Containers.GetSelectedItem() container, err := gui.Panels.Containers.GetSelectedItem()
if err != nil { if err != nil {
return nil return nil
} }
return gui.WithWaitingStatus(gui.Tr.RestartingStatus, func() error { return gui.WithWaitingStatus(gui.Tr.RestartingStatus, func() error {
if err := ctr.Restart(); err != nil { if err := container.Restart(); err != nil {
return gui.createErrorPanel(err.Error()) return gui.createErrorPanel(err.Error())
} }
@ -417,17 +399,17 @@ func (gui *Gui) handleContainerRestart(g *gocui.Gui, v *gocui.View) error {
} }
func (gui *Gui) handleContainerAttach(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleContainerAttach(g *gocui.Gui, v *gocui.View) error {
ctr, err := gui.Panels.Containers.GetSelectedItem() container, err := gui.Panels.Containers.GetSelectedItem()
if err != nil { if err != nil {
return nil return nil
} }
c, err := ctr.Attach() c, err := container.Attach()
if err != nil { if err != nil {
return gui.createErrorPanel(err.Error()) return gui.createErrorPanel(err.Error())
} }
return gui.runSubprocessWithMessage(c, gui.Tr.DetachFromContainerShortCut) return gui.runSubprocess(c)
} }
func (gui *Gui) handlePruneContainers() error { func (gui *Gui) handlePruneContainers() error {
@ -443,23 +425,23 @@ func (gui *Gui) handlePruneContainers() error {
} }
func (gui *Gui) handleContainerViewLogs(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleContainerViewLogs(g *gocui.Gui, v *gocui.View) error {
ctr, err := gui.Panels.Containers.GetSelectedItem() container, err := gui.Panels.Containers.GetSelectedItem()
if err != nil { if err != nil {
return nil return nil
} }
gui.renderLogsToStdout(ctr) gui.renderLogsToStdout(container)
return nil return nil
} }
func (gui *Gui) handleContainersExecShell(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleContainersExecShell(g *gocui.Gui, v *gocui.View) error {
ctr, err := gui.Panels.Containers.GetSelectedItem() container, err := gui.Panels.Containers.GetSelectedItem()
if err != nil { if err != nil {
return nil return nil
} }
return gui.containerExecShell(ctr) return gui.containerExecShell(container)
} }
func (gui *Gui) containerExecShell(container *commands.Container) error { func (gui *Gui) containerExecShell(container *commands.Container) error {
@ -475,13 +457,13 @@ func (gui *Gui) containerExecShell(container *commands.Container) error {
} }
func (gui *Gui) handleContainersCustomCommand(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleContainersCustomCommand(g *gocui.Gui, v *gocui.View) error {
ctr, err := gui.Panels.Containers.GetSelectedItem() container, err := gui.Panels.Containers.GetSelectedItem()
if err != nil { if err != nil {
return nil return nil
} }
commandObject := gui.DockerCommand.NewCommandObject(commands.CommandObject{ commandObject := gui.DockerCommand.NewCommandObject(commands.CommandObject{
Container: ctr, Container: container,
}) })
customCommands := gui.Config.UserConfig.CustomCommands.Containers customCommands := gui.Config.UserConfig.CustomCommands.Containers
@ -492,8 +474,8 @@ func (gui *Gui) handleContainersCustomCommand(g *gocui.Gui, v *gocui.View) error
func (gui *Gui) handleStopContainers() error { func (gui *Gui) handleStopContainers() error {
return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.ConfirmStopContainers, func(g *gocui.Gui, v *gocui.View) error { return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.ConfirmStopContainers, func(g *gocui.Gui, v *gocui.View) error {
return gui.WithWaitingStatus(gui.Tr.StoppingStatus, func() error { return gui.WithWaitingStatus(gui.Tr.StoppingStatus, func() error {
for _, ctr := range gui.Panels.Containers.List.GetAllItems() { for _, container := range gui.Panels.Containers.List.GetAllItems() {
if err := ctr.Stop(); err != nil { if err := container.Stop(); err != nil {
gui.Log.Error(err) gui.Log.Error(err)
} }
} }
@ -506,8 +488,8 @@ func (gui *Gui) handleStopContainers() error {
func (gui *Gui) handleRemoveContainers() error { func (gui *Gui) handleRemoveContainers() error {
return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.ConfirmRemoveContainers, func(g *gocui.Gui, v *gocui.View) error { return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.ConfirmRemoveContainers, func(g *gocui.Gui, v *gocui.View) error {
return gui.WithWaitingStatus(gui.Tr.RemovingStatus, func() error { return gui.WithWaitingStatus(gui.Tr.RemovingStatus, func() error {
for _, ctr := range gui.Panels.Containers.List.GetAllItems() { for _, container := range gui.Panels.Containers.List.GetAllItems() {
if err := ctr.Remove(container.RemoveOptions{Force: true}); err != nil { if err := container.Remove(dockerTypes.ContainerRemoveOptions{Force: true}); err != nil {
gui.Log.Error(err) gui.Log.Error(err)
} }
} }
@ -541,21 +523,21 @@ func (gui *Gui) handleContainersBulkCommand(g *gocui.Gui, v *gocui.View) error {
// Open first port in browser // Open first port in browser
func (gui *Gui) handleContainersOpenInBrowserCommand(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleContainersOpenInBrowserCommand(g *gocui.Gui, v *gocui.View) error {
ctr, err := gui.Panels.Containers.GetSelectedItem() container, err := gui.Panels.Containers.GetSelectedItem()
if err != nil { if err != nil {
return nil return nil
} }
return gui.openContainerInBrowser(ctr) return gui.openContainerInBrowser(container)
} }
func (gui *Gui) openContainerInBrowser(ctr *commands.Container) error { func (gui *Gui) openContainerInBrowser(container *commands.Container) error {
// skip if no any ports // skip if no any ports
if len(ctr.Container.Ports) == 0 { if len(container.Container.Ports) == 0 {
return nil return nil
} }
// skip if the first port is not published // skip if the first port is not published
port := ctr.Container.Ports[0] port := container.Container.Ports[0]
if port.IP == "" { if port.IP == "" {
return nil return nil
} }

View file

@ -18,13 +18,10 @@ func (gui *Gui) createCommandMenu(customCommands []config.CustomCommand, command
return command.InternalFunction() return command.InternalFunction()
} }
if command.Shell {
resolvedCommand = gui.OSCommand.NewCommandStringWithShell(resolvedCommand)
}
// if we have a command for attaching, we attach and return the subprocess error // if we have a command for attaching, we attach and return the subprocess error
if command.Attach { if command.Attach {
return gui.runSubprocess(gui.OSCommand.ExecutableFromString(resolvedCommand)) cmd := gui.OSCommand.ExecutableFromString(resolvedCommand)
return gui.runSubprocess(cmd)
} }
return gui.WithWaitingStatus(waitingStatus, func() error { return gui.WithWaitingStatus(waitingStatus, func() error {

View file

@ -6,7 +6,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/docker/docker/api/types/events" dockerTypes "github.com/docker/docker/api/types"
"github.com/go-errors/errors" "github.com/go-errors/errors"
@ -23,6 +23,9 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
// OverlappingEdges determines if panel edges overlap
var OverlappingEdges = false
// Gui wraps the gocui Gui object which handles rendering and events // Gui wraps the gocui Gui object which handles rendering and events
type Gui struct { type Gui struct {
g *gocui.Gui g *gocui.Gui
@ -53,7 +56,6 @@ type Panels struct {
Containers *panels.SideListPanel[*commands.Container] Containers *panels.SideListPanel[*commands.Container]
Images *panels.SideListPanel[*commands.Image] Images *panels.SideListPanel[*commands.Image]
Volumes *panels.SideListPanel[*commands.Volume] Volumes *panels.SideListPanel[*commands.Volume]
Networks *panels.SideListPanel[*commands.Network]
Menu *panels.SideListPanel[*types.MenuItem] Menu *panels.SideListPanel[*types.MenuItem]
} }
@ -111,19 +113,6 @@ const (
SCREEN_FULL SCREEN_FULL
) )
func getScreenMode(config *config.AppConfig) WindowMaximisation {
switch config.UserConfig.Gui.ScreenMode {
case "normal":
return SCREEN_NORMAL
case "half":
return SCREEN_HALF
case "fullscreen":
return SCREEN_FULL
default:
return SCREEN_NORMAL
}
}
// NewGui builds a new gui handler // NewGui builds a new gui handler
func NewGui(log *logrus.Entry, dockerCommand *commands.DockerCommand, oSCommand *commands.OSCommand, tr *i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*Gui, error) { func NewGui(log *logrus.Entry, dockerCommand *commands.DockerCommand, oSCommand *commands.OSCommand, tr *i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*Gui, error) {
initialState := guiState{ initialState := guiState{
@ -136,7 +125,6 @@ func NewGui(log *logrus.Entry, dockerCommand *commands.DockerCommand, oSCommand
ViewStack: []string{}, ViewStack: []string{},
ShowExitedContainers: true, ShowExitedContainers: true,
ScreenMode: getScreenMode(config),
} }
gui := &Gui{ gui := &Gui{
@ -173,9 +161,11 @@ func (gui *Gui) goEvery(interval time.Duration, function func() error) {
ticker := time.NewTicker(interval) ticker := time.NewTicker(interval)
defer ticker.Stop() defer ticker.Stop()
for range ticker.C { for range ticker.C {
if !gui.PauseBackgroundThreads { if gui.PauseBackgroundThreads {
_ = function() return
} }
_ = function()
} }
}() }()
} }
@ -185,10 +175,7 @@ func (gui *Gui) Run() error {
// closing our task manager which in turn closes the current task if there is any, so we aren't leaving processes lying around after closing lazydocker // closing our task manager which in turn closes the current task if there is any, so we aren't leaving processes lying around after closing lazydocker
defer gui.taskManager.Close() defer gui.taskManager.Close()
g, err := gocui.NewGui(gocui.NewGuiOpts{ g, err := gocui.NewGui(gocui.OutputTrue, OverlappingEdges, gocui.NORMAL, false, map[rune]string{})
OutputMode: gocui.OutputTrue,
RuneReplacements: map[rune]string{},
})
if err != nil { if err != nil {
return err return err
} }
@ -286,33 +273,27 @@ func (gui *Gui) setPanels() {
Containers: gui.getContainersPanel(), Containers: gui.getContainersPanel(),
Images: gui.getImagesPanel(), Images: gui.getImagesPanel(),
Volumes: gui.getVolumesPanel(), Volumes: gui.getVolumesPanel(),
Networks: gui.getNetworksPanel(),
Menu: gui.getMenuPanel(), Menu: gui.getMenuPanel(),
} }
} }
func (gui *Gui) updateContainerDetails() error { func (gui *Gui) updateContainerDetails() error {
return gui.DockerCommand.RefreshContainerDetails(gui.Panels.Containers.List.GetAllItems()) return gui.DockerCommand.UpdateContainerDetails(gui.Panels.Containers.List.GetAllItems())
} }
func (gui *Gui) refresh() { func (gui *Gui) refresh() {
go func() { go func() {
// Refresh containers/services first, then projects (which depend on
// container labels to discover projects).
if err := gui.refreshContainersAndServices(); err != nil {
gui.Log.Error(err)
}
if err := gui.refreshProject(); err != nil { if err := gui.refreshProject(); err != nil {
gui.Log.Error(err) gui.Log.Error(err)
} }
}() }()
go func() { go func() {
if err := gui.reloadVolumes(); err != nil { if err := gui.refreshContainersAndServices(); err != nil {
gui.Log.Error(err) gui.Log.Error(err)
} }
}() }()
go func() { go func() {
if err := gui.reloadNetworks(); err != nil { if err := gui.reloadVolumes(); err != nil {
gui.Log.Error(err) gui.Log.Error(err)
} }
}() }()
@ -336,7 +317,7 @@ func (gui *Gui) listenForEvents(ctx context.Context, refresh func()) {
outer: outer:
for { for {
messageChan, errChan := gui.DockerCommand.Client.Events(context.Background(), events.ListOptions{}) messageChan, errChan := gui.DockerCommand.Client.Events(context.Background(), dockerTypes.EventsOptions{})
if errorCount > 0 { if errorCount > 0 {
select { select {
@ -459,7 +440,7 @@ func (gui *Gui) ShouldRefresh(key string) bool {
} }
func (gui *Gui) initiallyFocusedViewName() string { func (gui *Gui) initiallyFocusedViewName() string {
if gui.DockerCommand.IsProjectScoped() { if gui.DockerCommand.InDockerComposeProject {
return "services" return "services"
} }
return "containers" return "containers"
@ -496,11 +477,7 @@ func (gui *Gui) monitorContainerStats(ctx context.Context) {
// and panels to exist for us to know what keybindings there are, so we invoke // and panels to exist for us to know what keybindings there are, so we invoke
// gocui in headless mode and create them. // gocui in headless mode and create them.
func (gui *Gui) SetupFakeGui() { func (gui *Gui) SetupFakeGui() {
g, err := gocui.NewGui(gocui.NewGuiOpts{ g, err := gocui.NewGui(gocui.OutputTrue, false, gocui.NORMAL, true, map[rune]string{})
OutputMode: gocui.OutputTrue,
RuneReplacements: map[rune]string{},
Headless: true,
})
if err != nil { if err != nil {
panic(err) panic(err)
} }

View file

@ -5,7 +5,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/docker/docker/api/types/image" dockerTypes "github.com/docker/docker/api/types"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/jesseduffield/gocui" "github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazydocker/pkg/commands" "github.com/jesseduffield/lazydocker/pkg/commands"
@ -123,37 +123,37 @@ func (gui *Gui) handleImagesRemoveMenu(g *gocui.Gui, v *gocui.View) error {
type removeImageOption struct { type removeImageOption struct {
description string description string
command string command string
configOptions image.RemoveOptions configOptions dockerTypes.ImageRemoveOptions
} }
img, err := gui.Panels.Images.GetSelectedItem() image, err := gui.Panels.Images.GetSelectedItem()
if err != nil { if err != nil {
return nil return nil
} }
shortSha := img.ID[7:17] shortSha := image.ID[7:17]
// TODO: have a way of toggling in a menu instead of showing each permutation as a separate menu item // TODO: have a way of toggling in a menu instead of showing each permutation as a separate menu item
options := []*removeImageOption{ options := []*removeImageOption{
{ {
description: gui.Tr.Remove, description: gui.Tr.Remove,
command: "docker image rm " + shortSha, command: "docker image rm " + shortSha,
configOptions: image.RemoveOptions{PruneChildren: true, Force: false}, configOptions: dockerTypes.ImageRemoveOptions{PruneChildren: true, Force: false},
}, },
{ {
description: gui.Tr.RemoveWithoutPrune, description: gui.Tr.RemoveWithoutPrune,
command: "docker image rm --no-prune " + shortSha, command: "docker image rm --no-prune " + shortSha,
configOptions: image.RemoveOptions{PruneChildren: false, Force: false}, configOptions: dockerTypes.ImageRemoveOptions{PruneChildren: false, Force: false},
}, },
{ {
description: gui.Tr.RemoveWithForce, description: gui.Tr.RemoveWithForce,
command: "docker image rm --force " + shortSha, command: "docker image rm --force " + shortSha,
configOptions: image.RemoveOptions{PruneChildren: true, Force: true}, configOptions: dockerTypes.ImageRemoveOptions{PruneChildren: true, Force: true},
}, },
{ {
description: gui.Tr.RemoveWithoutPruneWithForce, description: gui.Tr.RemoveWithoutPruneWithForce,
command: "docker image rm --no-prune --force " + shortSha, command: "docker image rm --no-prune --force " + shortSha,
configOptions: image.RemoveOptions{PruneChildren: false, Force: true}, configOptions: dockerTypes.ImageRemoveOptions{PruneChildren: false, Force: true},
}, },
} }
@ -164,7 +164,7 @@ func (gui *Gui) handleImagesRemoveMenu(g *gocui.Gui, v *gocui.View) error {
color.New(color.FgRed).Sprint(option.command), color.New(color.FgRed).Sprint(option.command),
}, },
OnPress: func() error { OnPress: func() error {
if err := img.Remove(option.configOptions); err != nil { if err := image.Remove(option.configOptions); err != nil {
return gui.createErrorPanel(err.Error()) return gui.createErrorPanel(err.Error())
} }
@ -192,13 +192,13 @@ func (gui *Gui) handlePruneImages() error {
} }
func (gui *Gui) handleImagesCustomCommand(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleImagesCustomCommand(g *gocui.Gui, v *gocui.View) error {
img, err := gui.Panels.Images.GetSelectedItem() image, err := gui.Panels.Images.GetSelectedItem()
if err != nil { if err != nil {
return nil return nil
} }
commandObject := gui.DockerCommand.NewCommandObject(commands.CommandObject{ commandObject := gui.DockerCommand.NewCommandObject(commands.CommandObject{
Image: img, Image: image,
}) })
customCommands := gui.Config.UserConfig.CustomCommands.Images customCommands := gui.Config.UserConfig.CustomCommands.Images

View file

@ -409,27 +409,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Handler: gui.handleVolumesBulkCommand, Handler: gui.handleVolumesBulkCommand,
Description: gui.Tr.ViewBulkCommands, Description: gui.Tr.ViewBulkCommands,
}, },
{
ViewName: "networks",
Key: 'c',
Modifier: gocui.ModNone,
Handler: gui.handleNetworksCustomCommand,
Description: gui.Tr.RunCustomCommand,
},
{
ViewName: "networks",
Key: 'd',
Modifier: gocui.ModNone,
Handler: gui.handleNetworksRemoveMenu,
Description: gui.Tr.RemoveNetwork,
},
{
ViewName: "networks",
Key: 'b',
Modifier: gocui.ModNone,
Handler: gui.handleNetworksBulkCommand,
Description: gui.Tr.ViewBulkCommands,
},
{ {
ViewName: "main", ViewName: "main",
Key: gocui.KeyEsc, Key: gocui.KeyEsc,
@ -534,15 +513,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
}...) }...)
} }
bindings = append(bindings, []*Binding{
{Handler: gui.handleGoTo(gui.Panels.Projects.View), Key: '1', Description: gui.Tr.FocusProjects},
{Handler: gui.handleGoTo(gui.Panels.Services.View), Key: '2', Description: gui.Tr.FocusServices},
{Handler: gui.handleGoTo(gui.Panels.Containers.View), Key: '3', Description: gui.Tr.FocusContainers},
{Handler: gui.handleGoTo(gui.Panels.Images.View), Key: '4', Description: gui.Tr.FocusImages},
{Handler: gui.handleGoTo(gui.Panels.Volumes.View), Key: '5', Description: gui.Tr.FocusVolumes},
{Handler: gui.handleGoTo(gui.Panels.Networks.View), Key: '6', Description: gui.Tr.FocusNetworks},
}...)
for _, panel := range gui.allListPanels() { for _, panel := range gui.allListPanels() {
setUpDownClickBindings(panel.GetView().Name(), panel.HandlePrevLine, panel.HandleNextLine, panel.HandleClick) setUpDownClickBindings(panel.GetView().Name(), panel.HandlePrevLine, panel.HandleNextLine, panel.HandleClick)
} }

View file

@ -120,11 +120,9 @@ func (gui *Gui) focusPointInView(view *gocui.View) {
return return
} }
for _, panel := range gui.allListPanels() { currentPanel, ok := gui.currentListPanel()
if panel.GetView() == view { if ok {
panel.Refocus() currentPanel.Refocus()
return
}
} }
} }

View file

@ -1,179 +0,0 @@
package gui
import (
"strconv"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazydocker/pkg/commands"
"github.com/jesseduffield/lazydocker/pkg/config"
"github.com/jesseduffield/lazydocker/pkg/gui/panels"
"github.com/jesseduffield/lazydocker/pkg/gui/presentation"
"github.com/jesseduffield/lazydocker/pkg/gui/types"
"github.com/jesseduffield/lazydocker/pkg/tasks"
"github.com/jesseduffield/lazydocker/pkg/utils"
"github.com/samber/lo"
)
func (gui *Gui) getNetworksPanel() *panels.SideListPanel[*commands.Network] {
return &panels.SideListPanel[*commands.Network]{
ContextState: &panels.ContextState[*commands.Network]{
GetMainTabs: func() []panels.MainTab[*commands.Network] {
return []panels.MainTab[*commands.Network]{
{
Key: "config",
Title: gui.Tr.ConfigTitle,
Render: gui.renderNetworkConfig,
},
}
},
GetItemContextCacheKey: func(network *commands.Network) string {
return "networks-" + network.Name
},
},
ListPanel: panels.ListPanel[*commands.Network]{
List: panels.NewFilteredList[*commands.Network](),
View: gui.Views.Networks,
},
NoItemsMessage: gui.Tr.NoNetworks,
Gui: gui.intoInterface(),
// we're sorting these networks based on whether they have labels defined,
// because those are the ones you typically care about.
// Within that, we also sort them alphabetically
Sort: func(a *commands.Network, b *commands.Network) bool {
return a.Name < b.Name
},
GetTableCells: presentation.GetNetworkDisplayStrings,
}
}
func (gui *Gui) renderNetworkConfig(network *commands.Network) tasks.TaskFunc {
return gui.NewSimpleRenderStringTask(func() string { return gui.networkConfigStr(network) })
}
func (gui *Gui) networkConfigStr(network *commands.Network) string {
padding := 15
output := ""
output += utils.WithPadding("ID: ", padding) + network.Network.ID + "\n"
output += utils.WithPadding("Name: ", padding) + network.Name + "\n"
output += utils.WithPadding("Driver: ", padding) + network.Network.Driver + "\n"
output += utils.WithPadding("Scope: ", padding) + network.Network.Scope + "\n"
output += utils.WithPadding("EnabledIPV6: ", padding) + strconv.FormatBool(network.Network.EnableIPv6) + "\n"
output += utils.WithPadding("Internal: ", padding) + strconv.FormatBool(network.Network.Internal) + "\n"
output += utils.WithPadding("Attachable: ", padding) + strconv.FormatBool(network.Network.Attachable) + "\n"
output += utils.WithPadding("Ingress: ", padding) + strconv.FormatBool(network.Network.Ingress) + "\n"
output += utils.WithPadding("Containers: ", padding)
if len(network.Network.Containers) > 0 {
output += "\n"
for _, v := range network.Network.Containers {
output += utils.FormatMapItem(padding, v.Name, v.EndpointID)
}
} else {
output += "none\n"
}
output += "\n"
output += utils.WithPadding("Labels: ", padding) + utils.FormatMap(padding, network.Network.Labels) + "\n"
output += utils.WithPadding("Options: ", padding) + utils.FormatMap(padding, network.Network.Options)
return output
}
func (gui *Gui) reloadNetworks() error {
if err := gui.refreshStateNetworks(); err != nil {
return err
}
return gui.Panels.Networks.RerenderList()
}
func (gui *Gui) refreshStateNetworks() error {
networks, err := gui.DockerCommand.RefreshNetworks()
if err != nil {
return err
}
gui.Panels.Networks.SetItems(networks)
return nil
}
func (gui *Gui) handleNetworksRemoveMenu(g *gocui.Gui, v *gocui.View) error {
network, err := gui.Panels.Networks.GetSelectedItem()
if err != nil {
return nil
}
type removeNetworkOption struct {
description string
command string
}
options := []*removeNetworkOption{
{
description: gui.Tr.Remove,
command: utils.WithShortSha("docker network rm " + network.Name),
},
}
menuItems := lo.Map(options, func(option *removeNetworkOption, _ int) *types.MenuItem {
return &types.MenuItem{
LabelColumns: []string{option.description, color.New(color.FgRed).Sprint(option.command)},
OnPress: func() error {
return gui.WithWaitingStatus(gui.Tr.RemovingStatus, func() error {
if err := network.Remove(); err != nil {
return gui.createErrorPanel(err.Error())
}
return nil
})
},
}
})
return gui.Menu(CreateMenuOptions{
Title: "",
Items: menuItems,
})
}
func (gui *Gui) handlePruneNetworks() error {
return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.ConfirmPruneNetworks, func(g *gocui.Gui, v *gocui.View) error {
return gui.WithWaitingStatus(gui.Tr.PruningStatus, func() error {
err := gui.DockerCommand.PruneNetworks()
if err != nil {
return gui.createErrorPanel(err.Error())
}
return nil
})
}, nil)
}
func (gui *Gui) handleNetworksCustomCommand(g *gocui.Gui, v *gocui.View) error {
network, err := gui.Panels.Networks.GetSelectedItem()
if err != nil {
return nil
}
commandObject := gui.DockerCommand.NewCommandObject(commands.CommandObject{
Network: network,
})
customCommands := gui.Config.UserConfig.CustomCommands.Networks
return gui.createCustomCommandMenu(customCommands, commandObject)
}
func (gui *Gui) handleNetworksBulkCommand(g *gocui.Gui, v *gocui.View) error {
baseBulkCommands := []config.CustomCommand{
{
Name: gui.Tr.PruneNetworks,
InternalFunction: gui.handlePruneNetworks,
},
}
bulkCommands := append(baseBulkCommands, gui.Config.UserConfig.BulkCommands.Networks...)
commandObject := gui.DockerCommand.NewCommandObject(commands.CommandObject{})
return gui.createBulkCommandMenu(bulkCommands, commandObject)
}

View file

@ -47,9 +47,6 @@ type SideListPanel[T comparable] struct {
// a callback to invoke when the item is clicked // a callback to invoke when the item is clicked
OnClick func(T) error OnClick func(T) error
// a callback to invoke when a new item is selected (e.g. keyboard navigation)
OnSelect func(T) error
// returns the cells that we render to the view in a table format. The cells will // returns the cells that we render to the view in a table format. The cells will
// be rendered with padding. // be rendered with padding.
GetTableCells func(T) []string GetTableCells func(T) []string
@ -119,12 +116,6 @@ func (self *SideListPanel[T]) HandleSelect() error {
self.Refocus() self.Refocus()
if self.OnSelect != nil {
if err := self.OnSelect(item); err != nil {
return err
}
}
return self.renderContext(item) return self.renderContext(item)
} }

View file

@ -1,6 +1,7 @@
package presentation package presentation
import ( import (
"encoding/json"
"fmt" "fmt"
"math" "math"
"reflect" "reflect"
@ -37,7 +38,7 @@ func RenderStats(userConfig *config.UserConfig, container *commands.Container, v
dataReceived := fmt.Sprintf("Traffic received: %s", utils.FormatDecimalBytes(stats.ClientStats.Networks.Eth0.RxBytes)) dataReceived := fmt.Sprintf("Traffic received: %s", utils.FormatDecimalBytes(stats.ClientStats.Networks.Eth0.RxBytes))
dataSent := fmt.Sprintf("Traffic sent: %s", utils.FormatDecimalBytes(stats.ClientStats.Networks.Eth0.TxBytes)) dataSent := fmt.Sprintf("Traffic sent: %s", utils.FormatDecimalBytes(stats.ClientStats.Networks.Eth0.TxBytes))
originalStats, err := utils.MarshalIntoYaml(stats) originalJSON, err := json.MarshalIndent(stats, "", " ")
if err != nil { if err != nil {
return "", err return "", err
} }
@ -47,7 +48,7 @@ func RenderStats(userConfig *config.UserConfig, container *commands.Container, v
pidsCount, pidsCount,
dataReceived, dataReceived,
dataSent, dataSent,
utils.ColoredYamlString(string(originalStats)), string(originalJSON),
) )
return contents, nil return contents, nil

View file

@ -6,18 +6,17 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/docker/docker/api/types/container" dockerTypes "github.com/docker/docker/api/types"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/jesseduffield/lazydocker/pkg/commands" "github.com/jesseduffield/lazydocker/pkg/commands"
"github.com/jesseduffield/lazydocker/pkg/config"
"github.com/jesseduffield/lazydocker/pkg/utils" "github.com/jesseduffield/lazydocker/pkg/utils"
"github.com/samber/lo" "github.com/samber/lo"
) )
func GetContainerDisplayStrings(guiConfig *config.GuiConfig, container *commands.Container) []string { func GetContainerDisplayStrings(container *commands.Container) []string {
return []string{ return []string{
getContainerDisplayStatus(guiConfig, container), getContainerDisplayStatus(container),
getContainerDisplaySubstatus(guiConfig, container), getContainerDisplaySubstatus(container),
container.Name, container.Name,
getDisplayCPUPerc(container), getDisplayCPUPerc(container),
utils.ColoredString(displayPorts(container), color.FgYellow), utils.ColoredString(displayPorts(container), color.FgYellow),
@ -30,7 +29,7 @@ func displayContainerImage(container *commands.Container) string {
} }
func displayPorts(c *commands.Container) string { func displayPorts(c *commands.Container) string {
portStrings := lo.Map(c.Container.Ports, func(port container.Port, _ int) string { portStrings := lo.Map(c.Container.Ports, func(port dockerTypes.Port, _ int) string {
if port.PublicPort == 0 { if port.PublicPort == 0 {
return fmt.Sprintf("%d/%s", port.PrivatePort, port.Type) return fmt.Sprintf("%d/%s", port.PrivatePort, port.Type)
} }
@ -53,44 +52,12 @@ func displayPorts(c *commands.Container) string {
} }
// getContainerDisplayStatus returns the colored status of the container // getContainerDisplayStatus returns the colored status of the container
func getContainerDisplayStatus(guiConfig *config.GuiConfig, c *commands.Container) string { func getContainerDisplayStatus(c *commands.Container) string {
shortStatusMap := map[string]string{ return utils.ColoredString(c.Container.State, getContainerColor(c))
"paused": "P",
"exited": "X",
"created": "C",
"removing": "RM",
"restarting": "RS",
"running": "R",
"dead": "D",
}
iconStatusMap := map[string]rune{
"paused": '◫',
"exited": '',
"created": '+',
"removing": '',
"restarting": '⟳',
"running": '▶',
"dead": '!',
}
var containerState string
switch guiConfig.ContainerStatusHealthStyle {
case "short":
containerState = shortStatusMap[c.Container.State]
case "icon":
containerState = string(iconStatusMap[c.Container.State])
case "long":
fallthrough
default:
containerState = c.Container.State
}
return utils.ColoredString(containerState, getContainerColor(c))
} }
// GetDisplayStatus returns the exit code if the container has exited, and the health status if the container is running (and has a health check) // GetDisplayStatus returns the exit code if the container has exited, and the health status if the container is running (and has a health check)
func getContainerDisplaySubstatus(guiConfig *config.GuiConfig, c *commands.Container) string { func getContainerDisplaySubstatus(c *commands.Container) string {
if !c.DetailsLoaded() { if !c.DetailsLoaded() {
return "" return ""
} }
@ -101,13 +68,13 @@ func getContainerDisplaySubstatus(guiConfig *config.GuiConfig, c *commands.Conta
fmt.Sprintf("(%s)", strconv.Itoa(c.Details.State.ExitCode)), getContainerColor(c), fmt.Sprintf("(%s)", strconv.Itoa(c.Details.State.ExitCode)), getContainerColor(c),
) )
case "running": case "running":
return getHealthStatus(guiConfig, c) return getHealthStatus(c)
default: default:
return "" return ""
} }
} }
func getHealthStatus(guiConfig *config.GuiConfig, c *commands.Container) string { func getHealthStatus(c *commands.Container) string {
if !c.DetailsLoaded() { if !c.DetailsLoaded() {
return "" return ""
} }
@ -121,32 +88,8 @@ func getHealthStatus(guiConfig *config.GuiConfig, c *commands.Container) string
if c.Details.State.Health == nil { if c.Details.State.Health == nil {
return "" return ""
} }
healthStatus := c.Details.State.Health.Status
shortHealthStatusMap := map[string]string{ if healthStatusColor, ok := healthStatusColorMap[healthStatus]; ok {
"healthy": "H",
"unhealthy": "U",
"starting": "S",
}
iconHealthStatusMap := map[string]rune{
"healthy": '✔',
"unhealthy": '?',
"starting": '…',
}
var healthStatus string
switch guiConfig.ContainerStatusHealthStyle {
case "short":
healthStatus = shortHealthStatusMap[c.Details.State.Health.Status]
case "icon":
healthStatus = string(iconHealthStatusMap[c.Details.State.Health.Status])
case "long":
fallthrough
default:
healthStatus = c.Details.State.Health.Status
}
if healthStatusColor, ok := healthStatusColorMap[c.Details.State.Health.Status]; ok {
return utils.ColoredString(fmt.Sprintf("(%s)", healthStatus), healthStatusColor) return utils.ColoredString(fmt.Sprintf("(%s)", healthStatus), healthStatusColor)
} }
return "" return ""

View file

@ -1,7 +0,0 @@
package presentation
import "github.com/jesseduffield/lazydocker/pkg/commands"
func GetNetworkDisplayStrings(network *commands.Network) []string {
return []string{network.Network.Driver, network.Name}
}

View file

@ -3,26 +3,13 @@ package presentation
import ( import (
"github.com/fatih/color" "github.com/fatih/color"
"github.com/jesseduffield/lazydocker/pkg/commands" "github.com/jesseduffield/lazydocker/pkg/commands"
"github.com/jesseduffield/lazydocker/pkg/config"
"github.com/jesseduffield/lazydocker/pkg/utils" "github.com/jesseduffield/lazydocker/pkg/utils"
) )
func GetServiceDisplayStrings(guiConfig *config.GuiConfig, service *commands.Service) []string { func GetServiceDisplayStrings(service *commands.Service) []string {
if service.Container == nil { if service.Container == nil {
var containerState string
switch guiConfig.ContainerStatusHealthStyle {
case "short":
containerState = "n"
case "icon":
containerState = "."
case "long":
fallthrough
default:
containerState = "none"
}
return []string{ return []string{
utils.ColoredString(containerState, color.FgBlue), utils.ColoredString("none", color.FgBlue),
"", "",
service.Name, service.Name,
"", "",
@ -33,8 +20,8 @@ func GetServiceDisplayStrings(guiConfig *config.GuiConfig, service *commands.Ser
container := service.Container container := service.Container
return []string{ return []string{
getContainerDisplayStatus(guiConfig, container), getContainerDisplayStatus(container),
getContainerDisplaySubstatus(guiConfig, container), getContainerDisplaySubstatus(container),
service.Name, service.Name,
getDisplayCPUPerc(container), getDisplayCPUPerc(container),
utils.ColoredString(displayPorts(container), color.FgYellow), utils.ColoredString(displayPorts(container), color.FgYellow),

View file

@ -3,6 +3,7 @@ package gui
import ( import (
"bytes" "bytes"
"context" "context"
"path"
"strings" "strings"
"github.com/fatih/color" "github.com/fatih/color"
@ -15,10 +16,14 @@ import (
"github.com/jesseduffield/yaml" "github.com/jesseduffield/yaml"
) )
// Although at the moment we'll only have one project, in future we could have
// a list of projects in the project panel.
func (gui *Gui) getProjectPanel() *panels.SideListPanel[*commands.Project] { func (gui *Gui) getProjectPanel() *panels.SideListPanel[*commands.Project] {
return &panels.SideListPanel[*commands.Project]{ return &panels.SideListPanel[*commands.Project]{
ContextState: &panels.ContextState[*commands.Project]{ ContextState: &panels.ContextState[*commands.Project]{
GetMainTabs: func() []panels.MainTab[*commands.Project] { GetMainTabs: func() []panels.MainTab[*commands.Project] {
if gui.DockerCommand.InDockerComposeProject {
return []panels.MainTab[*commands.Project]{ return []panels.MainTab[*commands.Project]{
{ {
Key: "logs", Key: "logs",
@ -36,6 +41,15 @@ func (gui *Gui) getProjectPanel() *panels.SideListPanel[*commands.Project] {
Render: gui.renderCredits, Render: gui.renderCredits,
}, },
} }
}
return []panels.MainTab[*commands.Project]{
{
Key: "credits",
Title: gui.Tr.CreditsTitle,
Render: gui.renderCredits,
},
}
}, },
GetItemContextCacheKey: func(project *commands.Project) string { GetItemContextCacheKey: func(project *commands.Project) string {
return "projects-" + project.Name return "projects-" + project.Name
@ -50,91 +64,31 @@ func (gui *Gui) getProjectPanel() *panels.SideListPanel[*commands.Project] {
Gui: gui.intoInterface(), Gui: gui.intoInterface(),
Sort: func(a *commands.Project, b *commands.Project) bool { Sort: func(a *commands.Project, b *commands.Project) bool {
return a.Name < b.Name return false
}, },
GetTableCells: presentation.GetProjectDisplayStrings, GetTableCells: presentation.GetProjectDisplayStrings,
OnSelect: func(project *commands.Project) error { // It doesn't make sense to filter a list of only one item.
// When a different project is selected, re-filter services and DisableFilter: true,
// containers to show only those belonging to the selected project.
return gui.renderContainersAndServices()
},
Hide: func() bool {
return !gui.DockerCommand.IsProjectScoped()
},
} }
} }
func (gui *Gui) refreshProject() error { func (gui *Gui) refreshProject() error {
projects := gui.getDiscoveredProjects() gui.Panels.Projects.SetItems([]*commands.Project{{Name: gui.getProjectName()}})
// Preserve the current selection across refreshes. On the first refresh,
// select the project specified via -p flag, or fall back to the local project.
selectedName := gui.getSelectedProjectName()
if selectedName == "" {
if gui.Config.ProjectName != "" {
selectedName = gui.Config.ProjectName
} else {
selectedName = gui.DockerCommand.LocalProjectName
}
}
gui.Panels.Projects.SetItems(projects)
if selectedName != "" {
for i, p := range gui.Panels.Projects.List.GetItems() {
if p.Name == selectedName {
gui.Panels.Projects.SetSelectedLineIdx(i)
gui.Panels.Projects.Refocus()
break
}
}
}
return gui.Panels.Projects.RerenderList() return gui.Panels.Projects.RerenderList()
} }
// getDiscoveredProjects returns all docker compose projects by examining container labels. func (gui *Gui) getProjectName() string {
// The local project (from docker-compose.yml in the current directory, or from -p) is projectName := path.Base(gui.Config.ProjectDir)
// included even when it has no running containers, so the user always sees the project if gui.DockerCommand.InDockerComposeProject {
// they explicitly scoped to. for _, service := range gui.Panels.Services.List.GetAllItems() {
func (gui *Gui) getDiscoveredProjects() []*commands.Project { container := service.Container
containers := gui.Panels.Containers.List.GetAllItems() if container != nil && container.DetailsLoaded() {
projectNames := gui.DockerCommand.GetProjectNames(containers) return container.Details.Config.Labels["com.docker.compose.project"]
// If we're scoped to a project but it has no running containers, still
// include it. We don't fall back to the directory name here to avoid
// briefly flashing the wrong project name on startup.
localName := gui.DockerCommand.LocalProjectName
if gui.DockerCommand.IsProjectScoped() && localName != "" {
found := false
for _, name := range projectNames {
if name == localName {
found = true
break
} }
} }
if !found {
projectNames = append([]string{localName}, projectNames...)
}
} }
projects := make([]*commands.Project, len(projectNames)) return projectName
for i, name := range projectNames {
projects[i] = &commands.Project{Name: name}
}
return projects
}
// getSelectedProjectName returns the name of the currently selected project,
// or empty string if none is selected.
func (gui *Gui) getSelectedProjectName() string {
project, err := gui.Panels.Projects.GetSelectedItem()
if err != nil {
return ""
}
return project.Name
} }
func (gui *Gui) renderCredits(_project *commands.Project) tasks.TaskFunc { func (gui *Gui) renderCredits(_project *commands.Project) tasks.TaskFunc {
@ -154,11 +108,11 @@ func (gui *Gui) creditsStr() string {
"Raise an Issue: https://github.com/jesseduffield/lazydocker/issues", "Raise an Issue: https://github.com/jesseduffield/lazydocker/issues",
utils.ColoredString("Buy Jesse a coffee: https://github.com/sponsors/jesseduffield", color.FgMagenta), // caffeine ain't free utils.ColoredString("Buy Jesse a coffee: https://github.com/sponsors/jesseduffield", color.FgMagenta), // caffeine ain't free
"Here's your lazydocker config when merged in with the defaults (you can open your config by pressing 'o'):", "Here's your lazydocker config when merged in with the defaults (you can open your config by pressing 'o'):",
utils.ColoredYamlString(configBuf.String()), configBuf.String(),
}, "\n\n") }, "\n\n")
} }
func (gui *Gui) renderAllLogs(project *commands.Project) tasks.TaskFunc { func (gui *Gui) renderAllLogs(_project *commands.Project) tasks.TaskFunc {
return gui.NewTask(TaskOpts{ return gui.NewTask(TaskOpts{
Autoscroll: true, Autoscroll: true,
Wrap: gui.Config.UserConfig.Gui.WrapMainPanel, Wrap: gui.Config.UserConfig.Gui.WrapMainPanel,
@ -168,7 +122,7 @@ func (gui *Gui) renderAllLogs(project *commands.Project) tasks.TaskFunc {
cmd := gui.OSCommand.RunCustomCommand( cmd := gui.OSCommand.RunCustomCommand(
utils.ApplyTemplate( utils.ApplyTemplate(
gui.Config.UserConfig.CommandTemplates.AllLogs, gui.Config.UserConfig.CommandTemplates.AllLogs,
gui.DockerCommand.NewCommandObject(commands.CommandObject{Project: project}), gui.DockerCommand.NewCommandObject(commands.CommandObject{}),
), ),
) )
@ -190,20 +144,8 @@ func (gui *Gui) renderAllLogs(project *commands.Project) tasks.TaskFunc {
}) })
} }
func (gui *Gui) renderDockerComposeConfig(project *commands.Project) tasks.TaskFunc { func (gui *Gui) renderDockerComposeConfig(_project *commands.Project) tasks.TaskFunc {
if !gui.DockerCommand.InDockerComposeProject { return gui.NewSimpleRenderStringTask(func() string { return gui.DockerCommand.DockerComposeConfig() })
return gui.NewSimpleRenderStringTask(func() string {
return "Compose config is only available when launched from a docker-compose project directory"
})
}
if project != nil && project.Name != gui.DockerCommand.LocalProjectName {
return gui.NewSimpleRenderStringTask(func() string {
return "Compose config is not available for non-local projects"
})
}
return gui.NewSimpleRenderStringTask(func() string {
return utils.ColoredYamlString(gui.DockerCommand.DockerComposeConfigForProject(project))
})
} }
func (gui *Gui) handleOpenConfig(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleOpenConfig(g *gocui.Gui, v *gocui.View) error {
@ -229,8 +171,7 @@ func lazydockerTitle() string {
// handleViewAllLogs switches to a subprocess viewing all the logs from docker-compose // handleViewAllLogs switches to a subprocess viewing all the logs from docker-compose
func (gui *Gui) handleViewAllLogs(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleViewAllLogs(g *gocui.Gui, v *gocui.View) error {
project, _ := gui.Panels.Projects.GetSelectedItem() c, err := gui.DockerCommand.ViewAllLogs()
c, err := gui.DockerCommand.ViewAllLogs(project)
if err != nil { if err != nil {
return gui.createErrorPanel(err.Error()) return gui.createErrorPanel(err.Error())
} }

View file

@ -74,23 +74,9 @@ func (gui *Gui) getServicesPanel() *panels.SideListPanel[*commands.Service] {
return a.Name < b.Name return a.Name < b.Name
}, },
Filter: func(service *commands.Service) bool { GetTableCells: presentation.GetServiceDisplayStrings,
selectedProject := gui.getSelectedProjectName()
if selectedProject == "" {
// Before any project is selected (e.g. startup), default to
// the local project so we don't briefly flash all services.
selectedProject = gui.DockerCommand.LocalProjectName
}
if selectedProject == "" {
return true
}
return service.ProjectName == selectedProject
},
GetTableCells: func(service *commands.Service) []string {
return presentation.GetServiceDisplayStrings(&gui.Config.UserConfig.Gui, service)
},
Hide: func() bool { Hide: func() bool {
return !gui.DockerCommand.IsProjectScoped() return !gui.DockerCommand.InDockerComposeProject
}, },
} }
} }
@ -154,24 +140,13 @@ func (r *commandOption) getDisplayStrings() []string {
return []string{r.description, color.New(color.FgCyan).Sprint(r.command)} return []string{r.description, color.New(color.FgCyan).Sprint(r.command)}
} }
// isServiceFromLocalProject returns true if the given service belongs to the
// local compose project (the one whose compose file is in the current directory).
// Compose commands like up/stop/restart only work for local project services.
func (gui *Gui) isServiceFromLocalProject(service *commands.Service) bool {
return service.ProjectName == gui.DockerCommand.LocalProjectName
}
func (gui *Gui) handleServiceRemoveMenu(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleServiceRemoveMenu(g *gocui.Gui, v *gocui.View) error {
service, err := gui.Panels.Services.GetSelectedItem() service, err := gui.Panels.Services.GetSelectedItem()
if err != nil { if err != nil {
return nil return nil
} }
if !gui.isServiceFromLocalProject(service) { composeCommand := gui.Config.UserConfig.CommandTemplates.DockerCompose
return gui.createErrorPanel(gui.Tr.CannotManageNonLocalService)
}
composeCommand := gui.DockerCommand.NewCommandObject(commands.CommandObject{Service: service}).DockerCompose
options := []*commandOption{ options := []*commandOption{
{ {
@ -225,15 +200,10 @@ func (gui *Gui) handleServiceStop(g *gocui.Gui, v *gocui.View) error {
return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.StopService, func(g *gocui.Gui, v *gocui.View) error { return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.StopService, func(g *gocui.Gui, v *gocui.View) error {
return gui.WithWaitingStatus(gui.Tr.StoppingStatus, func() error { return gui.WithWaitingStatus(gui.Tr.StoppingStatus, func() error {
if !gui.isServiceFromLocalProject(service) {
if service.Container == nil {
return gui.createErrorPanel(gui.Tr.CannotManageNonLocalService)
}
return service.Container.Stop()
}
if err := service.Stop(); err != nil { if err := service.Stop(); err != nil {
return gui.createErrorPanel(err.Error()) return gui.createErrorPanel(err.Error())
} }
return nil return nil
}) })
}, nil) }, nil)
@ -245,10 +215,6 @@ func (gui *Gui) handleServiceUp(g *gocui.Gui, v *gocui.View) error {
return nil return nil
} }
if !gui.isServiceFromLocalProject(service) {
return gui.createErrorPanel(gui.Tr.CannotManageNonLocalService)
}
return gui.WithWaitingStatus(gui.Tr.UppingServiceStatus, func() error { return gui.WithWaitingStatus(gui.Tr.UppingServiceStatus, func() error {
if err := service.Up(); err != nil { if err := service.Up(); err != nil {
return gui.createErrorPanel(err.Error()) return gui.createErrorPanel(err.Error())
@ -265,15 +231,10 @@ func (gui *Gui) handleServiceRestart(g *gocui.Gui, v *gocui.View) error {
} }
return gui.WithWaitingStatus(gui.Tr.RestartingStatus, func() error { return gui.WithWaitingStatus(gui.Tr.RestartingStatus, func() error {
if !gui.isServiceFromLocalProject(service) {
if service.Container == nil {
return gui.createErrorPanel(gui.Tr.CannotManageNonLocalService)
}
return service.Container.Restart()
}
if err := service.Restart(); err != nil { if err := service.Restart(); err != nil {
return gui.createErrorPanel(err.Error()) return gui.createErrorPanel(err.Error())
} }
return nil return nil
}) })
} }
@ -284,19 +245,11 @@ func (gui *Gui) handleServiceStart(g *gocui.Gui, v *gocui.View) error {
return nil return nil
} }
if !gui.isServiceFromLocalProject(service) {
if service.Container == nil {
return gui.createErrorPanel(gui.Tr.CannotManageNonLocalService)
}
return gui.WithWaitingStatus(gui.Tr.StartingStatus, func() error {
return service.Container.Start()
})
}
return gui.WithWaitingStatus(gui.Tr.StartingStatus, func() error { return gui.WithWaitingStatus(gui.Tr.StartingStatus, func() error {
if err := service.Start(); err != nil { if err := service.Start(); err != nil {
return gui.createErrorPanel(err.Error()) return gui.createErrorPanel(err.Error())
} }
return nil return nil
}) })
} }
@ -334,14 +287,10 @@ func (gui *Gui) handleServiceRenderLogsToMain(g *gocui.Gui, v *gocui.View) error
} }
func (gui *Gui) handleProjectUp(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleProjectUp(g *gocui.Gui, v *gocui.View) error {
project, _ := gui.Panels.Projects.GetSelectedItem()
if project != nil && project.Name != gui.DockerCommand.LocalProjectName {
return gui.createErrorPanel(gui.Tr.CannotManageNonLocalService)
}
return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.ConfirmUpProject, func(g *gocui.Gui, v *gocui.View) error { return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.ConfirmUpProject, func(g *gocui.Gui, v *gocui.View) error {
cmdStr := utils.ApplyTemplate( cmdStr := utils.ApplyTemplate(
gui.Config.UserConfig.CommandTemplates.Up, gui.Config.UserConfig.CommandTemplates.Up,
gui.DockerCommand.NewCommandObject(commands.CommandObject{Project: project}), gui.DockerCommand.NewCommandObject(commands.CommandObject{}),
) )
return gui.WithWaitingStatus(gui.Tr.UppingProjectStatus, func() error { return gui.WithWaitingStatus(gui.Tr.UppingProjectStatus, func() error {
@ -354,18 +303,14 @@ func (gui *Gui) handleProjectUp(g *gocui.Gui, v *gocui.View) error {
} }
func (gui *Gui) handleProjectDown(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleProjectDown(g *gocui.Gui, v *gocui.View) error {
project, _ := gui.Panels.Projects.GetSelectedItem()
if project != nil && project.Name != gui.DockerCommand.LocalProjectName {
return gui.createErrorPanel(gui.Tr.CannotManageNonLocalService)
}
downCommand := utils.ApplyTemplate( downCommand := utils.ApplyTemplate(
gui.Config.UserConfig.CommandTemplates.Down, gui.Config.UserConfig.CommandTemplates.Down,
gui.DockerCommand.NewCommandObject(commands.CommandObject{Project: project}), gui.DockerCommand.NewCommandObject(commands.CommandObject{}),
) )
downWithVolumesCommand := utils.ApplyTemplate( downWithVolumesCommand := utils.ApplyTemplate(
gui.Config.UserConfig.CommandTemplates.DownWithVolumes, gui.Config.UserConfig.CommandTemplates.DownWithVolumes,
gui.DockerCommand.NewCommandObject(commands.CommandObject{Project: project}), gui.DockerCommand.NewCommandObject(commands.CommandObject{}),
) )
options := []*commandOption{ options := []*commandOption{
@ -414,10 +359,6 @@ func (gui *Gui) handleServiceRestartMenu(g *gocui.Gui, v *gocui.View) error {
return nil return nil
} }
if !gui.isServiceFromLocalProject(service) {
return gui.createErrorPanel(gui.Tr.CannotManageNonLocalService)
}
rebuildCommand := utils.ApplyTemplate( rebuildCommand := utils.ApplyTemplate(
gui.Config.UserConfig.CommandTemplates.RebuildService, gui.Config.UserConfig.CommandTemplates.RebuildService,
gui.DockerCommand.NewCommandObject(commands.CommandObject{Service: service}), gui.DockerCommand.NewCommandObject(commands.CommandObject{Service: service}),
@ -522,9 +463,8 @@ L:
} }
func (gui *Gui) handleServicesBulkCommand(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleServicesBulkCommand(g *gocui.Gui, v *gocui.View) error {
project, _ := gui.Panels.Projects.GetSelectedItem()
bulkCommands := gui.Config.UserConfig.BulkCommands.Services bulkCommands := gui.Config.UserConfig.BulkCommands.Services
commandObject := gui.DockerCommand.NewCommandObject(commands.CommandObject{Project: project}) commandObject := gui.DockerCommand.NewCommandObject(commands.CommandObject{})
return gui.createBulkCommandMenu(bulkCommands, commandObject) return gui.createBulkCommandMenu(bulkCommands, commandObject)
} }

View file

@ -4,7 +4,7 @@ import (
"sort" "sort"
"testing" "testing"
"github.com/docker/docker/api/types/container" dockerTypes "github.com/docker/docker/api/types"
"github.com/jesseduffield/lazydocker/pkg/commands" "github.com/jesseduffield/lazydocker/pkg/commands"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )
@ -14,28 +14,28 @@ func sampleContainers() []*commands.Container {
{ {
ID: "1", ID: "1",
Name: "1", Name: "1",
Container: container.Summary{ Container: dockerTypes.Container{
State: "exited", State: "exited",
}, },
}, },
{ {
ID: "2", ID: "2",
Name: "2", Name: "2",
Container: container.Summary{ Container: dockerTypes.Container{
State: "running", State: "running",
}, },
}, },
{ {
ID: "3", ID: "3",
Name: "3", Name: "3",
Container: container.Summary{ Container: dockerTypes.Container{
State: "running", State: "running",
}, },
}, },
{ {
ID: "4", ID: "4",
Name: "4", Name: "4",
Container: container.Summary{ Container: dockerTypes.Container{
State: "created", State: "created",
}, },
}, },
@ -47,28 +47,28 @@ func expectedPerStatusContainers() []*commands.Container {
{ {
ID: "2", ID: "2",
Name: "2", Name: "2",
Container: container.Summary{ Container: dockerTypes.Container{
State: "running", State: "running",
}, },
}, },
{ {
ID: "3", ID: "3",
Name: "3", Name: "3",
Container: container.Summary{ Container: dockerTypes.Container{
State: "running", State: "running",
}, },
}, },
{ {
ID: "1", ID: "1",
Name: "1", Name: "1",
Container: container.Summary{ Container: dockerTypes.Container{
State: "exited", State: "exited",
}, },
}, },
{ {
ID: "4", ID: "4",
Name: "4", Name: "4",
Container: container.Summary{ Container: dockerTypes.Container{
State: "created", State: "created",
}, },
}, },
@ -80,28 +80,28 @@ func expectedLegacySortedContainers() []*commands.Container {
{ {
ID: "1", ID: "1",
Name: "1", Name: "1",
Container: container.Summary{ Container: dockerTypes.Container{
State: "exited", State: "exited",
}, },
}, },
{ {
ID: "2", ID: "2",
Name: "2", Name: "2",
Container: container.Summary{ Container: dockerTypes.Container{
State: "running", State: "running",
}, },
}, },
{ {
ID: "3", ID: "3",
Name: "3", Name: "3",
Container: container.Summary{ Container: dockerTypes.Container{
State: "running", State: "running",
}, },
}, },
{ {
ID: "4", ID: "4",
Name: "4", Name: "4",
Container: container.Summary{ Container: dockerTypes.Container{
State: "created", State: "created",
}, },
}, },

View file

@ -2,7 +2,7 @@ package gui
import ( import (
"fmt" "fmt"
"io" "io/ioutil"
"os" "os"
"os/exec" "os/exec"
"os/signal" "os/signal"
@ -13,10 +13,6 @@ import (
) )
func (gui *Gui) runSubprocess(cmd *exec.Cmd) error { func (gui *Gui) runSubprocess(cmd *exec.Cmd) error {
return gui.runSubprocessWithMessage(cmd, "")
}
func (gui *Gui) runSubprocessWithMessage(cmd *exec.Cmd, msg string) error {
gui.Mutexes.SubprocessMutex.Lock() gui.Mutexes.SubprocessMutex.Lock()
defer gui.Mutexes.SubprocessMutex.Unlock() defer gui.Mutexes.SubprocessMutex.Unlock()
@ -26,7 +22,7 @@ func (gui *Gui) runSubprocessWithMessage(cmd *exec.Cmd, msg string) error {
gui.PauseBackgroundThreads = true gui.PauseBackgroundThreads = true
gui.runCommand(cmd, msg) gui.runCommand(cmd)
if err := gui.g.Resume(); err != nil { if err := gui.g.Resume(); err != nil {
return gui.createErrorPanel(err.Error()) return gui.createErrorPanel(err.Error())
@ -37,7 +33,7 @@ func (gui *Gui) runSubprocessWithMessage(cmd *exec.Cmd, msg string) error {
return nil return nil
} }
func (gui *Gui) runCommand(cmd *exec.Cmd, msg string) { func (gui *Gui) runCommand(cmd *exec.Cmd) {
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stdout cmd.Stderr = os.Stdout
cmd.Stdin = os.Stdin cmd.Stdin = os.Stdin
@ -55,9 +51,7 @@ func (gui *Gui) runCommand(cmd *exec.Cmd, msg string) {
}() }()
fmt.Fprintf(os.Stdout, "\n%s\n\n", utils.ColoredString("+ "+strings.Join(cmd.Args, " "), color.FgBlue)) fmt.Fprintf(os.Stdout, "\n%s\n\n", utils.ColoredString("+ "+strings.Join(cmd.Args, " "), color.FgBlue))
if msg != "" {
fmt.Fprintf(os.Stdout, "\n%s\n\n", utils.ColoredString(msg, color.FgGreen))
}
if err := cmd.Run(); err != nil { if err := cmd.Run(); err != nil {
// not handling the error explicitly because usually we're going to see it // not handling the error explicitly because usually we're going to see it
// in the output anyway // in the output anyway
@ -65,8 +59,8 @@ func (gui *Gui) runCommand(cmd *exec.Cmd, msg string) {
} }
cmd.Stdin = nil cmd.Stdin = nil
cmd.Stdout = io.Discard cmd.Stdout = ioutil.Discard
cmd.Stderr = io.Discard cmd.Stderr = ioutil.Discard
gui.promptToReturn() gui.promptToReturn()
} }

View file

@ -12,13 +12,6 @@ import (
"github.com/spkg/bom" "github.com/spkg/bom"
) )
func (gui *Gui) handleGoTo(view *gocui.View) func(g *gocui.Gui, v *gocui.View) error {
return func(g *gocui.Gui, v *gocui.View) error {
gui.resetMainView()
return gui.switchFocus(view)
}
}
func (gui *Gui) nextView(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) nextView(g *gocui.Gui, v *gocui.View) error {
sideViewNames := gui.sideViewNames() sideViewNames := gui.sideViewNames()
var focusedViewName string var focusedViewName string
@ -369,7 +362,6 @@ func (gui *Gui) allSidePanels() []panels.ISideListPanel {
gui.Panels.Containers, gui.Panels.Containers,
gui.Panels.Images, gui.Panels.Images,
gui.Panels.Volumes, gui.Panels.Volumes,
gui.Panels.Networks,
} }
} }

View file

@ -1,30 +1,11 @@
package gui package gui
import ( import (
"os"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/jesseduffield/gocui" "github.com/jesseduffield/gocui"
"github.com/samber/lo" "github.com/samber/lo"
) )
// See https://github.com/xtermjs/xterm.js/issues/4238
// VSCode is soon to fix this in an upcoming update.
// Once that's done, we can scrap the HIDE_UNDERSCORES variable
var (
underscoreEnvChecked bool
hideUnderscores bool
)
func hideUnderScores() bool {
if !underscoreEnvChecked {
hideUnderscores = os.Getenv("TERM_PROGRAM") == "vscode"
underscoreEnvChecked = true
}
return hideUnderscores
}
type Views struct { type Views struct {
// side panels // side panels
Project *gocui.View Project *gocui.View
@ -32,7 +13,6 @@ type Views struct {
Containers *gocui.View Containers *gocui.View
Images *gocui.View Images *gocui.View
Volumes *gocui.View Volumes *gocui.View
Networks *gocui.View
// main panel // main panel
Main *gocui.View Main *gocui.View
@ -71,7 +51,6 @@ func (gui *Gui) orderedViewNameMappings() []viewNameMapping {
{viewPtr: &gui.Views.Containers, name: "containers", autoPosition: true}, {viewPtr: &gui.Views.Containers, name: "containers", autoPosition: true},
{viewPtr: &gui.Views.Images, name: "images", autoPosition: true}, {viewPtr: &gui.Views.Images, name: "images", autoPosition: true},
{viewPtr: &gui.Views.Volumes, name: "volumes", autoPosition: true}, {viewPtr: &gui.Views.Volumes, name: "volumes", autoPosition: true},
{viewPtr: &gui.Views.Networks, name: "networks", autoPosition: true},
{viewPtr: &gui.Views.Main, name: "main", autoPosition: true}, {viewPtr: &gui.Views.Main, name: "main", autoPosition: true},
@ -92,66 +71,43 @@ func (gui *Gui) orderedViewNameMappings() []viewNameMapping {
} }
func (gui *Gui) createAllViews() error { func (gui *Gui) createAllViews() error {
frameRunes := []rune{'─', '│', '╭', '╮', '╰', '╯'}
switch gui.Config.UserConfig.Gui.Border {
case "single":
frameRunes = []rune{'─', '│', '┌', '┐', '└', '┘'}
case "double":
frameRunes = []rune{'═', '║', '╔', '╗', '╚', '╝'}
case "hidden":
frameRunes = []rune{' ', ' ', ' ', ' ', ' ', ' '}
}
var err error var err error
for _, mapping := range gui.orderedViewNameMappings() { for _, mapping := range gui.orderedViewNameMappings() {
*mapping.viewPtr, err = gui.prepareView(mapping.name) *mapping.viewPtr, err = gui.prepareView(mapping.name)
if err != nil && err.Error() != UNKNOWN_VIEW_ERROR_MSG { if err != nil && err.Error() != UNKNOWN_VIEW_ERROR_MSG {
return err return err
} }
(*mapping.viewPtr).FrameRunes = frameRunes
(*mapping.viewPtr).FgColor = gocui.ColorDefault (*mapping.viewPtr).FgColor = gocui.ColorDefault
} }
selectedLineBgColor := GetGocuiStyle(gui.Config.UserConfig.Gui.Theme.SelectedLineBgColor) selectedLineBgColor := gocui.ColorBlue
gui.Views.Main.Wrap = gui.Config.UserConfig.Gui.WrapMainPanel gui.Views.Main.Wrap = gui.Config.UserConfig.Gui.WrapMainPanel
// when you run a docker container with the -it flags (interactive mode) it adds carriage returns for some reason. This is not docker's fault, it's an os-level default. // when you run a docker container with the -it flags (interactive mode) it adds carriage returns for some reason. This is not docker's fault, it's an os-level default.
gui.Views.Main.IgnoreCarriageReturns = true gui.Views.Main.IgnoreCarriageReturns = true
gui.Views.Project.Title = gui.Tr.ProjectTitle gui.Views.Project.Title = gui.Tr.ProjectTitle
gui.Views.Project.TitlePrefix = "[1]"
gui.Views.Project.Highlight = true
gui.Views.Project.SelBgColor = selectedLineBgColor
gui.Views.Services.Highlight = true gui.Views.Services.Highlight = true
gui.Views.Services.Title = gui.Tr.ServicesTitle gui.Views.Services.Title = gui.Tr.ServicesTitle
gui.Views.Services.TitlePrefix = "[2]"
gui.Views.Services.SelBgColor = selectedLineBgColor gui.Views.Services.SelBgColor = selectedLineBgColor
gui.Views.Containers.Highlight = true gui.Views.Containers.Highlight = true
gui.Views.Containers.SelBgColor = selectedLineBgColor gui.Views.Containers.SelBgColor = selectedLineBgColor
if gui.Config.UserConfig.Gui.ShowAllContainers || !gui.DockerCommand.IsProjectScoped() { if gui.Config.UserConfig.Gui.ShowAllContainers || !gui.DockerCommand.InDockerComposeProject {
gui.Views.Containers.Title = gui.Tr.ContainersTitle gui.Views.Containers.Title = gui.Tr.ContainersTitle
} else { } else {
gui.Views.Containers.Title = gui.Tr.StandaloneContainersTitle gui.Views.Containers.Title = gui.Tr.StandaloneContainersTitle
} }
gui.Views.Containers.TitlePrefix = "[3]"
gui.Views.Images.Highlight = true gui.Views.Images.Highlight = true
gui.Views.Images.Title = gui.Tr.ImagesTitle gui.Views.Images.Title = gui.Tr.ImagesTitle
gui.Views.Images.SelBgColor = selectedLineBgColor gui.Views.Images.SelBgColor = selectedLineBgColor
gui.Views.Images.TitlePrefix = "[4]"
gui.Views.Volumes.Highlight = true gui.Views.Volumes.Highlight = true
gui.Views.Volumes.Title = gui.Tr.VolumesTitle gui.Views.Volumes.Title = gui.Tr.VolumesTitle
gui.Views.Volumes.TitlePrefix = "[5]"
gui.Views.Volumes.SelBgColor = selectedLineBgColor gui.Views.Volumes.SelBgColor = selectedLineBgColor
gui.Views.Networks.Highlight = true
gui.Views.Networks.Title = gui.Tr.NetworksTitle
gui.Views.Networks.TitlePrefix = "[6]"
gui.Views.Networks.SelBgColor = selectedLineBgColor
gui.Views.Options.Frame = false gui.Views.Options.Frame = false
gui.Views.Options.FgColor = gui.GetOptionsPanelTextColor() gui.Views.Options.FgColor = gui.GetOptionsPanelTextColor()
@ -199,12 +155,7 @@ func (gui *Gui) getInformationContent() string {
return informationStr return informationStr
} }
attrs := []color.Attribute{color.FgMagenta} donate := color.New(color.FgMagenta, color.Underline).Sprint(gui.Tr.Donate)
if !hideUnderScores() {
attrs = append(attrs, color.Underline)
}
donate := color.New(attrs...).Sprint(gui.Tr.Donate)
return donate + " " + informationStr return donate + " " + informationStr
} }

View file

@ -1,136 +0,0 @@
package i18n
func chineseSet() TranslationSet {
return TranslationSet{
PruningStatus: "修剪中",
RemovingStatus: "移除中",
RestartingStatus: "重启中",
StartingStatus: "启动中",
StoppingStatus: "停止中",
UppingServiceStatus: "升级服务中",
UppingProjectStatus: "升级项目中",
DowningStatus: "下架中",
PausingStatus: "暂停中",
RunningCustomCommandStatus: "正在运行自定义命令",
RunningBulkCommandStatus: "正在运行批量命令",
NoViewMachingNewLineFocusedSwitchStatement: "没有匹配 newLineFocused switch 语句的视图",
ErrorOccurred: "发生错误!请在 https://github.com/jesseduffield/lazydocker/issues 上创建一个问题",
ConnectionFailed: "无法连接到 Docker 客户端。您可能需要重新启动 Docker 客户端",
UnattachableContainerError: "容器不支持 attaching。您必须使用“-it”标志运行服务或者在docker-compose.yml文件中使用`stdin_open: truetty: true`",
WaitingForContainerInfo: "在 Docker 给我们更多关于容器的信息之前,无法继续。请几分钟后重试。",
CannotAttachStoppedContainerError: "您不能 attach 到已停止的容器,您需要先启动它(您可以用 'r' 键来执行此操作)(是的,我懒得为您自动执行此操作)(很酷的是,我可以通过错误消息与您进行一对一的通讯)",
CannotAccessDockerSocketError: "无法访问 Docker 套接字unix:///var/run/docker.sock\n请以 root 用户身份运行 lazydocker 或阅读https://docs.docker.com/install/linux/linux-postinstall/",
CannotKillChildError: "等待三秒钟以停止子进程。可能有一个孤儿进程在您的系统上继续运行。",
Donate: "捐赠",
Confirm: "确认",
Return: "返回",
FocusMain: "聚焦主面板",
LcFilter: "过滤列表",
Navigate: "导航",
Execute: "执行",
Close: "关闭",
Quit: "退出",
Menu: "菜单",
MenuTitle: "菜单",
Scroll: "滚动",
OpenConfig: "打开lazydocker配置",
EditConfig: "编辑lazydocker配置",
Cancel: "取消",
Remove: "移除",
HideStopped: "隐藏/显示已停止的容器",
ForceRemove: "强制移除",
RemoveWithVolumes: "移除并删除卷",
RemoveService: "移除容器",
UpService: "启动服务",
Stop: "停止",
Pause: "暂停",
Restart: "重新启动",
Down: "关闭项目",
DownWithVolumes: "关闭包括卷的项目",
Start: "启动项目",
Rebuild: "重建",
Recreate: "重新创建",
PreviousContext: "上一个选项卡",
NextContext: "下一个选项卡",
// Attach: "连接/附加",
ViewLogs: "查看日志",
UpProject: "创建并启动容器",
DownProject: "停止并移除容器",
RemoveImage: "移除镜像",
RemoveVolume: "移除卷",
RemoveNetwork: "移除网络",
RemoveWithoutPrune: "移除但不删除未标记的父级",
RemoveWithoutPruneWithForce: "移除(强制)但不删除未标记的父级",
RemoveWithForce: "移除(强制)",
PruneContainers: "删除退出的容器",
PruneVolumes: "删除未使用的卷",
PruneNetworks: "删除未使用的网络",
PruneImages: "删除未使用的镜像",
StopAllContainers: "停止所有容器",
RemoveAllContainers: "删除所有容器(强制)",
ViewRestartOptions: "查看重启选项",
ExecShell: "执行shell",
RunCustomCommand: "运行预定义的自定义命令",
ViewBulkCommands: "查看批量命令",
FilterList: "过滤列表",
OpenInBrowser: "在浏览器中打开(第一个端口为http)",
SortContainersByState: "按状态排序容器",
GlobalTitle: "全局",
MainTitle: "主要",
ProjectTitle: "项目",
ServicesTitle: "服务",
ContainersTitle: "容器",
StandaloneContainersTitle: "独立容器",
ImagesTitle: "镜像",
VolumesTitle: "卷",
NetworksTitle: "网络",
CustomCommandTitle: "自定义命令:",
BulkCommandTitle: "批量命令:",
ErrorTitle: "错误",
LogsTitle: "日志",
ConfigTitle: "配置",
EnvTitle: "环境变量",
DockerComposeConfigTitle: "Docker-Compose配置",
TopTitle: "系统资源管理",
StatsTitle: "统计信息",
CreditsTitle: "关于我们",
ContainerConfigTitle: "容器配置",
ContainerEnvTitle: "容器环境变量",
NothingToDisplay: "无内容显示",
NoContainerForService: "没有日志可以展示;该服务未关联任何容器",
CannotDisplayEnvVariables: "展示环境变量时出现问题",
NoContainers: "没有容器",
NoContainer: "没有容器",
NoImages: "没有镜像",
NoVolumes: "没有卷",
NoNetworks: "没有网络",
NoServices: "没有服务",
ConfirmQuit: "您确定要退出吗?",
ConfirmUpProject: "您确定要“up”的docker compose项目吗",
MustForceToRemoveContainer: "您无法删除正在运行的容器,除非您强制执行。您想强制执行吗?",
NotEnoughSpace: "空间不足,无法渲染面板",
ConfirmPruneImages: "您确定要删除所有未使用的镜像吗?",
ConfirmPruneContainers: "您确定要删除所有停止的容器吗?",
ConfirmStopContainers: "您确定要停止所有容器吗?",
ConfirmRemoveContainers: "您确定要删除所有容器吗?",
ConfirmPruneVolumes: "您确定要删除所有未使用的卷吗?",
ConfirmPruneNetworks: "您确定要删除所有未使用的网络吗?",
StopService: "您确定要停止此服务的容器吗?",
StopContainer: "您确定要停止此容器吗?",
PressEnterToReturn: "按 enter 返回 lazydocker您可以在配置文件中设置 `gui.returnImmediately: true` 来禁用此提示)",
No: "否",
Yes: "是",
LcNextScreenMode: "下一个屏幕模式(正常/半屏/全屏)",
LcPrevScreenMode: "上一个屏幕模式",
FilterPrompt: "筛选",
}
}

View file

@ -45,11 +45,9 @@ func dutchSet() TranslationSet {
ViewLogs: "bekijk logs", ViewLogs: "bekijk logs",
RemoveImage: "verwijder image", RemoveImage: "verwijder image",
RemoveVolume: "verwijder volume", RemoveVolume: "verwijder volume",
RemoveNetwork: "verwijder network",
RemoveWithoutPrune: "verwijder zonder de ongelabeld ouders te verwijderen", RemoveWithoutPrune: "verwijder zonder de ongelabeld ouders te verwijderen",
PruneContainers: "vernietig bestaande containers", PruneContainers: "vernietig bestaande containers",
PruneVolumes: "vernietig ongebruikte volumes", PruneVolumes: "vernietig ongebruikte volumes",
PruneNetworks: "vernietig ongebruikte networks",
PruneImages: "vernietig ongebruikte images", PruneImages: "vernietig ongebruikte images",
ViewRestartOptions: "bekijk herstart opties", ViewRestartOptions: "bekijk herstart opties",
RunCustomCommand: "draai een vooraf bedacht aangepaste opdracht", RunCustomCommand: "draai een vooraf bedacht aangepaste opdracht",
@ -62,7 +60,6 @@ func dutchSet() TranslationSet {
StandaloneContainersTitle: "Alleenstaande Containers", StandaloneContainersTitle: "Alleenstaande Containers",
ImagesTitle: "Images", ImagesTitle: "Images",
VolumesTitle: "Volumes", VolumesTitle: "Volumes",
NetworksTitle: "Networks",
CustomCommandTitle: "Aangepast commando:", CustomCommandTitle: "Aangepast commando:",
ErrorTitle: "Fout", ErrorTitle: "Fout",
LogsTitle: "Logs", LogsTitle: "Logs",
@ -81,7 +78,6 @@ func dutchSet() TranslationSet {
NoContainer: "Geen container", NoContainer: "Geen container",
NoImages: "Geen images", NoImages: "Geen images",
NoVolumes: "Geen volumes", NoVolumes: "Geen volumes",
NoNetworks: "Geen networks",
ConfirmQuit: "Weet je zeker dat je weg wil gaan?", ConfirmQuit: "Weet je zeker dat je weg wil gaan?",
MustForceToRemoveContainer: "Je kan geen draaiende container verwijderen tenzij je het forceert, Wil je het forceren?", MustForceToRemoveContainer: "Je kan geen draaiende container verwijderen tenzij je het forceert, Wil je het forceren?",
@ -89,10 +85,8 @@ func dutchSet() TranslationSet {
ConfirmPruneImages: "Weet je zeker dat je alle niet gebruikte images wil vernietigen?", ConfirmPruneImages: "Weet je zeker dat je alle niet gebruikte images wil vernietigen?",
ConfirmPruneContainers: "Weet je zeker dat je alle niet gestopte containers wil vernietigen?", ConfirmPruneContainers: "Weet je zeker dat je alle niet gestopte containers wil vernietigen?",
ConfirmPruneVolumes: "Weet je zeker dat je alle niet gebruikte volumes wil vernietigen?", ConfirmPruneVolumes: "Weet je zeker dat je alle niet gebruikte volumes wil vernietigen?",
ConfirmPruneNetworks: "Weet je zeker dat je alle niet gebruikte networks wil vernietigen?",
StopService: "Weet je zeker dat je deze service zijn containers wil stoppen?", StopService: "Weet je zeker dat je deze service zijn containers wil stoppen?",
StopContainer: "Weet je zeker dat je deze container wil stoppen?", StopContainer: "Weet je zeker dat je deze container wil stoppen?",
PressEnterToReturn: "Druk op enter om terug te gaan naar lazydocker (Deze popup kan uit gezet worden door in de config dit neer te zetten `gui.returnImmediately: true`)", PressEnterToReturn: "Druk op enter om terug te gaan naar lazydocker (Deze popup kan uit gezet worden door in de config dit neer te zetten `gui.returnImmediately: true`)",
DetachFromContainerShortCut: "Als u wilt loskoppelen van de container, drukt u standaard op ctrl-p en vervolgens op ctrl-q",
} }
} }

View file

@ -73,33 +73,27 @@ type TranslationSet struct {
TopTitle string TopTitle string
ImagesTitle string ImagesTitle string
VolumesTitle string VolumesTitle string
NetworksTitle string
NoContainers string NoContainers string
NoContainer string NoContainer string
NoImages string NoImages string
NoVolumes string NoVolumes string
NoNetworks string
NoServices string NoServices string
RemoveImage string RemoveImage string
RemoveVolume string RemoveVolume string
RemoveNetwork string
RemoveWithoutPrune string RemoveWithoutPrune string
RemoveWithoutPruneWithForce string RemoveWithoutPruneWithForce string
RemoveWithForce string RemoveWithForce string
PruneImages string PruneImages string
PruneContainers string PruneContainers string
PruneVolumes string PruneVolumes string
PruneNetworks string
ConfirmPruneContainers string ConfirmPruneContainers string
ConfirmStopContainers string ConfirmStopContainers string
ConfirmRemoveContainers string ConfirmRemoveContainers string
ConfirmPruneImages string ConfirmPruneImages string
ConfirmPruneVolumes string ConfirmPruneVolumes string
ConfirmPruneNetworks string
PruningStatus string PruningStatus string
StopService string StopService string
PressEnterToReturn string PressEnterToReturn string
DetachFromContainerShortCut string
StopAllContainers string StopAllContainers string
RemoveAllContainers string RemoveAllContainers string
ViewRestartOptions string ViewRestartOptions string
@ -121,7 +115,6 @@ type TranslationSet struct {
NothingToDisplay string NothingToDisplay string
NoContainerForService string NoContainerForService string
CannotDisplayEnvVariables string CannotDisplayEnvVariables string
CannotManageNonLocalService string
No string No string
Yes string Yes string
@ -129,13 +122,6 @@ type TranslationSet struct {
LcNextScreenMode string LcNextScreenMode string
LcPrevScreenMode string LcPrevScreenMode string
FilterPrompt string FilterPrompt string
FocusProjects string
FocusServices string
FocusContainers string
FocusImages string
FocusVolumes string
FocusNetworks string
} }
func englishSet() TranslationSet { func englishSet() TranslationSet {
@ -200,13 +186,11 @@ func englishSet() TranslationSet {
DownProject: "down project", DownProject: "down project",
RemoveImage: "remove image", RemoveImage: "remove image",
RemoveVolume: "remove volume", RemoveVolume: "remove volume",
RemoveNetwork: "remove network",
RemoveWithoutPrune: "remove without deleting untagged parents", RemoveWithoutPrune: "remove without deleting untagged parents",
RemoveWithoutPruneWithForce: "remove (forced) without deleting untagged parents", RemoveWithoutPruneWithForce: "remove (forced) without deleting untagged parents",
RemoveWithForce: "remove (forced)", RemoveWithForce: "remove (forced)",
PruneContainers: "prune exited containers", PruneContainers: "prune exited containers",
PruneVolumes: "prune unused volumes", PruneVolumes: "prune unused volumes",
PruneNetworks: "prune unused networks",
PruneImages: "prune unused images", PruneImages: "prune unused images",
StopAllContainers: "stop all containers", StopAllContainers: "stop all containers",
RemoveAllContainers: "remove all containers (forced)", RemoveAllContainers: "remove all containers (forced)",
@ -226,7 +210,6 @@ func englishSet() TranslationSet {
StandaloneContainersTitle: "Standalone Containers", StandaloneContainersTitle: "Standalone Containers",
ImagesTitle: "Images", ImagesTitle: "Images",
VolumesTitle: "Volumes", VolumesTitle: "Volumes",
NetworksTitle: "Networks",
CustomCommandTitle: "Custom Command:", CustomCommandTitle: "Custom Command:",
BulkCommandTitle: "Bulk Command:", BulkCommandTitle: "Bulk Command:",
ErrorTitle: "Error", ErrorTitle: "Error",
@ -242,13 +225,11 @@ func englishSet() TranslationSet {
NothingToDisplay: "Nothing to display", NothingToDisplay: "Nothing to display",
NoContainerForService: "No logs to show; service is not associated with a container", NoContainerForService: "No logs to show; service is not associated with a container",
CannotDisplayEnvVariables: "Something went wrong while displaying environment variables", CannotDisplayEnvVariables: "Something went wrong while displaying environment variables",
CannotManageNonLocalService: "This service belongs to a different compose project. Run lazydocker from that project's directory to manage it.",
NoContainers: "No containers", NoContainers: "No containers",
NoContainer: "No container", NoContainer: "No container",
NoImages: "No images", NoImages: "No images",
NoVolumes: "No volumes", NoVolumes: "No volumes",
NoNetworks: "No networks",
NoServices: "No services", NoServices: "No services",
ConfirmQuit: "Are you sure you want to quit?", ConfirmQuit: "Are you sure you want to quit?",
@ -260,11 +241,9 @@ func englishSet() TranslationSet {
ConfirmStopContainers: "Are you sure you want to stop all containers?", ConfirmStopContainers: "Are you sure you want to stop all containers?",
ConfirmRemoveContainers: "Are you sure you want to remove all containers?", ConfirmRemoveContainers: "Are you sure you want to remove all containers?",
ConfirmPruneVolumes: "Are you sure you want to prune all unused volumes?", ConfirmPruneVolumes: "Are you sure you want to prune all unused volumes?",
ConfirmPruneNetworks: "Are you sure you want to prune all unused networks?",
StopService: "Are you sure you want to stop this service's containers?", StopService: "Are you sure you want to stop this service's containers?",
StopContainer: "Are you sure you want to stop this container?", StopContainer: "Are you sure you want to stop this container?",
PressEnterToReturn: "Press enter to return to lazydocker (this prompt can be disabled in your config by setting `gui.returnImmediately: true`)", PressEnterToReturn: "Press enter to return to lazydocker (this prompt can be disabled in your config by setting `gui.returnImmediately: true`)",
DetachFromContainerShortCut: "By default, to detach from the container press ctrl-p then ctrl-q",
No: "no", No: "no",
Yes: "yes", Yes: "yes",
@ -272,12 +251,5 @@ func englishSet() TranslationSet {
LcNextScreenMode: "next screen mode (normal/half/fullscreen)", LcNextScreenMode: "next screen mode (normal/half/fullscreen)",
LcPrevScreenMode: "prev screen mode", LcPrevScreenMode: "prev screen mode",
FilterPrompt: "filter", FilterPrompt: "filter",
FocusProjects: "focus projects panel",
FocusServices: "focus services panel",
FocusContainers: "focus containers panel",
FocusImages: "focus images panel",
FocusVolumes: "focus volumes panel",
FocusNetworks: "focus networks panel",
} }
} }

View file

@ -3,42 +3,42 @@ package i18n
func frenchSet() TranslationSet { func frenchSet() TranslationSet {
return TranslationSet{ return TranslationSet{
PruningStatus: "destruction", PruningStatus: "destruction",
RemovingStatus: "suppression", RemovingStatus: "supression",
RestartingStatus: "redémarrage", RestartingStatus: "redémarrage",
StartingStatus: "démarrage", StartingStatus: "démarrage",
StoppingStatus: "arrêt", StoppingStatus: "arrêt",
PausingStatus: "mise en pause", PausingStatus: "mise en pause",
RunningCustomCommandStatus: "exécution de la commande personalisée", RunningCustomCommandStatus: "execution de la commande personalisée",
RunningBulkCommandStatus: "exécution de la commande groupée", RunningBulkCommandStatus: "execution de la commande groupée",
NoViewMachingNewLineFocusedSwitchStatement: "Aucune vue correspondant au switch newLineFocused", NoViewMachingNewLineFocusedSwitchStatement: "No view matching newLineFocused switch statement",
ErrorOccurred: "Une erreur s'est produite ! Veuillez créer un rapport d'erreur sur https://github.com/jesseduffield/lazydocker/issues", ErrorOccurred: "Une erreur s'est produite! Veuillez créer un rapport d'erreur sur https://github.com/jesseduffield/lazydocker/issues",
ConnectionFailed: "Erreur lors de la connexion au client Docker. Essayez de redémarrer votre client Docker", ConnectionFailed: "Erreur lors de la connexion au client docker. Essayez de redémarrer votre client docker",
UnattachableContainerError: "Le conteneur ne peut pas être attaché. Vous devez exécuter le service avec le drapeau 'it' ou bien utiliser `stdin_open: true, tty: true` dans votre fichier docker-compose.yml", UnattachableContainerError: "Le conteneur ne peut pas être attaché. Vous devez executer le service avec le drapeau 'it' ou bien utiliser `stdin_open: true, tty: true` dans votre fichier docker-compose.yaml",
WaitingForContainerInfo: "Le processus ne peut pas continuer avant que Docker ne fournisse plus d'informations. Veuillez réessayer dans quelques instants.", WaitingForContainerInfo: "Le processus ne peut pas continuer avant que docker donne plus d'informations. Veuillez réessayer dans quelques instants.",
CannotAttachStoppedContainerError: "Vous ne pouvez pas vous attacher à un conteneur arrêté, vous devez le démarrer en amont (ce que vous pouvez faire avec la touche 'r') (oui, je suis trop paresseux pour le faire automatiquement pour vous) (plutôt cool que je puisse communiquer en tête-à-tête avec vous au travers d'un message d'erreur, cependant)", CannotAttachStoppedContainerError: "Vous ne pouvez pas vous attacher à un conteneur en arrêt, vous devez le démarrer avant (ce que vous pouvez faire avec la touche 'r') (oui, je suis trop paresseux pour le faire automatiquement pour vous) (plutôt cool que je puisse communiquer en tête-à-tête avec vous au travers d'un message d'erreur)",
CannotAccessDockerSocketError: "Impossible d'accéder au socket Docker à : unix:///var/run/docker.sock\nLancez lazydocker en tant que root ou alors lisez https://docs.docker.com/install/linux/linux-postinstall/", CannotAccessDockerSocketError: "Impossible d'accèder à la socket docker à: unix:///var/run/docker.sock\nLancez lazydocker en tant que root ou alors lisez https://docs.docker.com/install/linux/linux-postinstall/",
CannotKillChildError: "Trois secondes se sont écoulées depuis la demande d'arrêt des processus enfants. Il se peut qu'un processus orphelin continue à tourner sur votre système.", CannotKillChildError: "Trois secondes ont étés attendu pour l'arrêt des processus fils. Il y a possiblement un processus orphelin qui continue à tourner sur votre systeme.",
Donate: "Donner", Donate: "Donner",
Confirm: "Confirmer", Confirm: "Confirmer",
Return: "retour", Return: "retour",
FocusMain: "focus panneau principal", FocusMain: "focus paneau principal",
Navigate: "naviguer", Navigate: "naviguer",
Execute: "exécuter", Execute: "executer",
Close: "fermer", Close: "fermer",
Menu: "menu", Menu: "menu",
MenuTitle: "Menu", MenuTitle: "Menu",
Scroll: "faire défiler", Scroll: "faire défiler",
OpenConfig: "ouvrir la configuration lazydocker", OpenConfig: "ouvrire la configuration lazydocker",
EditConfig: "modifier la configuration lazydocker", EditConfig: "modifier la configuration lazydocker",
Cancel: "annuler", Cancel: "annuler",
Remove: "supprimer", Remove: "supprimer",
HideStopped: "cacher/montrer les conteneurs arrêtés", HideStopped: "cacher/montrer les conteneurs arrêtés",
ForceRemove: "forcer la suppression", ForceRemove: "forcer la supression",
RemoveWithVolumes: "supprimer avec les volumes", RemoveWithVolumes: "supprimer avec les volumes",
RemoveService: "supprimer les conteneurs", RemoveService: "supprimer les conteneurs",
Stop: "arrêter", Stop: "arrêter",
@ -53,21 +53,19 @@ func frenchSet() TranslationSet {
ViewLogs: "voir les enregistrements", ViewLogs: "voir les enregistrements",
RemoveImage: "supprimer l'image", RemoveImage: "supprimer l'image",
RemoveVolume: "supprimer le volume", RemoveVolume: "supprimer le volume",
RemoveNetwork: "supprimer le réseau", RemoveWithoutPrune: "supprimer sans effacer les parents non étiqueté",
RemoveWithoutPrune: "supprimer sans effacer les parents non étiquetés", RemoveWithoutPruneWithForce: "supprimer (forcer) sans effacer les parents non étiqueté",
RemoveWithoutPruneWithForce: "supprimer (forcer) sans effacer les parents non étiquetés",
RemoveWithForce: "supprimer (forcer)", RemoveWithForce: "supprimer (forcer)",
PruneContainers: "détruire les conteneurs arrêtés", PruneContainers: "détruire les conteneurs arrêtes",
PruneVolumes: "détruire les volumes non utilisés", PruneVolumes: "détruire les volumes non utilisés",
PruneNetworks: "détruire les réseaux non utilisés", PruneImages: "détruire les images non utilisés",
PruneImages: "détruire les images non utilisées",
StopAllContainers: "arrêter tous les conteneurs", StopAllContainers: "arrêter tous les conteneurs",
RemoveAllContainers: "supprimer tous les conteneurs (forcer)", RemoveAllContainers: "supprimer tous les conteneurs (forcer)",
ViewRestartOptions: "voir les options de redémarrage", ViewRestartOptions: "voir les options de redémarrage",
ExecShell: "exécuter le shell", ExecShell: "executer le shell",
RunCustomCommand: "exécuter une commande prédéfinie", RunCustomCommand: "executer une commande prédéfinie",
ViewBulkCommands: "voir les commandes groupées", ViewBulkCommands: "voir les commandes groupés",
OpenInBrowser: "ouvrir dans le navigateur (le premier port est http)", OpenInBrowser: "ouvrir dans le navgateur (le premier port est http)",
SortContainersByState: "ordonner les conteneurs par état", SortContainersByState: "ordonner les conteneurs par état",
GlobalTitle: "Global", GlobalTitle: "Global",
@ -75,44 +73,40 @@ func frenchSet() TranslationSet {
ProjectTitle: "Projet", ProjectTitle: "Projet",
ServicesTitle: "Services", ServicesTitle: "Services",
ContainersTitle: "Conteneurs", ContainersTitle: "Conteneurs",
StandaloneContainersTitle: "Conteneurs autonomes", StandaloneContainersTitle: "Conteneurs Autonomes",
ImagesTitle: "Images", ImagesTitle: "Images",
VolumesTitle: "Volumes", VolumesTitle: "Volumes",
NetworksTitle: "Réseaux", CustomCommandTitle: "Commande personalisé:",
CustomCommandTitle: "Commande personnalisée :", BulkCommandTitle: "Commande groupée:",
BulkCommandTitle: "Commande groupée :",
ErrorTitle: "Erreur", ErrorTitle: "Erreur",
LogsTitle: "Journaux", LogsTitle: "Enregistrements",
ConfigTitle: "Config", ConfigTitle: "Config",
EnvTitle: "Env", EnvTitle: "Env",
DockerComposeConfigTitle: "Config Docker-Compose", DockerComposeConfigTitle: "Config Docker-Compose",
TopTitle: "Top", TopTitle: "Top",
StatsTitle: "Statistiques", StatsTitle: "Statistiques",
CreditsTitle: "À propos", CreditsTitle: "A propos",
ContainerConfigTitle: "Config Conteneur", ContainerConfigTitle: "Config Conteneur",
ContainerEnvTitle: "Env Conteneur", ContainerEnvTitle: "Env Conteneur",
NothingToDisplay: "Rien à afficher", NothingToDisplay: "Rien à afficher",
CannotDisplayEnvVariables: "Quelque chose a échoué lors de l'affichage des variables d'environnement", CannotDisplayEnvVariables: "Quelque chose à échoué lors de l'affichage des variables d'environnement",
NoContainers: "Aucun conteneur", NoContainers: "Aucun conteneurs",
NoContainer: "Aucun conteneur", NoContainer: "Aucun conteneur",
NoImages: "Aucune image", NoImages: "Aucune images",
NoVolumes: "Aucun volume", NoVolumes: "Aucun volumes",
NoNetworks: "Aucun réseau",
ConfirmQuit: "Êtes-vous certain de vouloir quitter ?", ConfirmQuit: "Êtes vous certain de vouloir quitter?",
MustForceToRemoveContainer: "Vous ne pouvez pas supprimer un conteneur qui tourne sans le forcer. Voulez-vous le forcer ?", MustForceToRemoveContainer: "Vous ne pouvez pas supprimer un conteneur qui tourne sans le forcer. Voulez-vous le forcer ?",
NotEnoughSpace: "Manque d'espace pour afficher les différent panneaux", NotEnoughSpace: "Manque d'espace pour afficher les differents panneaux",
ConfirmPruneImages: "Êtes-vous certain de vouloir détruire toutes les images non utilisées ?", ConfirmPruneImages: "Êtes-vous certain de vouloir détruire toutes les images non utilisés ?",
ConfirmPruneContainers: "Êtes-vous certain de vouloir détruire tous les conteneurs arrêtés ?", ConfirmPruneContainers: "Êtes-vous certain de vouloir détruire tous les conteneurs arrêtés ?",
ConfirmStopContainers: "Êtes-vous certain de vouloir arrêter tous les conteneurs ?", ConfirmStopContainers: "Êtes-vous certain de vouloir arrêter tous les conteneurs ?",
ConfirmRemoveContainers: "Êtes-vous certain de vouloir supprimer tous les conteneurs ?", ConfirmRemoveContainers: "Êtes-vous certain de vouloir supprimer tous les conteneurs ?",
ConfirmPruneVolumes: "Êtes-vous certain de vouloir détruire tous les volumes non utilisés ?", ConfirmPruneVolumes: "Êtes-vous certain de vouloir détruire tous les volumes non utilisés ?",
ConfirmPruneNetworks: "Êtes-vous certain de vouloir détruire tous les réseaux non utilisés ?",
StopService: "Êtes-vous certain de vouloir arrêter le conteneur de ce service ?", StopService: "Êtes-vous certain de vouloir arrêter le conteneur de ce service ?",
StopContainer: "Êtes-vous certain de vouloir arrêter ce conteneur ?", StopContainer: "Êtes-vous certain de vouloir arrêter ce conteneur ?",
PressEnterToReturn: "Appuyez sur Entrée pour revenir à lazydocker (ce message peut être désactivé dans vos configurations en appliquant `gui.returnImmediately: true`)", PressEnterToReturn: "Appuiez sur Enter pour revenir à lazydocker (ce message peut être désactivé dans vos configurations en appliquant `gui.returnImmediately: true`)",
DetachFromContainerShortCut: "Par défaut, pour se détacher du conteneur appuyez sur CTRL-P puis CTRL-Q",
No: "non", No: "non",
Yes: "oui", Yes: "oui",

View file

@ -44,11 +44,9 @@ func germanSet() TranslationSet {
ViewLogs: "zeige Protokolle", ViewLogs: "zeige Protokolle",
RemoveImage: "entferne Image", RemoveImage: "entferne Image",
RemoveVolume: "entferne Volume", RemoveVolume: "entferne Volume",
RemoveNetwork: "entferne Netzwerk",
RemoveWithoutPrune: "entfernen, ohne die unmarkierten Eltern zu entfernen", RemoveWithoutPrune: "entfernen, ohne die unmarkierten Eltern zu entfernen",
PruneContainers: "entferne verlassene Container", PruneContainers: "entferne verlassene Container",
PruneVolumes: "entferne unbenutzte Volumes", PruneVolumes: "entferne unbenutzte Volumes",
PruneNetworks: "entferne unbenutzte Netzwerk",
PruneImages: "entferne unbenutzte Images", PruneImages: "entferne unbenutzte Images",
ViewRestartOptions: "zeige Neustartoptionen", ViewRestartOptions: "zeige Neustartoptionen",
RunCustomCommand: "führe vordefinierten benutzerdefinierten Befehl aus", RunCustomCommand: "führe vordefinierten benutzerdefinierten Befehl aus",
@ -61,7 +59,6 @@ func germanSet() TranslationSet {
StandaloneContainersTitle: "Alleinstehende Container", StandaloneContainersTitle: "Alleinstehende Container",
ImagesTitle: "Images", ImagesTitle: "Images",
VolumesTitle: "Volumes", VolumesTitle: "Volumes",
NetworksTitle: "Netzwerk",
CustomCommandTitle: "Benutzerdefinierter Befehl", CustomCommandTitle: "Benutzerdefinierter Befehl",
ErrorTitle: "Fehler", ErrorTitle: "Fehler",
LogsTitle: "Protokoll", LogsTitle: "Protokoll",
@ -80,7 +77,6 @@ func germanSet() TranslationSet {
NoContainer: "Kein Container", NoContainer: "Kein Container",
NoImages: "Keine Images", NoImages: "Keine Images",
NoVolumes: "Keine Volumes", NoVolumes: "Keine Volumes",
NoNetworks: "Keine Netzwerk",
ConfirmQuit: "Bist du dir sicher, dass du verlassen möchtest?", ConfirmQuit: "Bist du dir sicher, dass du verlassen möchtest?",
MustForceToRemoveContainer: "Du kannst keinen Container entfernen, der noch ausgeführt wird außer du erzwingst es. Möchtest du es erzwingen?", MustForceToRemoveContainer: "Du kannst keinen Container entfernen, der noch ausgeführt wird außer du erzwingst es. Möchtest du es erzwingen?",
@ -88,10 +84,8 @@ func germanSet() TranslationSet {
ConfirmPruneImages: "Bist du dir sicher, dass du alle unbenutzten Images entfernen möchtest?", ConfirmPruneImages: "Bist du dir sicher, dass du alle unbenutzten Images entfernen möchtest?",
ConfirmPruneContainers: "Bist du dir sicher, dass du alle angehaltenen Container entfernen möchtes?", ConfirmPruneContainers: "Bist du dir sicher, dass du alle angehaltenen Container entfernen möchtes?",
ConfirmPruneVolumes: "Bist du dir sicher, dass du alle unbenutzen Volumes entfernen möchtest?", ConfirmPruneVolumes: "Bist du dir sicher, dass du alle unbenutzen Volumes entfernen möchtest?",
ConfirmPruneNetworks: "Bist du dir sicher, dass du alle unbenutzen Netzwerk entfernen möchtest?",
StopService: "Bist du dir sicher, dass du den Dienst dieses Containers anhalten möchtest?", StopService: "Bist du dir sicher, dass du den Dienst dieses Containers anhalten möchtest?",
StopContainer: "Bist du dir sicher, dass du den Container anhalten möchtest?", StopContainer: "Bist du dir sicher, dass du den Container anhalten möchtest?",
PressEnterToReturn: "Drücke Eingabe um zu lazydocker zurückzukehren. (Diese Nachfrage kann in Deiner Konfiguration deaktiviert werden, indem du folgenden Wert setzt: `gui.returnImmediately: true`)", PressEnterToReturn: "Drücke Eingabe um zu lazydocker zurückzukehren. (Diese Nachfrage kann in Deiner Konfiguration deaktiviert werden, indem du folgenden Wert setzt: `gui.returnImmediately: true`)",
DetachFromContainerShortCut: "Um sich vom Container zu trennen, drücken Sie standardmäßig ctrl-p und dann ctrl-q",
} }
} }

View file

@ -54,9 +54,6 @@ func GetTranslationSets() map[string]TranslationSet {
"tr": turkishSet(), "tr": turkishSet(),
"en": englishSet(), "en": englishSet(),
"fr": frenchSet(), "fr": frenchSet(),
"zh": chineseSet(),
"es": spanishSet(),
"pt": portugueseSet(),
} }
} }

View file

@ -44,11 +44,9 @@ func polishSet() TranslationSet {
ViewLogs: "pokaż logi", ViewLogs: "pokaż logi",
RemoveImage: "usuń obraz", RemoveImage: "usuń obraz",
RemoveVolume: "usuń wolumen", RemoveVolume: "usuń wolumen",
RemoveNetwork: "usuń sieci",
RemoveWithoutPrune: "usuń bez kasowania nieoznaczonych rodziców", RemoveWithoutPrune: "usuń bez kasowania nieoznaczonych rodziców",
PruneContainers: "wyczyść kontenery", PruneContainers: "wyczyść kontenery",
PruneVolumes: "wyczyść nieużywane wolumeny", PruneVolumes: "wyczyść nieużywane wolumeny",
PruneNetworks: "wyczyść nieużywane sieci",
PruneImages: "wyczyść nieużywane obrazy", PruneImages: "wyczyść nieużywane obrazy",
ViewRestartOptions: "pokaż opcje restartu", ViewRestartOptions: "pokaż opcje restartu",
RunCustomCommand: "wykonaj predefiniowaną własną komende", RunCustomCommand: "wykonaj predefiniowaną własną komende",
@ -61,7 +59,6 @@ func polishSet() TranslationSet {
StandaloneContainersTitle: "Kontenery samodzielne", StandaloneContainersTitle: "Kontenery samodzielne",
ImagesTitle: "Obrazy", ImagesTitle: "Obrazy",
VolumesTitle: "Wolumeny", VolumesTitle: "Wolumeny",
NetworksTitle: "Sieci",
CustomCommandTitle: "Własna komenda:", CustomCommandTitle: "Własna komenda:",
ErrorTitle: "Błąd", ErrorTitle: "Błąd",
LogsTitle: "Logi", LogsTitle: "Logi",
@ -80,7 +77,6 @@ func polishSet() TranslationSet {
NoContainer: "Brak kontenera", NoContainer: "Brak kontenera",
NoImages: "Brak obrazów", NoImages: "Brak obrazów",
NoVolumes: "Brak wolumenów", NoVolumes: "Brak wolumenów",
NoNetworks: "Brak sieci",
ConfirmQuit: "Na pewno chcesz wyjść?", ConfirmQuit: "Na pewno chcesz wyjść?",
MustForceToRemoveContainer: "Nie możesz usunąć uruchomionego kontenera dopóki nie zrobisz tego siłą. Chcesz wykonać to z siłą?", MustForceToRemoveContainer: "Nie możesz usunąć uruchomionego kontenera dopóki nie zrobisz tego siłą. Chcesz wykonać to z siłą?",
@ -88,10 +84,8 @@ func polishSet() TranslationSet {
ConfirmPruneImages: "Na pewno wyczyścić wszystkie nieużywane obrazy?", ConfirmPruneImages: "Na pewno wyczyścić wszystkie nieużywane obrazy?",
ConfirmPruneContainers: "Na pewno wyczyścić wszystkie nieuruchomione kontenery?", ConfirmPruneContainers: "Na pewno wyczyścić wszystkie nieuruchomione kontenery?",
ConfirmPruneVolumes: "Na pewno wyczyścić wszystkie nieużywane wolumeny?", ConfirmPruneVolumes: "Na pewno wyczyścić wszystkie nieużywane wolumeny?",
ConfirmPruneNetworks: "Na pewno wyczyścić wszystkie nieużywane sieci?",
StopService: "Na pewno zatrzymać kontenery tego serwisu?", StopService: "Na pewno zatrzymać kontenery tego serwisu?",
StopContainer: "Na pewno zatrzymać ten kontener?", StopContainer: "Na pewno zatrzymać ten kontener?",
PressEnterToReturn: "Wciśnij enter aby powrócić do lazydockera (ten komunikat może być wyłączony w konfiguracji poprzez ustawienie `gui.returnImmediately: true`)", PressEnterToReturn: "Wciśnij enter aby powrócić do lazydockera (ten komunikat może być wyłączony w konfiguracji poprzez ustawienie `gui.returnImmediately: true`)",
DetachFromContainerShortCut: "Domyślnie, aby odłączyć się od kontenera, naciśnij ctrl-p, a następnie ctrl-q",
} }
} }

View file

@ -1,137 +0,0 @@
package i18n
func portugueseSet() TranslationSet {
return TranslationSet{
PruningStatus: "destruindo",
RemovingStatus: "removendo",
RestartingStatus: "reiniciando",
StartingStatus: "iniciando",
StoppingStatus: "parando",
UppingServiceStatus: "subindo serviço",
UppingProjectStatus: "subindo projeto",
DowningStatus: "derrubando",
PausingStatus: "pausando",
RunningCustomCommandStatus: "executando comando personalizado",
RunningBulkCommandStatus: "executando comando em massa",
NoViewMachingNewLineFocusedSwitchStatement: "No view matching newLineFocused switch statement",
ErrorOccurred: "Um erro ocorreu! Por favor, crie uma issue em https://github.com/jesseduffield/lazydocker/issues",
ConnectionFailed: "Falha na conexão com o cliente Docker. Você pode precisar reiniciar o seu cliente Docker",
UnattachableContainerError: "O contêiner não suporta anexação. Você deve executar o serviço com a flag '-it' ou usar `stdin_open: true, tty: true` no arquivo docker-compose.yml",
WaitingForContainerInfo: "Não é possível prosseguir até que o Docker forneça mais informações sobre o contêiner. Por favor, tente novamente em alguns momentos.",
CannotAttachStoppedContainerError: "Você não pode anexar a um contêiner parado, você precisa iniciá-lo primeiro (o que você pode fazer com a tecla 'r') (sim, sou preguiçoso demais para fazer isso automaticamente para você) (aliás, bem legal que eu posso me comunicar diretamente com você na forma de uma mensagem de erro)",
CannotAccessDockerSocketError: "Não é possível acessar o sôquete docker em: unix:///var/run/docker.sock\nExecute o lazydocker como root ou leia https://docs.docker.com/install/linux/linux-postinstall/",
CannotKillChildError: "Três segundos foram esperarados para que os processos filhos parassem. Pode haver um processo órfão que continua em execução em seu sistema.",
Donate: "Doar",
Confirm: "Confirmar",
Return: "retornar",
FocusMain: "focar no painel principal",
LcFilter: "filtrar lista",
Navigate: "navegar",
Execute: "executar",
Close: "fechar",
Quit: "sair",
Menu: "menu",
MenuTitle: "Menu",
Scroll: "rolar",
OpenConfig: "abrir configuração do lazydocker",
EditConfig: "editar configuração do lazydocker",
Cancel: "cancelar",
Remove: "remover",
HideStopped: "ocultar/mostrar contêineres parados",
ForceRemove: "forçar remoção",
RemoveWithVolumes: "remover com volumes",
RemoveService: "remover contêineres",
UpService: "subir serviço",
Stop: "parar",
Pause: "pausar",
Restart: "reiniciar",
Down: "derrubar projeto",
DownWithVolumes: "derrubar projetos com volumes",
Start: "iniciar",
Rebuild: "reconstuir",
Recreate: "recriar",
PreviousContext: "aba anterior",
NextContext: "próxima aba",
Attach: "anexar",
ViewLogs: "ver logs",
UpProject: "subir projeto",
DownProject: "derrubar projeto",
RemoveImage: "remover imagem",
RemoveVolume: "remover volume",
RemoveNetwork: "remover rede",
RemoveWithoutPrune: "remover sem deletar pais não etiquetados",
RemoveWithoutPruneWithForce: "remover (forçado) sem deletar pais não etiquetados",
RemoveWithForce: "remover (forçado)",
PruneContainers: "destruir contêineres encerrados",
PruneVolumes: "destruir volumes não utilizados",
PruneNetworks: "destruir redes não utilizadas",
PruneImages: "destruir imagens não utilizadas",
StopAllContainers: "parar todos os contêineres",
RemoveAllContainers: "remover todos os contêineres (forçado)",
ViewRestartOptions: "ver opções de reinício",
ExecShell: "executar shell",
RunCustomCommand: "executar comando personalizado predefinido",
ViewBulkCommands: "ver comandos em massa",
FilterList: "filtrar lista",
OpenInBrowser: "abrir no navegador (primeira porta é http)",
SortContainersByState: "ordenar contêineres por estado",
GlobalTitle: "Global",
MainTitle: "Principal",
ProjectTitle: "Projeto",
ServicesTitle: "Serviços",
ContainersTitle: "Contêineres",
StandaloneContainersTitle: "Contêineres Avulsos",
ImagesTitle: "Imagens",
VolumesTitle: "Volumes",
NetworksTitle: "Redes",
CustomCommandTitle: "Comando Personalizado:",
BulkCommandTitle: "Comando em Massa:",
ErrorTitle: "Erro",
LogsTitle: "Registros",
ConfigTitle: "Config",
EnvTitle: "Env",
DockerComposeConfigTitle: "Docker-Compose Config",
TopTitle: "Topo",
StatsTitle: "Estatísticas",
CreditsTitle: "Sobre",
ContainerConfigTitle: "Configuração do Contêiner",
ContainerEnvTitle: "Contêiner Env",
NothingToDisplay: "Nada a exibir",
NoContainerForService: "Nenhum log para exibir; o serviço não está associado a nenhum contêiner",
CannotDisplayEnvVariables: "Algo deu errado ao exibir as variáveis de ambiente",
NoContainers: "Sem contêineres",
NoContainer: "Sem contêiner",
NoImages: "Sem imagens",
NoVolumes: "Sem volumes",
NoNetworks: "Sem redes",
NoServices: "Sem serviços",
ConfirmQuit: "Tem certeza que deseja sair?",
ConfirmUpProject: "Tem certeza que deseja 'iniciar' seu projeto docker compose?",
MustForceToRemoveContainer: "Você não pode remover um contêiner em execução a menos que o force. Deseja forçar?",
NotEnoughSpace: "Sem espaço suficiente para renderizar os painéis",
ConfirmPruneImages: "Tem certeza que deseja eliminar todas as imagens não utilizadas?",
ConfirmPruneContainers: "Tem certeza que deseja destruir todos os contêineres parados?",
ConfirmStopContainers: "Tem certeza que deseja parar todos os contêineres?",
ConfirmRemoveContainers: "Tem certeza que deseja remover todos os contêineres?",
ConfirmPruneVolumes: "Tem certeza que deseja destruir todos os volumes não utilizados?",
ConfirmPruneNetworks: "Tem certeza que deseja destruir todas as redes não utilizadas?",
StopService: "Tem certeza que deseja parar os contêineres deste serviço?",
StopContainer: "Tem certeza que deseja parar este contêiner?",
PressEnterToReturn: "Pressione enter para retornar ao lazydocker (este prompt pode ser desativado em sua configuração definindo `gui.returnImmediately: true`)",
DetachFromContainerShortCut: "Por padrão, para desanexar do contêiner, pressione ctrl-p e depois ctrl-q",
No: "não",
Yes: "sim",
LcNextScreenMode: "modo de tela seguinte (normal/meia/tela cheia)",
LcPrevScreenMode: "modo de tela anterior",
FilterPrompt: "filtro",
}
}

View file

@ -1,129 +0,0 @@
package i18n
func spanishSet() TranslationSet {
return TranslationSet{
PruningStatus: "limpiando",
RemovingStatus: "eliminando",
RestartingStatus: "reiniciando",
StartingStatus: "iniciando",
StoppingStatus: "terminando",
UppingServiceStatus: "levantando servicio",
UppingProjectStatus: "levantando proyecto",
DowningStatus: "dando de baja",
PausingStatus: "pausando",
RunningCustomCommandStatus: "ejecutando comando personalizado",
RunningBulkCommandStatus: "ejecutando comando masivo",
ErrorOccurred: "¡Hubo un error! Por favor crea un issue en https://github.com/jesseduffield/lazydocker/issues",
ConnectionFailed: "Falló la conexión con el docker client. Quizá necesitas reiniciar tu docker client",
UnattachableContainerError: "Container does not support attaching. You must either run the service with the '-it' flag or use `stdin_open: true, tty: true` in the docker-compose.yml file",
WaitingForContainerInfo: "No podemos proceder hasta que docker nos de más información sobre el contenedor. Inténtalo otra vez en unos segundos.",
CannotAccessDockerSocketError: "No es posible acceder al docker socket en: unix:///var/run/docker.sock\nEjecuta lazydocker como root o lee https://docs.docker.com/install/linux/linux-postinstall/",
CannotKillChildError: "Esperamos tres segundos a que el proceso hijo se detenga. Debe de haber un proceso huérfano que continua activo en tu sistema.",
Donate: "Donar",
Confirm: "Confirmar",
Return: "regresar",
FocusMain: "enfocar panel principal",
LcFilter: "filtrar lista",
Navigate: "navegar",
Execute: "ejecutar",
Close: "cerrar",
Quit: "salir",
Menu: "menú",
MenuTitle: "Menú",
OpenConfig: "abrir configuración de lazydocker",
EditConfig: "editar configuración de lazydocker",
Cancel: "cancelar",
Remove: "borrar",
HideStopped: "esconder/mostrar contenedores parados",
ForceRemove: "borrar(forzado)",
RemoveWithVolumes: "borrar con volúmenes",
RemoveService: "borrar contenedores",
UpService: "levantar servicio",
Stop: "parar",
Pause: "pausa",
Restart: "reiniciar",
Down: "bajar proyecto",
DownWithVolumes: "bajar proyecto con volúmenes",
Start: "iniciar",
Rebuild: "recompilar",
Recreate: "recrear",
PreviousContext: "anterior pestaña",
NextContext: "siguiente pestaña",
ViewLogs: "ver logs",
UpProject: "levantar proyecto",
DownProject: "dar de baja el proyecto",
RemoveImage: "limpiar imagen",
RemoveVolume: "limpiar volúmen",
RemoveNetwork: "limpiar red",
RemoveWithoutPrune: "limpiar sin borrar padres sin etiqueta",
RemoveWithoutPruneWithForce: "limpiar (forzado) sin borrar padres sin etiqueta",
RemoveWithForce: "limpiar (forzado)",
PruneContainers: "limpiar contenedores finalizados",
PruneVolumes: "limpiar volúmenes sin usar",
PruneNetworks: "limpiar redes sin usar",
PruneImages: "limpiar imágenes sin usar",
StopAllContainers: "detener todos los contenedores",
RemoveAllContainers: "borrar todos los contenedores (forzado)",
ViewRestartOptions: "ver opciones de reinicio",
ExecShell: "ejecutar shell",
RunCustomCommand: "ejecutar comando personalizado",
ViewBulkCommands: "ver comandos masivos",
FilterList: "filtar list",
OpenInBrowser: "abrir en navegador (first port is http)",
SortContainersByState: "ordenar contenedores por estado",
GlobalTitle: "Global",
MainTitle: "Inicio",
ProjectTitle: "Proyecto",
ServicesTitle: "Servicios",
ContainersTitle: "Contenedores",
StandaloneContainersTitle: "Contenedores independientes",
ImagesTitle: "Imágenes",
VolumesTitle: "Volúmenes",
NetworksTitle: "Redes",
CustomCommandTitle: "Comando personalizado:",
BulkCommandTitle: "Comando masivo:",
ErrorTitle: "Error",
LogsTitle: "Logs",
ConfigTitle: "Configuración",
EnvTitle: "Variables de entorno",
DockerComposeConfigTitle: "Docker-Compose Config",
TopTitle: "Top",
StatsTitle: "Estadísticas",
CreditsTitle: "Acerca",
ContainerConfigTitle: "Configuración",
ContainerEnvTitle: "Variables de entorno",
NothingToDisplay: "Nada que mostrar",
NoContainerForService: "No hay logs que mostrar; el servicio no está asociado con un contenedor",
CannotDisplayEnvVariables: "Algo salió mal mientras se mostraban las variables de entorno",
NoContainers: "Sin contenedores",
NoContainer: "Sin contenedor",
NoImages: "Sin imágenes",
NoVolumes: "Sin volúmenes",
NoNetworks: "Sin redes",
NoServices: "Sin servicios",
ConfirmQuit: "¿Realmente quieres salir?",
ConfirmUpProject: "¿Realmente quieres levantar tu proyecto docker compose?",
MustForceToRemoveContainer: "No puedes borrar un contenedor en ejecución a menos de que lo fuerces, ¿quieres hacerlo?",
NotEnoughSpace: "No hay suficiente espacio para renderizar los paneles",
ConfirmPruneImages: "¿Realmente quieres limpiar todas tus imágenes?",
ConfirmPruneContainers: "¿Realmente quieres limpiar todos los contenedores finalizados?",
ConfirmStopContainers: "¿Realmente quieres detener todos los contenedores?",
ConfirmRemoveContainers: "¿Realmente quieres borrar todos los contenedores?",
ConfirmPruneVolumes: "¿Realmente quieres limpiar todos los vólumenes sin usar?",
ConfirmPruneNetworks: "¿Realmente quieres limpiar todas las redes sin usar?",
StopService: "¿Realmente quieres detener los contenedores de este servicio?",
StopContainer: "¿Realmente quieres detener este contenedor?",
PressEnterToReturn: "Presionar [enter] para volver a lazydocker (este mensaje puede ser desactivado en tu configuración poniendo `gui.returnImmediately: true`)",
No: "no",
Yes: "sí",
FilterPrompt: "filtrar",
}
}

View file

@ -44,11 +44,9 @@ func turkishSet() TranslationSet {
ViewLogs: "kayıt defterini görüntüle", ViewLogs: "kayıt defterini görüntüle",
RemoveImage: "imajı kaldır", RemoveImage: "imajı kaldır",
RemoveVolume: "alanı kaldır", RemoveVolume: "alanı kaldır",
RemoveNetwork: "ağı kaldır",
RemoveWithoutPrune: "etkisiz ebeveynleri silmeden kaldır", RemoveWithoutPrune: "etkisiz ebeveynleri silmeden kaldır",
PruneContainers: "çalışmayan konteynerleri temizle", PruneContainers: "çalışmayan konteynerleri temizle",
PruneVolumes: "kullanılmayan alanları temizle", PruneVolumes: "kullanılmayan alanları temizle",
PruneNetworks: "kullanılmayan ağları temizle",
PruneImages: "kullanılmayan imajları temizle", PruneImages: "kullanılmayan imajları temizle",
ViewRestartOptions: "yeniden başlatma seçeneklerini görüntüle", ViewRestartOptions: "yeniden başlatma seçeneklerini görüntüle",
RunCustomCommand: "önceden tanımlanmış özel komutu çalıştır", RunCustomCommand: "önceden tanımlanmış özel komutu çalıştır",
@ -61,7 +59,6 @@ func turkishSet() TranslationSet {
StandaloneContainersTitle: "Bağımsız Konteynerler", StandaloneContainersTitle: "Bağımsız Konteynerler",
ImagesTitle: "Imajlar", ImagesTitle: "Imajlar",
VolumesTitle: "Alanlar", VolumesTitle: "Alanlar",
NetworksTitle: "Ağları",
CustomCommandTitle: "Özel Komut:", CustomCommandTitle: "Özel Komut:",
ErrorTitle: "Hata", ErrorTitle: "Hata",
LogsTitle: "Kayitlar", LogsTitle: "Kayitlar",
@ -80,7 +77,6 @@ func turkishSet() TranslationSet {
NoContainer: "Konteyner yok", NoContainer: "Konteyner yok",
NoImages: "Imajlar yok", NoImages: "Imajlar yok",
NoVolumes: "Alanlar yok", NoVolumes: "Alanlar yok",
NoNetworks: "Ağları yok",
ConfirmQuit: ıkmak istediğine emin misin?", ConfirmQuit: ıkmak istediğine emin misin?",
MustForceToRemoveContainer: "Zorlamadan çalışan bir konteyneri kaldıramazsınız. Zorlamak ister misin?", MustForceToRemoveContainer: "Zorlamadan çalışan bir konteyneri kaldıramazsınız. Zorlamak ister misin?",
@ -88,10 +84,8 @@ func turkishSet() TranslationSet {
ConfirmPruneImages: "Kullanılmayan tüm görüntüleri temizlemek istediğinize emin misiniz?", ConfirmPruneImages: "Kullanılmayan tüm görüntüleri temizlemek istediğinize emin misiniz?",
ConfirmPruneContainers: "Durdurulan tüm konteynerları temizlemek istediğinizden emin misiniz?", ConfirmPruneContainers: "Durdurulan tüm konteynerları temizlemek istediğinizden emin misiniz?",
ConfirmPruneVolumes: "Kullanılmayan tüm alanları temizlemek istediğinizden emin misiniz?", ConfirmPruneVolumes: "Kullanılmayan tüm alanları temizlemek istediğinizden emin misiniz?",
ConfirmPruneNetworks: "Kullanılmayan tüm ağları temizlemek istediğinizden emin misiniz?",
StopService: "Bu servisin konteynerlerini durdurmak istediğinize emin misiniz?", StopService: "Bu servisin konteynerlerini durdurmak istediğinize emin misiniz?",
StopContainer: "Bu konteyneri durdurmak istediğinize emin misiniz?", StopContainer: "Bu konteyneri durdurmak istediğinize emin misiniz?",
PressEnterToReturn: "lazydocker' a geri dönmek için enter tuşuna basın ( Bu uyarı, `gui.return Immediately: true` ayarıyla devre dışı bırakılabilir)", PressEnterToReturn: "lazydocker' a geri dönmek için enter tuşuna basın ( Bu uyarı, `gui.return Immediately: true` ayarıyla devre dışı bırakılabilir)",
DetachFromContainerShortCut: "Varsayılan olarak, kaptan ayırmak için ctrl-p ve ardından ctrl-q tuşlarına basın",
} }
} }

View file

@ -2,7 +2,7 @@ package log
import ( import (
"fmt" "fmt"
"io" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
@ -54,7 +54,7 @@ func newDevelopmentLogger(config *config.AppConfig) *logrus.Logger {
func newProductionLogger() *logrus.Logger { func newProductionLogger() *logrus.Logger {
log := logrus.New() log := logrus.New()
log.Out = io.Discard log.Out = ioutil.Discard
log.SetLevel(logrus.ErrorLevel) log.SetLevel(logrus.ErrorLevel)
return log return log
} }

View file

@ -65,12 +65,9 @@ func (t *TaskManager) NewTask(f func(ctx context.Context)) error {
t.waitingMutex.Lock() t.waitingMutex.Lock()
defer t.waitingMutex.Unlock() defer t.waitingMutex.Unlock()
t.taskIDMutex.Lock()
if taskID < t.newTaskId { if taskID < t.newTaskId {
t.taskIDMutex.Unlock()
return return
} }
t.taskIDMutex.Unlock()
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
notifyStopped := make(chan struct{}) notifyStopped := make(chan struct{})

View file

@ -2,7 +2,6 @@ package utils
import ( import (
"bytes" "bytes"
"encoding/json"
"fmt" "fmt"
"html/template" "html/template"
"io" "io"
@ -14,14 +13,8 @@ import (
"github.com/go-errors/errors" "github.com/go-errors/errors"
"github.com/jesseduffield/gocui" "github.com/jesseduffield/gocui"
"github.com/mattn/go-runewidth"
// "github.com/jesseduffield/yaml"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/goccy/go-yaml"
"github.com/goccy/go-yaml/lexer"
"github.com/goccy/go-yaml/printer"
) )
// SplitLines takes a multiline string and splits it on newlines // SplitLines takes a multiline string and splits it on newlines
@ -42,10 +35,10 @@ func SplitLines(multilineString string) []string {
// WithPadding pads a string as much as you want // WithPadding pads a string as much as you want
func WithPadding(str string, padding int) string { func WithPadding(str string, padding int) string {
uncoloredStr := Decolorise(str) uncoloredStr := Decolorise(str)
if padding < runewidth.StringWidth(uncoloredStr) { if padding < len(uncoloredStr) {
return str return str
} }
return str + strings.Repeat(" ", padding-runewidth.StringWidth(uncoloredStr)) return str + strings.Repeat(" ", padding-len(uncoloredStr))
} }
// ColoredString takes a string and a colour attribute and returns a colored // ColoredString takes a string and a colour attribute and returns a colored
@ -59,45 +52,6 @@ func ColoredString(str string, colorAttribute color.Attribute) string {
return ColoredStringDirect(str, colour) return ColoredStringDirect(str, colour)
} }
// ColoredYamlString takes an YAML formatted string and returns a colored string
// with colors hardcoded as:
// keys: cyan
// Booleans: magenta
// Numbers: yellow
// Strings: green
func ColoredYamlString(str string) string {
format := func(attr color.Attribute) string {
return fmt.Sprintf("%s[%dm", "\x1b", attr)
}
tokens := lexer.Tokenize(str)
var p printer.Printer
p.Bool = func() *printer.Property {
return &printer.Property{
Prefix: format(color.FgMagenta),
Suffix: format(color.Reset),
}
}
p.Number = func() *printer.Property {
return &printer.Property{
Prefix: format(color.FgYellow),
Suffix: format(color.Reset),
}
}
p.MapKey = func() *printer.Property {
return &printer.Property{
Prefix: format(color.FgCyan),
Suffix: format(color.Reset),
}
}
p.String = func() *printer.Property {
return &printer.Property{
Prefix: format(color.FgGreen),
Suffix: format(color.Reset),
}
}
return p.PrintTokens(tokens)
}
// MultiColoredString takes a string and an array of colour attributes and returns a colored // MultiColoredString takes a string and an array of colour attributes and returns a colored
// string with those attributes // string with those attributes
func MultiColoredString(str string, colorAttribute ...color.Attribute) string { func MultiColoredString(str string, colorAttribute ...color.Attribute) string {
@ -144,52 +98,54 @@ func Max(x, y int) int {
} }
// RenderTable takes an array of string arrays and returns a table containing the values // RenderTable takes an array of string arrays and returns a table containing the values
func RenderTable(rows [][]string) (string, error) { func RenderTable(stringArrays [][]string) (string, error) {
if len(rows) == 0 { if len(stringArrays) == 0 {
return "", nil return "", nil
} }
if !displayArraysAligned(rows) { if !displayArraysAligned(stringArrays) {
return "", errors.New("Each item must return the same number of strings to display") return "", errors.New("Each item must return the same number of strings to display")
} }
columnPadWidths := getPadWidths(rows) padWidths := getPadWidths(stringArrays)
paddedDisplayRows := getPaddedDisplayStrings(rows, columnPadWidths) paddedDisplayStrings := getPaddedDisplayStrings(stringArrays, padWidths)
return strings.Join(paddedDisplayRows, "\n"), nil return strings.Join(paddedDisplayStrings, "\n"), nil
} }
// Decolorise strips a string of color // Decolorise strips a string of color
func Decolorise(str string) string { func Decolorise(str string) string {
re := regexp.MustCompile(`\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mK]`) re := regexp.MustCompile(`\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]`)
return re.ReplaceAllString(str, "") return re.ReplaceAllString(str, "")
} }
func getPadWidths(rows [][]string) []int { func getPadWidths(stringArrays [][]string) []int {
if len(rows[0]) <= 1 { if len(stringArrays[0]) <= 1 {
return []int{} return []int{}
} }
columnPadWidths := make([]int, len(rows[0])-1) padWidths := make([]int, len(stringArrays[0])-1)
for i := range columnPadWidths { for i := range padWidths {
for _, cells := range rows { for _, strings := range stringArrays {
uncoloredCell := Decolorise(cells[i]) uncoloredString := Decolorise(strings[i])
if len(uncoloredString) > padWidths[i] {
if runewidth.StringWidth(uncoloredCell) > columnPadWidths[i] { padWidths[i] = len(uncoloredString)
columnPadWidths[i] = runewidth.StringWidth(uncoloredCell)
} }
} }
} }
return columnPadWidths return padWidths
} }
func getPaddedDisplayStrings(rows [][]string, columnPadWidths []int) []string { func getPaddedDisplayStrings(stringArrays [][]string, padWidths []int) []string {
paddedDisplayRows := make([]string, len(rows)) paddedDisplayStrings := make([]string, len(stringArrays))
for i, cells := range rows { for i, stringArray := range stringArrays {
for j, columnPadWidth := range columnPadWidths { if len(stringArray) == 0 {
paddedDisplayRows[i] += WithPadding(cells[j], columnPadWidth) + " " continue
} }
paddedDisplayRows[i] += cells[len(columnPadWidths)] for j, padWidth := range padWidths {
paddedDisplayStrings[i] += WithPadding(stringArray[j], padWidth) + " "
} }
return paddedDisplayRows paddedDisplayStrings[i] += stringArray[len(padWidths)]
}
return paddedDisplayStrings
} }
// displayArraysAligned returns true if every string array returned from our // displayArraysAligned returns true if every string array returned from our
@ -383,30 +339,3 @@ func IsValidHexValue(v string) bool {
func OpensMenuStyle(str string) string { func OpensMenuStyle(str string) string {
return ColoredString(fmt.Sprintf("%s...", str), color.FgMagenta) return ColoredString(fmt.Sprintf("%s...", str), color.FgMagenta)
} }
// MarshalIntoYaml gets any json-tagged data and marshal it into yaml saving original json structure.
// Useful for structs from 3rd-party libs without yaml tags.
func MarshalIntoYaml(data interface{}) ([]byte, error) {
return marshalIntoFormat(data, "yaml")
}
func marshalIntoFormat(data interface{}, format string) ([]byte, error) {
// First marshal struct->json to get the resulting structure declared by json tags
dataJSON, err := json.MarshalIndent(data, "", " ")
if err != nil {
return nil, err
}
switch format {
case "json":
return dataJSON, err
case "yaml":
// Use Unmarshal->Marshal hack to convert json into yaml with the original structure preserved
var dataMirror yaml.MapSlice
if err := yaml.Unmarshal(dataJSON, &dataMirror); err != nil {
return nil, err
}
return yaml.Marshal(dataMirror)
default:
return nil, errors.New(fmt.Sprintf("Unsupported detailization format: %s", format))
}
}

View file

@ -257,65 +257,3 @@ func TestRenderTable(t *testing.T) {
} }
} }
} }
func TestMarshalIntoFormat(t *testing.T) {
type innerData struct {
Foo int `json:"foo"`
Bar string `json:"bar"`
Baz bool `json:"baz"`
}
type data struct {
Qux int `json:"quz"`
Quux innerData `json:"quux"`
}
type scenario struct {
input interface{}
format string
expected []byte
expectedErr error
}
scenarios := []scenario{
{
input: data{1, innerData{2, "foo", true}},
format: "json",
expected: []byte(`{
"quz": 1,
"quux": {
"foo": 2,
"bar": "foo",
"baz": true
}
}`),
expectedErr: nil,
},
{
input: data{1, innerData{2, "foo", true}},
format: "yaml",
expected: []byte(`quz: 1
quux:
bar: foo
baz: true
foo: 2
`),
expectedErr: nil,
},
{
input: data{1, innerData{2, "foo", true}},
format: "xml",
expected: nil,
expectedErr: errors.New("Unsupported detailization format: xml"),
},
}
for _, s := range scenarios {
output, err := marshalIntoFormat(s.input, s.format)
assert.EqualValues(t, s.expected, output)
if s.expectedErr != nil {
assert.EqualError(t, err, s.expectedErr.Error())
} else {
assert.NoError(t, err)
}
}
}

0
test.sh Executable file → Normal file
View file

View file

@ -1,3 +0,0 @@
FROM alpine:latest
COPY . /app

View file

@ -1,25 +0,0 @@
version: "3.5"
services:
my-service:
build:
dockerfile: Dockerfile
context: .
command: /app/print-random-stuff.sh
depends_on:
- my-service2
ports:
- 123:321
my-service2:
build:
dockerfile: Dockerfile
context: .
command: /app/print-random-stuff.sh
ports:
- 12345:12345
my-service3:
build:
dockerfile: Dockerfile
context: .
command: /app/print-random-stuff.sh

View file

@ -1,7 +0,0 @@
#!/bin/sh
while true
do
echo $((1 + $RANDOM % 10))
sleep 1
done

View file

@ -0,0 +1,24 @@
# building the binary
FROM golang:1.11 as builder
# Add Maintainer Info
LABEL maintainer="Jesse Duffield <jessedduffield@gmail.com>"
# Set the Current Working Directory inside the container
WORKDIR /src/github.com/jesseduffield/lazydocker/test/printrandom
# Copy everything from the current directory to the PWD(Present Working Directory) inside the container
COPY . .
# Build the package
RUN go build
# putting binary into a minimal image
FROM scratch
WORKDIR /root/
COPY --from=builder /src/github.com/jesseduffield/lazydocker/test/printrandom/printrandom .
# Run the executable
CMD ["./printrandom"]

26
test/printrandom/main.go Normal file
View file

@ -0,0 +1,26 @@
package main
import (
"fmt"
"math/rand"
"os"
"os/signal"
"time"
)
func main() {
exitOnInterrupt()
for range time.Tick(time.Second / 3) {
fmt.Println(rand.Intn(1000))
}
}
func exitOnInterrupt() {
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
go func() {
<-c
os.Exit(0)
}()
}

BIN
test/printrandom/printrandom Executable file

Binary file not shown.

View file

@ -1 +0,0 @@
* text=auto eol=lf

View file

@ -1,10 +1 @@
.vscode/
*.exe *.exe
# testing
testdata
# go workspaces
go.work
go.work.sum

View file

@ -1,147 +0,0 @@
linters:
enable:
# style
- containedctx # struct contains a context
- dupl # duplicate code
- errname # erorrs are named correctly
- nolintlint # "//nolint" directives are properly explained
- revive # golint replacement
- unconvert # unnecessary conversions
- wastedassign
# bugs, performance, unused, etc ...
- contextcheck # function uses a non-inherited context
- errorlint # errors not wrapped for 1.13
- exhaustive # check exhaustiveness of enum switch statements
- gofmt # files are gofmt'ed
- gosec # security
- nilerr # returns nil even with non-nil error
- thelper # test helpers without t.Helper()
- unparam # unused function params
issues:
exclude-dirs:
- pkg/etw/sample
exclude-rules:
# err is very often shadowed in nested scopes
- linters:
- govet
text: '^shadow: declaration of "err" shadows declaration'
# ignore long lines for skip autogen directives
- linters:
- revive
text: "^line-length-limit: "
source: "^//(go:generate|sys) "
#TODO: remove after upgrading to go1.18
# ignore comment spacing for nolint and sys directives
- linters:
- revive
text: "^comment-spacings: no space between comment delimiter and comment text"
source: "//(cspell:|nolint:|sys |todo)"
# not on go 1.18 yet, so no any
- linters:
- revive
text: "^use-any: since GO 1.18 'interface{}' can be replaced by 'any'"
# allow unjustified ignores of error checks in defer statements
- linters:
- nolintlint
text: "^directive `//nolint:errcheck` should provide explanation"
source: '^\s*defer '
# allow unjustified ignores of error lints for io.EOF
- linters:
- nolintlint
text: "^directive `//nolint:errorlint` should provide explanation"
source: '[=|!]= io.EOF'
linters-settings:
exhaustive:
default-signifies-exhaustive: true
govet:
enable-all: true
disable:
# struct order is often for Win32 compat
# also, ignore pointer bytes/GC issues for now until performance becomes an issue
- fieldalignment
nolintlint:
require-explanation: true
require-specific: true
revive:
# revive is more configurable than static check, so likely the preferred alternative to static-check
# (once the perf issue is solved: https://github.com/golangci/golangci-lint/issues/2997)
enable-all-rules:
true
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
rules:
# rules with required arguments
- name: argument-limit
disabled: true
- name: banned-characters
disabled: true
- name: cognitive-complexity
disabled: true
- name: cyclomatic
disabled: true
- name: file-header
disabled: true
- name: function-length
disabled: true
- name: function-result-limit
disabled: true
- name: max-public-structs
disabled: true
# geneally annoying rules
- name: add-constant # complains about any and all strings and integers
disabled: true
- name: confusing-naming # we frequently use "Foo()" and "foo()" together
disabled: true
- name: flag-parameter # excessive, and a common idiom we use
disabled: true
- name: unhandled-error # warns over common fmt.Print* and io.Close; rely on errcheck instead
disabled: true
# general config
- name: line-length-limit
arguments:
- 140
- name: var-naming
arguments:
- []
- - CID
- CRI
- CTRD
- DACL
- DLL
- DOS
- ETW
- FSCTL
- GCS
- GMSA
- HCS
- HV
- IO
- LCOW
- LDAP
- LPAC
- LTSC
- MMIO
- NT
- OCI
- PMEM
- PWSH
- RX
- SACl
- SID
- SMB
- TX
- VHD
- VHDX
- VMID
- VPCI
- WCOW
- WIM

View file

@ -1 +0,0 @@
* @microsoft/containerplat

View file

@ -1,4 +1,4 @@
# go-winio [![Build Status](https://github.com/microsoft/go-winio/actions/workflows/ci.yml/badge.svg)](https://github.com/microsoft/go-winio/actions/workflows/ci.yml) # go-winio
This repository contains utilities for efficiently performing Win32 IO operations in This repository contains utilities for efficiently performing Win32 IO operations in
Go. Currently, this is focused on accessing named pipes and other file handles, and Go. Currently, this is focused on accessing named pipes and other file handles, and
@ -11,79 +11,12 @@ package.
Please see the LICENSE file for licensing information. Please see the LICENSE file for licensing information.
## Contributing This project has adopted the [Microsoft Open Source Code of
Conduct](https://opensource.microsoft.com/codeofconduct/). For more information
see the [Code of Conduct
FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact
[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional
questions or comments.
This project welcomes contributions and suggestions. Thanks to natefinch for the inspiration for this library. See https://github.com/natefinch/npipe
Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that for another named pipe implementation.
you have the right to, and actually do, grant us the rights to use your contribution.
For details, visit [Microsoft CLA](https://cla.microsoft.com).
When you submit a pull request, a CLA-bot will automatically determine whether you need to
provide a CLA and decorate the PR appropriately (e.g., label, comment).
Simply follow the instructions provided by the bot.
You will only need to do this once across all repos using our CLA.
Additionally, the pull request pipeline requires the following steps to be performed before
mergining.
### Code Sign-Off
We require that contributors sign their commits using [`git commit --signoff`][git-commit-s]
to certify they either authored the work themselves or otherwise have permission to use it in this project.
A range of commits can be signed off using [`git rebase --signoff`][git-rebase-s].
Please see [the developer certificate](https://developercertificate.org) for more info,
as well as to make sure that you can attest to the rules listed.
Our CI uses the DCO Github app to ensure that all commits in a given PR are signed-off.
### Linting
Code must pass a linting stage, which uses [`golangci-lint`][lint].
The linting settings are stored in [`.golangci.yaml`](./.golangci.yaml), and can be run
automatically with VSCode by adding the following to your workspace or folder settings:
```json
"go.lintTool": "golangci-lint",
"go.lintOnSave": "package",
```
Additional editor [integrations options are also available][lint-ide].
Alternatively, `golangci-lint` can be [installed locally][lint-install] and run from the repo root:
```shell
# use . or specify a path to only lint a package
# to show all lint errors, use flags "--max-issues-per-linter=0 --max-same-issues=0"
> golangci-lint run ./...
```
### Go Generate
The pipeline checks that auto-generated code, via `go generate`, are up to date.
This can be done for the entire repo:
```shell
> go generate ./...
```
## Code of Conduct
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
## Special Thanks
Thanks to [natefinch][natefinch] for the inspiration for this library.
See [npipe](https://github.com/natefinch/npipe) for another named pipe implementation.
[lint]: https://golangci-lint.run/
[lint-ide]: https://golangci-lint.run/usage/integrations/#editor-integration
[lint-install]: https://golangci-lint.run/usage/install/#local-installation
[git-commit-s]: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt--s
[git-rebase-s]: https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---signoff
[natefinch]: https://github.com/natefinch

View file

@ -1,41 +0,0 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->
## Security
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
## Reporting Security Issues
**Please do not report security vulnerabilities through public GitHub issues.**
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
This information will help us triage your report more quickly.
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
## Preferred Languages
We prefer all communications to be in English.
## Policy
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
<!-- END MICROSOFT SECURITY.MD BLOCK -->

View file

@ -1,4 +1,3 @@
//go:build windows
// +build windows // +build windows
package winio package winio
@ -8,16 +7,15 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"os" "os"
"runtime" "runtime"
"syscall"
"unicode/utf16" "unicode/utf16"
"github.com/Microsoft/go-winio/internal/fs"
"golang.org/x/sys/windows"
) )
//sys backupRead(h windows.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupRead //sys backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupRead
//sys backupWrite(h windows.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupWrite //sys backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupWrite
const ( const (
BackupData = uint32(iota + 1) BackupData = uint32(iota + 1)
@ -26,7 +24,7 @@ const (
BackupAlternateData BackupAlternateData
BackupLink BackupLink
BackupPropertyData BackupPropertyData
BackupObjectId //revive:disable-line:var-naming ID, not Id BackupObjectId
BackupReparseData BackupReparseData
BackupSparseBlock BackupSparseBlock
BackupTxfsData BackupTxfsData
@ -36,16 +34,14 @@ const (
StreamSparseAttributes = uint32(8) StreamSparseAttributes = uint32(8)
) )
//nolint:revive // var-naming: ALL_CAPS
const ( const (
WRITE_DAC = windows.WRITE_DAC WRITE_DAC = 0x40000
WRITE_OWNER = windows.WRITE_OWNER WRITE_OWNER = 0x80000
ACCESS_SYSTEM_SECURITY = windows.ACCESS_SYSTEM_SECURITY ACCESS_SYSTEM_SECURITY = 0x1000000
) )
// BackupHeader represents a backup stream of a file. // BackupHeader represents a backup stream of a file.
type BackupHeader struct { type BackupHeader struct {
//revive:disable-next-line:var-naming ID, not Id
Id uint32 // The backup stream ID Id uint32 // The backup stream ID
Attributes uint32 // Stream attributes Attributes uint32 // Stream attributes
Size int64 // The size of the stream in bytes Size int64 // The size of the stream in bytes
@ -53,8 +49,8 @@ type BackupHeader struct {
Offset int64 // The offset of the stream in the file (for BackupSparseBlock only). Offset int64 // The offset of the stream in the file (for BackupSparseBlock only).
} }
type win32StreamID struct { type win32StreamId struct {
StreamID uint32 StreamId uint32
Attributes uint32 Attributes uint32
Size uint64 Size uint64
NameSize uint32 NameSize uint32
@ -75,7 +71,7 @@ func NewBackupStreamReader(r io.Reader) *BackupStreamReader {
// Next returns the next backup stream and prepares for calls to Read(). It skips the remainder of the current stream if // Next returns the next backup stream and prepares for calls to Read(). It skips the remainder of the current stream if
// it was not completely read. // it was not completely read.
func (r *BackupStreamReader) Next() (*BackupHeader, error) { func (r *BackupStreamReader) Next() (*BackupHeader, error) {
if r.bytesLeft > 0 { //nolint:nestif // todo: flatten this if r.bytesLeft > 0 {
if s, ok := r.r.(io.Seeker); ok { if s, ok := r.r.(io.Seeker); ok {
// Make sure Seek on io.SeekCurrent sometimes succeeds // Make sure Seek on io.SeekCurrent sometimes succeeds
// before trying the actual seek. // before trying the actual seek.
@ -86,16 +82,16 @@ func (r *BackupStreamReader) Next() (*BackupHeader, error) {
r.bytesLeft = 0 r.bytesLeft = 0
} }
} }
if _, err := io.Copy(io.Discard, r); err != nil { if _, err := io.Copy(ioutil.Discard, r); err != nil {
return nil, err return nil, err
} }
} }
var wsi win32StreamID var wsi win32StreamId
if err := binary.Read(r.r, binary.LittleEndian, &wsi); err != nil { if err := binary.Read(r.r, binary.LittleEndian, &wsi); err != nil {
return nil, err return nil, err
} }
hdr := &BackupHeader{ hdr := &BackupHeader{
Id: wsi.StreamID, Id: wsi.StreamId,
Attributes: wsi.Attributes, Attributes: wsi.Attributes,
Size: int64(wsi.Size), Size: int64(wsi.Size),
} }
@ -104,9 +100,9 @@ func (r *BackupStreamReader) Next() (*BackupHeader, error) {
if err := binary.Read(r.r, binary.LittleEndian, name); err != nil { if err := binary.Read(r.r, binary.LittleEndian, name); err != nil {
return nil, err return nil, err
} }
hdr.Name = windows.UTF16ToString(name) hdr.Name = syscall.UTF16ToString(name)
} }
if wsi.StreamID == BackupSparseBlock { if wsi.StreamId == BackupSparseBlock {
if err := binary.Read(r.r, binary.LittleEndian, &hdr.Offset); err != nil { if err := binary.Read(r.r, binary.LittleEndian, &hdr.Offset); err != nil {
return nil, err return nil, err
} }
@ -151,8 +147,8 @@ func (w *BackupStreamWriter) WriteHeader(hdr *BackupHeader) error {
return fmt.Errorf("missing %d bytes", w.bytesLeft) return fmt.Errorf("missing %d bytes", w.bytesLeft)
} }
name := utf16.Encode([]rune(hdr.Name)) name := utf16.Encode([]rune(hdr.Name))
wsi := win32StreamID{ wsi := win32StreamId{
StreamID: hdr.Id, StreamId: hdr.Id,
Attributes: hdr.Attributes, Attributes: hdr.Attributes,
Size: uint64(hdr.Size), Size: uint64(hdr.Size),
NameSize: uint32(len(name) * 2), NameSize: uint32(len(name) * 2),
@ -205,9 +201,9 @@ func NewBackupFileReader(f *os.File, includeSecurity bool) *BackupFileReader {
// Read reads a backup stream from the file by calling the Win32 API BackupRead(). // Read reads a backup stream from the file by calling the Win32 API BackupRead().
func (r *BackupFileReader) Read(b []byte) (int, error) { func (r *BackupFileReader) Read(b []byte) (int, error) {
var bytesRead uint32 var bytesRead uint32
err := backupRead(windows.Handle(r.f.Fd()), b, &bytesRead, false, r.includeSecurity, &r.ctx) err := backupRead(syscall.Handle(r.f.Fd()), b, &bytesRead, false, r.includeSecurity, &r.ctx)
if err != nil { if err != nil {
return 0, &os.PathError{Op: "BackupRead", Path: r.f.Name(), Err: err} return 0, &os.PathError{"BackupRead", r.f.Name(), err}
} }
runtime.KeepAlive(r.f) runtime.KeepAlive(r.f)
if bytesRead == 0 { if bytesRead == 0 {
@ -220,7 +216,7 @@ func (r *BackupFileReader) Read(b []byte) (int, error) {
// the underlying file. // the underlying file.
func (r *BackupFileReader) Close() error { func (r *BackupFileReader) Close() error {
if r.ctx != 0 { if r.ctx != 0 {
_ = backupRead(windows.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx) backupRead(syscall.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx)
runtime.KeepAlive(r.f) runtime.KeepAlive(r.f)
r.ctx = 0 r.ctx = 0
} }
@ -244,9 +240,9 @@ func NewBackupFileWriter(f *os.File, includeSecurity bool) *BackupFileWriter {
// Write restores a portion of the file using the provided backup stream. // Write restores a portion of the file using the provided backup stream.
func (w *BackupFileWriter) Write(b []byte) (int, error) { func (w *BackupFileWriter) Write(b []byte) (int, error) {
var bytesWritten uint32 var bytesWritten uint32
err := backupWrite(windows.Handle(w.f.Fd()), b, &bytesWritten, false, w.includeSecurity, &w.ctx) err := backupWrite(syscall.Handle(w.f.Fd()), b, &bytesWritten, false, w.includeSecurity, &w.ctx)
if err != nil { if err != nil {
return 0, &os.PathError{Op: "BackupWrite", Path: w.f.Name(), Err: err} return 0, &os.PathError{"BackupWrite", w.f.Name(), err}
} }
runtime.KeepAlive(w.f) runtime.KeepAlive(w.f)
if int(bytesWritten) != len(b) { if int(bytesWritten) != len(b) {
@ -259,7 +255,7 @@ func (w *BackupFileWriter) Write(b []byte) (int, error) {
// close the underlying file. // close the underlying file.
func (w *BackupFileWriter) Close() error { func (w *BackupFileWriter) Close() error {
if w.ctx != 0 { if w.ctx != 0 {
_ = backupWrite(windows.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx) backupWrite(syscall.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx)
runtime.KeepAlive(w.f) runtime.KeepAlive(w.f)
w.ctx = 0 w.ctx = 0
} }
@ -271,14 +267,11 @@ func (w *BackupFileWriter) Close() error {
// //
// If the file opened was a directory, it cannot be used with Readdir(). // If the file opened was a directory, it cannot be used with Readdir().
func OpenForBackup(path string, access uint32, share uint32, createmode uint32) (*os.File, error) { func OpenForBackup(path string, access uint32, share uint32, createmode uint32) (*os.File, error) {
h, err := fs.CreateFile(path, winPath, err := syscall.UTF16FromString(path)
fs.AccessMask(access), if err != nil {
fs.FileShareMode(share), return nil, err
nil, }
fs.FileCreationDisposition(createmode), h, err := syscall.CreateFile(&winPath[0], access, share, nil, createmode, syscall.FILE_FLAG_BACKUP_SEMANTICS|syscall.FILE_FLAG_OPEN_REPARSE_POINT, 0)
fs.FILE_FLAG_BACKUP_SEMANTICS|fs.FILE_FLAG_OPEN_REPARSE_POINT,
0,
)
if err != nil { if err != nil {
err = &os.PathError{Op: "open", Path: path, Err: err} err = &os.PathError{Op: "open", Path: path, Err: err}
return nil, err return nil, err

View file

@ -1,22 +0,0 @@
// This package provides utilities for efficiently performing Win32 IO operations in Go.
// Currently, this package is provides support for genreal IO and management of
// - named pipes
// - files
// - [Hyper-V sockets]
//
// This code is similar to Go's [net] package, and uses IO completion ports to avoid
// blocking IO on system threads, allowing Go to reuse the thread to schedule other goroutines.
//
// This limits support to Windows Vista and newer operating systems.
//
// Additionally, this package provides support for:
// - creating and managing GUIDs
// - writing to [ETW]
// - opening and manageing VHDs
// - parsing [Windows Image files]
// - auto-generating Win32 API code
//
// [Hyper-V sockets]: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/make-integration-service
// [ETW]: https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw-
// [Windows Image files]: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/work-with-windows-images
package winio

View file

@ -33,7 +33,7 @@ func parseEa(b []byte) (ea ExtendedAttribute, nb []byte, err error) {
err = binary.Read(bytes.NewReader(b), binary.LittleEndian, &info) err = binary.Read(bytes.NewReader(b), binary.LittleEndian, &info)
if err != nil { if err != nil {
err = errInvalidEaBuffer err = errInvalidEaBuffer
return ea, nb, err return
} }
nameOffset := fileFullEaInformationSize nameOffset := fileFullEaInformationSize
@ -43,7 +43,7 @@ func parseEa(b []byte) (ea ExtendedAttribute, nb []byte, err error) {
nextOffset := int(info.NextEntryOffset) nextOffset := int(info.NextEntryOffset)
if valueLen+valueOffset > len(b) || nextOffset < 0 || nextOffset > len(b) { if valueLen+valueOffset > len(b) || nextOffset < 0 || nextOffset > len(b) {
err = errInvalidEaBuffer err = errInvalidEaBuffer
return ea, nb, err return
} }
ea.Name = string(b[nameOffset : nameOffset+nameLen]) ea.Name = string(b[nameOffset : nameOffset+nameLen])
@ -52,7 +52,7 @@ func parseEa(b []byte) (ea ExtendedAttribute, nb []byte, err error) {
if info.NextEntryOffset != 0 { if info.NextEntryOffset != 0 {
nb = b[info.NextEntryOffset:] nb = b[info.NextEntryOffset:]
} }
return ea, nb, err return
} }
// DecodeExtendedAttributes decodes a list of EAs from a FILE_FULL_EA_INFORMATION // DecodeExtendedAttributes decodes a list of EAs from a FILE_FULL_EA_INFORMATION
@ -67,7 +67,7 @@ func DecodeExtendedAttributes(b []byte) (eas []ExtendedAttribute, err error) {
eas = append(eas, ea) eas = append(eas, ea)
b = nb b = nb
} }
return eas, err return
} }
func writeEa(buf *bytes.Buffer, ea *ExtendedAttribute, last bool) error { func writeEa(buf *bytes.Buffer, ea *ExtendedAttribute, last bool) error {

Some files were not shown because too many files have changed in this diff Show more