Skip to content

Commit

Permalink
Merge pull request #303 from lsst-sqre/tickets/DM-41907
Browse files Browse the repository at this point in the history
DM-41907: Convert all Kubernetes comparison to new function
  • Loading branch information
rra authored Dec 8, 2023
2 parents b942b1a + ec57cc2 commit 99bd247
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
19 changes: 9 additions & 10 deletions controller/tests/data/standard/output/prepull-objects.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
[
{
"api_version": "v1",
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"labels": {
"nublado.lsst.io/category": "prepuller"
},
"name": "prepull-d-2077-10-23-node2",
"namespace": "nublado",
"owner_references": [
"ownerReferences": [
{
"api_version": "v1",
"block_owner_deletion": true,
"apiVersion": "v1",
"blockOwnerDeletion": true,
"kind": "Pod",
"name": "nublado-controller",
"uid": "12720beb-ecae-452e-982e-2f0a0a2fbaf1"
}
],
"resource_version": "1"
]
},
"spec": {
"containers": [
Expand All @@ -27,14 +26,14 @@
],
"image": "lighthouse.ceres/library/sketchbook:d_2077_10_23@sha256:1234",
"name": "prepull",
"working_dir": "/tmp"
"workingDir": "/tmp"
}
],
"image_pull_secrets": [
"imagePullSecrets": [
{ "name": "pull-secret" }
],
"node_name": "node2",
"restart_policy": "Never"
"nodeName": "node2",
"restartPolicy": "Never"
},
"status": {
"phase": "Running"
Expand Down
4 changes: 2 additions & 2 deletions controller/tests/services/prepuller_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
V1ObjectMeta,
V1Pod,
)
from safir.testing.kubernetes import MockKubernetesApi, strip_none
from safir.testing.kubernetes import MockKubernetesApi
from safir.testing.slack import MockSlackWebhook

from controller.config import Config
Expand Down Expand Up @@ -86,7 +86,7 @@ async def test_docker(
# nodes. Check that we created the correct prepuller pods.
pod_list = await mock_kubernetes.list_namespaced_pod("nublado")
expected = read_output_json("standard", "prepull-objects")
assert [strip_none(o.to_dict()) for o in pod_list.items] == expected
assert objects_to_dicts(pod_list.items) == expected

# Update all of the pods to have a status of completed and send an event.
for pod in pod_list.items:
Expand Down

0 comments on commit 99bd247

Please sign in to comment.