bergerx/kubectl-status

View on GitHub
pkg/plugin/templates/PersistentVolumeClaim.tmpl

Summary

Maintainability
Test Coverage
{{- define "PersistentVolumeClaim" }}
    {{- /*gotype: github.com/bergerx/kubectl-status/pkg/plugin.RenderableObject*/ -}}
    {{- template "status_summary_line" . }}
    {{- template "kstatus_summary" . }}
    {{- template "finalizer_details_on_termination" . }}
    {{- template "application_details" . }}
    {{- template "conditions_summary" . }}
    {{- "PVC" | nindent 2 }}
    {{- with .Spec.volumeName }} uses {{ "PersistentVolume" | bold }}/{{ . }}{{ end }}
    {{- with .Spec.volumeMode }}, with {{ . | bold }} mode{{ end }}
    {{- with .Status.capacity.storage }}, asks for {{ . | bold }}{{ end }}
    {{- with index .Annotations "volume.beta.kubernetes.io/storage-provisioner" }}, provisioned by {{ . | bold }}{{ end }}
    {{- with index .Annotations "volume.kubernetes.io/selected-node" }}, attached on {{ "Node" | bold }}/{{ . }}{{ end }}
    {{- if not .Spec.volumeName }}
        {{- "Pending" | red | bold | nindent 2 }}: This PVC doesnt yet have a paired PV.
    {{- end }}
    {{- template "recent_updates" . }}
    {{- template "events" . }}
    {{- template "owners" . }}
    {{- with $volumeName := .Spec.volumeName }}
        {{- if $.Config.GetBool "include-volumes" }}
            {{- "Binds:" | nindent 2 }}
            {{- $pv := $.KubeGetFirst "" "PersistentVolume" $volumeName }}
            {{- $.Include "PersistentVolume" $pv | nindent 4 -}}
        {{- else }}
            {{- "Binds:" | nindent 2 }} PersistentVolume/{{ $volumeName }}
        {{- end }}
    {{- end }}
{{- end -}}