MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / SanitizeExtensionNameForVolume

Function SanitizeExtensionNameForVolume

pkg/specs/volumes.go:338–340  ·  view source on GitHub ↗

SanitizeExtensionNameForVolume returns a prefixed, RFC 1123 compliant volume name for an extension. The 4-character "ext-" prefix is what bounds ExtensionConfiguration.Name to MaxLength=59 (RFC 1123 label limit of 63, minus the prefix). The upgrade-target counterpart uses an equally-sized "new-" pr

(extensionName string)

Source from the content-addressed store, hash-verified

336// upgrade-target counterpart uses an equally-sized "new-" prefix on purpose,
337// so adjusting either one requires updating the API's MaxLength too.
338func SanitizeExtensionNameForVolume(extensionName string) string {
339 return "ext-" + strings.ReplaceAll(extensionName, "_", "-")
340}
341
342// SanitizeExtensionNameForUpgradeTargetVolume returns the RFC 1123 compliant
343// volume name for a target-version extension during a major upgrade. The

Callers 5

validateExtensionsMethod · 0.92
normalizeVolumeNameFunction · 0.85
normalizeVolumeMountNameFunction · 0.85
volumes_test.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected