diff options
author | Chris Baumbauer <cab@cabnetworks.net> | 2018-11-26 23:02:33 +0300 |
---|---|---|
committer | Chris Baumbauer <cab@cabnetworks.net> | 2018-11-26 23:46:00 +0300 |
commit | 2937be7b0c46ae97aa89572a9a349ed636198696 (patch) | |
tree | 49757cdd159b2385600d9a08ede07caf07a31313 /spec/support/shared_examples/services | |
parent | 95ebdf3053ef9aeba657ff9bf1a5a66b608cc6dc (diff) |
Expose external_ip to knative cluster application
Diffstat (limited to 'spec/support/shared_examples/services')
-rw-r--r-- | spec/support/shared_examples/services/check_ingress_ip_address_service_shared_examples.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/support/shared_examples/services/check_ingress_ip_address_service_shared_examples.rb b/spec/support/shared_examples/services/check_ingress_ip_address_service_shared_examples.rb new file mode 100644 index 00000000000..14638a574a5 --- /dev/null +++ b/spec/support/shared_examples/services/check_ingress_ip_address_service_shared_examples.rb @@ -0,0 +1,33 @@ +shared_examples 'check ingress ip executions' do |app_name| + describe '#execute' do + let(:application) { create(app_name, :installed) } + let(:service) { described_class.new(application) } + let(:kubeclient) { double(::Kubeclient::Client, get_service: kube_service) } + + context 'when the ingress ip address is available' do + it 'updates the external_ip for the app' do + subject + + expect(application.external_ip).to eq('111.222.111.222') + end + end + + context 'when the ingress ip address is not available' do + let(:ingress) { nil } + + it 'does not error' do + subject + end + end + + context 'when the exclusive lease cannot be obtained' do + it 'does not call kubeclient' do + stub_exclusive_lease_taken(lease_key, timeout: 15.seconds.to_i) + + subject + + expect(kubeclient).not_to have_received(:get_service) + end + end + end +end |