Module: PuppetX::Sensu::AgentEntityConfig

Defined in:
lib/puppet_x/sensu/agent_entity_config.rb

Class Method Summary collapse

Class Method Details

.check_redacted(entity) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/puppet_x/sensu/agent_entity_config.rb', line 16

def self.check_redacted(entity)
   = entity.fetch('metadata', {})
  labels = .fetch('labels', {})
  annotations = .fetch('annotations', {})
  (labels || {}).each_pair do |key,value|
    return true if value == 'REDACTED'
  end
  (annotations || {}).each_pair do |key,value|
    return true if value == 'REDACTED'
  end
  return false
end

.config_classesObject



4
5
6
7
8
9
10
11
# File 'lib/puppet_x/sensu/agent_entity_config.rb', line 4

def self.config_classes
  {
    'subscriptions' => [],
    'labels'        => {},
    'annotations'   => {},
    'redact'        => [],
  }
end

.metadata_configsObject



12
13
14
# File 'lib/puppet_x/sensu/agent_entity_config.rb', line 12

def self.
  [ 'labels', 'annotations' ]
end