Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Kazunori Yamamoto
gitlab-runner
Commits
bb93deef
Commit
bb93deef
authored
Apr 08, 2019
by
Tomasz Maczukin
Browse files
Merge branch 'cleanup-k8s-cleanup-test' into 'master'
Cleanup k8s cleanup test See merge request
!1280
parents
341ec09b
6c6738b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
executors/kubernetes/executor_kubernetes_test.go
executors/kubernetes/executor_kubernetes_test.go
+4
-4
No files found.
executors/kubernetes/executor_kubernetes_test.go
View file @
bb93deef
...
...
@@ -285,7 +285,7 @@ func fakeKubeDeleteResponse(status int) *http.Response {
body
:=
objBody
(
codec
,
&
metav1
.
Status
{
Code
:
int32
(
status
)})
return
&
http
.
Response
{
StatusCode
:
status
,
Body
:
body
,
Header
:
map
[
string
][]
string
{
"Content-Type"
:
[]
string
{
"application/json"
},
"Content-Type"
:
{
"application/json"
},
}}
}
...
...
@@ -306,7 +306,7 @@ func TestCleanup(t *testing.T) {
Pod
:
&
api
.
Pod
{
ObjectMeta
:
objectMeta
},
ClientFunc
:
func
(
req
*
http
.
Request
)
(
*
http
.
Response
,
error
)
{
switch
p
,
m
:=
req
.
URL
.
Path
,
req
.
Method
;
{
case
m
==
"DELETE"
&&
p
==
"/api/"
+
version
+
"/namespaces/test-ns/pods/test-resource"
:
case
m
==
http
.
MethodDelete
&&
p
==
"/api/"
+
version
+
"/namespaces/test-ns/pods/test-resource"
:
return
fakeKubeDeleteResponse
(
http
.
StatusOK
),
nil
default
:
return
nil
,
fmt
.
Errorf
(
"unexpected request. method: %s, path: %s"
,
m
,
p
)
...
...
@@ -326,7 +326,7 @@ func TestCleanup(t *testing.T) {
Pod
:
&
api
.
Pod
{
ObjectMeta
:
objectMeta
},
ClientFunc
:
func
(
req
*
http
.
Request
)
(
*
http
.
Response
,
error
)
{
switch
p
,
m
:=
req
.
URL
.
Path
,
req
.
Method
;
{
case
m
==
"DELETE"
&&
p
==
"/api/"
+
version
+
"/namespaces/test-ns/pods/test-resource"
:
case
m
==
http
.
MethodDelete
&&
p
==
"/api/"
+
version
+
"/namespaces/test-ns/pods/test-resource"
:
return
fakeKubeDeleteResponse
(
http
.
StatusNotFound
),
nil
default
:
return
nil
,
fmt
.
Errorf
(
"unexpected request. method: %s, path: %s"
,
m
,
p
)
...
...
@@ -340,7 +340,7 @@ func TestCleanup(t *testing.T) {
Credentials
:
&
api
.
Secret
{
ObjectMeta
:
objectMeta
},
ClientFunc
:
func
(
req
*
http
.
Request
)
(
*
http
.
Response
,
error
)
{
switch
p
,
m
:=
req
.
URL
.
Path
,
req
.
Method
;
{
case
m
==
"DELETE"
&&
p
==
"/api/"
+
version
+
"/namespaces/test-ns/secrets/test-resource"
:
case
m
==
http
.
MethodDelete
&&
p
==
"/api/"
+
version
+
"/namespaces/test-ns/secrets/test-resource"
:
return
fakeKubeDeleteResponse
(
http
.
StatusNotFound
),
nil
default
:
return
nil
,
fmt
.
Errorf
(
"unexpected request. method: %s, path: %s"
,
m
,
p
)
...
...
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