Class: Kube::Cluster::Standard::MetaController::DecoratorController

Inherits:
Object
  • Object
show all
Defined in:
lib/kube/cluster/standard/meta_controller/decorator_controller.rb

Instance Method Summary collapse

Constructor Details

#initialize(name:, webhook_url:, resync_period: 30, resources: {}, attachments: {}, &block) ⇒ DecoratorController

Returns a new instance of DecoratorController.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/kube/cluster/standard/meta_controller/decorator_controller.rb', line 11

def initialize(
  name:, webhook_url:,
  resync_period: 30, resources: {}, attachments: {}, &block
)

  resolved_resources   = resolve_hash(resources)
  resolved_attachments = resolve_hash(attachments)

  super() {
    .name = name

    spec.resources           = resolved_resources
    spec.attachments         = resolved_attachments
    spec.resyncPeriodSeconds = resync_period
    spec.hooks.sync.webhook  = { url: webhook_url }

    instance_exec(&block) if block
  }
end