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
ca35eb47
Commit
ca35eb47
authored
Jul 25, 2018
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor refactoring of InitCommand and InstallCommand
parent
dc8ccbb6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
lib/gitlab/kubernetes/helm/init_command.rb
lib/gitlab/kubernetes/helm/init_command.rb
+2
-2
lib/gitlab/kubernetes/helm/install_command.rb
lib/gitlab/kubernetes/helm/install_command.rb
+10
-8
No files found.
lib/gitlab/kubernetes/helm/init_command.rb
View file @
ca35eb47
...
@@ -20,12 +20,12 @@ module Gitlab
...
@@ -20,12 +20,12 @@ module Gitlab
private
private
def
init_helm_command
def
init_helm_command
tls_
opt
s
=
"--tiller-tls"
\
tls_
flag
s
=
"--tiller-tls"
\
" --tiller-tls-verify --tls-ca-cert
#{
files_dir
}
/ca.pem"
\
" --tiller-tls-verify --tls-ca-cert
#{
files_dir
}
/ca.pem"
\
" --tiller-tls-cert
#{
files_dir
}
/cert.pem"
\
" --tiller-tls-cert
#{
files_dir
}
/cert.pem"
\
" --tiller-tls-key
#{
files_dir
}
/key.pem"
" --tiller-tls-key
#{
files_dir
}
/key.pem"
"helm init
#{
tls_
opt
s
}
>/dev/null"
"helm init
#{
tls_
flag
s
}
>/dev/null"
end
end
end
end
end
end
...
...
lib/gitlab/kubernetes/helm/install_command.rb
View file @
ca35eb47
...
@@ -34,21 +34,23 @@ module Gitlab
...
@@ -34,21 +34,23 @@ module Gitlab
end
end
def
script_command
def
script_command
if
files
.
key?
(
:'ca.pem'
)
tls_opts
=
" --tls"
\
" --tls-ca-cert
#{
files_dir
}
/ca.pem"
\
" --tls-cert
#{
files_dir
}
/cert.pem"
\
" --tls-key
#{
files_dir
}
/key.pem"
end
<<~
HEREDOC
<<~
HEREDOC
helm install
#{
tls_opt
s
}
#{
chart
}
--name
#{
name
}#{
optional_version_flag
}
--namespace
#{
Gitlab
::
Kubernetes
::
Helm
::
NAMESPACE
}
-f /data/helm/
#{
name
}
/config/values.yaml >/dev/null
helm install
#{
optional_tls_flag
s
}
#{
chart
}
--name
#{
name
}#{
optional_version_flag
}
--namespace
#{
Gitlab
::
Kubernetes
::
Helm
::
NAMESPACE
}
-f /data/helm/
#{
name
}
/config/values.yaml >/dev/null
HEREDOC
HEREDOC
end
end
def
optional_version_flag
def
optional_version_flag
" --version
#{
version
}
"
if
version
" --version
#{
version
}
"
if
version
end
end
def
optional_tls_flags
if
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
end
end
end
end
...
...
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