Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Return nil for tags on unsuccessful catalogs #1293

Closed
wants to merge 1 commit into from

Conversation

mssola
Copy link
Collaborator

@mssola mssola commented Jun 5, 2017

Whenever we try to fetch the tags of a given repository, set the "tags"
value to nil for repositories for which the request was unsuccessful.
This is already handled by the CatalogJob as a way to skip it. This way,
we avoid removing repos when a 401 response has been returned when
accessing the catalog.

Signed-off-by: Miquel Sabaté Solà msabate@suse.com

Whenever we try to fetch the tags of a given repository, set the "tags"
value to nil for repositories for which the request was unsuccessful.
This is already handled by the CatalogJob as a way to skip it. This way,
we avoid removing repos when a 401 response has been returned when
accessing the catalog.

Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
@mssola mssola changed the title Return empty tags on unsuccessful catalogs Return nil for tags on unsuccessful catalogs Jun 5, 2017
@odg0318
Copy link

odg0318 commented Jul 5, 2017

I changed my code and checked that CatalogJob works fine.
But it repeatedly deleted and created the existing repositories.

@mssola
Copy link
Collaborator Author

mssola commented Apr 13, 2018

Closing. After #1782 I will submit a PR that depends on it that clears this once and for all. It should also cover some corner cases pointed out in #1599.

@mssola mssola closed this Apr 13, 2018
@mssola mssola deleted the on-401-catalog branch April 13, 2018 13:51
mssola added a commit to mssola/Portus that referenced this pull request Apr 17, 2018
This commit is more explicit on what to do when a catalog error happens.
In this case, if a plain catalog error happens (fetching the list of
repositories and their manifests), then nothing will be done. If
fetching the catalog worked, and fetching the list of tags then suddenly
fails, before this commit that repo would've get nuked because it
would've get a repository with no tags.

This commit instructs to skip that repository when considering whether
to remove or not some repositories that are found to be dangling.

See SUSE#1293
See SUSE#1599

Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
mssola added a commit to mssola/Portus that referenced this pull request Apr 18, 2018
This commit is more explicit on what to do when a catalog error happens.
In this case, if a plain catalog error happens (fetching the list of
repositories and their manifests), then nothing will be done. If
fetching the catalog worked, and fetching the list of tags then suddenly
fails, before this commit that repo would've get nuked because it
would've get a repository with no tags.

This commit instructs to skip that repository when considering whether
to remove or not some repositories that are found to be dangling.

See SUSE#1293
See SUSE#1599

Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
mssola added a commit that referenced this pull request Apr 18, 2018
This commit is more explicit on what to do when a catalog error happens.
In this case, if a plain catalog error happens (fetching the list of
repositories and their manifests), then nothing will be done. If
fetching the catalog worked, and fetching the list of tags then suddenly
fails, before this commit that repo would've get nuked because it
would've get a repository with no tags.

This commit instructs to skip that repository when considering whether
to remove or not some repositories that are found to be dangling.

See #1293
See #1599

Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants