`prefer` drops a path when the preferred package lists it `until: mutate`

Abierto
#354 1 comentario 0 reacciones 0 asignados Ver en GitHub

@18Abhinav07 ya está trabajando en esto.

Desde el 28/11/2026.

  • #358 de @18Abhinav07 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go
Área
backend

Línea de trabajo

Read internal/slicer/slicer.go where entries skipped for prefer are handled, then compare the behavior with issue #330. Reproduce with the two package slice YAML examples and chisel-proxy cut; verify /file remains in the rootfs and contains the preferred package's content when both slices are selected, including generated content (text).

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Bug

a path that a slice asks for goes missing from the rootfs when another selected slice lists the same path with until: mutate and is the preferred one. no error from cut.

# test-package1.yaml
package: test-package1
slices:
  myslice:
    contents:
      /file: {prefer: test-package2}
# test-package2.yaml
package: test-package2
slices:
  myslice:
    contents:
      /file: {until: mutate}

repro using chisel-proxy:

$ alias chisel-proxy='go run github.com/lczyk/chisel-proxy/cmd/[email protected]'
$ mkdir -p test-package1 test-package2
$ echo foo > test-package1/file
$ echo bar > test-package2/file
$ cut() {
    rm -rf ./rootfs && mkdir ./rootfs
    chisel-proxy cut --arch amd64 ./test-package1 ./test-package2 ./test-package1.yaml ./test-package2.yaml \
      -- --root ./rootfs "$@"
    cat ./rootfs/file 2> /dev/null || echo missing
  }
$ cut test-package1_myslice
Extracting files from package "test-package1"...
foo
$ cut test-package1_myslice test-package2_myslice
Extracting files from package "test-package1"...
Extracting files from package "test-package2"...
missing

test-package1_myslice wants /file to stay, and with test-package2_myslice next to it nobody gets it.

the entry of the package that lost the prefer is skipped before until is worked out (internal/slicer/slicer.go), so only the preferred until: mutate is counted. same for generated content (text).

same family as #330, with until in place of arch.

proposal

count the until of every selected slice that lists the path, also the ones skipped for prefer. then /file stays, with the preferred content.

Lenguaje dominante
Go
Estrellas
434
Forks
74
Merge medio
1 d 30 min
PR fusionados (30 d)
1

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de canonical/chisel

Todos los issues de canonical/chisel

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.