{{/* Each level is a map with the key being the directory name */}}
{{/* $Site.Data.crds /$version/crds/yaml */}}
{{ range $filename,$content := index $.Site.Data.crds .Section "api" "yaml" }}
{{ with $content }}
{{ $url := .ResourceType }}
{{ $kind := .spec.names.kind }}
{{ $group := .spec.group }}
{{ $version := "" }}
{{ $description := "" }}
{{ $schemaScratch := newScratch }} {{/* Temporary variable used to prune fields from the larger spec */}}
{{ $schemaWithStatus := dict }} {{/* The pruned schema to work with */}}
{{ $bigName := gt (len $kind) 32 }} {{/* Long names overrun the display and cause problems. This allows for applying custom styles */}}
{{/* Iterate over each version and find the "storage: true" version */}}
{{ range .spec.versions }}
{{ if index . "storage" }}
{{ $version = .name }}
{{ $schemaScratch.Set "oAPI" (index . "schema" "openAPIV3Schema" "properties") }}
{{/* Pull out the top-level Kind description and delete unnecessary fields */}}
{{ $description = (index . "schema" "openAPIV3Schema" "description") }}
{{ $schemaScratch.DeleteInMap "oAPI" "apiVersion" }}
{{ $schemaScratch.DeleteInMap "oAPI" "kind" }}
{{ $schemaScratch.DeleteInMap "oAPI" "metadata" }}
{{ $schemaScratch.DeleteInMap "oAPI" "description" }}
{{ $schemaWithStatus = $schemaScratch.Get "oAPI" }}
{{ end }}
{{ end }}
{{/* the crd-root-row is a top level CRD row */}}
{{/* Collapse/Expand Button and Kind name */}}
{{/* Plus/Minus Button */}}
{{/* CRD name text */}}
{{/* If the CRD name is longer than 24 characters hide the other fields, regardless of viewport size */}}
{{ $group }}/{{ $version }}
Expand All
Collapse All
{{/* The container to show/hide with information related to the CRD */}}
{{ define "buildCRD" }}
{{/* The first field (spec) has a different schema compared to the child nodes */}}
{{ if .isFirst }}
{{ $elemID := (printf "%s-%s" .kind .key) }}
{{ $dataTypeStyle := .schema.type }}
{{ $dataType := .schema.type }}
{{ $description := .schema.description }}
{{ $properties := .schema.properties }}
{{ $required := .schema.required }}
{{/* Special handling for arrays to check if it's a list of 'items' */}}
{{ if eq .schema.type "array" }}
{{ if .schema.items }}
{{ $dataType = (printf "[ ]%s" .schema.items.type) }}
{{ $dataTypeStyle = .schema.items.type }}
{{ $description = .schema.items.description }}
{{ $properties = .schema.items.properties }}
{{ $required = .schema.items.required }}
{{ else }}
{{ $dataType = (printf "[ ]%s" .schema.type) }}
{{ end }}
{{ end }}
{{/* Plus/Minus Button */}}
{{/* CRD name text */}}
{{/* Anchor link icon */}}
{{/* The container to show/hide with information related to the CRD */}}