Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
kube-bench
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
aquasecurity
kube-bench
Commits
07750ea4
Commit
07750ea4
authored
8 years ago
by
Liz Rice
Browse files
Options
Downloads
Patches
Plain Diff
Don't output message about config file if output format is JSON
parent
6340ee44
No related branches found
No related tags found
Loading
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmd/common.go
+2
-0
2 additions, 0 deletions
cmd/common.go
cmd/root.go
+1
-3
1 addition, 3 deletions
cmd/root.go
with
3 additions
and
3 deletions
cmd/common.go
+
2
−
0
View file @
07750ea4
...
@@ -225,6 +225,8 @@ func colorPrint(state check.State, s string) {
...
@@ -225,6 +225,8 @@ func colorPrint(state check.State, s string) {
// prettyPrint outputs the results to stdout in human-readable format
// prettyPrint outputs the results to stdout in human-readable format
func
prettyPrint
(
warnings
[]
string
,
r
*
check
.
Controls
,
summary
check
.
Summary
)
{
func
prettyPrint
(
warnings
[]
string
,
r
*
check
.
Controls
,
summary
check
.
Summary
)
{
colorPrint
(
check
.
INFO
,
fmt
.
Sprintf
(
"Using config file: %s
\n
"
,
viper
.
ConfigFileUsed
()))
for
_
,
w
:=
range
warnings
{
for
_
,
w
:=
range
warnings
{
colorPrint
(
check
.
WARN
,
w
)
colorPrint
(
check
.
WARN
,
w
)
}
}
...
...
This diff is collapsed.
Click to expand it.
cmd/root.go
+
1
−
3
View file @
07750ea4
...
@@ -96,9 +96,7 @@ func initConfig() {
...
@@ -96,9 +96,7 @@ func initConfig() {
viper
.
SetDefault
(
"federatedFile"
,
cfgDir
+
"/federated.yaml"
)
viper
.
SetDefault
(
"federatedFile"
,
cfgDir
+
"/federated.yaml"
)
// If a config file is found, read it in.
// If a config file is found, read it in.
if
err
:=
viper
.
ReadInConfig
();
err
==
nil
{
if
err
:=
viper
.
ReadInConfig
();
err
!=
nil
{
colorPrint
(
check
.
INFO
,
fmt
.
Sprintf
(
"Using config file: %s
\n
"
,
viper
.
ConfigFileUsed
()))
}
else
{
colorPrint
(
check
.
FAIL
,
fmt
.
Sprintf
(
"Failed to read config file: %v
\n
"
,
err
))
colorPrint
(
check
.
FAIL
,
fmt
.
Sprintf
(
"Failed to read config file: %v
\n
"
,
err
))
os
.
Exit
(
1
)
os
.
Exit
(
1
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment