certs

package
v0.30.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderReport

func RenderReport(w io.Writer, report *Report)

RenderReport writes the certificate expiration report to w in two sections: leaf certificates followed by certificate authorities.

Types

type CAEntry

type CAEntry struct {
	Name    string
	Expires time.Time
}

CAEntry represents a CA certificate in the report.

type CertEntry

type CertEntry struct {
	Name      string
	Expires   time.Time
	Authority string
}

CertEntry represents a non-CA certificate in the report.

type Report

type Report struct {
	Certs []CertEntry
	CAs   []CAEntry
}

Report holds the result of a certificate expiration check.

func BuildFullScanReport

func BuildFullScanReport(certsDir, kubeconfigDir string) (*Report, error)

BuildFullScanReport enumerates all known control-plane certificates and kubeconfig client certificates, returning a report split into CAs and leaf certs. certsDir is the PKI directory (e.g. /etc/kubernetes/pki). kubeconfigDir is the directory containing kubeconfig files (e.g. /etc/kubernetes). Callers that want the standard layout can pass filepath.Dir(certsDir).

func BuildSingleFileReport

func BuildSingleFileReport(path string) (*Report, error)

BuildSingleFileReport inspects a single file at path. It tries kubeconfig parsing first; if that fails it falls back to PEM certificate parsing. If both parsers fail, the combined error is returned.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL