An error occurred while fetching the assigned milestone of the selected merge_request.
This MR not only renames Cluster::Concerns::ApplicationStatus.installed
to Cluster::Concerns::ApplicationStatus.available
but also include applications with the state udpated
to it, so that functions are properly found for Knative installed and updated apps. Explanation below:
After updating Knative, the app state will be updated
instead of installed
.
In our FunctionsController
we find our functions with the Projects::Serverless::FunctionsFinder
:
def finder
Projects::Serverless::FunctionsFinder.new(project.clusters)
end
This finder will try to find the functions for clusters that are included in the Clusters::Cluster.with_knative_installed
:
def execute
knative_services.flatten.compact
end
def knative_service(environment_scope, name)
clusters_with_knative_installed.preload_knative.map do |cluster|
...
end
def clusters_with_knative_installed
@clusters.with_knative_installed
end
ultimately, with_knative_installed
clusters scope will query clusters that have knative applications that are included in the Clusters::Applications::Knative.installed
scope.
scope :with_knative_installed, -> { joins(:application_knative).merge(Clusters::Applications::Knative.installed) }
This change could also fix our Gitlab::UsageData.system_usage_data
which also makes use of the above scope to count the number of installed Knative apps.