Skip to content

persistent-volume-claim data source

Description

PersistentVolumeClaimDataSource reads a namespaced claim by its exact name.

Source: internal/api/core/v1/persistent_volume_claim_dsrc.go:20

Example usage:

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

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

Inputs

metadata

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

required

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

Requirement.

Rule logic
For each
input.metadata.labels ?? {}
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}$')

If set, @each.value must match the specified pattern.

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

Requirement.

Rule logic
For each
input.metadata.annotations ?? {}
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
  namespace: string
  generate-name: string
  annotations: map(string)
  labels: map(string)
  generation: integer
  resource-version: string
  uid: string
})

spec

optional(object)
optional(
  object({
    access-modes: list(string)
    resources: object({
      limits: map(string)
      requests: map(string)
    })
    selector: optional(
      object({
        match-labels: optional(map(string))
        match-expressions: optional(
          list(
            object({
              key: optional(string)
              operator: optional(string)
              values: optional(list(string))
            })
          )
        )
      })
    )
    volume-name: string
    storage-class-name: string
    volume-mode: string
  })
)