Env vars given with --env/--env-value-from/--env-file are silently dropped when they can't be matched in the command line
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Empieza leyendo UpdateEnvVars en pkg/flags/podspec_helper.go y sigue cómo se recopilan y ordenan las entradas --env, --env-value-from y --env-file a partir de los argumentos de la línea de comandos. Asegúrate de que la coincidencia solo afecte al orden, para que las entradas sin coincidencia también se apliquen. El trabajo estará terminado cuando los casos reportados de opciones abreviadas, nombres repetidos y plugins conserven todas las variables solicitadas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug report
kn service create / kn service update silently drop some of the environment variables given with --env, --env-value-from or --env-file. The command succeeds, but the variables are missing from the created revision.
UpdateEnvVars in pkg/flags/podspec_helper.go determines the order of the env vars by walking os.Args and matching every argument against the next expected NAME=value entry of each flag. Any entry that can't be matched this way is never added to the container. This happens for example when:
- the short flag is used without a separator, e.g.
-eFOO=bar(only-e FOO=bar,-e=FOO=barand--env=FOO=barare recognized), - a name is given more than once, e.g.
-e A=1 -e B=2 -e A=3: the matching gets stuck onA=3whileB=2passes by, soBis lost, - the
pkglibrary is used from another binary (e.g. a plugin) whoseos.Argsdon't contain the kn flags at all: then no env var is set.
Expected behavior
All requested environment variables are set. Matching against the arguments should only influence the order, never whether a variable is applied.
Steps to reproduce the problem
kn service create foo --image gcr.io/knative-samples/helloworld-go -eFOO=bar --no-wait
kn service describe foo -o yaml | grep -A3 env # FOO is missing
kn service create bar --image gcr.io/knative-samples/helloworld-go -e A=1 -e B=2 -e A=3 --no-wait
kn service describe bar -o yaml | grep -A5 env # only A=3, B is missing
kn version
main (f2bfc7f3)
Knative (serving/eventing) version
Nightly
- Lenguaje dominante
- Go
- Estrellas
- 387
- Forks
- 279
- Merge medio
- 2 d 10 h
- PR fusionados (30 d)
- 8
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de knative/client
-
kn secret create --tls-cert creates the certificate under the wrong keyPosiblemente ocupada @RaphaelFakhri la tomó hace 4 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
Los mantenedores suelen responder en 1 día
-
--node-affinity panics without Type and wipes existing affinity settingsPosiblemente ocupada @NopeCharon la tomó hace 11 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
kind/bug lifecycle/stale triage/accepted
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
knative/client#1965 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
[48h Knative] KServe pluginQuizá libre de nuevo @sharmaansh21 la tomó hace 1074 días y no hay ningún pull request abierto. Abiertoknative48h triage/accepted
knative/client#1866 · 4 comentarios · 1 reacción · 2 asignados ·
Los mantenedores suelen responder en 1 día
-
CLI: add support for experimental new filters API in triggerQuizá libre de nuevo @JuneOh710 la tomó hace 1074 días y no hay ningún pull request abierto. Abiertokind/feature triage/accepted
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
knative/client#1833 · 6 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de knative/client
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
agent-butler-finding chore
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
jordansmall/spindrift#6695 ·
Los mantenedores suelen responder en 1 día
-
skills-init: commit-SHA skill refs never start (git checkout -- <sha> reads the SHA as a pathspec)Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
kagent-dev/kagent#3571 ·
Los mantenedores suelen responder en 1 día
-
book-layout.spec fails when the similar-books rail holds other projects' booksPosiblemente ocupada @praetorianer777 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
praetorianer777/GoTome#373 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100