Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
33a765c1
Commit
33a765c1
authored
Apr 10, 2019
by
Thong Kuah
Committed by
Stan Hu
Apr 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Teach Helm::Api about #uninstall
parent
43be4d54
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
lib/gitlab/kubernetes/helm/api.rb
lib/gitlab/kubernetes/helm/api.rb
+7
-0
spec/lib/gitlab/kubernetes/helm/api_spec.rb
spec/lib/gitlab/kubernetes/helm/api_spec.rb
+22
-0
No files found.
lib/gitlab/kubernetes/helm/api.rb
View file @
33a765c1
...
...
@@ -22,6 +22,13 @@ module Gitlab
alias_method
:update
,
:install
def
uninstall
(
command
)
namespace
.
ensure_exists!
delete_pod!
(
command
.
pod_name
)
kubeclient
.
create_pod
(
command
.
pod_resource
)
end
##
# Returns Pod phase
#
...
...
spec/lib/gitlab/kubernetes/helm/api_spec.rb
View file @
33a765c1
...
...
@@ -33,6 +33,28 @@ describe Gitlab::Kubernetes::Helm::Api do
end
end
describe
'#uninstall'
do
before
do
allow
(
client
).
to
receive
(
:create_pod
).
and_return
(
nil
)
allow
(
client
).
to
receive
(
:delete_pod
).
and_return
(
nil
)
allow
(
namespace
).
to
receive
(
:ensure_exists!
).
once
end
it
'ensures the namespace exists before creating the POD'
do
expect
(
namespace
).
to
receive
(
:ensure_exists!
).
once
.
ordered
expect
(
client
).
to
receive
(
:create_pod
).
once
.
ordered
subject
.
uninstall
(
command
)
end
it
'removes an existing pod before installing'
do
expect
(
client
).
to
receive
(
:delete_pod
).
with
(
'install-app-name'
,
'gitlab-managed-apps'
).
once
.
ordered
expect
(
client
).
to
receive
(
:create_pod
).
once
.
ordered
subject
.
uninstall
(
command
)
end
end
describe
'#install'
do
before
do
allow
(
client
).
to
receive
(
:create_pod
).
and_return
(
nil
)
...
...
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