Commit Graph

3756 Commits

Author SHA1 Message Date
Madhu Rajanna
492c89ff07 rbd: use os.Remove to remove directory
using os.RemoveAll will remove everything
in the director after the Umount we should
be using os.Remove only to remove the empty
directory

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 39cc628adf)
2025-01-02 09:57:29 +05:30
Madhu Rajanna
640d1b9e79 cephfs: use os.Remove to remove directory
using os.RemoveAll will remove everything
in the director after the Umount we should
be using os.Remove only to remove the empty
directory

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit ffa8eaf5dd)
2024-12-17 13:34:58 +05:30
Madhu Rajanna
bc92611d1b cephfs: take lock on targetpath on node operation
We should not be dependent on the CO to ensure
that it will serialize the request instead of
that we need to have own internal locks to ensure
that we dont do concurrent operations for same
request.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 38b0a4cbad)
2024-12-17 13:34:39 +05:30
Madhu Rajanna
6bad9bcafc rbd: take lock on targetpath during node operation
We should not be dependent on the CO to ensure
that it will serialize the request instead of
that we need to have own internal locks to ensure
that we dont do concurrent operations for same
request.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 38c0e64307)
2024-12-17 13:32:53 +05:30
openshift-merge-bot[bot]
d6bbc61aa9
Merge pull request #369 from iPraveenParihar/bz/2309730
Bug 2309730: CVE-2024-6104 cephcsi-container: go-retryablehttp: url might write sensitive information to log file
2024-09-11 05:44:56 +00:00
Madhu Rajanna
341da762ba cleanup: fix spellcheck errors
fixed spellcheck errors caught in
CI.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 304462c7cc)
2024-09-10 22:52:00 +05:30
Madhu Rajanna
e27e0522c0 doc: fix codespell problem
fixed codespell problems found
in the CI run

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit bdd4c077ce)
2024-09-10 22:49:08 +05:30
Praveen M
9a5fb61901 ci: update centos stream 8 baseurl
Since CentOS Stream 8 is EOL, this commit updates the
config to use vault.centos.org for CentOS Stream 8.
This should be removed once the base image (ceph) is
updated to a version with a newer CentOS.

Signed-off-by: Praveen M <m.praveen@ibm.com>
(cherry picked from commit 5809628523)
2024-09-05 11:17:02 +05:30
Niels de Vos
31a90b4cb5 ci: disable seccomp when running podman with GitHub Actions
Fedora 40 builds seems to require disabling seccomp. When enabled,
installing Golang inside the container fails.

See-also: containers/podman#21012
Signed-off-by: Niels de Vos <ndevos@ibm.com>
(cherry picked from commit db6f54f75d)
2024-09-05 10:57:44 +05:30
dependabot[bot]
4115eec7a0 rebase: bump github.com/hashicorp/go-retryablehttp from 0.7.1 to 0.7.7
Bumps [github.com/hashicorp/go-retryablehttp](https://github.com/hashicorp/go-retryablehttp) from 0.7.1 to 0.7.7.
- [Changelog](https://github.com/hashicorp/go-retryablehttp/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/go-retryablehttp/compare/v0.7.1...v0.7.7)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-retryablehttp
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 2131a84a53)
2024-09-04 21:59:47 +05:30
openshift-merge-bot[bot]
27a450f889
Merge pull request #214 from Rakshith-R/BZ-2249600
BUG 2249600: cephfs: set Pool parameter to empty for Snapshot-backed volumes
2023-11-14 08:49:57 +00:00
rakshith-r
9546818863 cephfs: set Pool parameter to empty for Snapshot-backed volumes
Set VolumeOptions.Pool parameter to empty for Snapshot-backed volumes.
This Pool parameter is optional and  only used as 'pool-layout' parameter
during subvolume and subvolume clone create request in cephcsi
and not used for Snapshot-backed volume at all.
It is not saved anywhere for use in subsequent operations after create too.
Therefore, We can set it to empty and not error out.

Signed-off-by: rakshith-r <rar@redhat.com>
(cherry picked from commit f1e9d8084a)
2023-11-14 14:14:31 +05:30
openshift-ci[bot]
88078ee510
Merge pull request #191 from Rakshith-R/BZ-2242121
BUG 2242121:  cephfs: safeguard localClusterState struct from race conditions
2023-10-11 06:25:10 +00:00
Rakshith R
113eebfd4c cephfs: safeguard subVolumeGroupCreated map from race condition
Multiple go-routines may simultaneously create the
subVolumeGroupCreated map or  write into it
for a particular group.

This commit safeguards subVolumeGroupCreated map
from concurrent creation/writes while allowing for multiple
readers.

Signed-off-by: Rakshith R <rar@redhat.com>
(cherry picked from commit d516a1d66d)
2023-10-11 11:38:52 +05:30
Rakshith R
16c6ba8bc4 cephfs: safeguard localClusterState struct from race conditions
Multiple go-routines may simultaneously check for a clusterID's
presence in clusterAdditionalInfo and create an entry if it is
absent. This set of operation needs to be serialized.

Therefore, this commit safeguards clusterAdditionalInfo map
from concurrent writes with a mutex to prevent the above problem.

Signed-off-by: Rakshith R <rar@redhat.com>
(cherry picked from commit 82f1323af4)
2023-10-11 11:38:45 +05:30
OpenShift Merge Robot
ac04e66293
Merge pull request #189 from Madhu-1/close-2165941
BUG 2165941: rbd: discard not found error from GetMetadata
2023-09-04 08:17:14 +02:00
Madhu Rajanna
8cf11f59e3 rbd: discard not found error from GetMetadata
During ResyncVolume call, discard not found
error from GetMetadata API. If the image gets
resynced the local image creation time will be
lost, if the key is not present in the image
metadata then we can assume that the image is
already resynced.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 683821c407)
2023-09-04 08:01:15 +02:00
OpenShift Merge Robot
5b6b3d295f
Merge pull request #185 from Madhu-1/bz-2165941
BUG 2165941: rbd: Dont depend on image state to issue resync
2023-08-30 13:38:35 +02:00
Madhu Rajanna
1c1ff6039b cephfs: fix make go-lint error
Not sure why but go-lint is failing
with below error and this fix is required
to make it pass

```
directive `//nolint:staticcheck // See comment above.`
is unused for linter "staticcheck" (nolintlint)
```

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 4016876c9d)
2023-08-30 11:16:40 +02:00
Madhu Rajanna
c9b0f1752a rbd: fix resync issue
During the Demote volume store
the image creation timestamp.

During Resync do below operation

* Check image creation timestamp
stored during Demote operation
and current creation timestamp during Resync
and check both are equal and its for
force resync then issue resync
* If the image on both sides is
not in unknown state, check
last_snapshot_timestamp on the
local mirror description, if its present
send volumeReady as false or else return
error message.

If both the images are in up+unknown the
send volumeReady as true.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit e013cfed15)
2023-08-30 11:16:27 +02:00
OpenShift Merge Robot
2b2d5aa90f
Merge pull request #179 from nixpanic/bug/2228807
Bug 2228807: rebase: update golang.org/x/net to v0.14
2023-08-08 05:13:05 -04:00
Niels de Vos
d95c784457 rebase: update golang.org/x/net to v0.14
golang.org/x/net/html v0.12 is vulnerable against CVE-2023-3978.
Exploiting it through Ceph-CSI is non-trivial, but rebasing
golang.org/x/net should take away any concerns.

See-also: https://pkg.go.dev/vuln/GO-2023-1988
Signed-off-by: Niels de Vos <ndevos@ibm.com>
(cherry picked from commit a129b1c4ab)
2023-08-08 11:00:15 +02:00
OpenShift Merge Robot
2b5cc6c27a
Merge pull request #169 from Rakshith-R/backport-sparsify
rbd: do not execute rbd sparsify when volume is in use
2023-07-11 11:02:35 -04:00
Rakshith R
60a86ab877 rbd: do not execute rbd sparsify when volume is in use
This commit makes sure sparsify() is not run when rbd
image is in use.
Running rbd sparsify with workload doing io and too
frequently is not desirable.
When a image is in use fstrim is run and sparsify will
be run only when image is not mapped.

Signed-off-by: Rakshith R <rar@redhat.com>
(cherry picked from commit 98fdadfde7)
2023-07-11 20:18:24 +05:30
OpenShift Merge Robot
22aeb9cdcf
Merge pull request #166 from ceph/devel
nfs: add support for `clients` in the StorageClass
2023-07-06 04:05:03 -04:00
Sachin Prabhu
254699cb1a nfs: add support for clients in the StorageClass
The clients parameter in the storage class is used to limit access to
the export to the set of hostnames, networks or ip addresses specified.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
2023-07-06 06:24:11 +00:00
OpenShift Merge Robot
62312fa693
Merge pull request #165 from ceph/devel
sync downstream with upstream devel
2023-07-06 01:40:38 -04:00
riya-singhal31
a7d259a334 e2e: add test for validation of kernelMountOption
Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2023-07-05 11:20:47 +00:00
riya-singhal31
330995751a e2e: add test for validation of fuseMountOptions
Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2023-07-05 11:20:47 +00:00
dependabot[bot]
b7e223d664 rebase: bump k8s.io/api from 0.27.2 to 0.27.3 in /api
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.27.2 to 0.27.3.
- [Commits](https://github.com/kubernetes/api/compare/v0.27.2...v0.27.3)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-04 13:31:42 +00:00
Niels de Vos
489d0ff1a6 doc: remove /retest all command for Jenkins jobs
`/retest all` causes a spike in resource consumption in Jenkins and the
OpenShift cluster kills the Pod. That means tests are not fully running
yet, and results never arrive back in the PR. Instead of `/retest all`,
the `ok-to-test` label can be used to trigger required tests with a
slight delay between each command.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-07-04 12:38:39 +00:00
Niels de Vos
ebfd915ad6 build: disable ceph-iscsi repository for test-container builds too
The ceph-iscsi repository seems to provide broken metadata or packages.
Ceph-CSI does not need to install them, so disable the repository for
now.

It seems that other repositories gave issues before too, but these
repositories were disabled after installing all available updates. For
ceph-iscsi updating fails already, so disable the repositories before
updating.

Updates: #2034
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-07-04 11:29:10 +00:00
dependabot[bot]
c916a90c73 rebase: Bump github.com/aws/aws-sdk-go from 1.44.290 to 1.44.295
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.290 to 1.44.295.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.290...v1.44.295)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-04 09:08:04 +00:00
dependabot[bot]
8aae41c9bc rebase: Bump google.golang.org/grpc from 1.56.0 to 1.56.1
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.56.0 to 1.56.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.56.0...v1.56.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-04 08:29:06 +00:00
Niels de Vos
f60a358007 rbd: do not try to run resizefs on an encrypted BlockMode volume
When a volume has AccessType=Block and is encrypted with LUKS, a resize
of the filesystem on the (decrypted) block-device is attempted. This
should not be done, as the application that requested the Block volume
is the only authoritive reader/writer of the data.

In particular VirtualMachines that use RBD volumes as a disk, usually
have a partition table on the disk, instead of only a single filesystem.
The `resizefs` command will not be able to resize the filesystem on the
block-device, as it is a partition table.

When `resizefs` fails during NodeStageVolume, the volume is unstaged and
an error is returned.

Resizing an encrypted block-device requires `cryptsetup resize` so that
the LUKS header on the RBD-image is updated with the correct size. But
there is no need to call `resizefs` in this case.

Fixes: #3945
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-07-03 14:54:39 +00:00
Niels de Vos
0efe8e4711 build: disable ceph-iscsi repository
The ceph-iscsi repository seems to provide broken metadata or packages.
Ceph-CSI does not need to install them, so disable the repository for
now.

It seems that other repositories gave issues before too, but these
repositories were disabled after installing all available updates. For
ceph-iscsi updating fails already, so disable the repositories before
updating.

Updates: #2034
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-07-03 12:10:49 +00:00
dependabot[bot]
e8f1bbe36b rebase: Bump github.com/onsi/ginkgo/v2 from 2.10.0 to 2.11.0
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.10.0 to 2.11.0.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v2.10.0...v2.11.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-28 16:02:39 +00:00
dependabot[bot]
029276b569 rebase: Bump github.com/ceph/go-ceph from 0.21.0 to 0.22.0
Bumps [github.com/ceph/go-ceph](https://github.com/ceph/go-ceph) from 0.21.0 to 0.22.0.
- [Release notes](https://github.com/ceph/go-ceph/releases)
- [Changelog](https://github.com/ceph/go-ceph/blob/master/docs/release-process.md)
- [Commits](https://github.com/ceph/go-ceph/compare/v0.21.0...v0.22.0)

---
updated-dependencies:
- dependency-name: github.com/ceph/go-ceph
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-28 13:12:41 +00:00
dependabot[bot]
fca2646736 rebase: Bump github.com/kubernetes-csi/csi-lib-utils
Bumps [github.com/kubernetes-csi/csi-lib-utils](https://github.com/kubernetes-csi/csi-lib-utils) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/kubernetes-csi/csi-lib-utils/releases)
- [Commits](https://github.com/kubernetes-csi/csi-lib-utils/compare/v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: github.com/kubernetes-csi/csi-lib-utils
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-28 10:01:49 +00:00
dependabot[bot]
9064d77943 rebase: Bump google.golang.org/protobuf from 1.30.0 to 1.31.0
Bumps google.golang.org/protobuf from 1.30.0 to 1.31.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-27 16:31:19 +00:00
dependabot[bot]
4c0ee75899 rebase: Bump github.com/aws/aws-sdk-go from 1.44.285 to 1.44.290
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.285 to 1.44.290.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.285...v1.44.290)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-27 14:47:05 +00:00
riya-singhal31
9ee128123f cleanup: correct the comment in csi-addons/rbd
Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2023-06-27 14:07:34 +00:00
Rakshith R
e99e6174d9 ci: remove mergify rules for release-v3.7
This commit removes mergify rules to backport PR
to release-v3.7 branch.

Signed-off-by: Rakshith R <rar@redhat.com>
2023-06-27 12:15:15 +05:30
Rakshith R
46fbc4868d ci: add mergify rules for release-v3.9
This commit adds mergify rules to backport PR
to release-v3.9 branch.

Signed-off-by: Rakshith R <rar@redhat.com>
2023-06-27 12:15:15 +05:30
Rakshith R
d4fc23ece0 doc: add steps for upgrading from 3.8 to 3.9
This commit adds steps for upgrading from 3.8
to 3.9.

Signed-off-by: Rakshith R <rar@redhat.com>
2023-06-26 14:10:17 +00:00
Rakshith R
ef8ffb4c57 doc: update README for v3.9.0 release
This commit updates README to deprecate 3.7.x release
and pin latest release to v3.9.0

Signed-off-by: Rakshith R <rar@redhat.com>
2023-06-26 14:10:17 +00:00
Rakshith R
1ca6f004a5 rbd: (lastSyncInfo)handle last sync duration being empty case
This commit modifies code to handle last sync duration being
empty & 0,returning nil & 0 on encountering it respectively.
Earlier both case return 0. Test case is added too.

Signed-off-by: Rakshith R <rar@redhat.com>
2023-06-23 11:23:17 +00:00
Yati Padia
2e2e9044c0 rbd: get lastsyncbytes and lastsycduration for volrep
This commit get more information from the description
like lastsyncbytes and lastsyncduration and send them
as a response of getvolumereplicationinfo request.

Signed-off-by: Yati Padia <ypadia@redhat.com>
2023-06-23 07:38:26 +00:00
riya-singhal31
dbdb9086d8 rbd: migration of replication controller server
this commit migrates the replication controller server
from internal/rbd and adds it to csi-addons.

Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2023-06-23 06:00:40 +00:00
riya-singhal31
cdaa9264eb rbd: migration of replication service to csi-addon
this commit removes grpc import from replication.go
and replaced it with usual errors and passed gRPC
responses in csi-addons

Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
2023-06-22 11:50:54 +00:00