Skip to content

endpoints data source

Description

EndpointsDataSource reads one named Endpoints object.

Source: internal/api/core/v1/endpoints_dsrc.go:30

Example usage:

imports: {
  kubernetes-core-v1: 'github.com/cloudboss/unobin-library-kubernetes//api/core/v1'
}

data-sources: {
  example: kubernetes-core-v1.endpoints {
    # Set input fields here.
  }
}

Inputs

metadata

object
object({
  name: optional(string)
  generate-name: optional(string)
  namespace: optional(string)
  annotations: optional(map(optional(string)))
  labels: optional(map(optional(string)))
})

required

subset

optional(list(object))
optional(
  list(
    object({
      address: optional(
        list(
          object({
            ip: string
            hostname: optional(string)
            node-name: optional(string)
          })
        )
      )
      not-ready-address: optional(
        list(
          object({
            ip: string
            hostname: optional(string)
            node-name: optional(string)
          })
        )
      )
      port: optional(
        list(
          object({
            name: optional(string)
            port: integer
            protocol: optional(string)
          })
        )
      )
    })
  )
)

Input Constraints

Metadata rules

Requirement.

Rule logic
Require
@core.is-match(input.metadata.name, '^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$')
&& @core.length(input.metadata.name ?? '') <= 253

If set, metadata.generate-name must match the specified pattern.

Rule logic
Require
@core.is-match(input.metadata.generate-name, '^([a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?|([a-z0-9][-a-z0-9]{0,61})?[\\x00-\\x7F]-)$')

Conditional requirement.

Rule logic
For each
input.metadata.labels ?? {}
When
@each.value != null
Require
@core.is-match(@each.key, '^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?[A-Za-z0-9]([-A-Za-z0-9_.]*[A-Za-z0-9])?$')
&& @core.is-match(@each.key, '^([^/]{1,253}/)?[^/]{1,63}$')

Conditional requirement.

Rule logic
For each
input.metadata.labels ?? {}
When
@each.value != null
Require
@core.is-match(@each.value, '^([A-Za-z0-9]([-A-Za-z0-9_.]{0,61}[A-Za-z0-9])?)?$')

Conditional requirement.

Rule logic
For each
input.metadata.annotations ?? {}
When
@each.value != null
Require
@core.is-match(@each.key, '^([a-zA-Z0-9İK]([-a-zA-Z0-9İK]*[a-zA-Z0-9İK])?(\\.[a-zA-Z0-9İK]([-a-zA-Z0-9İK]*[a-zA-Z0-9İK])?)*/)?[A-Za-z0-9İK]([-A-Za-z0-9_.İK]*[A-Za-z0-9İK])?$')
&& @core.is-match(@each.key, '^([^/]{1,253}/)?[^/]{1,63}$')

Outputs

metadata

object
object({
  name: string
  generate-name: string
  namespace: string
  annotations: map(string)
  labels: map(string)
  generation: integer
  resource-version: string
  uid: string
})

subset

list(object)
list(
  object({
    address: list(
      object({
        ip: string
        hostname: string
        node-name: string
      })
    )
    not-ready-address: list(
      object({
        ip: string
        hostname: string
        node-name: string
      })
    )
    port: list(
      object({
        name: string
        port: integer
        protocol: string
      })
    )
  })
)