WithVolume adds a volume to the current podTemplate, replacing the current definition if present
(volume *corev1.Volume)
| 72 | // WithVolume adds a volume to the current podTemplate, replacing the current |
| 73 | // definition if present |
| 74 | func (builder *Builder) WithVolume(volume *corev1.Volume) *Builder { |
| 75 | for idx, value := range builder.status.Spec.Volumes { |
| 76 | if value.Name == volume.Name { |
| 77 | builder.status.Spec.Volumes[idx] = *volume |
| 78 | return builder |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | builder.status.Spec.Volumes = append(builder.status.Spec.Volumes, *volume) |
| 83 | return builder |
| 84 | } |
| 85 | |
| 86 | // WithSecurityContext adds a securityContext to the current podTemplate is nil. |
| 87 | // If `overwrite` is true the securityContext is overwritten even when it's not empty |
no outgoing calls
no test coverage detected