Skip to content

Commit

Permalink
worker: check MTLS config for ostree
Browse files Browse the repository at this point in the history
  • Loading branch information
lzap authored and achilleas-k committed Nov 12, 2024
1 parent 2eb3c9f commit 2a5d25d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/osbuild-worker/jobimpl-ostree-resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ type OSTreeResolveJobImpl struct {
}

func (job *OSTreeResolveJobImpl) CompareBaseURL(baseURLStr string) (bool, error) {
if job.RepositoryMTLSConfig == nil || job.RepositoryMTLSConfig.BaseURL == nil {
return false, nil
}

baseURL, err := url.Parse(baseURLStr)
if err != nil {
return false, err
Expand Down Expand Up @@ -91,6 +95,12 @@ func (impl *OSTreeResolveJobImpl) Run(job worker.Job) error {
err.Error(),
)
break
} else {
mURL := ""
if impl.RepositoryMTLSConfig != nil && impl.RepositoryMTLSConfig.BaseURL != nil {
mURL = impl.RepositoryMTLSConfig.BaseURL.String()
}
logWithId.Warnf("Repository URL '%s' does not match '%s', MTLS: %t", s.URL, mURL, impl.RepositoryMTLSConfig != nil)
}
commitSpec, err := ostree.Resolve(reqParams)
if err != nil {
Expand Down

0 comments on commit 2a5d25d

Please sign in to comment.