Skip to content

cluster-role data source

Description

ClusterRoleDataSource reads one cluster-scoped ClusterRole by name.

Source: internal/api/rbac/v1/cluster_role_dsrc.go:19

Example usage:

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

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

Inputs

metadata

object
object({
  name: string
})

required

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 == '..')

Outputs

metadata

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

rules

optional(list(object))
optional(
  list(
    object({
      api-groups: list(string)
      resources: list(string)
      verbs: list(string)
      resource-names: list(string)
      non-resource-urls: list(string)
    })
  )
)

aggregation-rule

optional(object)
optional(
  object({
    cluster-role-selectors: list(
      object({
        match-labels: map(string)
        match-expressions: list(
          object({
            key: string
            operator: string
            values: list(string)
          })
        )
      })
    )
  })
)