Skip to content

Commit

Permalink
Do not expose internal CPU profiling option as flag (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
yannh committed Oct 16, 2022
1 parent f5338b0 commit dbcd787
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 1 addition & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ $ ./bin/kubeconform -h
Usage: ./bin/kubeconform [OPTION]... [FILE OR FOLDER]...
-cache string
cache schemas downloaded via HTTP to this folder
-cpu-prof string
debug - log CPU profiling to file
-debug
print debug information
-exit-on-error
Expand Down Expand Up @@ -103,7 +101,7 @@ Usage: ./bin/kubeconform [OPTION]... [FILE OR FOLDER]...
disallow additional properties not in schema or duplicated keys
-summary
print a summary at the end (ignored for junit output)
-v show version information
-v show version information
-verbose
print results for all resources (ignored for tap and junit output)
```
Expand Down
5 changes: 3 additions & 2 deletions cmd/kubeconform/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ func realMain() int {
return 1
}

if cfg.CPUProfileFile != "" {
f, err := os.Create(cfg.CPUProfileFile)
cpuProfileFile := os.Getenv("KUBECONFORM_CPUPROFILE_FILE")
if cpuProfileFile != "" {
f, err := os.Create(cpuProfileFile)
if err != nil {
log.Fatal("could not create CPU profile: ", err)
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

type Config struct {
Cache string
CPUProfileFile string
Debug bool
ExitOnError bool
Files []string
Expand Down Expand Up @@ -79,7 +78,6 @@ func FromFlags(progName string, args []string) (Config, string, error) {
flags.BoolVar(&c.Verbose, "verbose", false, "print results for all resources (ignored for tap and junit output)")
flags.BoolVar(&c.SkipTLS, "insecure-skip-tls-verify", false, "disable verification of the server's SSL certificate. This will make your HTTPS connections insecure")
flags.StringVar(&c.Cache, "cache", "", "cache schemas downloaded via HTTP to this folder")
flags.StringVar(&c.CPUProfileFile, "cpu-prof", "", "debug - log CPU profiling to file")
flags.BoolVar(&c.Help, "h", false, "show help information")
flags.BoolVar(&c.Version, "v", false, "show version information")
flags.Usage = func() {
Expand Down

0 comments on commit dbcd787

Please sign in to comment.