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
9b31985b
Commit
9b31985b
authored
Nov 14, 2018
by
David Eads
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix client-side specification of timeout now that it is honored
parent
493bc79c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
23 deletions
+15
-23
audit.go
test/e2e/auth/audit.go
+12
-16
audit_test.go
test/integration/master/audit_test.go
+3
-7
No files found.
test/e2e/auth/audit.go
View file @
9b31985b
...
...
@@ -106,8 +106,7 @@ var _ = SIGDescribe("Advanced Audit", func() {
podChan
,
err
:=
f
.
PodClient
()
.
Watch
(
watchOptions
)
framework
.
ExpectNoError
(
err
,
"failed to create watch for pods"
)
for
range
podChan
.
ResultChan
()
{
}
podChan
.
Stop
()
f
.
PodClient
()
.
Update
(
pod
.
Name
,
updatePod
)
...
...
@@ -159,7 +158,7 @@ var _ = SIGDescribe("Advanced Audit", func() {
},
{
Level
:
auditinternal
.
LevelRequest
,
Stage
:
auditinternal
.
StageResponseStarted
,
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/pods?timeout
Seconds=%d&watch=true"
,
namespace
,
watchTestTimeout
),
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/pods?timeout
=%ds&timeoutSeconds=%d&watch=true"
,
namespace
,
watchTestTimeout
,
watchTestTimeout
),
Verb
:
"watch"
,
Code
:
200
,
User
:
auditTestUser
,
...
...
@@ -171,7 +170,7 @@ var _ = SIGDescribe("Advanced Audit", func() {
},
{
Level
:
auditinternal
.
LevelRequest
,
Stage
:
auditinternal
.
StageResponseComplete
,
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/pods?timeout
Seconds=%d&watch=true"
,
namespace
,
watchTestTimeout
),
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/pods?timeout
=%ds&timeoutSeconds=%d&watch=true"
,
namespace
,
watchTestTimeout
,
watchTestTimeout
),
Verb
:
"watch"
,
Code
:
200
,
User
:
auditTestUser
,
...
...
@@ -233,8 +232,7 @@ var _ = SIGDescribe("Advanced Audit", func() {
deploymentChan
,
err
:=
f
.
ClientSet
.
AppsV1
()
.
Deployments
(
namespace
)
.
Watch
(
watchOptions
)
framework
.
ExpectNoError
(
err
,
"failed to create watch for deployments"
)
for
range
deploymentChan
.
ResultChan
()
{
}
deploymentChan
.
Stop
()
_
,
err
=
f
.
ClientSet
.
AppsV1
()
.
Deployments
(
namespace
)
.
Update
(
d
)
framework
.
ExpectNoError
(
err
,
"failed to update audit-deployment"
)
...
...
@@ -288,7 +286,7 @@ var _ = SIGDescribe("Advanced Audit", func() {
},
{
Level
:
auditinternal
.
LevelRequest
,
Stage
:
auditinternal
.
StageResponseStarted
,
RequestURI
:
fmt
.
Sprintf
(
"/apis/apps/v1/namespaces/%s/deployments?timeout
Seconds=%d&watch=true"
,
namespace
,
watchTestTimeout
),
RequestURI
:
fmt
.
Sprintf
(
"/apis/apps/v1/namespaces/%s/deployments?timeout
=%ds&timeoutSeconds=%d&watch=true"
,
namespace
,
watchTestTimeout
,
watchTestTimeout
),
Verb
:
"watch"
,
Code
:
200
,
User
:
auditTestUser
,
...
...
@@ -300,7 +298,7 @@ var _ = SIGDescribe("Advanced Audit", func() {
},
{
Level
:
auditinternal
.
LevelRequest
,
Stage
:
auditinternal
.
StageResponseComplete
,
RequestURI
:
fmt
.
Sprintf
(
"/apis/apps/v1/namespaces/%s/deployments?timeout
Seconds=%d&watch=true"
,
namespace
,
watchTestTimeout
),
RequestURI
:
fmt
.
Sprintf
(
"/apis/apps/v1/namespaces/%s/deployments?timeout
=%ds&timeoutSeconds=%d&watch=true"
,
namespace
,
watchTestTimeout
,
watchTestTimeout
),
Verb
:
"watch"
,
Code
:
200
,
User
:
auditTestUser
,
...
...
@@ -368,8 +366,7 @@ var _ = SIGDescribe("Advanced Audit", func() {
configMapChan
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
ConfigMaps
(
namespace
)
.
Watch
(
watchOptions
)
framework
.
ExpectNoError
(
err
,
"failed to create watch for config maps"
)
for
range
configMapChan
.
ResultChan
()
{
}
configMapChan
.
Stop
()
_
,
err
=
f
.
ClientSet
.
CoreV1
()
.
ConfigMaps
(
namespace
)
.
Update
(
configMap
)
framework
.
ExpectNoError
(
err
,
"failed to update audit-configmap"
)
...
...
@@ -423,7 +420,7 @@ var _ = SIGDescribe("Advanced Audit", func() {
},
{
Level
:
auditinternal
.
LevelMetadata
,
Stage
:
auditinternal
.
StageResponseStarted
,
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/configmaps?timeout
Seconds=%d&watch=true"
,
namespace
,
watchTestTimeout
),
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/configmaps?timeout
=%ds&timeoutSeconds=%d&watch=true"
,
namespace
,
watchTestTimeout
,
watchTestTimeout
),
Verb
:
"watch"
,
Code
:
200
,
User
:
auditTestUser
,
...
...
@@ -435,7 +432,7 @@ var _ = SIGDescribe("Advanced Audit", func() {
},
{
Level
:
auditinternal
.
LevelMetadata
,
Stage
:
auditinternal
.
StageResponseComplete
,
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/configmaps?timeout
Seconds=%d&watch=true"
,
namespace
,
watchTestTimeout
),
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/configmaps?timeout
=%ds&timeoutSeconds=%d&watch=true"
,
namespace
,
watchTestTimeout
,
watchTestTimeout
),
Verb
:
"watch"
,
Code
:
200
,
User
:
auditTestUser
,
...
...
@@ -502,8 +499,7 @@ var _ = SIGDescribe("Advanced Audit", func() {
secretChan
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Secrets
(
namespace
)
.
Watch
(
watchOptions
)
framework
.
ExpectNoError
(
err
,
"failed to create watch for secrets"
)
for
range
secretChan
.
ResultChan
()
{
}
secretChan
.
Stop
()
_
,
err
=
f
.
ClientSet
.
CoreV1
()
.
Secrets
(
namespace
)
.
Update
(
secret
)
framework
.
ExpectNoError
(
err
,
"failed to update audit-secret"
)
...
...
@@ -557,7 +553,7 @@ var _ = SIGDescribe("Advanced Audit", func() {
},
{
Level
:
auditinternal
.
LevelMetadata
,
Stage
:
auditinternal
.
StageResponseStarted
,
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/secrets?timeout
Seconds=%d&watch=true"
,
namespace
,
watchTestTimeout
),
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/secrets?timeout
=%ds&timeoutSeconds=%d&watch=true"
,
namespace
,
watchTestTimeout
,
watchTestTimeout
),
Verb
:
"watch"
,
Code
:
200
,
User
:
auditTestUser
,
...
...
@@ -569,7 +565,7 @@ var _ = SIGDescribe("Advanced Audit", func() {
},
{
Level
:
auditinternal
.
LevelMetadata
,
Stage
:
auditinternal
.
StageResponseComplete
,
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/secrets?timeout
Seconds=%d&watch=true"
,
namespace
,
watchTestTimeout
),
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/secrets?timeout
=%ds&timeoutSeconds=%d&watch=true"
,
namespace
,
watchTestTimeout
,
watchTestTimeout
),
Verb
:
"watch"
,
Code
:
200
,
User
:
auditTestUser
,
...
...
test/integration/master/audit_test.go
View file @
9b31985b
...
...
@@ -124,11 +124,7 @@ func testAudit(t *testing.T, version string) {
configMapChan
,
err
:=
kubeclient
.
CoreV1
()
.
ConfigMaps
(
namespace
)
.
Watch
(
watchOptions
)
expectNoError
(
t
,
err
,
"failed to create watch for config maps"
)
for
range
configMapChan
.
ResultChan
()
{
// Block until watchOptions.TimeoutSeconds expires.
// If the test finishes before watchOptions.TimeoutSeconds expires, the watch audit
// event at stage ResponseComplete will not be generated.
}
configMapChan
.
Stop
()
_
,
err
=
kubeclient
.
CoreV1
()
.
ConfigMaps
(
namespace
)
.
Update
(
configMap
)
expectNoError
(
t
,
err
,
"failed to update audit-configmap"
)
...
...
@@ -183,7 +179,7 @@ func testAudit(t *testing.T, version string) {
},
{
Level
:
auditinternal
.
LevelRequestResponse
,
Stage
:
auditinternal
.
StageResponseStarted
,
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/configmaps?timeout
Seconds=%d&watch=true"
,
namespace
,
watchTestTimeout
),
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/configmaps?timeout
=%ds&timeoutSeconds=%d&watch=true"
,
namespace
,
watchTestTimeout
,
watchTestTimeout
),
Verb
:
"watch"
,
Code
:
200
,
User
:
auditTestUser
,
...
...
@@ -195,7 +191,7 @@ func testAudit(t *testing.T, version string) {
},
{
Level
:
auditinternal
.
LevelRequestResponse
,
Stage
:
auditinternal
.
StageResponseComplete
,
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/configmaps?timeout
Seconds=%d&watch=true"
,
namespace
,
watchTestTimeout
),
RequestURI
:
fmt
.
Sprintf
(
"/api/v1/namespaces/%s/configmaps?timeout
=%ds&timeoutSeconds=%d&watch=true"
,
namespace
,
watchTestTimeout
,
watchTestTimeout
),
Verb
:
"watch"
,
Code
:
200
,
User
:
auditTestUser
,
...
...
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