bergerx/kubectl-status

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

Summary

Maintainability
Test Coverage
{{- define "Lease" }}
    {{- /*gotype: github.com/bergerx/kubectl-status/pkg/plugin.RenderableObject */ -}}
    {{- template "status_summary_line" . }}
    {{- template "application_details" . }}
    {{- template "owners" . }}
    {{- "Lease" | bold | nindent 2 }}
    {{- with .Spec.acquireTime }} acquired {{ . | colorAgo }} ago{{ end }}
    {{- with .Spec.renewTime }} renewed {{ . | colorAgo }} ago{{ end }}
    {{- with .Spec.leaseDurationSeconds }} being hold for {{ . | duration }}{{ end }}
    {{- with .Spec.holderIdentity }} by {{ . | bold }}{{ end }}
    {{- with .Spec.leaseTransitions }}{{ if gt . 0 }}{{ printf "Transitioned %d times" . | yellow | nindent 4 }}{{ end }}{{ end }}
    {{- with .Metadata.labels }}{{with index . "kubernetes.io/hostname" }} on host {{ . | bold }}{{ end }}{{ end }}
    {{- template "recent_updates" . }}
    {{- template "events" . }}
{{- end }}