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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
661fd213
Commit
661fd213
authored
Oct 24, 2018
by
Chris Baumbauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update helm version 1.7.2 -> 2.11.0
parent
742f8d64
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
7 deletions
+38
-7
app/models/clusters/platforms/kubernetes.rb
app/models/clusters/platforms/kubernetes.rb
+6
-0
changelogs/unreleased/update-helm-version.yml
changelogs/unreleased/update-helm-version.yml
+4
-0
lib/gitlab/kubernetes/helm.rb
lib/gitlab/kubernetes/helm.rb
+1
-1
lib/gitlab/kubernetes/helm/base_command.rb
lib/gitlab/kubernetes/helm/base_command.rb
+1
-1
lib/gitlab/kubernetes/helm/install_command.rb
lib/gitlab/kubernetes/helm/install_command.rb
+20
-3
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
+4
-0
spec/support/shared_examples/helm_generated_script.rb
spec/support/shared_examples/helm_generated_script.rb
+2
-2
No files found.
app/models/clusters/platforms/kubernetes.rb
View file @
661fd213
...
...
@@ -25,6 +25,7 @@ module Clusters
algorithm:
'aes-256-cbc'
before_validation
:enforce_namespace_to_lower_case
before_validation
:enforce_ca_whitespace_trimming
validates
:namespace
,
allow_blank:
true
,
...
...
@@ -191,6 +192,11 @@ module Clusters
self
.
namespace
=
self
.
namespace
&
.
downcase
end
def
enforce_ca_whitespace_trimming
self
.
ca_pem
=
self
.
ca_pem
&
.
strip
self
.
token
=
self
.
token
&
.
strip
end
def
prevent_modification
return
unless
managed?
...
...
changelogs/unreleased/update-helm-version.yml
0 → 100644
View file @
661fd213
---
title
:
Update Helm version to 2.11.0
author
:
Chris Baumbauer
type
:
changed
lib/gitlab/kubernetes/helm.rb
View file @
661fd213
module
Gitlab
module
Kubernetes
module
Helm
HELM_VERSION
=
'2.
7.2
'
.
freeze
HELM_VERSION
=
'2.
11.0
'
.
freeze
NAMESPACE
=
'gitlab-managed-apps'
.
freeze
SERVICE_ACCOUNT
=
'tiller'
.
freeze
CLUSTER_ROLE_BINDING
=
'tiller-admin'
.
freeze
...
...
lib/gitlab/kubernetes/helm/base_command.rb
View file @
661fd213
...
...
@@ -14,7 +14,7 @@ module Gitlab
ALPINE_VERSION=$(cat /etc/alpine-release | cut -d '.' -f 1,2)
echo http://mirror.clarkson.edu/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
echo http://mirror1.hs-esslingen.de/pub/Mirrors/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
apk add -U wget ca-certificates openssl >/dev/null
apk add -U wget ca-certificates openssl
git
>/dev/null
wget -q -O - https://kubernetes-helm.storage.googleapis.com/helm-v
#{
Gitlab
::
Kubernetes
::
Helm
::
HELM_VERSION
}
-linux-amd64.tar.gz | tar zxC /tmp >/dev/null
mv /tmp/linux-amd64/helm /usr/bin/
HEREDOC
...
...
lib/gitlab/kubernetes/helm/install_command.rb
View file @
661fd213
...
...
@@ -4,21 +4,23 @@ module Gitlab
class
InstallCommand
include
BaseCommand
attr_reader
:name
,
:files
,
:chart
,
:version
,
:repository
attr_reader
:name
,
:files
,
:chart
,
:version
,
:repository
,
:setargs
def
initialize
(
name
:,
chart
:,
files
:,
rbac
:,
version:
nil
,
repository:
nil
)
def
initialize
(
name
:,
chart
:,
files
:,
rbac
:,
version:
nil
,
repository:
nil
,
setargs:
nil
)
@name
=
name
@chart
=
chart
@version
=
version
@rbac
=
rbac
@files
=
files
@repository
=
repository
@setargs
=
setargs
end
def
generate_script
super
+
[
init_command
,
repository_command
,
repository_update_command
,
script_command
].
compact
.
join
(
"
\n
"
)
end
...
...
@@ -37,6 +39,10 @@ module Gitlab
[
'helm'
,
'repo'
,
'add'
,
name
,
repository
].
shelljoin
if
repository
end
def
repository_update_command
'helm repo update >/dev/null'
if
repository
end
def
script_command
command
=
[
'helm'
,
'install'
,
chart
]
+
install_command_flags
...
...
@@ -47,13 +53,15 @@ module Gitlab
name_flag
=
[
'--name'
,
name
]
namespace_flag
=
[
'--namespace'
,
Gitlab
::
Kubernetes
::
Helm
::
NAMESPACE
]
value_flag
=
[
'-f'
,
"/data/helm/
#{
name
}
/config/values.yaml"
]
args_flag
=
optional_install_set_args_flag
name_flag
+
optional_tls_flags
+
optional_version_flag
+
optional_rbac_create_flag
+
namespace_flag
+
value_flag
value_flag
+
args_flag
end
def
optional_rbac_create_flag
...
...
@@ -64,6 +72,15 @@ module Gitlab
%w[--set rbac.create=true,rbac.enabled=true]
end
def
optional_install_set_args_flag
return
[]
unless
setargs
args
=
[]
setargs
.
each
do
|
s
|
args
.
push
(
"--set"
,
s
)
end
end
def
optional_version_flag
return
[]
unless
version
...
...
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
View file @
661fd213
...
...
@@ -24,6 +24,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
<<~
EOS
helm init --client-only >/dev/null
helm repo add app-name https://repository.example.com
helm repo update >/dev/null
#{
helm_install_comand
}
EOS
end
...
...
@@ -51,6 +52,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
<<~
EOS
helm init --client-only >/dev/null
helm repo add app-name https://repository.example.com
helm repo update >/dev/null
#{
helm_install_command
}
EOS
end
...
...
@@ -107,6 +109,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
<<~
EOS
helm init --client-only >/dev/null
helm repo add app-name https://repository.example.com
helm repo update >/dev/null
#{
helm_install_command
}
EOS
end
...
...
@@ -131,6 +134,7 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do
<<~
EOS
helm init --client-only >/dev/null
helm repo add app-name https://repository.example.com
helm repo update >/dev/null
#{
helm_install_command
}
EOS
end
...
...
spec/support/shared_examples/helm_generated_script.rb
View file @
661fd213
...
...
@@ -6,8 +6,8 @@ shared_examples 'helm commands' do
ALPINE_VERSION=$(cat /etc/alpine-release | cut -d '.' -f 1,2)
echo http://mirror.clarkson.edu/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
echo http://mirror1.hs-esslingen.de/pub/Mirrors/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories
apk add -U wget ca-certificates openssl >/dev/null
wget -q -O - https://kubernetes-helm.storage.googleapis.com/helm-v2.
7.2
-linux-amd64.tar.gz | tar zxC /tmp >/dev/null
apk add -U wget ca-certificates openssl
git
>/dev/null
wget -q -O - https://kubernetes-helm.storage.googleapis.com/helm-v2.
11.0
-linux-amd64.tar.gz | tar zxC /tmp >/dev/null
mv /tmp/linux-amd64/helm /usr/bin/
EOS
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