bug: microcks login ignores the --config flag and always modifies default config
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 88/100
Línea de trabajo
Empieza leyendo login.go alrededor de las líneas 113-124, donde el comando llama a config.DefaultLocalConfigPath() en lugar de usar globalClientOpts.ConfigPath. Compara eso con cmd.go alrededor de la línea 63 y con logout, context, start, stop e import, que ya respetan el flag global. La corrección consiste en hacer que login lea y escriba a través de la ruta de configuración proporcionada; hecho significa que microcks login http://localhost:8080 --config ./test-config.yaml actualiza ese archivo y deja la configuración predeterminada intacta.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
When authenticating using the microcks login command, the global --config <path> flag is silently ignored. Even when a custom configuration file path is explicitly provided, microcks login continues to read and write authentication tokens, users, and contexts directly to the default path (~/.config/microcks/config).
This breaks multi-profile setups, CI/CD pipeline isolation (where jobs maintain ephemeral configuration files in dedicated directories), and prevents tests from running in isolated temporary directories.
Expected behavior
Passing --config <path> to microcks login should load and persist configuration, user tokens, server definitions, and contexts into the specified path, matching the behavior of microcks logout, microcks context, microcks start, microcks stop, and microcks import.
Actual behavior
microcks login ignores the provided --config argument and writes the login state to ~/.config/microcks/config. The specified custom configuration file remains untouched.
How to Reproduce?
-
Specify a path for an isolated custom configuration file (e.g.,
./test-config.yaml). -
Run the login command with the custom configuration file:
microcks login http://localhost:8080 --config ./test-config.yaml -
Check
./test-config.yamland observe that the file was not created or modified. -
Check
~/.config/microcks/configand observe that the default configuration file was updated with the context and server information.
Microcks version or git rev
1.0.3 / master (commit 5cef506)
Install method (docker-compose, helm chart, operator, docker-desktop extension,...)
Built from source (go build)
Additional information
Root cause
In cmd.go:63, the persistent --config flag is registered and bound to clientOpts.ConfigPath, then passed to NewLoginCommand(&clientOpts):
command.PersistentFlags().StringVar(
&clientOpts.ConfigPath,
"config",
defaultLocalConfigPath,
"Path to Microcks config",
)
command.AddCommand(NewLoginCommand(&clientOpts))
However, in login.go:113-124, the command hardcodes a call to config.DefaultLocalConfigPath() instead of reading globalClientOpts.ConfigPath:
configFile, err := config.DefaultLocalConfigPath()
if err != nil {
return err
}
localConfig, err := config.ReadLocalConfig(configFile)
// ...
if err := config.WriteLocalConfig(*localConfig, configFile); err != nil {
return err
}
Every other command (start, stop, context, logout, import, and service) correctly uses globalClientOpts.ConfigPath.
Changing the hardcoded path assignment to configFile := globalClientOpts.ConfigPath should restore consistency across the CLI and ensure that microcks login respects the global --config flag.
- Lenguaje dominante
- Go
- Estrellas
- 59
- Forks
- 74
- Merge medio
- 5 d 17 h
- PR fusionados (30 d)
- 22
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 microcks/microcks-cli
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microcks/microcks-cli#601 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
microcks/microcks-cli#598 ·
Los mantenedores suelen responder en 1 día
-
Wrong link to test resultsPosiblemente ocupada @SajanBisht la tomó hace 3 días. Abiertocomponent/cli keep-open kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
microcks/microcks-cli#589 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Default configuration path falls back to the current directory when the home directory cannot be determinedPosiblemente ocupada @Sarthak-Shreshtha01 la tomó hace 17 días. Abiertocomponent/cli kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
microcks/microcks-cli#583 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug: YAML parse error in config is silently swallowed, login overwrites all other contextsPosiblemente ocupada @Sarthak-Shreshtha01 la tomó hace 22 días. Abiertocomponent/cli kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
microcks/microcks-cli#572 · 6 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de microcks/microcks-cli
Issues similares
-
automation doc-healer documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
tsukumogami/tsuku#2804 ·
Los mantenedores suelen responder en 1 día
-
Anthropic /v1/messages: only the last thinking block of an assistant message is keptPosiblemente ocupada @Shayan12456 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
ollama/ollama#19415 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
raised-by:verifier
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
medici-finance/assay#5039 ·
Los mantenedores suelen responder en 1 día
-
metax CheckHealth reads Status.Capacity, so unhealthy Metax-GPU nodes are never cleaned upPosiblemente ocupada @barbierajput378-pixel la tomó hoy. Abiertokind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Project-HAMi/HAMi#3343 · 1 comentario ·
Los mantenedores suelen responder en 1 día