normalizeVolumeMountName is the VolumeMount counterpart of normalizeVolumeName, using mount paths to detect the volume type. TODO: delete this function after minor version 1.28 is discontinued
(mount corev1.VolumeMount)
| 164 | // |
| 165 | // TODO: delete this function after minor version 1.28 is discontinued |
| 166 | func normalizeVolumeMountName(mount corev1.VolumeMount) string { |
| 167 | name := mount.Name |
| 168 | |
| 169 | extensionPathPrefix := postgres.ExtensionsBaseDirectory + "/" |
| 170 | if strings.HasPrefix(mount.MountPath, extensionPathPrefix) && !strings.HasPrefix(name, "ext-") { |
| 171 | return SanitizeExtensionNameForVolume(name) |
| 172 | } |
| 173 | |
| 174 | if strings.HasPrefix(mount.MountPath, PgTablespaceVolumePath+"/") && !strings.HasPrefix(name, "tbs-") { |
| 175 | return "tbs-" + name |
| 176 | } |
| 177 | |
| 178 | return name |
| 179 | } |
| 180 | |
| 181 | func compareVolumes(currentVolumes, targetVolumes []corev1.Volume) (bool, string) { |
| 182 | current := make(map[string]corev1.Volume) |
no test coverage detected