From 1ff18d31ed620f086912ba577245c6fa2cf83666 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Fri, 21 Nov 2025 02:07:19 +0100 Subject: [PATCH] refactor(print-env): omit empty kubeContext from output Signed-off-by: Dominik Schmidt --- pkg/app/print_env.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/app/print_env.go b/pkg/app/print_env.go index ecd50270..17421e30 100644 --- a/pkg/app/print_env.go +++ b/pkg/app/print_env.go @@ -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