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
620e2d7c
Commit
620e2d7c
authored
Oct 15, 2019
by
James Fargher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed cert-manager retry logic to apply correct exit code
parent
f563de19
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
12 deletions
+13
-12
app/models/clusters/applications/cert_manager.rb
app/models/clusters/applications/cert_manager.rb
+1
-1
lib/gitlab/kubernetes/helm/client_command.rb
lib/gitlab/kubernetes/helm/client_command.rb
+2
-1
spec/lib/gitlab/kubernetes/helm/delete_command_spec.rb
spec/lib/gitlab/kubernetes/helm/delete_command_spec.rb
+2
-2
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
+7
-7
spec/models/clusters/applications/cert_manager_spec.rb
spec/models/clusters/applications/cert_manager_spec.rb
+1
-1
No files found.
app/models/clusters/applications/cert_manager.rb
View file @
620e2d7c
...
...
@@ -65,7 +65,7 @@ module Clusters
end
def
retry_command
(
command
)
"for i in $(seq 1 30); do
#{
command
}
&&
break; sleep 1s; echo
\"
Retrying ($i)...
\"
; false; done
"
"for i in $(seq 1 30); do
#{
command
}
&&
s=0 && break || s=$?; sleep 1s; echo
\"
Retrying ($i)...
\"
; done; (exit $s)
"
end
def
post_delete_script
...
...
lib/gitlab/kubernetes/helm/client_command.rb
View file @
620e2d7c
...
...
@@ -17,7 +17,8 @@ module Gitlab
# 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_check
}
&& break; sleep 1s; echo
\"
Retrying ($i)...
\"
; false; done"
"for i in $(seq 1 30); do
#{
helm_check
}
&& s=0 && break || s=$?; sleep 1s; echo
\"
Retrying ($i)...
\"
; done; (exit $s)"
end
def
repository_command
...
...
spec/lib/gitlab/kubernetes/helm/delete_command_spec.rb
View file @
620e2d7c
...
...
@@ -14,7 +14,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)..."; false; done
for i in $(seq 1 30); do helm version &&
s=0 && break || s=$?; sleep 1s; echo
\"
Retrying ($i)...
\"
; done; (exit $s)
helm delete --purge app-name
EOS
end
...
...
@@ -36,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
#{
tls_flags
}
&&
break; sleep 1s; echo "Retrying ($i)..."; false; done
for i in $(seq 1 30); do helm version
#{
tls_flags
}
&&
s=0 && break || s=$?; sleep 1s; echo
\"
Retrying ($i)...
\"
; done; (exit $s)
#{
helm_delete_command
}
EOS
end
...
...
spec/lib/gitlab/kubernetes/helm/install_command_spec.rb
View file @
620e2d7c
...
...
@@ -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
#{
tls_flags
}
&&
break; sleep 1s; echo "Retrying ($i)..."; false; done
for i in $(seq 1 30); do helm version
#{
tls_flags
}
&&
s=0 && break || s=$?; sleep 1s; echo
\"
Retrying ($i)...
\"
; done; (exit $s)
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
#{
tls_flags
}
&&
break; sleep 1s; echo "Retrying ($i)..."; false; done
for i in $(seq 1 30); do helm version
#{
tls_flags
}
&&
s=0 && break || s=$?; sleep 1s; echo
\"
Retrying ($i)...
\"
; done; (exit $s)
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
#{
tls_flags
}
&&
break; sleep 1s; echo "Retrying ($i)..."; false; done
for i in $(seq 1 30); do helm version
#{
tls_flags
}
&&
s=0 && break || s=$?; sleep 1s; echo
\"
Retrying ($i)...
\"
; done; (exit $s)
#{
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
#{
tls_flags
}
&&
break; sleep 1s; echo "Retrying ($i)..."; false; done
for i in $(seq 1 30); do helm version
#{
tls_flags
}
&&
s=0 && break || s=$?; sleep 1s; echo
\"
Retrying ($i)...
\"
; done; (exit $s)
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
#{
tls_flags
}
&&
break; sleep 1s; echo "Retrying ($i)..."; false; done
for i in $(seq 1 30); do helm version
#{
tls_flags
}
&&
s=0 && break || s=$?; sleep 1s; echo
\"
Retrying ($i)...
\"
; done; (exit $s)
helm repo add app-name https://repository.example.com
helm repo update
#{
helm_install_command
}
...
...
@@ -182,7 +182,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)..."; false; done
for i in $(seq 1 30); do helm version &&
s=0 && break || s=$?; sleep 1s; echo
\"
Retrying ($i)...
\"
; done; (exit $s)
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
#{
tls_flags
}
&&
break; sleep 1s; echo "Retrying ($i)..."; false; done
for i in $(seq 1 30); do helm version
#{
tls_flags
}
&&
s=0 && break || s=$?; sleep 1s; echo
\"
Retrying ($i)...
\"
; done; (exit $s)
helm repo add app-name https://repository.example.com
helm repo update
#{
helm_install_command
}
...
...
spec/models/clusters/applications/cert_manager_spec.rb
View file @
620e2d7c
...
...
@@ -54,7 +54,7 @@ describe Clusters::Applications::CertManager do
'kubectl label --overwrite namespace gitlab-managed-apps certmanager.k8s.io/disable-validation=true'
])
expect
(
subject
.
postinstall
).
to
eq
([
'for i in $(seq 1 30); do kubectl apply -f /data/helm/certmanager/config/cluster_issuer.yaml && break; sleep 1s; echo "Retrying ($i)..."; false; done'
"for i in $(seq 1 30); do kubectl apply -f /data/helm/certmanager/config/cluster_issuer.yaml && s=0 && break || s=$?; sleep 1s; echo
\"
Retrying ($i)...
\"
; done; (exit $s)"
])
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