Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bib: load repo keys using external paths (COMPOSER-2408) #734

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bib/cmd/bootc-image-builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func manifestFromCobra(cmd *cobra.Command, args []string) ([]byte, *mTLSConfig,
return nil, nil, err
}

mTLS, err := extractTLSKeys(container, repos)
mTLS, err := extractTLSKeys(SimpleFileReader{}, repos)
if err != nil {
return nil, nil, err
}
Expand Down
6 changes: 6 additions & 0 deletions bib/cmd/bootc-image-builder/mtls.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ type fileReader interface {
ReadFile(string) ([]byte, error)
}

type SimpleFileReader struct{}

func (SimpleFileReader) ReadFile(path string) ([]byte, error) {
return os.ReadFile(path)
}

func extractTLSKeys(reader fileReader, repoSets map[string][]rpmmd.RepoConfig) (*mTLSConfig, error) {
var keyPath, certPath, caPath string
for _, set := range repoSets {
Expand Down
Loading