2020-01-01 13:55:28 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Gitlab::Kubernetes::Helm::InitCommand do
|
2020-05-24 23:13:21 +05:30
|
|
|
subject(:init_command) { described_class.new(name: application.name, files: files, rbac: rbac) }
|
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
let(:application) { create(:clusters_applications_helm) }
|
2018-11-20 20:47:30 +05:30
|
|
|
let(:rbac) { false }
|
|
|
|
let(:files) { {} }
|
2018-03-27 19:54:05 +05:30
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
it_behaves_like 'helm command generator' do
|
|
|
|
let(:commands) do
|
|
|
|
<<~EOS
|
|
|
|
helm init --tiller-tls --tiller-tls-verify --tls-ca-cert /data/helm/helm/config/ca.pem --tiller-tls-cert /data/helm/helm/config/cert.pem --tiller-tls-key /data/helm/helm/config/key.pem
|
|
|
|
EOS
|
|
|
|
end
|
2018-11-20 20:47:30 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
context 'on a rbac-enabled cluster' do
|
|
|
|
let(:rbac) { true }
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
it_behaves_like 'helm command generator' do
|
2018-11-20 20:47:30 +05:30
|
|
|
let(:commands) do
|
|
|
|
<<~EOS
|
2019-02-15 15:39:39 +05:30
|
|
|
helm init --tiller-tls --tiller-tls-verify --tls-ca-cert /data/helm/helm/config/ca.pem --tiller-tls-cert /data/helm/helm/config/cert.pem --tiller-tls-key /data/helm/helm/config/key.pem --service-account tiller
|
2018-11-20 20:47:30 +05:30
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
it_behaves_like 'helm command' do
|
|
|
|
let(:command) { init_command }
|
2018-11-20 20:47:30 +05:30
|
|
|
end
|
2018-03-27 19:54:05 +05:30
|
|
|
end
|