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

Function compareVolumes

pkg/specs/podspec_diff.go:181–194  ·  view source on GitHub ↗
(currentVolumes, targetVolumes []corev1.Volume)

Source from the content-addressed store, hash-verified

179}
180
181func compareVolumes(currentVolumes, targetVolumes []corev1.Volume) (bool, string) {
182 current := make(map[string]corev1.Volume)
183 target := make(map[string]corev1.Volume)
184 for _, vol := range currentVolumes {
185 normalized := normalizeVolumeName(vol)
186 vol.Name = normalized
187 current[normalized] = vol
188 }
189 for _, vol := range targetVolumes {
190 target[vol.Name] = vol
191 }
192
193 return compareMaps(current, target)
194}
195
196func compareVolumeMounts(currentMounts, targetMounts []corev1.VolumeMount) (bool, string) {
197 current := make(map[string]corev1.VolumeMount)

Callers 2

ComparePodSpecsFunction · 0.85

Calls 2

normalizeVolumeNameFunction · 0.85
compareMapsFunction · 0.85

Tested by

no test coverage detected