Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding config command #244

Merged
merged 3 commits into from
Sep 11, 2024
Merged

adding config command #244

merged 3 commits into from
Sep 11, 2024

Conversation

jt-dd
Copy link
Contributor

@jt-dd jt-dd commented Aug 7, 2024

Adding a config command to view the current config KubeHound (with a flag --path to dump the content):

kubehound config
INFO[04:39:30] Loading application from inline command
INFO[04:39:30] Using /Users/julien.terriac/.config/kubehound.yaml for default config
INFO[04:39:30] Initializing application telemetry
WARN[04:39:30] Telemetry disabled via configuration
 --- YAML ---
debug: false
collector:
  type: live-k8s-api-collector
  file:
    clustername: ""
    directory: ""
    archive:
      archivename: ""
      nocompress: false
    blob:
      bucket: ""
      region: ""
  live:
    pagesize: 500
    pagebuffersize: 10
    ratelimitpersecond: 50
  noninteractive: false

Copy link
Contributor

@edznux-dd edznux-dd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter & some wording fixes :D

I'd pre-approve but that would be dissmissed anyway

configCmd = &cobra.Command{
Use: "config",
Short: "Show the current configuration",
Long: `[devOnly] Spawn the kubehound dev stack for the system-tests (build from dockerfile)`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong comment

return nil
}

fmt.Println(" --- YAML ---") //nolint:forbidigo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it confusing that you use --- since it's also the "start of document" in yaml? But at the same time the rest of the line should fail since it's not valid yaml (and it also has a space prefixed, that might be a typo)?

"github.com/DataDog/KubeHound/pkg/cmd"
"github.com/DataDog/KubeHound/pkg/telemetry/log"
"github.com/spf13/cobra"
"gopkg.in/yaml.v2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we have this dep already so it's fine, but otherwise I'd ask the reason of not being on v3.

@jt-dd jt-dd marked this pull request as ready for review September 11, 2024 13:55
@jt-dd jt-dd requested a review from a team as a code owner September 11, 2024 13:55
@jt-dd jt-dd merged commit 62d3726 into main Sep 11, 2024
8 checks passed
@jt-dd jt-dd deleted the jt-dd/new-cmd-config branch September 11, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants