Skip to content

Conversation

AndrewChubatiuk
Copy link
Contributor

@AndrewChubatiuk AndrewChubatiuk commented Jul 26, 2025

currently it's only possible to set external PVC for vlsingle and vmsingle only with crutches: storageDataPath should be set using spec.extraArgs, since default or one, which is controlled by spec.storageDataPath creates PVC from spec.storage or mounts emptyDir if spec.storage is not set. any volume mounts that are mounted to spec.storageDataPath lead to collision. Even with this crutch pod has unneeded volume mount, also in vmsingle backup functionality becomes unavailable, since it also relies on spec.storageDataPath value.

this PR moves method, which mounts storage volume to build package and does the following:

  • adds volume mount that points to storageDataPath only if volume with expected name is not already present in spec.volumeMounts
  • adds volume with managed PVC if spec.storage is defined
  • adds emptyDir volume only storage volume is not found in spec.volumes

Understand that it may cause restart for vlsingle and vmsingle pods, if there are any values defined at spec.volumeMounts or spec.volumes, but didn't want to make function signature too heavy also not sure if this is a common case

@AndrewChubatiuk AndrewChubatiuk force-pushed the mount-existing-volume-as-storage branch from fbeb6cd to 2bc9689 Compare July 27, 2025 05:52
@AndrewChubatiuk AndrewChubatiuk force-pushed the mount-existing-volume-as-storage branch from 2bc9689 to 96465ef Compare July 27, 2025 07:37
return t.needAddLiveness
}

func Test_buildProbe(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes to the container_test.go file looks unrelated to this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method for volumes and mounts creation was added to container.go, added tests for it to container_test.go and rewrote other tests to f-tests

@f41gh7 f41gh7 self-assigned this Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants