class Kustomize::Transform::FilterForSessionSpecifiedComponentTransform

Constants

ANNOTS_LENS
COMPONENT_ANNOT_NAME
DROP_ANNOT_NAME

Public Class Methods

new(component_name) click to toggle source
# File lib/kustomize/transform/filter_for_session_specified_component_transform.rb, line 8
def initialize(component_name)
  @component_name = component_name
end

Public Instance Methods

rewrite(rc) click to toggle source
# File lib/kustomize/transform/filter_for_session_specified_component_transform.rb, line 17
def rewrite(rc)
  ANNOTS_LENS.update_in(rc) do |orig_annots|
    orig_annots ||= {}

    if orig_annots[COMPONENT_ANNOT_NAME] == @component_name
      :keep
    else
      new_annots = orig_annots.merge({DROP_ANNOT_NAME => 'true'})
      [:set, new_annots]
    end
  end
end