Commit be1fe010 authored by Alishan Ladhani's avatar Alishan Ladhani

Add association to serverless_domain_cluster

parent be33ee25
...@@ -11,6 +11,8 @@ module Clusters ...@@ -11,6 +11,8 @@ module Clusters
self.table_name = 'clusters_applications_knative' self.table_name = 'clusters_applications_knative'
has_one :serverless_domain_cluster, class_name: 'Serverless::DomainCluster', foreign_key: 'clusters_applications_knative_id', inverse_of: :knative
include ::Clusters::Concerns::ApplicationCore include ::Clusters::Concerns::ApplicationCore
include ::Clusters::Concerns::ApplicationStatus include ::Clusters::Concerns::ApplicationStatus
include ::Clusters::Concerns::ApplicationVersion include ::Clusters::Concerns::ApplicationVersion
......
...@@ -16,6 +16,10 @@ describe Clusters::Applications::Knative do ...@@ -16,6 +16,10 @@ describe Clusters::Applications::Knative do
allow(ClusterWaitForIngressIpAddressWorker).to receive(:perform_async) allow(ClusterWaitForIngressIpAddressWorker).to receive(:perform_async)
end end
describe 'associations' do
it { is_expected.to have_one(:serverless_domain_cluster).class_name('Serverless::DomainCluster').with_foreign_key('clusters_applications_knative_id').inverse_of(:knative) }
end
describe 'when cloud run is enabled' do describe 'when cloud run is enabled' do
let(:cluster) { create(:cluster, :provided_by_gcp, :cloud_run_enabled) } let(:cluster) { create(:cluster, :provided_by_gcp, :cloud_run_enabled) }
let(:knative_cloud_run) { create(:clusters_applications_knative, cluster: cluster) } let(:knative_cloud_run) { create(:clusters_applications_knative, cluster: cluster) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment