upload/pulp: distribute ostree repo
Function for distributing an ostree repository, making it available for consumption.
This commit is contained in:
parent
57f1bb8bf4
commit
50367e6f14
1 changed files with 13 additions and 0 deletions
|
|
@ -126,3 +126,16 @@ func (cl *Client) ImportCommit(commitHref, repoHref string) (string, error) {
|
|||
|
||||
return result.Task, nil
|
||||
}
|
||||
|
||||
// Distribute makes an ostree repository available for download. This task is
|
||||
// asynchronous. The returned value is the href for the distribute task.
|
||||
func (cl *Client) DistributeOSTreeRepo(basePath, name, repoHref string) (string, error) {
|
||||
dist := *pulpclient.NewOstreeOstreeDistribution(basePath, name)
|
||||
dist.SetRepository(repoHref)
|
||||
res, resp, err := cl.client.DistributionsOstreeAPI.DistributionsOstreeOstreeCreate(cl.ctx).OstreeOstreeDistribution(dist).Execute()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("error distributing ostree repository: %s (%s)", err.Error(), readBody(resp))
|
||||
}
|
||||
|
||||
return res.Task, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue