Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
3816b6fd
Commit
3816b6fd
authored
Jun 04, 2017
by
Cao Shufeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove extra empty lines from log
remove extra "\n" from Everything()
parent
67730881
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
format.go
staging/src/k8s.io/apiserver/pkg/audit/format.go
+1
-1
metrics.go
staging/src/k8s.io/apiserver/pkg/audit/metrics.go
+1
-1
backend.go
staging/src/k8s.io/apiserver/plugin/pkg/audit/log/backend.go
+1
-1
No files found.
staging/src/k8s.io/apiserver/pkg/audit/format.go
View file @
3816b6fd
...
...
@@ -60,7 +60,7 @@ func EventString(ev *auditinternal.Event) string {
ip
=
ev
.
SourceIPs
[
0
]
}
return
fmt
.
Sprintf
(
"%s AUDIT: id=%q stage=%q ip=%q method=%q user=%q groups=%q as=%q asgroups=%q namespace=%q uri=%q response=
\"
%s
\"
\n
"
,
return
fmt
.
Sprintf
(
"%s AUDIT: id=%q stage=%q ip=%q method=%q user=%q groups=%q as=%q asgroups=%q namespace=%q uri=%q response=
\"
%s
\"
"
,
ev
.
Timestamp
.
Format
(
time
.
RFC3339Nano
),
ev
.
AuditID
,
ev
.
Stage
,
ip
,
ev
.
Verb
,
username
,
groups
,
asuser
,
asgroups
,
namespace
,
ev
.
RequestURI
,
response
)
}
...
...
staging/src/k8s.io/apiserver/pkg/audit/metrics.go
View file @
3816b6fd
...
...
@@ -72,7 +72,7 @@ func ObservePolicyLevel(level auditinternal.Level) {
// HandlePluginError handles an error that occurred in an audit plugin. This method should only be
// used if the error may have prevented the audit event from being properly recorded. The events are
//
modified
.
//
logged to the debug log
.
func
HandlePluginError
(
plugin
string
,
err
error
,
impacted
...*
auditinternal
.
Event
)
{
// Count the error.
errorCounter
.
WithLabelValues
(
plugin
)
.
Add
(
float64
(
len
(
impacted
)))
...
...
staging/src/k8s.io/apiserver/plugin/pkg/audit/log/backend.go
View file @
3816b6fd
...
...
@@ -47,7 +47,7 @@ func (b *backend) ProcessEvents(events ...*auditinternal.Event) {
func
(
b
*
backend
)
logEvent
(
ev
*
auditinternal
.
Event
)
{
line
:=
audit
.
EventString
(
ev
)
if
_
,
err
:=
fmt
.
Fprint
(
b
.
out
,
line
);
err
!=
nil
{
if
_
,
err
:=
fmt
.
Fprint
ln
(
b
.
out
,
line
);
err
!=
nil
{
audit
.
HandlePluginError
(
"log"
,
err
,
ev
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment