Skip to content

role-binding data source

Description

RoleBindingDataSource reads one live RoleBinding without changing it.

Source: internal/api/rbac/v1/role_binding_dsrc.go:20

Example usage:

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

data-sources: {
  example: kubernetes-rbac-v1.role-binding {
    # Set input fields here.
  }
}

Inputs

metadata

object
object({
  name: string
  namespace: optional(string)
})

required

Metadata selects the required name and optional namespace, which defaults to default.

Input Constraints

Metadata rules

Requirement.

Rule logic
Require
@core.length(input.metadata.name) >= 1
&& @core.is-match(input.metadata.name, '^[^/%]*$')
&& !(input.metadata.name == '.' || input.metadata.name == '..')

Conditional requirement.

Rule logic
When
input.metadata.namespace != null
Require
@core.is-match(input.metadata.namespace, '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$')
&& @core.length(input.metadata.namespace) <= 63

Outputs

metadata

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

role-ref

optional(object)
optional(
  object({
    api-group: string
    kind: string
    name: string
  })
)

subjects

optional(list(object))
optional(
  list(
    object({
      kind: string
      api-group: string
      name: string
      namespace: string
    })
  )
)