internal/distro/rhel9: handle ignition.embedded for edge
Signed-off-by: Irene Diez <idiez@redhat.com>
This commit is contained in:
parent
428dd169e4
commit
76728818c9
6 changed files with 98 additions and 11 deletions
29
internal/osbuild/ignition_stage.go
Normal file
29
internal/osbuild/ignition_stage.go
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package osbuild
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type IgnitionStageInputInline struct {
|
||||
InlineFile IgnitionStageInput `json:"inlinefile"`
|
||||
}
|
||||
|
||||
func (IgnitionStageInputInline) isStageInputs() {}
|
||||
|
||||
type IgnitionStageInput struct {
|
||||
inputCommon
|
||||
References IgnitionStageReferences `json:"references"`
|
||||
}
|
||||
|
||||
type IgnitionStageReferences []string
|
||||
|
||||
func (IgnitionStageReferences) isReferences() {}
|
||||
|
||||
func NewIgnitionInlineInput(embeddedData string) Inputs {
|
||||
inputs := new(IgnitionStageInputInline)
|
||||
inputs.InlineFile.Type = "org.osbuild.files"
|
||||
inputs.InlineFile.Origin = "org.osbuild.source"
|
||||
inputs.InlineFile.References = IgnitionStageReferences{fmt.Sprintf("sha256:%x", sha256.Sum256([]byte(embeddedData)))}
|
||||
return inputs
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue