diff options
author | Chris Baumbauer <cab@cabnetworks.net> | 2018-11-06 10:55:18 +0300 |
---|---|---|
committer | Chris Baumbauer <cab@cabnetworks.net> | 2018-11-06 10:55:18 +0300 |
commit | 97441486ceb3522fc5d3ff9e52a9d93e07bc8961 (patch) | |
tree | bc7774f06c43b3b6131b2e036cd3e1695f0b226c /spec/lib/gitlab/kubernetes/helm/install_command_spec.rb | |
parent | 1435fe60752728790544ed07bf4c95fc3ba39efe (diff) |
Fix issue with missing knative cluster role binding, and cleanup tests
Diffstat (limited to 'spec/lib/gitlab/kubernetes/helm/install_command_spec.rb')
-rw-r--r-- | spec/lib/gitlab/kubernetes/helm/install_command_spec.rb | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/spec/lib/gitlab/kubernetes/helm/install_command_spec.rb b/spec/lib/gitlab/kubernetes/helm/install_command_spec.rb index bbe7cbe05c5..ed879350004 100644 --- a/spec/lib/gitlab/kubernetes/helm/install_command_spec.rb +++ b/spec/lib/gitlab/kubernetes/helm/install_command_spec.rb @@ -5,6 +5,8 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do let(:repository) { 'https://repository.example.com' } let(:rbac) { false } let(:version) { '1.2.3' } + let(:preinstall) { nil } + let(:postinstall) { nil } let(:install_command) do described_class.new( @@ -13,7 +15,9 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do rbac: rbac, files: files, version: version, - repository: repository + repository: repository, + preinstall: preinstall, + postinstall: postinstall ) end @@ -101,6 +105,53 @@ describe Gitlab::Kubernetes::Helm::InstallCommand do end end + context 'when there is a pre-install script' do + let(:preinstall) { ['/bin/date', '/bin/true'] } + + it_behaves_like 'helm commands' do + let(:commands) 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 + + let(:helm_install_command) do + <<~EOS.strip + /bin/date + /bin/true + helm install chart-name --name 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 --version 1.2.3 --namespace gitlab-managed-apps -f /data/helm/app-name/config/values.yaml >/dev/null + EOS + end + end + end + + context 'when there is a post-install script' do + let(:postinstall) { ['/bin/date', "/bin/false\n"] } + + it_behaves_like 'helm commands' do + let(:commands) 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 + + let(:helm_install_command) do + <<~EOS.strip + helm install chart-name --name 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 --version 1.2.3 --namespace gitlab-managed-apps -f /data/helm/app-name/config/values.yaml >/dev/null + + /bin/date + /bin/false + EOS + end + end + end + context 'when there is no ca.pem file' do let(:files) { { 'file.txt': 'some content' } } |