kubernetes/pkg/volume/iscsi
Maxim Patlasov 0a37f09c32 Fix directory mismatch for volume.SetVolumeOwnership()
In most cases `dir` arg of `SetUpAt()` method of `volume.Mounter` interface is the same as `mounter.GetPath()` because we usually call `SetUpAt()` from `SetUp()` like this:"
```
func (ed *emptyDir) SetUp(mounterArgs volume.MounterArgs) error {
	return ed.SetUpAt(ed.GetPath(), mounterArgs)
}
```
(this example is from `volume/emptydir/empty_dir.go`, but there are plenty other examples like that in `volume/*`)

However, there is currently one exception. This is from `volume/projected/projected.go`:
```
	if err := wrapped.SetUpAt(dir, mounterArgs); err != nil {
		return err
	}
```
(see 96306f144a/pkg/volume/projected/projected.go (L203))

In this case `dir` is not equal to `wrapped.GetPath()` and `volume.SetVolumeOwnership()` fails when called from `SetUpAt()` of wrapped volume:
```
lstat /var/lib/kubelet/pods/a2f6e58f-7edf-4c48-a97c-ef1b8fd3caf6/volumes/kubernetes.io~empty-dir/wrapped_kube-api-access-knvkv: no such file or directory
```

To fix the issue let's pass `dir` arg to `volume.SetVolumeOwnership()` explicitly, and use it instead of `mounter.GetPath()`.
2023-04-03 12:34:37 -07:00
..
attacher.go Implement mounting with -o context= in iSCSI volume plugin 2022-08-04 10:51:31 +02:00
disk_manager.go Fix directory mismatch for volume.SetVolumeOwnership() 2023-04-03 12:34:37 -07:00
doc.go
iscsi_test.go unittests: Fixes unit tests for Windows (part 2) 2022-08-01 18:56:32 +03:00
iscsi_util_test.go unit tests: Skip Windows-unrelated tests on Windows 2022-10-18 12:43:07 +03:00
iscsi_util.go Fix iSCSI over ipv6 2022-06-22 14:53:01 +02:00
iscsi.go Reconstruct SELinux mount option 2022-11-08 11:17:38 +01:00
OWNERS OWNERS cleanup - Jan 2021 Week 1 2022-01-10 08:14:29 -05:00