summaryrefslogtreecommitdiff
path: root/app/finders/packages/helm/package_files_finder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders/packages/helm/package_files_finder.rb')
-rw-r--r--app/finders/packages/helm/package_files_finder.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/finders/packages/helm/package_files_finder.rb b/app/finders/packages/helm/package_files_finder.rb
new file mode 100644
index 00000000000..74f9eaaca82
--- /dev/null
+++ b/app/finders/packages/helm/package_files_finder.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+module Packages
+ module Helm
+ class PackageFilesFinder
+ def initialize(project, channel, params = {})
+ @project = project
+ @channel = channel
+ @params = params
+ end
+
+ def execute
+ package_files = Packages::PackageFile.for_helm_with_channel(@project, @channel).preload_helm_file_metadata
+ by_file_name(package_files)
+ end
+
+ private
+
+ def by_file_name(files)
+ return files unless @params[:file_name]
+
+ files.with_file_name(@params[:file_name])
+ end
+ end
+ end
+end