Skip to content

Commit

Permalink
[#31] fix delete unused volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny authored and zipofar committed Oct 18, 2022
1 parent 401f857 commit d1ea7e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/domain_logic/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ func (l *Logic) ApplyContainersVolumes(

if len(pvc.UID) == 0 {
_, err = l.KuberClient.CreatePersistentVolumeClaim(namespace, pvc)

log.Printf("%v/pvc %v was created\n", namespace, pvcName)
}

if err != nil {
Expand All @@ -102,6 +104,7 @@ func (l *Logic) ApplyContainersVolumes(
func (l *Logic) RemoveUnusedContainersVolumes(namespace string, containerList domainTypes.ContainerList) error {
uniqVolumes := containerList.GetUniqNamedVolumes()
uniqVolumes = append(uniqVolumes, containerList.GetUniqAnonymousVolumes()...)
uniqVolumes = append(uniqVolumes, containerList.GetUniqHostVolumes()...)
newPersistentVolumeClaimNames := []string{}

for _, volume := range uniqVolumes {
Expand Down

0 comments on commit d1ea7e0

Please # to comment.