Skip to content

Commit e894fbd

Browse files
committed
fix lease targeting missing parts
Make create_lease selector optional, harden the name-targeted lease parser test fixture, and reduce e2e flakiness by waiting for exporter reconnection before reusing it. Assisted-by: GPT-5.3 Codex Signed-off-by: Bella Khizgiyaev <bkhizgiy@redhat.com>
1 parent 777d6d7 commit e894fbd

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

e2e/tests.bats

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,9 @@ EOF
360360
jmp shell --client test-client-sa --name test-exporter-sa j power on
361361
jmp shell --client test-client-legacy --name test-exporter-legacy j power on
362362

363+
# Reusing the same exporter immediately can be flaky while it reconnects.
364+
wait_for_exporter
365+
363366
# --name and --selector together should work when they match.
364367
jmp shell --client test-client-oidc --name test-exporter-oidc --selector example.com/board=oidc j power on
365368
}

python/packages/jumpstarter-kubernetes/jumpstarter_kubernetes/test_leases.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def test_lease_dump_yaml():
115115
)
116116

117117

118-
def test_lease_from_dict_without_match_labels():
118+
def test_lease_from_dict_without_match_labels_name_targeted():
119119
lease = V1Alpha1Lease.from_dict(
120120
{
121121
"apiVersion": "jumpstarter.dev/v1alpha1",
@@ -133,6 +133,7 @@ def test_lease_from_dict_without_match_labels():
133133
"clientRef": {"name": "test-client"},
134134
"duration": "1h",
135135
"selector": {},
136+
"exporterRef": {"name": "test-exporter"},
136137
},
137138
"status": {
138139
"ended": False,

python/packages/jumpstarter/jumpstarter/config/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ async def list_exporters(
222222
@_handle_connection_error
223223
async def create_lease(
224224
self,
225-
selector: str | None,
226225
duration: timedelta,
226+
selector: str | None = None,
227227
exporter_name: str | None = None,
228228
begin_time: datetime | None = None,
229229
lease_id: str | None = None,

0 commit comments

Comments
 (0)