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

Function compareVolumeMounts

pkg/specs/podspec_diff.go:196–209  ·  view source on GitHub ↗
(currentMounts, targetMounts []corev1.VolumeMount)

Source from the content-addressed store, hash-verified

194}
195
196func compareVolumeMounts(currentMounts, targetMounts []corev1.VolumeMount) (bool, string) {
197 current := make(map[string]corev1.VolumeMount)
198 target := make(map[string]corev1.VolumeMount)
199 for _, mount := range currentMounts {
200 normalized := normalizeVolumeMountName(mount)
201 mount.Name = normalized
202 current[normalized] = mount
203 }
204 for _, mount := range targetMounts {
205 target[mount.Name] = mount
206 }
207
208 return compareMaps(current, target)
209}
210
211// doContainersMatch checks if the containers match. They are assumed to be for the same name.
212// If they don't match, the first diff found is returned

Callers 2

doContainersMatchFunction · 0.85

Calls 2

normalizeVolumeMountNameFunction · 0.85
compareMapsFunction · 0.85

Tested by

no test coverage detected