Class: KubeDSL::DSL::Networking::V1::NetworkPolicySpec

Inherits:
KubeDSL::DSLObject show all
Defined in:
lib/kube-dsl/dsl/networking/v1/network_policy_spec.rb

Instance Method Summary collapse

Methods inherited from KubeDSL::DSLObject

#initialize, #to_resource

Methods included from ValueFields

#array_field, #object_field, #value_field, #value_fields

Constructor Details

This class inherits a constructor from KubeDSL::DSLObject

Instance Method Details

#kind_symObject



17
18
19
# File 'lib/kube-dsl/dsl/networking/v1/network_policy_spec.rb', line 17

def kind_sym
  :network_policy_spec
end

#serializeObject



8
9
10
11
12
13
14
15
# File 'lib/kube-dsl/dsl/networking/v1/network_policy_spec.rb', line 8

def serialize
  {}.tap do |result|
    result[:policyTypes] = policy_types
    result[:egress] = egresses.map(&:serialize)
    result[:ingress] = ingresses.map(&:serialize)
    result[:podSelector] = pod_selector.serialize
  end
end