Class: Kubes::Compiler::Dsl::Syntax::Endpoint

Inherits:
Resource
  • Object
show all
Defined in:
lib/kubes/compiler/dsl/syntax/endpoint.rb

Instance Attribute Summary

Attributes inherited from Resource

#kind_from_block

Instance Method Summary collapse

Methods inherited from Resource

#default_metadata, #default_result, #default_result_append, #field, #top

Methods included from Util::Normalize

#extract_type, #normalize_kind

Instance Method Details

#default_apiVersionObject



15
16
17
# File 'lib/kubes/compiler/dsl/syntax/endpoint.rb', line 15

def default_apiVersion
  "v1"
end

#default_kindObject



10
11
12
13
# File 'lib/kubes/compiler/dsl/syntax/endpoint.rb', line 10

def default_kind
  return @kind_from_block if @kind_from_block
  "Endpoints" # always plural
end

#default_subsetsObject



26
27
28
29
30
31
32
# File 'lib/kubes/compiler/dsl/syntax/endpoint.rb', line 26

def default_subsets
  [{
    addresses: addresses,
    notReadyAddresses: notReadyAddresses,
    ports: ports,
  }]
end

#default_topObject



19
20
21
22
23
24
# File 'lib/kubes/compiler/dsl/syntax/endpoint.rb', line 19

def default_top
  top = super
  top.merge(
    subsets: subsets
  )
end