refactor(print-env): omit empty kubeContext from output

Signed-off-by: Dominik Schmidt <dev@dominik-schmidt.de>
This commit is contained in:
Dominik Schmidt 2025-11-21 02:07:19 +01:00
parent 19c9beb786
commit 1ff18d31ed
1 changed files with 6 additions and 4 deletions

View File

@ -35,10 +35,12 @@ func (a *App) PrintEnv(c PrintEnvConfigProvider) error {
// Prepare output structure - include file path to identify source
output := map[string]any{
"filePath": filePath,
"name": st.Env.Name,
"kubeContext": st.Env.KubeContext,
"values": values,
"filePath": filePath,
"name": st.Env.Name,
"values": values,
}
if st.Env.KubeContext != "" {
output["kubeContext"] = st.Env.KubeContext
}
// Marshal based on output format