Skip to content

Commit

Permalink
Use sigs.k8s.io/yaml since it respects omitempty
Browse files Browse the repository at this point in the history
  • Loading branch information
banjoh committed Aug 24, 2023
1 parent cbe1579 commit 54f7c62
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmd/internal/util/dump_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import (
"github.com/pkg/errors"
"github.com/replicatedhq/troubleshoot/internal/specs"
"github.com/replicatedhq/troubleshoot/pkg/k8sutil"
"github.com/replicatedhq/troubleshoot/pkg/logger"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"gopkg.in/yaml.v2"
"k8s.io/client-go/kubernetes"
"sigs.k8s.io/yaml"
)

func DumpSpecCmd() *cobra.Command {
Expand All @@ -22,6 +23,15 @@ func DumpSpecCmd() *cobra.Command {
return printSpecs(args)
},
}

cmd.Flags().StringSliceP("selector", "l", []string{"troubleshoot.sh/kind=support-bundle"}, "selector to filter on for loading additional support bundle specs found in secrets within the cluster")
cmd.Flags().Bool("load-cluster-specs", false, "enable/disable loading additional troubleshoot specs found within the cluster. required when no specs are provided on the command line")

// Initialize klog flags
logger.InitKlogFlags(cmd)

k8sutil.AddFlags(cmd.Flags())

return cmd
}

Expand Down

0 comments on commit 54f7c62

Please sign in to comment.