Skip to content

Commit dbcd787

Browse files
authoredOct 16, 2022
Do not expose internal CPU profiling option as flag (#136)
1 parent f5338b0 commit dbcd787

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed
 

Diff for: ‎Readme.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ $ ./bin/kubeconform -h
7474
Usage: ./bin/kubeconform [OPTION]... [FILE OR FOLDER]...
7575
-cache string
7676
cache schemas downloaded via HTTP to this folder
77-
-cpu-prof string
78-
debug - log CPU profiling to file
7977
-debug
8078
print debug information
8179
-exit-on-error
@@ -103,7 +101,7 @@ Usage: ./bin/kubeconform [OPTION]... [FILE OR FOLDER]...
103101
disallow additional properties not in schema or duplicated keys
104102
-summary
105103
print a summary at the end (ignored for junit output)
106-
-v show version information
104+
-v show version information
107105
-verbose
108106
print results for all resources (ignored for tap and junit output)
109107
```

Diff for: ‎cmd/kubeconform/main.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ func realMain() int {
6969
return 1
7070
}
7171

72-
if cfg.CPUProfileFile != "" {
73-
f, err := os.Create(cfg.CPUProfileFile)
72+
cpuProfileFile := os.Getenv("KUBECONFORM_CPUPROFILE_FILE")
73+
if cpuProfileFile != "" {
74+
f, err := os.Create(cpuProfileFile)
7475
if err != nil {
7576
log.Fatal("could not create CPU profile: ", err)
7677
}

Diff for: ‎pkg/config/config.go

-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99

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

0 commit comments

Comments
 (0)
Please sign in to comment.