osbuild: add support for resolv-conf stage
This commit is contained in:
parent
3e566398ec
commit
295bc09592
3 changed files with 37 additions and 0 deletions
|
|
@ -283,6 +283,8 @@ func (t *imageType) pipeline(c *blueprint.Customizations, options distro.ImageOp
|
|||
p.AddStage(osbuild.NewRPMStage(t.rpmStageOptions(*t.arch, repos, packageSpecs)))
|
||||
p.AddStage(osbuild.NewFixBLSStage())
|
||||
|
||||
p.AddStage(osbuild.NewResolvConfStage(t.resolvConfOptions()))
|
||||
|
||||
if pt != nil {
|
||||
p.AddStage(osbuild.NewFSTabStage(pt.FSTabStageOptions()))
|
||||
}
|
||||
|
|
@ -460,6 +462,10 @@ func (t *imageType) userStageOptions(users []blueprint.UserCustomization) (*osbu
|
|||
return &options, nil
|
||||
}
|
||||
|
||||
func (t *imageType) resolvConfOptions() *osbuild.ResolvConfStageOptions {
|
||||
return &osbuild.ResolvConfStageOptions{}
|
||||
}
|
||||
|
||||
func (t *imageType) groupStageOptions(groups []blueprint.GroupCustomization) *osbuild.GroupsStageOptions {
|
||||
options := osbuild.GroupsStageOptions{
|
||||
Groups: map[string]osbuild.GroupsStageOptionsGroup{},
|
||||
|
|
|
|||
15
internal/osbuild1/resolv_conf_stage.go
Normal file
15
internal/osbuild1/resolv_conf_stage.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package osbuild1
|
||||
|
||||
type ResolvConfStageOptions struct {
|
||||
Nameserver []string `json:"nameserver,omitempty"`
|
||||
Search []string `json:"search,omitempty"`
|
||||
}
|
||||
|
||||
func (ResolvConfStageOptions) isStageOptions() {}
|
||||
|
||||
func NewResolvConfStage(options *ResolvConfStageOptions) *Stage {
|
||||
return &Stage{
|
||||
Name: "org.osbuild.resolv-conf",
|
||||
Options: options,
|
||||
}
|
||||
}
|
||||
16
internal/osbuild1/resolv_conf_stage_test.go
Normal file
16
internal/osbuild1/resolv_conf_stage_test.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package osbuild1
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestNewResolvConfStageStage(t *testing.T) {
|
||||
expectedStage := &Stage{
|
||||
Name: "org.osbuild.resolv-conf",
|
||||
Options: &ResolvConfStageOptions{},
|
||||
}
|
||||
actualStage := NewResolvConfStage(&ResolvConfStageOptions{})
|
||||
assert.Equal(t, expectedStage, actualStage)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue