Commit Graph
4062 Commits
Author SHA1 Message Date
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
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
Satoru Takeuchi a8398f9996 Merge pull request #17724 from jhoblitt/osd-activate-skip-rbd-scan
osd: do not scan rbd devices in raw activate fallback
2026-06-23 07:44:02 +09:00
Joshua Hoblitt da07f0c476 osd: do not scan rbd devices in raw activate fallback
When the OSD activate init container cannot match its configured
device, it falls back to a bare 'ceph-volume raw list', which
enumerates every block device on the node and opens each one to read
bluestore labels. Opening a krbd device whose backing cluster is
unhealthy can block in uninterruptible sleep; when that device's I/O
depends on the OSD being activated, activation deadlocks.

Build the fallback scan list explicitly with lsblk and exclude the
network-backed device types that can hang when their backing storage
is unavailable (rbd, nbd, drbd) along with zram (volatile RAM). Rook
never provisions OSDs on any of these, so the fallback can never
legitimately need to find an OSD on them. loop devices are kept,
since OSDs on loop devices are supported for CI and local testing.
Fail fast if the filtered list is empty rather than degenerating back
to a full scan.

Note this hardens only the rename-fallback path. The deadlock observed
in CI (kernel hung tasks under 'ceph-volume raw activate' opening a
stalled /dev/rbd0; actions runs 27325963851, 27333888237, and
27378983111, which reproduced it on this PR's own head) ultimately
originates inside ceph-volume: 'raw activate' runs an unconditional
LUKS2/TPM2 discovery sweep over all block devices even when given an
explicit --device. That requires a ceph-volume fix; this change makes
the Rook-controlled scan safe regardless of ceph version.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-06-22 10:00:58 -07:00
Travis Nielsen 63eed4ed47 Merge pull request #17279 from sophotechlabs/test/osd-config-store
test: add unit tests for OSD store config parsing
2026-06-19 08:12:00 -06:00
subhamkrai ad26ebdab0 build: update ceph version to latest v20.2.2
updating the ceph version from v20.2.1 to v20.2.2

Signed-off-by: subhamkrai <srai@redhat.com>
2026-06-17 22:00:11 +05:30
Santosh Pillai 6feb856a9f Merge pull request #17670 from jhoblitt/maint-remove-dead-lockingbool
operator: remove dead code from the operator tree
2026-06-17 15:05:49 +05:30
Travis Nielsen ecadb76e6f Merge pull request #17710 from jhoblitt/object-realm-key-urlsafe
object: generate URL-safe realm access keys
2026-06-16 15:16:22 -06:00
Joshua Hoblitt b1bbfb4bba Merge pull request #17726 from jhoblitt/maint-remove-dead-k8sutil-sweep
k8sutil: remove unused helper functions
2026-06-12 09:10:32 -07:00
Joshua Hoblitt b30ba09bda operator: remove unused AddCephVersionLabelToDaemonSet
AddCephVersionLabelToDaemonSet had no callers anywhere in the repo
(verified with deadcode and repo-wide grep); rook applies ceph version
labels to Deployments, Jobs, and object metas, but never to DaemonSets.
The shared addCephVersionLabel helper remains in use by the live
siblings.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-06-11 15:44:18 -07:00
Joshua Hoblitt 23f4f50bdb csi: remove unused NFSDriverName variable
NFSDriverName was assigned once in the CSI controller reconcile but never
read anywhere in the repo (verified with repo-wide grep and an
exported-symbol audit). Remove the variable, its assignment, and the
nfsDriverSuffix const that only existed to feed it.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-06-11 15:44:18 -07:00
Joshua Hoblitt 0f5d8ba37f Merge pull request #17682 from jhoblitt/maint-remove-dead-k8sutil-daemonset
k8sutil: remove unused daemonset helpers
2026-06-11 14:21:17 -07:00
Travis Nielsen d8dd41a623 Merge pull request #17701 from OdedViner/nvme_image
nvmeof: fetch gateway image from ceph config when not in CR
2026-06-11 12:02:45 -06:00
Oded Viner 8b4fd67e17 nvmeof: fetch gateway image from ceph config when not in CR
Make the NVMe-oF gateway image optional in the CR spec.
When not specified, the operator fetches the image from
the Ceph mon config store using the key
mgr/cephadm/container_image_nvmeof. Falls back to the
hardcoded default if the config is unavailable.

Signed-off-by: Oded Viner <oviner@redhat.com>
2026-06-11 19:55:16 +03:00
Joshua Hoblitt 573e2f81e7 object: generate URL-safe realm access keys
The realm system user's access and secret keys are generated by
GeneratePassword() and then wrapped in base64. GeneratePassword()
deliberately excludes '/' from the access key character set, but the
base64.StdEncoding wrap reintroduces it: its alphabet contains '/' and
'+', and the 14-character input always produces trailing '='. The
encoded string is the literal key used in S3 requests.

An access key containing '/' breaks AWS SigV4 credential scope parsing
("<access-key>/<date>/<region>/<service>/aws4_request" is split on
'/'), so "radosgw-admin realm pull" against the realm endpoint fails
permanently with "request failed: (22) Invalid argument" (HTTP 400),
and a CephObjectRealm pulling that realm can never reconcile.

This is the dominant cause of the "deploy second cluster rook"
failures in the rgw-multisite-testing canary job: every sampled failure
had a generated access key containing '/' and looped on EINVAL for the
whole 600s wait window, while runs with slash-free keys pulled the
realm successfully.

Encode both keys with base64.RawURLEncoding instead, whose alphabet
(A-Za-z0-9-_, unpadded) is safe in credential scopes, URLs, and shell
arguments. Only newly created realm secrets are affected; existing
secrets are not modified by the reconciler.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-06-10 15:38:58 -07:00
Joshua Hoblitt 41c81a281c Merge pull request #17684 from jhoblitt/maint-remove-dead-osd-updatequeue-clear
osd: remove unused updateQueue.Clear method
2026-06-10 14:20:04 -07:00
Santosh 3396198e9c core: delete stale MDS and RGW pdbs
When RGW and MDS intances are reduce to 1, the older RGW and MDS PDB
instance (with maxUnavailabe=1) are still available. This blocks node
drain when the node, on which the single RGW and MDS instances are
running, is drained.

This PR deletes any stale MDS and RGW PDB when the only 1 MDS and 1 RGW
instances are available.

Signed-off-by: Santosh <sapillai@redhat.com>
2026-06-10 21:04:55 +05:30
Joshua Hoblitt b29e89ef67 k8sutil: remove unused helper functions
Remove dead code from the k8sutil package; none of these symbols had any
callers anywhere in the repo (verified with deadcode, staticcheck U1000,
and repo-wide grep, tests included):

- patcher.go: delete file (Patcher type, NewPatcher, Patch)
- replicaset.go: delete file (DeleteReplicaSet)
- customresource.go: WatchCR (the CustomResource type remains in use)
- deployment.go: WaitForDeploymentImage
- job.go: WaitForJobCompletion
- k8sutil.go: GetK8SVersion
- pod.go: ConfigOverrideMount, ConfigOverrideVolume, GetPodLog
- prometheus.go: DeleteServiceMonitor
- service.go: DeleteService
- volume.go: NodeConfigURI, BinariesMountInfo, YamlToVolumes,
  YamlToVolumeMounts, and the BinariesMountPath const (only used by the
  removed BinariesMountInfo)

Now-unused imports are dropped from each file. The shared
deleteResourceAndWait helper remains (still used by DeleteDeployment).

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-06-09 15:05:19 -07:00
Joshua Hoblitt 6a94ae904c Merge pull request #17672 from jhoblitt/maint-remove-dead-verifylabels
test: remove unused label verification helpers
2026-06-09 11:28:05 -07:00
Joshua Hoblitt 8dba034126 Merge pull request #17671 from jhoblitt/maint-remove-dead-container-testhelper
test: remove unused container test helper
2026-06-09 11:27:06 -07:00
Travis Nielsen a9235090f4 Merge pull request #17649 from yuxiang-he/node-label-device-class
osd: Support using node labels for OSD device class assignment
2026-06-08 16:07:07 -06:00
Joshua Hoblitt 50c95d343e osd: remove unused updateQueue.Clear method
The Clear method on updateQueue had no callers anywhere in the repo
(verified with grep, deadcode, and staticcheck). The queue is emptied via
Remove/Pop in practice. Remove the dead method.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-06-08 15:01:15 -07:00
Joshua Hoblitt c8ad81a3cf k8sutil: remove unused daemonset helpers
daemonset.go was entirely dead: CreateDaemonSet, DeleteDaemonset,
AddRookVersionLabelToDaemonSet, and GetDaemonsets had no callers anywhere
in the repo (verified with grep, deadcode, and staticcheck). Rook does not
manage any DaemonSets via these helpers. Remove the file.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-06-08 14:57:59 -07:00
Joshua Hoblitt 80511ae2dc Merge pull request #17669 from jhoblitt/maint-remove-dead-ismoduleinspec
mgr: remove unused IsModuleInSpec function
2026-06-08 14:51:14 -07:00
Yuxiang He d9357dbfdc osd: support using node labels for OSD device class assignment
Add support for the osd.rook.io/device-class node label to assign
CRUSH device classes to all OSDs on a node.
The operator reads the label during OSD provisioning and
deployment reconciliation. If CR-level deviceClass conflicts
with the node label, the operator will skip reconciling the
node and logs an error.

Resolves: #17131
Signed-off-by: Yuxiang He <yuxiang@dropbox.com>
2026-06-08 13:21:05 -07:00
Joshua Hoblitt d12cd1a4b3 operator: remove unused LockingBool / ReconcileCanaries
The ReconcileCanaries field of controllerconfig.Context was set once in
cr_manager.go but never read anywhere, so the LockingBool type backing it
and its Get/Update methods were dead code (verified with grep and
staticcheck). Remove the field, the type, its methods, the initializer,
and the now-unused sync import.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-06-08 08:54:43 -07:00
Joshua Hoblitt ac75488621 test: remove unused label verification helpers
VerifyPodLabels had no callers anywhere in the repo, and it was the only
caller of VerifyAppLabels, which in turn was the only caller of the
checkLabel and combineErrors helpers. Remove the whole dead cluster (and
the now-unused strings, github.com/pkg/errors, and ceph/controller
imports). AssertLabelsContainCephRequirements in the same file remains and
is unaffected. Verified with grep, deadcode, and staticcheck.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-06-08 08:54:43 -07:00
Joshua Hoblitt 9efb7f351f test: remove unused container test helper
container.go in the ceph operator test-helper package was entirely dead:
ContainerTestDefinition, its TestContainer method, and the logCommandWithArgs
helper had no references anywhere in the repo (no test or non-test callers,
verified with grep, deadcode, and staticcheck). The package doc comment is
also present on info.go, so removing this file leaves the package documented.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-06-08 08:54:43 -07:00
Joshua Hoblitt f8c0d36a50 mgr: remove unused IsModuleInSpec function
IsModuleInSpec has no callers anywhere in the repository (verified with
deadcode and grep). Remove the dead code.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2026-06-08 08:54:43 -07:00
Travis Nielsen de59dcb481 Merge pull request #17546 from Nordix/Sunnatillo/fix-setting-require-osd-release
osd: fix race condition in require-osd-release after rolling upgrade
2026-06-04 09:10:57 -06:00
Sunnatillo f6fa25e844 osd: set require-osd-release from the health monitor
applyUpgradeOSDFunctionality() may run before all OSDs have registered
their new version, leaving require-osd-release unset and the cluster in
HEALTH_WARN.

Check for a single converged OSD version on each health-monitor tick and
set require-osd-release when it changes. The release name is cached to
avoid redundant ceph commands

Signed-off-by: Sunnatillo <sunnat.samadov@est.tech>
2026-06-04 16:54:36 +03:00
Artem Muterko 05da0d1294 test: add unit tests for OSD store config parsing
Signed-off-by: Artem Muterko <artem@sopho.tech>
2026-06-04 15:16:03 +02:00
Joshua Hoblitt d6d0fd8d89 Merge pull request #17648 from jhoblitt/maint-rm-dead-object-funcs
object: remove dead functions and ObjectBuckets sort type
2026-06-03 12:07:15 -07:00
Joshua Hoblitt 1c16afdbc9 Merge pull request #17647 from jhoblitt/maint-rm-dead-object-policy-funcs
object: remove dead EjectPrincipals methods and duplicate AllowedActi…
2026-06-03 11:06:18 -07:00