Skip to content

Commit

Permalink
fix: mirrors with capability declaraion might disappear in /rest/server
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-suse committed Nov 24, 2023
1 parent 863fb70 commit 030c808
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/MirrorCache/Schema/Result/Server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ __PACKAGE__->has_many(
__PACKAGE__->has_many(
"server_capability_declaration",
"MirrorCache::Schema::Result::ServerCapabilityDeclaration",
{ "foreign.server_id" => "self.id" },
sub {
my $args = shift;
return {
"$args->{foreign_alias}.server_id" => { -ident => "$args->{self_alias}.id" },
"$args->{foreign_alias}.extra" => { '=', 'region' },
};
},
{ cascade_copy => 0, cascade_delete => 0, join_type => 'left' },
);

Expand Down
2 changes: 2 additions & 0 deletions t/environ/01-smoke-mirror-country-only-remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,6 @@ $mc/curl -I /download/folder1/file1.1.dat?COUNTRY=dk | grep -C10 302 | grep "$($
echo but ap8 still serves uk
$mc/curl -I /download/folder1/file1.1.dat?COUNTRY=uk | grep -C10 302 | grep "$($ap8/print_address)"

$mc/curl /rest/server | grep "$($ap8/print_address)"

echo success

0 comments on commit 030c808

Please sign in to comment.