Skip to content

Conversation

@thozza
Copy link
Member

@thozza thozza commented Sep 23, 2024

Add NoReposLoadedError custom error type for the case when any function that is supposed to load repository configs, does not load any. Use it in all functions that are directly loading repositories from configuration files.

I considered NoReposError name, but that could be later added for functions such as RepoRegistry.ReposBy...(), in case there are no repositories in the RepoRegistry for the given image type / arch.

This is a follow-up to osbuild/osbuild-composer#4378

Add `NoReposLoadedError` custom error type for the case when any
function that is supposed to load repository configs, does not load
any. Use it in all functions that are directly loading repositories
from configuration files.

I considered `NoReposError` name, but that could be later added for
functions such as `RepoRegistry.ReposBy...()`, in case there are no
repositories in the RepoRegistry for the given image type / arch.

Signed-off-by: Tomáš Hozza <[email protected]>
Copy link
Contributor

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@github-actions
Copy link

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 25, 2024
@mvo5 mvo5 removed the Stale label Oct 25, 2024
@mvo5 mvo5 added this pull request to the merge queue Oct 25, 2024
Merged via the queue into osbuild:main with commit a30708c Oct 25, 2024
achilleas-k added a commit to achilleas-k/osbuild-composer that referenced this pull request Oct 30, 2024
osbuild/images added an error type that's returned when the reporegistry
loader doesn't find any repository configurations to load [1].  This
lets callers decide whether to stop or continue execution based on
whether repository configurations are required.

Weldr (running on-prem) requires local repository configurations, while
the API (SaaS) doesn't.  However, at the time during startup when
reporegistry.LoadAllRepositories() is called, it is still not known
whether the Weldr API will be initialised.

Log the error message as an info message when it is detected but
continue execution.

[1] osbuild/images#946
achilleas-k added a commit to achilleas-k/osbuild-composer that referenced this pull request Oct 30, 2024
osbuild/images added an error type that's returned when the reporegistry
loader doesn't find any repository configurations to load [1].  This
lets callers decide whether to stop or continue execution based on
whether repository configurations are required.

Weldr (running on-prem) requires local repository configurations, while
the API (SaaS) doesn't.  However, at the time during startup when
reporegistry.LoadAllRepositories() is called, it is still not known
whether the Weldr API will be initialised.

Log the error message as an info message when it is detected but
continue execution.

[1] osbuild/images#946
achilleas-k added a commit to achilleas-k/osbuild-composer that referenced this pull request Oct 31, 2024
osbuild/images added an error type that's returned when the reporegistry
loader doesn't find any repository configurations to load [1].  This
lets callers decide whether to stop or continue execution based on
whether repository configurations are required.

Weldr (running on-prem) requires local repository configurations, while
the API (SaaS) doesn't.  However, at the time during startup when
reporegistry.LoadAllRepositories() is called, it is still not known
whether the Weldr API will be initialised.

Log the error message as an info message when it is detected but
continue execution.

[1] osbuild/images#946
achilleas-k added a commit to achilleas-k/osbuild-composer that referenced this pull request Oct 31, 2024
osbuild/images added an error type that's returned when the reporegistry
loader doesn't find any repository configurations to load [1].  This
lets callers decide whether to stop or continue execution based on
whether repository configurations are required.

Weldr (running on-prem) requires local repository configurations, while
the API (SaaS) doesn't.  However, at the time during startup when
reporegistry.LoadAllRepositories() is called, it is still not known
whether the Weldr API will be initialised.

Log the error message as an info message when it is detected but
continue execution.

[1] osbuild/images#946
mvo5 added a commit to mvo5/osbuild-composer that referenced this pull request Jan 29, 2025
This commit changes cmd/composer to use the `reporegistry.New`
call again. This is a preparation for
osbuild/images#1179

And undoes parts of osbuild#4378
but that is no longer necessary because in
osbuild/images#946 the error is now passed
on from `reporegistry.New()` in the same way as from `LoadRepositories()`.
thozza pushed a commit to osbuild/osbuild-composer that referenced this pull request Jan 29, 2025
This commit changes cmd/composer to use the `reporegistry.New`
call again. This is a preparation for
osbuild/images#1179

And undoes parts of #4378
but that is no longer necessary because in
osbuild/images#946 the error is now passed
on from `reporegistry.New()` in the same way as from `LoadRepositories()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants