Skip to content

Commit

Permalink
stages(kickstart): introduce ostreecontainer
Browse files Browse the repository at this point in the history
Adds the necessary stage options for the new `ostreecontainer` kickstart
command.
  • Loading branch information
supakeen authored and achilleas-k committed Dec 8, 2023
1 parent 8b3eab7 commit b5dd457
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion pkg/osbuild/kickstart_stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ type KickstartStageOptions struct {
// Where to place the kickstart file
Path string `json:"path"`

OSTreeCommit *OSTreeCommitOptions `json:"ostree,omitempty"`
OSTreeCommit *OSTreeCommitOptions `json:"ostree,omitempty"`
OSTreeContainer *OSTreeContainerOptions `json:"ostreecontainer,omitempty"`

LiveIMG *LiveIMGOptions `json:"liveimg,omitempty"`

Expand All @@ -26,6 +27,14 @@ type OSTreeCommitOptions struct {
GPG bool `json:"gpg"`
}

type OSTreeContainerOptions struct {
StateRoot string `json:"stateroot"`
URL string `json:"url"`
Transport string `json:"transport"`
Remote string `json:"remote"`
SignatureVerification bool `json:"signatureverification"`
}

func (KickstartStageOptions) isStageOptions() {}

// Creates an Anaconda kickstart file
Expand Down Expand Up @@ -90,6 +99,36 @@ func NewKickstartStageOptionsWithOSTreeCommit(
return options, nil
}

func NewKickstartStageOptionsWithOSTreeContainer(
path string,
userCustomizations []users.User,
groupCustomizations []users.Group,
containerURL string,
containerTransport string,
containerRemote string,
containerStateRoot string) (*KickstartStageOptions, error) {

options, err := NewKickstartStageOptions(path, userCustomizations, groupCustomizations)

if err != nil {
return nil, err
}

if containerURL != "" {
ostreeContainerOptions := &OSTreeContainerOptions{
StateRoot: containerStateRoot,
URL: containerURL,
Remote: containerRemote,
Transport: containerTransport,
SignatureVerification: false,
}

options.OSTreeContainer = ostreeContainerOptions
}

return options, nil
}

func NewKickstartStageOptionsWithLiveIMG(
path string,
userCustomizations []users.User,
Expand Down

0 comments on commit b5dd457

Please sign in to comment.