pipectl ignores a malformed --label or --labels value and acts on every application

Abierto
#7,599 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go
Área
cli

Línea de trabajo

Start with the pipectl handlers for application list, deployment list, transfer backup, and transfer restore application, then trace where their --label or --labels values are parsed. Check the existing tests for those commands and add coverage for values without a colon, including env=prod. Done means each malformed value produces an error naming the value and does not run the command across every application; the issue author says a fix with tests is already ready.

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

Descripción

What happened:

Four pipectl commands take label filters in the form KEY:VALUE, and they skip any value without a colon:

  • pipectl application list --label
  • pipectl deployment list --label
  • pipectl transfer backup --labels
  • pipectl transfer restore application --labels

So --labels=env=prod, or a typo such as --labels=env, silently removes the filter. The command then works on every application, with no warning. For transfer restore application this means restoring all applications in the backup instead of the ones the user selected.

What you expected to happen:

The command fails with an error that says which value is wrong.

How to reproduce it:

pipectl transfer restore application --labels=env=prod \
  --input-file=backup.json --piped-id-mapping-file=mapping.json \
  --address=... --api-key=...

Every application in backup.json is restored.

Environment:

  • piped version: not relevant
  • control-plane version: not relevant
  • Others: pipectl at master (cd72c196)

I'd like to work on this. I have a fix with tests ready: https://github.com/pipe-cd/pipecd/compare/master...itsnjstyle27:pipecd:fix/pipectl-malformed-labels

Lenguaje dominante
Go
Estrellas
1.4k
Forks
391
Merge medio
4 d 1 h
PR fusionados (30 d)
58

Preparar el entorno

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 pipe-cd/pipecd

Todos los issues de pipe-cd/pipecd

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.