Class: GlooIngressAdapter::RouteTableBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/gloo_ingress_adapter/route_table_builder.rb

Overview

Builder responsible to create a route table for an ingress

Instance Method Summary collapse

Instance Method Details

#build(ingress:) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/gloo_ingress_adapter/route_table_builder.rb', line 8

def build(ingress:)
  attributes = {
    apiVersion: "gateway.solo.io/v1",
    kind: "RouteTable",
    metadata: {
      name: ingress..name,
      namespace: ingress..namespace,
      labels: build_labels(ingress:),
      ownerReferences: [
        {
          apiVersion: "networking.k8s.io/v1",
          kind: "Ingress",
          name: ingress..name,
          uid: ingress..uid,
        },
      ],
    },
    spec: {
      routes: build_routes(ingress:),
    },
  }

  Kubeclient::Resource.new(attributes)
end