diff options
author | Michael Kozono <mkozono@gmail.com> | 2019-08-05 16:48:32 +0000 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2019-08-05 16:48:32 +0000 |
commit | 9982cec611d0850cfe46d862b9468a85637a4700 (patch) | |
tree | 311c83ce5ee4dbb987844b32457ac90c56420eaa | |
parent | 112ba0803a32419c50eb2f7a82bba6cfaee1cb48 (diff) | |
parent | 07572a93ac5f111b04a191636adcb1e2a5958457 (diff) | |
download | gitlab-ce-9982cec611d0850cfe46d862b9468a85637a4700.tar.gz |
Merge branch 'explicit-helm-factory-certs' into 'master'
Use stubbed key and certificate in Helm factory
See merge request gitlab-org/gitlab-ce!31169
-rw-r--r-- | spec/factories/clusters/applications/helm.rb | 14 | ||||
-rw-r--r-- | spec/fixtures/clusters/sample_key.key | 9 |
2 files changed, 23 insertions, 0 deletions
diff --git a/spec/factories/clusters/applications/helm.rb b/spec/factories/clusters/applications/helm.rb index 24c22ef3928..89f7bc15217 100644 --- a/spec/factories/clusters/applications/helm.rb +++ b/spec/factories/clusters/applications/helm.rb @@ -4,6 +4,20 @@ FactoryBot.define do factory :clusters_applications_helm, class: Clusters::Applications::Helm do cluster factory: %i(cluster provided_by_gcp) + before(:create) do + allow(Gitlab::Kubernetes::Helm::Certificate).to receive(:generate_root) + .and_return( + double( + key_string: File.read(Rails.root.join('spec/fixtures/clusters/sample_key.key')), + cert_string: File.read(Rails.root.join('spec/fixtures/clusters/sample_cert.pem')) + ) + ) + end + + after(:create) do + allow(Gitlab::Kubernetes::Helm::Certificate).to receive(:generate_root).and_call_original + end + trait :not_installable do status(-2) end diff --git a/spec/fixtures/clusters/sample_key.key b/spec/fixtures/clusters/sample_key.key new file mode 100644 index 00000000000..4ddb20b0922 --- /dev/null +++ b/spec/fixtures/clusters/sample_key.key @@ -0,0 +1,9 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIBOgIBAAJBAMA5sXIBE0HwgIB40iNidN4PGWzOyLQK0bsdOBNgpEXkDlZBvnak +OUgAPF+rME4PB0Yl415DabUI40T5UNmlwxcCAwEAAQJAZtY2pSwIFm3JAXIh0cZZ +iXcAfiJ+YzuqinUOS+eW2sBCAEzjcARlU/o6sFQgtsOi4FOMczAd1Yx8UDMXMmrw +2QIhAPBgVhJiTF09pdmeFWutCvTJDlFFAQNbrbo2X2x/9WF9AiEAzLgqMKeStSRu +H9N16TuDrUoO8R+DPqriCwkKrSHaWyMCIFzMhE4inuKcSywBaLmiG4m3GQzs++Al +A6PRG/PSTpQtAiBxtBg6zdf+JC3GH3zt/dA0/10tL4OF2wORfYQghRzyYQIhAL2l +0ZQW+yLIZAGrdBFWYEAa52GZosncmzBNlsoTgwE4 +-----END RSA PRIVATE KEY-----
\ No newline at end of file |