lib/pharos/phases/apply_manifests.rb
def load_manifests(path)
        path = Pathname.new(path).freeze
        files = if File.file?(path)
                  [path]
                else
                  Pathname.glob(path.join('*.{yml,yaml,yml.erb,yaml.erb}')).sort_by(&:to_s)
                end
        resources = files.flat_map do |file|
          Pharos::YamlFile.new(file).load_stream do |doc|
            K8s::Resource.new(doc)
          end
        end.select do |r|
          # Take in only resources that are valid kube resources
          r.kind && r.apiVersion
        end

        resources
      end
# Load resources from path containing erb-templated YAML files
#
# @param path [String]
# @return [Array<K8s::Resource>]
Load resources from path containing erb-templated YAML files
Load resources from path containing erb - templated YAML files
def load_manifests(path)
        path = Pathname.new(path).freeze
        files = if File.file?(path)
                  [path]
                else
                  Pathname.glob(path.join('*.{yml,yaml,yml.erb,yaml.erb}')).sort_by(&:to_s)
                end
        resources = files.flat_map do |file|
          Pharos::YamlFile.new(file).load_stream do |doc|
            K8s::Resource.new(doc)
          end
        end.select do |r|
          r.kind && r.apiVersion
        end
        resources
      end
def load_manifests ( path ) path = Pathname . new ( path ) . freeze files = if File . file? ( path ) [ path ] else Pathname . glob ( path . join ( '*.{yml,yaml,yml.erb,yaml.erb}' ) ) . sort_by ( & :to_s ) end resources = files . flat_map do | file | Pharos :: YamlFile . new ( file ) . load_stream do | doc | K8s :: Resource . new ( doc ) end end . select do | r | r . kind && r . apiVersion end resources end
Load resources from path containing erb-templated YAML files
Load resources from path containing erb - templated YAML files
# Take in only resources that are valid kube resources
None
Array<K8s::Resource>
path
None