Commit Graph
4095 Commits
Author SHA1 Message Date
Travis Nielsen 955f7c5428 Merge pull request #17785 from beyondcloud-co/fix/17761-duplicate-mgr-ips-in-endpointslice
fix(ceph): deduplicate external MGR endpoints in EndpointSlice
2026-07-22 09:05:31 -06:00
Parth Arora 1bb5bdfb55 Merge pull request #17971 from parth-gr/watch-rns-svg
external: add watcher to the rns controler for watching csi and clien…
2026-07-22 19:57:09 +05:30
parth-gr 7f602f12b0 external: add watcher to the rns controler for watching csi and client profile
if the csi secret is updated or a client profile is updated
we need a re-reconile of rns
So added the watcher for it

Signed-off-by: parth-gr <partharora1010@gmail.com>
2026-07-22 19:40:12 +05:30
Travis Nielsen ce05eff9e5 Merge pull request #17947 from OdedViner/fix_nvmeof_ci
nvmeof: use .nvmeof pool for gateway and remove pool field from CRD
2026-07-21 12:12:09 -06:00
Oded Viner ec502c3f80 nvmeof: use .nvmeof pool for gateway and remove pool field from CRD
Changes:
- Use a dedicated .nvmeof pool (via CephBlockPool CR named
  builtin-nvmeof) for the NVMe-oF gateway internal state.
- Use a separate nvmeof pool for the StorageClass data.
- Remove the pool field from the CephNVMeOFGateway CRD.
  The gateway now always uses the .nvmeof pool, hardcoded
  in the operator.
- Add .nvmeof to the allowed CephBlockPool name overrides.
- Create a production example nvmeof.yaml (instances: 2,
  replicas: 3) and a CI-only nvmeof-test.yaml (instances: 1,
  replicas: 1).
- Update documentation and CI test script accordingly.

Signed-off-by: Oded Viner <oviner@redhat.com>
2026-07-21 20:19:44 +03:00
Joshua Hoblitt a9bd575002 Merge pull request #17968 from anxkhn/patch-21
mon: fix data race on failedMonSchedule during scheduling
2026-07-21 09:24:24 -07:00
Anas Khan 7f2a68fa91 object: return an error when reconciled rgw user has no keys
In createOrUpdateCephUser, when the desired user carries no explicit
keys the reconciler falls back to the live RGW user's keys. If that live
user also has zero keys the code intends to fail, but it built the error
with errors.Wrapf(err, ...) at a point where err is already nil (the
prior SetUserQuota error was handled and returned just above).
errors.Wrapf(nil, ...) returns nil, so the failure was swallowed and
createOrUpdateCephUser returned success on a user the operator itself
flagged as broken.

The reconcile then continued to generateCephUserSecret, which indexes
userConfig.Keys[0] to populate the Kubernetes secret and panicked on the
empty key slice. The reconciler's deferred RecoverAndLogException caught
and logged that panic, so the reconcile was abandoned before it reached
the Ready status update; and because the recovered Reconcile returns a
zero Result with a nil error, the request was not requeued either. The
user was left neither marked Ready nor retried.

Construct the error with errors.Errorf so the intended failure is
surfaced instead of being swallowed. Add a regression test that returns
a keyless live user and asserts a non-nil "no keys set" error.

Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-07-20 17:41:21 -07:00
Joshua Hoblitt 7047206697 Merge pull request #17959 from anxkhn/patch-14
test: assert preferred anti-affinity count in testPodSpecPlacement
2026-07-20 17:31:12 -07:00
Joshua Hoblitt da490653a5 Merge pull request #17958 from anxkhn/patch-13
test: assert retained capacity LastUpdated in TestCephStatus
2026-07-20 17:29:56 -07:00
Joshua Hoblitt 101a9d4302 Merge pull request #17957 from anxkhn/patch-8
csi: fix compareJSON to compare actual output
2026-07-20 17:28:29 -07:00
Joshua Hoblitt 1cde80c6bb Merge pull request #17965 from anxkhn/patch-20
csi: do not log peer bootstrap token secret
2026-07-20 17:24:25 -07:00
Joshua Hoblitt 0f3d6b0941 Merge pull request #17963 from anxkhn/patch-19
mgr: use dashboard port 1024 as requested
2026-07-20 16:23:06 -07:00
Travis Nielsen 68853a50be Merge pull request #17962 from parth-gr/rgw-account-deletion
rgw: rgw account deletion should remove account from ceph
2026-07-20 14:11:52 -06:00
subham rai 02428dc8ac Merge pull request #17979 from Madhu-1/resolve-node-publish-secret
external: resolve node secret names via annotations for external cluster
2026-07-20 14:20:41 +05:30
Blaine Gardner 75e64b00be Merge pull request #17940 from subhamkrai/add-caps-rgw-admin-user
object: option to update rgw caps with account
2026-07-15 14:12:24 -06:00
Michael Adam c90913051b rgw: fix a comment typo
This fixes a comment typo caught bt the codespell CI check.

Signed-off-by: Michael Adam <obnox@samba.org>
2026-07-15 18:25:53 +02:00
subhamkrai 392204c1f8 object: option to update rgw caps with account
this commit add support for updating rgw caps with
`user-info-without-key` and `accounts` to cephobjectstoreuser crd
Adding the check for min ceph version from which these caps
are available.

Co-Authoured-by:  Jiffin Tony Thottan <thottanjiffin@gmail.com>
Signed-off-by: subhamkrai <srai@redhat.com>
2026-07-15 16:45:49 +05:30
Madhu Rajanna 14a146c045 external: resolve node secret names via annotations for external clusters
Add annotations to RBD node secrets in
import-external-cluster.sh so that externally
created secrets with
custom names can be discovered at runtime.
Update CreateUpdateClientProfileRadosNamespace to
look up secrets by annotation
instead of using hardcoded names.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2026-07-15 10:37:18 +05:30
Parth Arora 0679f843bc Merge pull request #17896 from parth-gr/vsi-volume-attach
external: resolve provisioner secret names via annotations for extern…
2026-07-14 18:10:16 +05:30
Anas Khan 0bbd5de84c mon: fix data race on failedMonSchedule during scheduling
assignMons schedules each mon in its own goroutine and shares a
failedMonSchedule bool to record whether any of them failed. The
resultLock mutex already guards the shared c.mapping.Schedule map
write, but the three failedMonSchedule = true assignments were done
without holding the lock. When two or more mons fail to schedule at
the same time (for example when waitForMonitorScheduling errors, the
node choice is nil, or getNodeInfoFromNode fails) their goroutines
write the flag concurrently, which is a write-write data race.

Guard the failedMonSchedule writes with the existing resultLock, the
same lock the goroutines already use for the map update. The post-Wait
read is left as is since the WaitGroup orders it after every write.

Add a regression test that fails scheduling for multiple mons at once
and confirms assignMons returns an error; run it with -race to catch
the race.

Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
2026-07-14 18:03:13 +05:30
Anas Khan 1013a8effc csi: do not log peer bootstrap token secret
decodePeerToken logged the whole decoded PeerToken with "%+v" at debug
level. PeerToken embeds Key, the peer cluster's cephx auth secret, so
running the operator with ROOK_LOG_LEVEL=DEBUG wrote that credential to
the operator logs in plaintext (CWE-532).

Log only the non-sensitive fields (fsid, client id, mon host, namespace),
which keep the message useful for diagnostics, and drop Key. Add a
regression test that captures the debug output and asserts the key is
never present.

Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
2026-07-14 16:55:01 +05:30
Anas Khan 43464d81b7 mgr: use dashboard port 1024 as requested
Port 1024 is the lowest non-privileged port on Linux (privileged ports
are 0-1023), so it should be honored as-is like any port >= 1024. The
dashboardInternalPort guard used `<=` instead of `<`, which pushed a
requested Port of 1024 into the "privileged" branch and reset the
container/targetPort back to the default (7000/8443). That left the
Service Port at 1024 but its targetPort at the default, a mismatch that
contradicts the constant's comment and the identical Port 1025 case.

Change the comparison to `<` and add a boundary case to
TestStartSecureDashboard asserting both Port and targetPort are 1024.

Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
2026-07-14 16:49:32 +05:30
parth-gr cca7020f0b rgw: rgw account deletion should remove account from ceph
currently there was a bug in the code where it didnt removed
the account from the ceph cluster during intial intialize

Signed-off-by: parth-gr <partharora1010@gmail.com>
2026-07-14 16:01:09 +05:30
Anas Khan 464582c40b test: assert preferred anti-affinity count in testPodSpecPlacement
testPodSpecPlacement accepts a pref parameter but never asserts the
preferred anti-affinity count, so the PreferredDuringScheduling branch
of SetNodeAntiAffinityForPod went unverified. The assertion was dropped
in b91f4211c9 when the separate preferred flag was removed from
SetNodeAntiAffinityForPod, leaving pref unused.

Restore the missing assertion so the helper validates both the required
and preferred term counts. Drop the third empty-placement case, which
became an exact duplicate of the second once the two-boolean API was
collapsed and now adds no coverage.

Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
2026-07-14 15:22:48 +05:30
Anas Khan 71e688cf96 test: assert retained capacity LastUpdated in TestCephStatus
The capacity-retention case in TestCephStatus asserted
formatTime(now-1m) against formatTime(now-1m), comparing an
expression to itself. That assertion can never fail and never
looks at the value under test, so the branch in
toCustomResourceStatus that keeps the previous capacity when
newStatus.PgMap.TotalBytes is 0 was left unverified.

Seed a known LastUpdated on the current status alongside the
existing TotalBytes, then assert the aggregated status carries
that timestamp through. This checks that the prior capacity,
including its LastUpdated, is retained when total bytes drop to 0.
The sibling cases already assert Capacity.LastUpdated the same way.

Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
2026-07-14 15:21:19 +05:30
Anas Khan 8bdc4559cb csi: fix compareJSON to compare actual output
The compareJSON test helper unmarshaled the expected JSON into both
the expected and actual variables, so assert.Equal always compared the
expected value against itself. The actualJSON argument was never read,
which made the assertion a tautology that could never fail and silently
disabled validation of updateCsiClusterConfig's output.

Parse actualJSON for the actual value. Enabling the check surfaced a
stale expectation in the multus sub-test: updateNetNamespaceFilePath
clears rbd.netNamespaceFilePath (holder pods are no longer used with the
ceph-csi-operator), so the expected literal is updated to drop that
field and match the real output.

Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
2026-07-14 14:54:28 +05:30
Travis Nielsen 46a1b0d19b Merge pull request #17887 from Madhu-1/add-node-publish-volume
csi: Add supported files for krbd QoS
2026-07-13 11:55:16 -06:00
Travis Nielsen 1b62ed8507 Merge pull request #17920 from XT-Phate/fix(cephfs)--raise-swallowed-error
file: reveal swallowed errors on cephfs reconciliation
2026-07-10 11:22:56 -06:00
parth-gr ac14ce76c9 external: resolve provisioner secret names via annotations for external clusters
Add annotations to CephFS and RBD provisioner secrets in
import-external-cluster.sh so that externally created secrets with
custom names can be discovered at runtime.
Update CreateUpdateClientProfileRadosNamespace and
generateProfileSubVolumeGroupSpec to look up secrets by annotation
instead of using hardcoded names.

closes: https://github.com/rook/rook/issues/16956
Signed-off-by: parth-gr <partharora1010@gmail.com>
2026-07-10 17:15:01 +05:30
Artem Torubarov 75fe8db848 osd: rename internal OSD migration field to migrateOSD
Signed-off-by: Artem Torubarov <artem.torubarov@sap.com>
2026-07-10 11:45:47 +02:00
Maxime Bertin 0696b24d9c file: reveal swallowed errors on cephfs reconciliation
CephFS reconciliation loop on Filesystem creation was swallowing errors.
The err variable which contained the error was replaced with the resulted error from the
kubernetes update status call on the CRD.
This commit fixes that and aggregate both errors in case there is both a kubernetes status update failure and a creation error.

Signed-off-by: Maxime Bertin <mbertin@luccasoftware.com>
2026-07-10 08:28:35 +02:00
Parth Arora 6ee3198716 Merge pull request #17689 from subhamkrai/update-tnf-script-hostname
mon: update how hostname was set for drbd
2026-07-09 21:07:54 +05:30
Madhu Rajanna 328efbadc4 csi: add nodepublishsecret to clientprofile
Add the node publish secret to the client
profile that is required for the PVC's created
from SC without any node publish secret.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2026-07-08 10:17:52 +05:30
subhamkrai c49ef5f079 mon: update how hostname was set for drbd
currently, drbd hostname was ready using command
but now the change we use kubernetes built-in api
to read hostname from `spec.nodeName`.`

Signed-off-by: subhamkrai <srai@redhat.com>
2026-07-07 08:45:28 +05:30
Anas Khan 47b4167b70 core: reconcile when node OSD topology labels change
shouldReconcileChangedNode only diffed the node spec, so changes to node
labels, including rook's own topology.rook.io/* labels, were never detected.
Relabeling a node therefore did not trigger a CephCluster reconcile until some
other condition eventually did.

Trigger a reconcile from the node update predicate when one of the OSD topology
labels rook cares about changes. The whitelist reuses the canonical label set
from topology.GetDefaultTopologyLabels() (the hostname, the Kubernetes
region/zone labels, and the topology.rook.io/* labels), so a reconcile is
scoped to topology changes instead of firing on any label or annotation change.
The UpdateFunc returns true directly for these changes because onK8sNode()
returns false for a node that is already an OSD host, which would otherwise
swallow the relabel.

Resolves #17652

Signed-off-by: Anas Khan <anas@anaskhan.me>
2026-07-07 07:38:15 +05:30
Joshua Hoblitt c0eb360041 docs: fix typos and grammar in code comments
Fix duplicate words, incorrect articles (a/an), it's/its, and other small
grammar mistakes in Go comments and user-facing messages across pkg/, cmd/,
and tests/.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-07-01 08:34:11 -07:00
Anas Khan 67bf4baab8 object: use passed context for S3 v2 API calls
The AWS SDK v1 to v2 migration in #17468 left the S3Agent wrapper methods
calling the SDK with context.TODO(), so S3 operations could not be cancelled
when the controller context is cancelled. Add a leading context.Context
parameter to CreateBucket, PutObjectInBucket, GetObjectInBucket,
DeleteObjectInBucket, PutBucketPolicy, and GetBucketPolicy, forward it to the
underlying client, and pass clusterInfo.Context from the bucket provisioner.

Resolves #17526

Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
2026-07-01 13:15:40 +05:30
blackflytech c65663c529 core: use slices.Backward to simplify the code
Signed-off-by: blackflytech <blackflytech@outlook.com>
2026-07-01 00:37:50 +08:00
Joshua Hoblitt e5c6d75a73 core: narrow bare //nolint directives to specific linters
The //nolint directives at these sites omit the linter name, so each
suppresses every linter on its line rather than the one check it needs.
That hides any unrelated errcheck/gosec/govet finding later introduced
on the same line. Name the specific linter for each:

- staticcheck for the two operator sites: SA4004 (the intentional
  single-iteration loop in the OSD PVC host lookup) and SA1019 (the
  deliberate read of the deprecated S3.Enabled field in the RGW
  API-enable builder).
- errcheck for the rbd-mirror deferred token-file cleanup and the
  test-framework logging helpers (WriteString / writeHeader).

No behavior change.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-06-29 16:32:59 -07:00
Joshua Hoblitt 993be34a24 Merge pull request #17834 from jhoblitt/docs/fix-stale-doc-comment-names
docs: fix function comments to match their declaration names
2026-06-29 12:04:25 -07:00
Blaine Gardner 485529056d Merge pull request #17764 from subhamkrai/mute-ceph-errors
core: add api changes to mute ceph warnings
2026-06-29 09:50:13 -06:00
Joshua Hoblitt 49612461a4 docs: fix function comments to match their declaration names
Several godoc comments led with a stale or incorrect identifier, left
over from renames, exported/unexported changes, copy-paste between
sibling declarations, or plain typos. As a result the documented name no
longer matched the function, method, type, or var it describes. Correct
each leading word to the name of the declaration it documents.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-06-26 12:52:39 -07:00
pengqima 240c431f42 docs: fix function comment to match actual function name
Signed-off-by: pengqima <pengqima@outlook.com>
2026-06-26 23:43:22 +08:00
daixihegu 063dcad054 core: use slices.Contains to simplify code
Signed-off-by: daixihegu <daixihegu@163.com>
2026-06-25 10:17:53 +08:00
Travis Nielsen d9de5b1d6f Merge pull request #17758 from kavirakesh14/fix-17285-config-override-newline
ceph: ensure config overrides end with a trailing newline
2026-06-24 10:48:48 -06:00
subhamkrai 9a6c5842bc core: implement ceph health warning mute
this commit implement api to configure
ceph health warning mute/unmute.

Signed-off-by: subhamkrai <srai@redhat.com>
2026-06-24 21:10:54 +05:30
kavirakesh14 619b800b67 operator: fail reconcile if rook-config-override lacks trailing newline
Signed-off-by: kavirakesh14 <kavirakesh007@gmail.com>
2026-06-24 09:56:41 +00:00
Travis Nielsen 7803fac10d core: skip node watcher during initial cache sync
When the operator starts, there is no need to handle the
node watcher immediately while the controller runtime
cache is being initialized. The cluster will anyway be
fully reconciled and create new OSDs if needed. The node
watcher is only intended for triggering a reconcile when
a node is added or updated at a later time after a sync
would anyway be triggered.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2026-06-23 13:39:49 -06:00
Parth Arora 451c3f3d1b Merge pull request #17805 from parth-gr/drbd-mons
core: reduce the floating mon reschdule time
2026-06-23 20:55:48 +05:30
parth-gr 9e0b6e5bbe core: reduce the floating mon reschdule time
currently k8s add the default eviction time as 300 sec
setting it to 5 sec for the quick re-schedule

Signed-off-by: parth-gr <partharora1010@gmail.com>
2026-06-23 20:15:56 +05:30