Skip to content

Commit

Permalink
Add kubeVersion to Nova dump (#3721)
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Castaño Arteaga <[email protected]>
  • Loading branch information
tegioz authored Mar 20, 2024
1 parent ec66fcd commit 7aee37b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions database/migrations/functions/packages/get_nova_dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ returns setof json as $$
select json_agg(json_build_object(
'pkg', version,
'app', app_version,
'kube', nullif(s.data->>'kubeVersion', ''),
'deprecated', nullif(deprecated, false)
))
from snapshot
Expand Down
7 changes: 6 additions & 1 deletion database/tests/functions/packages/get_nova_dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ insert into snapshot (
app_version,
description,
home_url,
data,
links,
logo_url
) values (
Expand All @@ -59,6 +60,7 @@ insert into snapshot (
'1.0.0',
'description',
'https://home.url',
'{"kubeVersion": ">= 1.19.0-0"}',
'[{"name": "link1", "url": "https://link1"}, {"name": "link2", "url": "https://link2"}]',
'https://logo.url'
);
Expand All @@ -76,10 +78,12 @@ insert into package (
insert into snapshot (
package_id,
version,
data,
deprecated
) values (
:'package2ID',
'1.0.0',
'{"kubeVersion": ""}',
true
);
insert into package (
Expand Down Expand Up @@ -135,7 +139,8 @@ select is(
"versions": [
{
"pkg": "1.0.0",
"app": "1.0.0"
"app": "1.0.0",
"kube": ">= 1.19.0-0"
}
]
},
Expand Down

0 comments on commit 7aee37b

Please sign in to comment.