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>
(cherry picked from commit b29e89ef67)
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>
(cherry picked from commit c8ad81a3cf)
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>
(cherry picked from commit 8b4fd67e17)
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>
(cherry picked from commit 50c95d343e)
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>
(cherry picked from commit 3396198e9c)
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>
(cherry picked from commit ac75488621)
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>
(cherry picked from commit 9efb7f351f)
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>
(cherry picked from commit f8c0d36a50)
Remove the following unreferenced symbols:
- (*S3Agent).CreateBucketNoInfoLogging
- (*S3Agent).DeleteBucket (wrapper; callers use the SDK client directly)
- GetBucketsStats
- ObjectBuckets type and its Len/Less/Swap sort.Interface methods
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
(cherry picked from commit ae481f0f43)
Remove (*BucketPolicy).EjectPrincipals and (*PolicyStatement).EjectPrincipals,
which had no callers outside policy.go. Also drop the duplicate PutBucketVersioning
entry in AllowedActions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
(cherry picked from commit df30bf66e8)
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>
(cherry picked from commit d9357dbfdc)
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>
(cherry picked from commit f6fa25e844)
ModifyBucketPolicy merged the caller's statement into the policy fetched
from the bucket, matching by SID. Besides a missing match flag that
appended a duplicate when a SID matched, this preserved any pre-existing
statements on the bucket and reapplied them on every reconcile.
Overwrite the policy with the provided statements instead, so a managed
bucket always ends up with exactly the intended policy and cannot retain
unexpected statements.
Signed-off-by: Artem Muterko <artem@sopho.tech>
(cherry picked from commit 321911b96c)
when using encryptedDevice:true with host based (non pvc) osds, resizing
the underlying disk and restarting the OSD didn't expand the OSD because
the LUKS encryption layer was not resized.
This PR adds resize capabilities inside the activate container. Full
device stack must be resized: PV → LV → LUKS
Steps:
1. Run pvresize and lvextend to grow the LVM layers.
2. Retrieve the LUKS key from the Ceph config-key store using the
lockbox crednetials already available in the activate container
3. Pass the key explicitly to cryptsetup resize via --key-file.
Signed-off-by: Santosh <sapillai@redhat.com>
(cherry picked from commit 3e49c9f4cf)
Wire a rookLogger adapter implementing smithy's Logger
interface so that aws.LogSigning output is emitted through
rook's capnslog when debug mode is enabled.
Signed-off-by: Oded Viner <oviner@redhat.com>
(cherry picked from commit 4b5fc9d16a)
Remove the AWS SDK v1 (github.com/aws/aws-sdk-go)
dependency entirely. All S3 operations now use AWS SDK v2
exclusively.
- Remove the v1 Client field from S3Agent struct and
rename ClientV2 to Client
- Remove v1 session/client initialization from NewS3Agent
- Update all call sites referencing ClientV2
- Convert integration tests to use v2 API calling
conventions (context parameter) and smithy error handling
- Remove aws-sdk-go v1.55.8 from go.mod
Signed-off-by: Oded Viner <oviner@redhat.com>
(cherry picked from commit 254965fff1)
# Conflicts:
# go.mod
# go.sum
adding new tls ssl_ciphersuites supporting tls 1.3 and the existing,
ssl_cipher supports tls 1.2 and below. Adding, the docs and unit-test
changs as well.
Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit b70a0c9257)
migrate the sns-based topic provisioner from aws-sdk-go (v1)
to aws-sdk-go-v2. replace v1 session, credentials, and
request handlers with v2 aws.Config, static credentials
provider, and endpoint resolver. convert the custom ceph rgw
v2 signer hack from a v1 handler swap to a smithy finalize
middleware. update sns api calls to use context-first
signatures, map[string]string attributes, and typed
snstypes.NotFoundException error handling via errors.As.
update unit tests accordingly.
Signed-off-by: Oded Viner <oviner@redhat.com>
(cherry picked from commit 81a2cd8833)
User RaceFreeFakeWatcher isntead of FakeWatcher in TestAddRemoveNode
function. The test runs c.Start() in a goroutine whch stops the watcher
when done. If mockNodeOrchestrationCompeltion sends a watch ever after,
that, FakeWatcher panics with "send on a closed channel".
RaceFreeFakeWatcher safely ignores the sends on a stopped channel.
Signed-off-by: Santosh <sapillai@redhat.com>
(cherry picked from commit 6781d2e58d)
Fixes#16834 and #17384. Per-OSD CR deviceClass was ignored in
osd prepare job when reporting the osd config back to the operator,
and in the operator's reconcile override.
Fixed by resolving the per-device class from the CR devices list
in GetCephVolumeRawOSDs and in makeDeployment.
Signed-off-by: Artem Torubarov <artem.torubarov@sap.com>
(cherry picked from commit b41d63788d)
adding missing resource request for mon drbd containers
log-collector and shut-down-app and update the unit test
to validate.
Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit d88e287726)
Added a watcher in the cluster controller to detect changes to the DRBD ConfigMap used by floating monitors in TNF deployments. When the ConfigMap is updated, the watcher triggers a CephCluster reconciliation to ensure configuration changes are applied.
Fixes#17338
Signed-off-by: Prabhala Tara Aasrita <taraasrita@ibm.com>
(cherry picked from commit af03615e97)
migrate the notification provisioner and s3ext packages from
aws sdk v1 to v2. the custom DeleteBucketNotification call is
rewritten to manually build and sign the HTTP request using the
v2 v4 signer, since this ceph-specific API has no sdk equivalent.
also fix t.Skipped() -> t.Skip() in notification integration test.
Signed-off-by: Oded Viner <oviner@redhat.com>
(cherry picked from commit f5df592106)
Going forward, admin will manage the csi operator
CR's and rook will only manage Ceph Connection cr
and client Profile cr.
The old csi driver is completely removed from Rook
and can no longer be used starting in Rook v1.20.
The upgrade guide will contain the needed transition steps
for managing the csi operator settings.
Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit 4eefad42e8)
Clean up duplicated words and a typo in object storage docs, comments, and user-facing messages.
Signed-off-by: immanuwell <pchpr.00@list.ru>
(cherry picked from commit c3a9f5fdd9)
Previously, shouldFailoverMonImmediately() was called only when a mon first went out of quorum. If the node gets deleted after the timeout starts, it does not get detected until the timeout expires. Moved the call outside the timeout initialization block so it runs on every health check iteration and detects node deletion immediately.
Fixes#15953
Signed-off-by: Prabhala Tara Aasrita <taraasrita@ibm.com>
(cherry picked from commit aeae61e5be)
this commit add option in the ceph objecstore CR
to configure TLS profile and TLS ciphersuite for
rgw beast.
Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit 01ef98c1e3)
Detect OSD encryption from the dmcrypt block path in `getOSDInfo` as a
fallback when the `encrypted` label is missing on pre-label deployments.
Include `osd.Encrypted` in the label check in `makeDeployment` so the
label reflects the actual OSD state on upgrade.
Fixes a bug where upgrading to a Rook version with the `encrypted` label
would set the label to `false` on already-encrypted OSDs, because the
label didn't exist yet and `getOSDInfo` defaulted to `false`.
Signed-off-by: Santosh <sapillai@redhat.com>
(cherry picked from commit fc9e3b54f3)
rook-ceph-exporter should use DNSPolicy ClusterFirstWithHostNet when
hostNetwork is enabled
Signed-off-by: Rohan Gupta <rohgupta@redhat.com>
(cherry picked from commit 17873d3af2)
migrate bucket provisioner from aws sdk v1 to v2.
replace awserr.Error type assertions with smithy.APIError
using errors.As for v2-style error handling.
switch setBucketPolicy and setBucketLifecycle to use
the v2 s3 client (ClientV2) directly with context.
replace v1 s3 types (BucketLifecycleConfiguration,
GetBucketLifecycleConfigurationOutput) with v2 equivalents
from s3types and s3v2 packages.
add cmpopts.IgnoreUnexported to cmp.Diff calls to handle
unexported noSmithyDocumentSerde fields in v2 sdk types.
add nil guard on lifecycle output before accessing rules
to prevent nil dereference when get returns an error.
depends on #17414
Signed-off-by: Oded Viner <oviner@redhat.com>
(cherry picked from commit 5ba3e1a2c0)
migrate PutBucketPolicy and GetBucketPolicy to use aws sdk v2
client.
Signed-off-by: Oded Viner <oviner@redhat.com>
(cherry picked from commit 88e0047d9b)