Help us shape the future of Go! Take the 2026 Go Developer Survey

certs

package
v0.34.7 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 12 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.

func RunRenewAll added in v0.31.0

func RunRenewAll(w io.Writer, certsDir, kubeconfigDirOverride string, dryRun bool, extraIP net.IP) error

RunRenewAll renews every known control-plane leaf certificate and kubeconfig client certificate.

func RunRenewSingle added in v0.31.0

func RunRenewSingle(w io.Writer, path, certsDir, kubeconfigDirOverride string, dryRun, pathExplicit bool) error

RunRenewSingle renews a single artifact identified by path: it auto-detects whether path is a kubeconfig file or a PEM leaf certificate. For artifacts outside the default /etc/kubernetes layout, --path must be set explicitly.

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