Class: Kustomize::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/kustomize/plugin.rb

Direct Known Subclasses

GeneratorPlugin, TransformerPlugin

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#sessionObject

Returns the value of attribute session.



14
15
16
# File 'lib/kustomize/plugin.rb', line 14

def session
  @session
end

Class Method Details

.create(rc, session:) ⇒ Object



4
5
6
7
8
# File 'lib/kustomize/plugin.rb', line 4

def self.create(rc, session:)
  inst = new(rc)
  inst.session = session
  inst
end

.kustomize_plugin_match_api_versionObject



31
32
33
34
35
# File 'lib/kustomize/plugin.rb', line 31

def self.kustomize_plugin_match_api_version
  return @kustomize_plugin_match_api_version if @kustomize_plugin_match_api_version
  api_dir = Pathname.new(__FILE__).parent
  api_dir.relative_path_from(api_dir.parent.parent).to_s
end

.kustomize_plugin_match_kindObject



26
27
28
29
# File 'lib/kustomize/plugin.rb', line 26

def self.kustomize_plugin_match_kind
  return @kustomize_plugin_match_kind if @kustomize_plugin_match_kind
  self.name.split('::').last
end

.match_on(kind: nil, api_version: nil) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/kustomize/plugin.rb', line 16

def self.match_on(kind: nil, api_version: nil)
  if kind
    @kustomize_plugin_match_kind = kind
  end

  if api_version
    @kustomize_plugin_match_api_version = api_version
  end
end