Skip to content

Commit

Permalink
manifest: don't set the ostree remote from the source in the pipeline
Browse files Browse the repository at this point in the history
When we want the source URL to be set as the remote for the system, we
define it at the distro level.  In the pipeline, if no remote URL is
set, don't add a remote stage at all.
  • Loading branch information
achilleas-k committed Nov 20, 2023
1 parent 2b02d4f commit f57c88d
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions pkg/manifest/ostree_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,24 +173,21 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {
},
))

remoteURL := p.Remote.URL
if remoteURL == "" {
// if the remote URL for the image is not specified, use the source commit URL
remoteURL = commit.URL
}
pipeline.AddStage(osbuild.NewOSTreeRemotesStage(
&osbuild.OSTreeRemotesStageOptions{
Repo: "/ostree/repo",
Remotes: []osbuild.OSTreeRemote{
{
Name: p.Remote.Name,
URL: remoteURL,
ContentURL: p.Remote.ContentURL,
GPGKeyPaths: p.Remote.GPGKeyPaths,
if p.Remote.URL != "" {
pipeline.AddStage(osbuild.NewOSTreeRemotesStage(
&osbuild.OSTreeRemotesStageOptions{
Repo: "/ostree/repo",
Remotes: []osbuild.OSTreeRemote{
{
Name: p.Remote.Name,
URL: p.Remote.URL,
ContentURL: p.Remote.ContentURL,
GPGKeyPaths: p.Remote.GPGKeyPaths,
},
},
},
},
))
))
}

pipeline.AddStage(osbuild.NewOSTreeFillvarStage(
&osbuild.OSTreeFillvarStageOptions{
Expand Down

0 comments on commit f57c88d

Please sign in to comment.