ignition: drop embedded provisioning url
Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
This commit is contained in:
parent
2b1facb44d
commit
b3f1b0edc8
5 changed files with 4 additions and 29 deletions
|
|
@ -32,12 +32,11 @@ type IgnitionCustomization struct {
|
|||
}
|
||||
|
||||
type EmbeddedIgnitionCustomization struct {
|
||||
ProvisioningURL string `json:"url,omitempty" toml:"url,omitempty"`
|
||||
Config string `json:"config,omitempty" toml:"config,omitempty"`
|
||||
Config string `json:"config,omitempty" toml:"config,omitempty"`
|
||||
}
|
||||
|
||||
type FirstBootIgnitionCustomization struct {
|
||||
ProvisioningURL string `json:"url,omitempty" toml:"url"`
|
||||
ProvisioningURL string `json:"url,omitempty" toml:"url,omitempty"`
|
||||
}
|
||||
|
||||
type FDOCustomization struct {
|
||||
|
|
@ -416,14 +415,3 @@ func (c *Customizations) GetIgnition() *IgnitionCustomization {
|
|||
func (c *IgnitionCustomization) HasIgnition() bool {
|
||||
return c != nil
|
||||
}
|
||||
|
||||
func (c *EmbeddedIgnitionCustomization) CheckEmbeddedIgnition() error {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
if c.Config != "" && c.ProvisioningURL != "" {
|
||||
t := reflect.TypeOf(*c)
|
||||
return &CustomizationError{fmt.Sprintf("'%s' and '%s' are not allowed at the same time", t.Field(0).Name, t.Field(1).Name)}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -364,12 +364,6 @@ func (t *imageType) checkOptions(customizations *blueprint.Customizations, optio
|
|||
if customizations.GetIgnition().Embedded != nil && customizations.GetIgnition().FirstBoot != nil {
|
||||
return fmt.Errorf("both ignition embedded and firstboot configurations found")
|
||||
}
|
||||
if customizations.GetIgnition().Embedded != nil {
|
||||
possibleErr := customizations.GetIgnition().Embedded.CheckEmbeddedIgnition()
|
||||
if possibleErr != nil {
|
||||
return possibleErr
|
||||
}
|
||||
}
|
||||
if customizations.GetIgnition().FirstBoot != nil && customizations.GetIgnition().FirstBoot.ProvisioningURL == "" {
|
||||
return fmt.Errorf("ignition.firstboot requires a provisioning url")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,7 @@ func FirstbootOptionsFromBP(bpIgnitionFirstboot blueprint.FirstBootIgnitionCusto
|
|||
}
|
||||
|
||||
type EmbeddedOptions struct {
|
||||
ProvisioningURL string
|
||||
Config string
|
||||
Config string
|
||||
}
|
||||
|
||||
func EmbeddedOptionsFromBP(bpIgnitionEmbedded blueprint.EmbeddedIgnitionCustomization) (*EmbeddedOptions, error) {
|
||||
|
|
@ -27,7 +26,6 @@ func EmbeddedOptionsFromBP(bpIgnitionEmbedded blueprint.EmbeddedIgnitionCustomiz
|
|||
return nil, errors.New("can't decode Ignition config")
|
||||
}
|
||||
return &EmbeddedOptions{
|
||||
ProvisioningURL: bpIgnitionEmbedded.ProvisioningURL,
|
||||
Config: string(decodedConfig),
|
||||
Config: string(decodedConfig),
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,9 +75,6 @@ func (p *CoreOSISOTree) serialize() osbuild.Pipeline {
|
|||
if p.coiPipeline.Ignition.Config != "" {
|
||||
filename = "ignition_config"
|
||||
copyInput = p.coiPipeline.Ignition.Config
|
||||
} else {
|
||||
filename = "ignition_url"
|
||||
copyInput = p.coiPipeline.Ignition.ProvisioningURL
|
||||
}
|
||||
pipeline.AddStage(osbuild.NewCopyStageSimple(
|
||||
&osbuild.CopyStageOptions{
|
||||
|
|
|
|||
|
|
@ -140,8 +140,6 @@ func (p *CoreOSInstaller) getInline() []string {
|
|||
if p.Ignition != nil {
|
||||
if p.Ignition.Config != "" {
|
||||
inlineData = append(inlineData, p.Ignition.Config)
|
||||
} else {
|
||||
inlineData = append(inlineData, p.Ignition.ProvisioningURL)
|
||||
}
|
||||
}
|
||||
return inlineData
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue