Class: Kubes::Compiler::Dsl::Syntax::Role

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

Direct Known Subclasses

ClusterRole

Instance Attribute Summary

Attributes inherited from Resource

#kind_from_block

Instance Method Summary collapse

Methods inherited from Resource

#default_apiVersion, #default_kind, #default_metadata, #default_result, #default_result_append, #field, #top

Methods included from Util::Normalize

#extract_type, #normalize_kind

Instance Method Details

#apiVersionObject



12
13
14
# File 'lib/kubes/compiler/dsl/syntax/role.rb', line 12

def apiVersion
  "rbac.authorization.k8s.io/v1"
end

#default_ruleObject



30
31
32
33
34
35
36
37
38
# File 'lib/kubes/compiler/dsl/syntax/role.rb', line 30

def default_rule
  {
    apiGroups: apiGroups,
    nonResourceURLs: nonResourceURLs,
    resourceNames: resourceNames,
    resources: resources,
    verbs: verbs,
  }
end

#default_rulesObject



26
27
28
# File 'lib/kubes/compiler/dsl/syntax/role.rb', line 26

def default_rules
  [default_rule]
end

#default_topObject

override superclass method - no spec



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

def default_top
  {
    apiVersion: apiVersion,
    kind: kind,
    metadata: ,
    rules: rules,
  }
end