Skip to content

ProxyRepository::read_tags_in_namespace contacts secondary repository despite configuration #1271

@jrray

Description

@jrray

async fn read_tag_in_namespace(
&self,
namespace: Option<&TagNamespace>,
tag: &tracking::TagSpec,
) -> Result<Pin<Box<dyn Stream<Item = Result<tracking::Tag>> + Send>>> {
let mut res = self.primary.read_tag_in_namespace(namespace, tag).await;
if res.is_ok() {
return res;
}
for repo in self.secondary.iter() {

I have a use case where I want to use a FallbackRepository in such a way that it only looks at the primary repository for tags but is willing to "repair" missing objects from secondary repositories. I'm talking about ProxyRepository here but the problem applies to both, after #1263.

ProxyRepository::read_tags_in_namespace will consult the secondary repositories, but other functions didn't until #1205, where the include_secondary_tags configuration property was added.

pub include_secondary_tags: bool,

In that PR, other methods were changed to also consult the secondary repositories, but only if this config property is true. However, ProxyRepository::read_tags_in_namespace was left as-is so it always consults secondary repositories without regard to the new configuration property.

Was that intentional? I need a way to turn that off. Does it suit everyone to use include_secondary_tags to govern this behavior or to we need more fine grained control here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions