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

impl: let manifest file specify --enable-network for mock #105

Merged
merged 2 commits into from
Apr 16, 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
4 changes: 4 additions & 0 deletions impl/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ func (bldr *mockBuilder) runFedoraMockStages() error {
if bldr.noCheck {
buildArgs = append(buildArgs, "--nocheck")
}
if bldr.enableNetwork {
buildArgs = append(buildArgs, "--enable-network")
}
bldr.log("starting")
if err := bldr.runMockCmd(buildArgs); err != nil {
return err
Expand Down Expand Up @@ -403,6 +406,7 @@ func Mock(repo string, pkg string, arch string, extraArgs MockExtraCmdlineArgs)
dnfConfig: dnfConfig,
errPrefix: errPrefix,
dependencyList: dependencyList,
enableNetwork: pkgSpec.Build.EnableNetwork,
},
onlyCreateCfg: extraArgs.OnlyCreateCfg,
noCheck: extraArgs.NoCheck,
Expand Down
1 change: 1 addition & 0 deletions impl/mock_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type builderCommon struct {
dnfConfig *dnfconfig.DnfConfig
errPrefix util.ErrPrefix
dependencyList []string
enableNetwork bool
}

type mockCfgBuilder struct {
Expand Down
9 changes: 5 additions & 4 deletions manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ type Generator struct {
// Generator specifies commands for eext generator
// Refer to Generator struct denifition above.
type Build struct {
Include []string `yaml:"include"`
RepoBundle []RepoBundle `yaml:"repo-bundle"`
Dependencies map[string][]string `yaml:"dependencies"`
Generator Generator `yaml:"eextgen"`
Include []string `yaml:"include"`
RepoBundle []RepoBundle `yaml:"repo-bundle"`
Dependencies map[string][]string `yaml:"dependencies"`
Generator Generator `yaml:"eextgen"`
EnableNetwork bool `yaml:"enable-network"`
}

// DetachedSignature spec
Expand Down
Loading