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
1f7ae4eb
Commit
1f7ae4eb
authored
Jul 15, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
aecb4072
f2582fbc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
23 deletions
+30
-23
lib/gitlab/kubernetes/helm/client_command.rb
lib/gitlab/kubernetes/helm/client_command.rb
+13
-1
lib/gitlab/kubernetes/helm/install_command.rb
lib/gitlab/kubernetes/helm/install_command.rb
+0
-11
spec/lib/gitlab/kubernetes/helm/delete_command_spec.rb
spec/lib/gitlab/kubernetes/helm/delete_command_spec.rb
+11
-5
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
+6
-6
No files found.
lib/gitlab/kubernetes/helm/client_command.rb
View file @
1f7ae4eb
...
...
@@ -13,15 +13,27 @@ module Gitlab
end
def
wait_for_tiller_command
helm_check
=
[
'helm'
,
'version'
,
*
optional_tls_flags
].
shelljoin
# This is necessary to give Tiller time to restart after upgrade.
# Ideally we'd be able to use --wait but cannot because of
# https://github.com/helm/helm/issues/4855
'for i in $(seq 1 30); do helm version && break; sleep 1s; echo "Retrying ($i)..."; done'
"for i in $(seq 1 30); do
#{
helm_check
}
&& break; sleep 1s; echo
\"
Retrying ($i)...
\"
; done"
end
def
repository_command
[
'helm'
,
'repo'
,
'add'
,
name
,
repository
].
shelljoin
if
repository
end
def
optional_tls_flags
return
[]
unless
files
.
key?
(
:'ca.pem'
)
[
'--tls'
,
'--tls-ca-cert'
,
"
#{
files_dir
}
/ca.pem"
,
'--tls-cert'
,
"
#{
files_dir
}
/cert.pem"
,
'--tls-key'
,
"
#{
files_dir
}
/key.pem"
]
end
end
end
end
...
...
lib/gitlab/kubernetes/helm/install_command.rb
View file @
1f7ae4eb
...
...
@@ -95,17 +95,6 @@ module Gitlab
[
'--version'
,
version
]
end
def
optional_tls_flags
return
[]
unless
files
.
key?
(
:'ca.pem'
)
[
'--tls'
,
'--tls-ca-cert'
,
"
#{
files_dir
}
/ca.pem"
,
'--tls-cert'
,
"
#{
files_dir
}
/cert.pem"
,
'--tls-key'
,
"
#{
files_dir
}
/key.pem"
]
end
end
end
end
...
...
spec/lib/gitlab/kubernetes/helm/delete_command_spec.rb
View file @
1f7ae4eb
...
...
@@ -20,6 +20,15 @@ describe Gitlab::Kubernetes::Helm::DeleteCommand do
end
end
let
(
:tls_flags
)
do
<<~
EOS
.
squish
--tls
--tls-ca-cert /data/helm/app-name/config/ca.pem
--tls-cert /data/helm/app-name/config/cert.pem
--tls-key /data/helm/app-name/config/key.pem
EOS
end
context
'when there is a ca.pem file'
do
let
(
:files
)
{
{
'ca.pem'
:
'some file content'
}
}
...
...
@@ -27,7 +36,7 @@ describe Gitlab::Kubernetes::Helm::DeleteCommand do
let
(
:commands
)
do
<<~
EOS
helm init --upgrade
for i in $(seq 1 30); do helm version && break; sleep 1s; echo "Retrying ($i)..."; done
for i in $(seq 1 30); do helm version
#{
tls_flags
}
&& break; sleep 1s; echo "Retrying ($i)..."; done
#{
helm_delete_command
}
EOS
end
...
...
@@ -35,10 +44,7 @@ describe Gitlab::Kubernetes::Helm::DeleteCommand do
let
(
:helm_delete_command
)
do
<<~
EOS
.
squish
helm delete --purge app-name
--tls
--tls-ca-cert /data/helm/app-name/config/ca.pem
--tls-cert /data/helm/app-name/config/cert.pem
--tls-key /data/helm/app-name/config/key.pem
#{
tls_flags
}
EOS
end
end
...
...
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
View file @
1f7ae4eb
...
...
@@ -36,7 +36,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
let
(
:commands
)
do
<<~
EOS
helm init --upgrade
for i in $(seq 1 30); do helm version && break; sleep 1s; echo "Retrying ($i)..."; done
for i in $(seq 1 30); do helm version
#{
tls_flags
}
&& break; sleep 1s; echo "Retrying ($i)..."; done
helm repo add app-name https://repository.example.com
helm repo update
#{
helm_install_comand
}
...
...
@@ -64,7 +64,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
let
(
:commands
)
do
<<~
EOS
helm init --upgrade
for i in $(seq 1 30); do helm version && break; sleep 1s; echo "Retrying ($i)..."; done
for i in $(seq 1 30); do helm version
#{
tls_flags
}
&& break; sleep 1s; echo "Retrying ($i)..."; done
helm repo add app-name https://repository.example.com
helm repo update
#{
helm_install_command
}
...
...
@@ -93,7 +93,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
let
(
:commands
)
do
<<~
EOS
helm init --upgrade
for i in $(seq 1 30); do helm version && break; sleep 1s; echo "Retrying ($i)..."; done
for i in $(seq 1 30); do helm version
#{
tls_flags
}
&& break; sleep 1s; echo "Retrying ($i)..."; done
#{
helm_install_command
}
EOS
end
...
...
@@ -120,7 +120,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
let
(
:commands
)
do
<<~
EOS
helm init --upgrade
for i in $(seq 1 30); do helm version && break; sleep 1s; echo "Retrying ($i)..."; done
for i in $(seq 1 30); do helm version
#{
tls_flags
}
&& break; sleep 1s; echo "Retrying ($i)..."; done
helm repo add app-name https://repository.example.com
helm repo update
/bin/date
...
...
@@ -151,7 +151,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
let
(
:commands
)
do
<<~
EOS
helm init --upgrade
for i in $(seq 1 30); do helm version && break; sleep 1s; echo "Retrying ($i)..."; done
for i in $(seq 1 30); do helm version
#{
tls_flags
}
&& break; sleep 1s; echo "Retrying ($i)..."; done
helm repo add app-name https://repository.example.com
helm repo update
#{
helm_install_command
}
...
...
@@ -210,7 +210,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
let
(
:commands
)
do
<<~
EOS
helm init --upgrade
for i in $(seq 1 30); do helm version && break; sleep 1s; echo "Retrying ($i)..."; done
for i in $(seq 1 30); do helm version
#{
tls_flags
}
&& break; sleep 1s; echo "Retrying ($i)..."; done
helm repo add app-name https://repository.example.com
helm repo update
#{
helm_install_command
}
...
...
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