Skip to content

Commit

Permalink
config/fcos: Add extensions param and generate treefile with packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrero committed Jan 18, 2022
1 parent 82a49c5 commit 78cc5b7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/fcos/v1_5_exp/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
type Config struct {
base.Config `yaml:",inline"`
BootDevice BootDevice `yaml:"boot_device"`
Extentions Extensions `yaml:"extensions"`
}

type BootDevice struct {
Expand All @@ -38,3 +39,5 @@ type BootDeviceLuks struct {
type BootDeviceMirror struct {
Devices []string `yaml:"devices"`
}

type Extensions []string
20 changes: 20 additions & 0 deletions config/fcos/v1_5_exp/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ const (
bootV1SizeMiB = 384
)

// TO-DO: Add template like the base for client side usage (service that calls rpm-ostree)

// Maybe also here template for treefile for build time.
//var (treeFileTemplate = TODO

// ToIgn3_4Unvalidated translates the config to an Ignition config. It also
// returns the set of translations it did so paths in the resultant config
// can be tracked back to their source in the source config. No config
Expand All @@ -78,6 +83,9 @@ func (c Config) ToIgn3_4Unvalidated(options common.TranslateOptions) (types.Conf
}
}
}

c.addPackages(&ret, &ts)

return ret, ts, r
}

Expand Down Expand Up @@ -292,3 +300,15 @@ func translateBootDeviceLuks(from BootDeviceLuks, options common.TranslateOption
tm.AddTranslation(path.New("yaml"), path.New("json"))
return
}

func (c Config) addPackages(config *types.Config, ts *translate.TranslationSet) {
if len(c.Extentions) == 0 {
fmt.Println("No Packages found: ", c.Extentions)
return
} else {
fmt.Println("Packages: ", c.Extentions)
//call template here
//treeFileTemplate
}

}

0 comments on commit 78cc5b7

Please sign in to comment.