Skip to content

Commit 36ff76e

Browse files
KXI-61418 properly handling disks without partitions
1 parent af25108 commit 36ff76e

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.gitlab-ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,18 @@ docker-builddev-push:
6060
needs:
6161
- job: docker-builddev-push
6262
variables:
63-
APPDIR: /opt/kx/app
6463
QLIC: /tmp/qlic
6564
before_script:
6665
- mkdir -p "$QLIC"
6766
- echo -n "$KDB_LICENSE_B64" | base64 -d > "$QLIC/kc.lic"
68-
- cd ${APPDIR}
6967
- source ./config/env
7068
rules:
7169
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
70+
artifacts:
71+
paths:
72+
- logs/*/*.log
73+
expire_in: 1 day
74+
when: on_failure
7275

7376
mthread-single:
7477
extends:

src/common.q

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ controller: `$"::",argv `controller;
2424

2525
msstring:{(string x)," ms"}
2626
// df returns partition like /dev/nvme0n1p1
27-
getPartition: {[db:`C] first " " vs last system "df ", db}
27+
getFilesystem: {[db:`C] first " " vs last system "df ", db}
2828

2929
getDeviceOSX:{
3030
$[1 = count system "diskutil list|grep physical";
@@ -36,7 +36,10 @@ getDeviceOSX:{
3636
getDevice:{[db:`C]
3737
if[.z.o=`m64;:getDeviceOSX[]];
3838

39-
p: ssr[;"/dev/";""] getPartition[db];
39+
fs: getFilesystem[db];
40+
if["overlay" ~ fs; :fs]; / Inside Docker, NYI
41+
if["disk" ~ last system "lsblk -o type ", fs; :fs];
42+
p: ssr[;"/dev/";""] fs;
4043
// disk is looked up from partition by e.g. /sys/class/block/nvme0n1p1
4144
if[not (`$p) in key `$":/sys/class/block";
4245
.qlog.warn "Unable to map partition ", p, " to a device";

version.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pub: 3.3.0
2-
dev: 3.3.0
1+
pub: 3.3.1
2+
dev: 3.3.1

0 commit comments

Comments
 (0)