Documentation ¶
Overview ¶
Package blueprint contains primitives for representing weldr blueprints
Index ¶
- func Convert(bp Blueprint) iblueprint.Blueprint
- func DirectoryCustomizationsToFsNodeDirectories(dirs []DirectoryCustomization) ([]*fsnode.Directory, error)
- func FileCustomizationsToFsNodeFiles(files []FileCustomization) ([]*fsnode.File, error)
- type AnacondaModules
- type Blueprint
- type Change
- type Container
- type CustomizationError
- type Customizations
- func (c *Customizations) CheckAllowed(allowed ...string) error
- func (c *Customizations) GetDirectories() []DirectoryCustomization
- func (c *Customizations) GetFDO() *FDOCustomization
- func (c *Customizations) GetFIPS() bool
- func (c *Customizations) GetFiles() []FileCustomization
- func (c *Customizations) GetFilesystems() []FilesystemCustomization
- func (c *Customizations) GetFilesystemsMinSize() uint64
- func (c *Customizations) GetFirewall() *FirewallCustomization
- func (c *Customizations) GetGroups() []GroupCustomization
- func (c *Customizations) GetHostname() *string
- func (c *Customizations) GetIgnition() *IgnitionCustomization
- func (c *Customizations) GetInstallationDevice() string
- func (c *Customizations) GetKernel() *KernelCustomization
- func (c *Customizations) GetOpenSCAP() *OpenSCAPCustomization
- func (c *Customizations) GetPartitioningMode() (disk.PartitioningMode, error)
- func (c *Customizations) GetPrimaryLocale() (*string, *string)
- func (c *Customizations) GetRepositories() ([]RepositoryCustomization, error)
- func (c *Customizations) GetServices() *ServicesCustomization
- func (c *Customizations) GetTimezoneSettings() (*string, []string)
- func (c *Customizations) GetUsers() []UserCustomization
- type DNFPluginConfig
- type DirectoryCustomization
- type EmbeddedIgnitionCustomization
- type FDOCustomization
- type FileCustomization
- type FilesystemCustomization
- type FirewallCustomization
- type FirewallServicesCustomization
- type FirewallZoneCustomization
- type FirstBootIgnitionCustomization
- type Group
- type GroupCustomization
- type IgnitionCustomization
- type InstallerCustomization
- type KernelCustomization
- type Kickstart
- type LocaleCustomization
- type OpenSCAPCustomization
- type OpenSCAPJSONTailoringCustomizations
- type OpenSCAPTailoringCustomizations
- type Package
- type RHSMConfig
- type RHSMCustomization
- type RPMCustomization
- type RPMImportKeys
- type RepositoryCustomization
- type SSHKeyCustomization
- type ServicesCustomization
- type SubManConfig
- type SubManDNFPluginsConfig
- type SubManRHSMCertdConfig
- type SubManRHSMConfig
- type TimezoneCustomization
- type UserCustomization
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
func Convert(bp Blueprint) iblueprint.Blueprint
func DirectoryCustomizationsToFsNodeDirectories ¶
func DirectoryCustomizationsToFsNodeDirectories(dirs []DirectoryCustomization) ([]*fsnode.Directory, error)
DirectoryCustomizationsToFsNodeDirectories converts a slice of DirectoryCustomizations to a slice of fsnode.Directories
func FileCustomizationsToFsNodeFiles ¶
func FileCustomizationsToFsNodeFiles(files []FileCustomization) ([]*fsnode.File, error)
FileCustomizationsToFsNodeFiles converts a slice of FileCustomization to a slice of *fsnode.File
Types ¶
type AnacondaModules ¶
type Blueprint ¶
type Blueprint struct { Name string `json:"name" toml:"name"` Description string `json:"description" toml:"description"` Version string `json:"version,omitempty" toml:"version,omitempty"` Packages []Package `json:"packages" toml:"packages"` Modules []Package `json:"modules" toml:"modules"` Groups []Group `json:"groups" toml:"groups"` Containers []Container `json:"containers,omitempty" toml:"containers,omitempty"` Customizations *Customizations `json:"customizations,omitempty" toml:"customizations"` Distro string `json:"distro" toml:"distro"` Arch string `json:"architecture,omitempty" toml:"architecture,omitempty"` }
A Blueprint is a high-level description of an image.
func (*Blueprint) BumpVersion ¶
BumpVersion increments the previous blueprint's version If the old version string is not vaild semver it will use the new version as-is This assumes that the new blueprint's version has already been validated via Initialize
func (*Blueprint) CryptPasswords ¶
CryptPasswords ensures that all blueprint passwords are hashed
func (*Blueprint) DeepCopy ¶
DeepCopy returns a deep copy of the blueprint This uses json.Marshal and Unmarshal which are not very efficient
func (*Blueprint) GetPackages ¶
packages, modules, and groups all resolve to rpm packages right now. This function returns a combined list of "name-version" strings.
func (*Blueprint) GetPackagesEx ¶
func (*Blueprint) Initialize ¶
Initialize ensures that the blueprint has sane defaults for any missing fields
type CustomizationError ¶
type CustomizationError struct {
Message string
}
func (*CustomizationError) Error ¶
func (e *CustomizationError) Error() string
type Customizations ¶
type Customizations struct { Hostname *string `json:"hostname,omitempty" toml:"hostname,omitempty"` Kernel *KernelCustomization `json:"kernel,omitempty" toml:"kernel,omitempty"` SSHKey []SSHKeyCustomization `json:"sshkey,omitempty" toml:"sshkey,omitempty"` User []UserCustomization `json:"user,omitempty" toml:"user,omitempty"` Group []GroupCustomization `json:"group,omitempty" toml:"group,omitempty"` Timezone *TimezoneCustomization `json:"timezone,omitempty" toml:"timezone,omitempty"` Locale *LocaleCustomization `json:"locale,omitempty" toml:"locale,omitempty"` Firewall *FirewallCustomization `json:"firewall,omitempty" toml:"firewall,omitempty"` Services *ServicesCustomization `json:"services,omitempty" toml:"services,omitempty"` Filesystem []FilesystemCustomization `json:"filesystem,omitempty" toml:"filesystem,omitempty"` InstallationDevice string `json:"installation_device,omitempty" toml:"installation_device,omitempty"` PartitioningMode string `json:"partitioning_mode,omitempty" toml:"partitioning_mode,omitempty"` FDO *FDOCustomization `json:"fdo,omitempty" toml:"fdo,omitempty"` OpenSCAP *OpenSCAPCustomization `json:"openscap,omitempty" toml:"openscap,omitempty"` Ignition *IgnitionCustomization `json:"ignition,omitempty" toml:"ignition,omitempty"` Directories []DirectoryCustomization `json:"directories,omitempty" toml:"directories,omitempty"` Files []FileCustomization `json:"files,omitempty" toml:"files,omitempty"` Repositories []RepositoryCustomization `json:"repositories,omitempty" toml:"repositories,omitempty"` FIPS *bool `json:"fips,omitempty" toml:"fips,omitempty"` Installer *InstallerCustomization `json:"installer,omitempty" toml:"installer,omitempty"` RPM *RPMCustomization `json:"rpm,omitempty" toml:"rpm,omitempty"` RHSM *RHSMCustomization `json:"rhsm,omitempty" toml:"rhsm,omitempty"` }
func (*Customizations) CheckAllowed ¶
func (c *Customizations) CheckAllowed(allowed ...string) error
CheckCustomizations returns an error of type `CustomizationError` if `c` has any customizations not specified in `allowed`
func (*Customizations) GetDirectories ¶
func (c *Customizations) GetDirectories() []DirectoryCustomization
func (*Customizations) GetFDO ¶
func (c *Customizations) GetFDO() *FDOCustomization
func (*Customizations) GetFIPS ¶
func (c *Customizations) GetFIPS() bool
func (*Customizations) GetFiles ¶
func (c *Customizations) GetFiles() []FileCustomization
func (*Customizations) GetFilesystems ¶
func (c *Customizations) GetFilesystems() []FilesystemCustomization
func (*Customizations) GetFilesystemsMinSize ¶
func (c *Customizations) GetFilesystemsMinSize() uint64
func (*Customizations) GetFirewall ¶
func (c *Customizations) GetFirewall() *FirewallCustomization
func (*Customizations) GetGroups ¶
func (c *Customizations) GetGroups() []GroupCustomization
func (*Customizations) GetHostname ¶
func (c *Customizations) GetHostname() *string
func (*Customizations) GetIgnition ¶
func (c *Customizations) GetIgnition() *IgnitionCustomization
func (*Customizations) GetInstallationDevice ¶
func (c *Customizations) GetInstallationDevice() string
func (*Customizations) GetKernel ¶
func (c *Customizations) GetKernel() *KernelCustomization
func (*Customizations) GetOpenSCAP ¶
func (c *Customizations) GetOpenSCAP() *OpenSCAPCustomization
func (*Customizations) GetPartitioningMode ¶
func (c *Customizations) GetPartitioningMode() (disk.PartitioningMode, error)
GetPartitioningMode converts the string to a disk.PartitioningMode type
func (*Customizations) GetPrimaryLocale ¶
func (c *Customizations) GetPrimaryLocale() (*string, *string)
func (*Customizations) GetRepositories ¶
func (c *Customizations) GetRepositories() ([]RepositoryCustomization, error)
func (*Customizations) GetServices ¶
func (c *Customizations) GetServices() *ServicesCustomization
func (*Customizations) GetTimezoneSettings ¶
func (c *Customizations) GetTimezoneSettings() (*string, []string)
func (*Customizations) GetUsers ¶
func (c *Customizations) GetUsers() []UserCustomization
type DNFPluginConfig ¶
type DNFPluginConfig struct {
Enabled *bool `json:"enabled,omitempty" toml:"enabled,omitempty"`
}
type DirectoryCustomization ¶
type DirectoryCustomization struct { // Absolute path to the directory Path string `json:"path" toml:"path"` // Owner of the directory specified as a string (user name), int64 (UID) or nil User interface{} `json:"user,omitempty" toml:"user,omitempty"` // Owner of the directory specified as a string (group name), int64 (UID) or nil Group interface{} `json:"group,omitempty" toml:"group,omitempty"` // Permissions of the directory specified as an octal number Mode string `json:"mode,omitempty" toml:"mode,omitempty"` // EnsureParents ensures that all parent directories of the directory exist EnsureParents bool `json:"ensure_parents,omitempty" toml:"ensure_parents,omitempty"` }
DirectoryCustomization represents a directory to be created in the image
func (DirectoryCustomization) ToFsNodeDirectory ¶
func (d DirectoryCustomization) ToFsNodeDirectory() (*fsnode.Directory, error)
ToFsNodeDirectory converts the DirectoryCustomization to an fsnode.Directory
func (*DirectoryCustomization) UnmarshalJSON ¶
func (d *DirectoryCustomization) UnmarshalJSON(data []byte) error
Custom JSON unmarshalling for DirectoryCustomization with validation
func (*DirectoryCustomization) UnmarshalTOML ¶
func (d *DirectoryCustomization) UnmarshalTOML(data interface{}) error
Custom TOML unmarshalling for DirectoryCustomization with validation
type EmbeddedIgnitionCustomization ¶
type EmbeddedIgnitionCustomization struct {
Config string `json:"config,omitempty" toml:"config,omitempty"`
}
type FDOCustomization ¶
type FDOCustomization struct { ManufacturingServerURL string `json:"manufacturing_server_url,omitempty" toml:"manufacturing_server_url,omitempty"` DiunPubKeyInsecure string `json:"diun_pub_key_insecure,omitempty" toml:"diun_pub_key_insecure,omitempty"` // This is the output of: // echo "sha256:$(openssl x509 -fingerprint -sha256 -noout -in diun_cert.pem | cut -d"=" -f2 | sed 's/://g')" DiunPubKeyHash string `json:"diun_pub_key_hash,omitempty" toml:"diun_pub_key_hash,omitempty"` DiunPubKeyRootCerts string `json:"diun_pub_key_root_certs,omitempty" toml:"diun_pub_key_root_certs,omitempty"` DiMfgStringTypeMacIface string `json:"di_mfg_string_type_mac_iface,omitempty" toml:"di_mfg_string_type_mac_iface,omitempty"` }
type FileCustomization ¶
type FileCustomization struct { // Absolute path to the file Path string `json:"path" toml:"path"` // Owner of the directory specified as a string (user name), int64 (UID) or nil User interface{} `json:"user,omitempty" toml:"user,omitempty"` // Owner of the directory specified as a string (group name), int64 (UID) or nil Group interface{} `json:"group,omitempty" toml:"group,omitempty"` // Permissions of the file specified as an octal number Mode string `json:"mode,omitempty" toml:"mode,omitempty"` // Data is the file content in plain text Data string `json:"data,omitempty" toml:"data,omitempty"` }
FileCustomization represents a file to be created in the image
func (FileCustomization) ToFsNodeFile ¶
func (f FileCustomization) ToFsNodeFile() (*fsnode.File, error)
ToFsNodeFile converts the FileCustomization to an fsnode.File
func (*FileCustomization) UnmarshalJSON ¶
func (f *FileCustomization) UnmarshalJSON(data []byte) error
Custom JSON unmarshalling for FileCustomization with validation
func (*FileCustomization) UnmarshalTOML ¶
func (f *FileCustomization) UnmarshalTOML(data interface{}) error
Custom TOML unmarshalling for FileCustomization with validation
type FilesystemCustomization ¶
type FilesystemCustomization struct { Mountpoint string `json:"mountpoint,omitempty" toml:"mountpoint,omitempty"` MinSize uint64 `json:"minsize,omitempty" toml:"minsize,omitempty"` }
func (*FilesystemCustomization) UnmarshalJSON ¶
func (fsc *FilesystemCustomization) UnmarshalJSON(data []byte) error
func (*FilesystemCustomization) UnmarshalTOML ¶
func (fsc *FilesystemCustomization) UnmarshalTOML(data interface{}) error
type FirewallCustomization ¶
type FirewallCustomization struct { Ports []string `json:"ports,omitempty" toml:"ports,omitempty"` Services *FirewallServicesCustomization `json:"services,omitempty" toml:"services,omitempty"` Zones []FirewallZoneCustomization `json:"zones,omitempty" toml:"zones,omitempty"` }
type FirstBootIgnitionCustomization ¶
type FirstBootIgnitionCustomization struct {
ProvisioningURL string `json:"url,omitempty" toml:"url,omitempty"`
}
type Group ¶
type Group struct {
Name string `json:"name" toml:"name"`
}
A group specifies an package group.
type GroupCustomization ¶
type IgnitionCustomization ¶
type IgnitionCustomization struct { Embedded *EmbeddedIgnitionCustomization `json:"embedded,omitempty" toml:"embedded,omitempty"` FirstBoot *FirstBootIgnitionCustomization `json:"firstboot,omitempty" toml:"firstboot,omitempty"` }
type InstallerCustomization ¶
type InstallerCustomization struct { Unattended bool `json:"unattended,omitempty" toml:"unattended,omitempty"` SudoNopasswd []string `json:"sudo-nopasswd,omitempty" toml:"sudo-nopasswd,omitempty"` Kickstart *Kickstart `json:"kickstart,omitempty" toml:"kickstart,omitempty"` Modules *AnacondaModules `json:"modules,omitempty" toml:"modules,omitempty"` }
type KernelCustomization ¶
type LocaleCustomization ¶
type OpenSCAPCustomization ¶
type OpenSCAPCustomization struct { DataStream string `json:"datastream,omitempty" toml:"datastream,omitempty"` ProfileID string `json:"profile_id,omitempty" toml:"profile_id,omitempty"` Tailoring *OpenSCAPTailoringCustomizations `json:"tailoring,omitempty" toml:"tailoring,omitempty"` JSONTailoring *OpenSCAPJSONTailoringCustomizations `json:"json_tailoring,omitempty" toml:"json_tailoring,omitempty"` PolicyID string `json:"policy_id,omitempty" toml:"policy_id,omitempty"` }
type Package ¶
type Package struct { Name string `json:"name" toml:"name"` Version string `json:"version,omitempty" toml:"version,omitempty"` }
A Package specifies an RPM package.
func (Package) ToNameVersion ¶
type RHSMConfig ¶
type RHSMConfig struct { DNFPlugins *SubManDNFPluginsConfig `json:"dnf_plugins,omitempty" toml:"dnf_plugins,omitempty"` SubscriptionManager *SubManConfig `json:"subscription_manager,omitempty" toml:"subscription_manager,omitempty"` }
type RHSMCustomization ¶
type RHSMCustomization struct {
Config *RHSMConfig `json:"config,omitempty" toml:"config,omitempty"`
}
type RPMCustomization ¶
type RPMCustomization struct {
ImportKeys *RPMImportKeys `json:"import_keys,omitempty" toml:"import_keys,omitempty"`
}
type RPMImportKeys ¶
type RPMImportKeys struct { // File paths in the image to import keys from Files []string `json:"files,omitempty" toml:"files,omitempty"` }
type RepositoryCustomization ¶
type RepositoryCustomization struct { Id string `json:"id" toml:"id"` BaseURLs []string `json:"baseurls,omitempty" toml:"baseurls,omitempty"` GPGKeys []string `json:"gpgkeys,omitempty" toml:"gpgkeys,omitempty"` Metalink string `json:"metalink,omitempty" toml:"metalink,omitempty"` Mirrorlist string `json:"mirrorlist,omitempty" toml:"mirrorlist,omitempty"` Name string `json:"name,omitempty" toml:"name,omitempty"` Priority *int `json:"priority,omitempty" toml:"priority,omitempty"` Enabled *bool `json:"enabled,omitempty" toml:"enabled,omitempty"` GPGCheck *bool `json:"gpgcheck,omitempty" toml:"gpgcheck,omitempty"` RepoGPGCheck *bool `json:"repo_gpgcheck,omitempty" toml:"repo_gpgcheck,omitempty"` SSLVerify *bool `json:"sslverify,omitempty" toml:"sslverify,omitempty"` ModuleHotfixes *bool `json:"module_hotfixes,omitempty" toml:"module_hotfixes,omitempty"` Filename string `json:"filename,omitempty" toml:"filename,omitempty"` }
type SSHKeyCustomization ¶
type ServicesCustomization ¶
type SubManConfig ¶
type SubManConfig struct { RHSMConfig *SubManRHSMConfig `json:"rhsm,omitempty" toml:"rhsm,omitempty"` RHSMCertdConfig *SubManRHSMCertdConfig `json:"rhsmcertd,omitempty" toml:"rhsmcertd,omitempty"` }
Subscription Manager 'rhsm.conf' configuration
type SubManDNFPluginsConfig ¶
type SubManDNFPluginsConfig struct { ProductID *DNFPluginConfig `json:"product_id,omitempty" toml:"product_id,omitempty"` SubscriptionManager *DNFPluginConfig `json:"subscription_manager,omitempty" toml:"subscription_manager,omitempty"` }
type SubManRHSMCertdConfig ¶
type SubManRHSMCertdConfig struct {
AutoRegistration *bool `json:"auto_registration,omitempty" toml:"auto_registration,omitempty"`
}
Subscription Manager [rhsmcertd] configuration
type SubManRHSMConfig ¶
type SubManRHSMConfig struct {
ManageRepos *bool `json:"manage_repos,omitempty" toml:"manage_repos,omitempty"`
}
Subscription Manager [rhsm] configuration
type TimezoneCustomization ¶
type UserCustomization ¶
type UserCustomization struct { Name string `json:"name" toml:"name"` Description *string `json:"description,omitempty" toml:"description,omitempty"` Password *string `json:"password,omitempty" toml:"password,omitempty"` Key *string `json:"key,omitempty" toml:"key,omitempty"` Home *string `json:"home,omitempty" toml:"home,omitempty"` Shell *string `json:"shell,omitempty" toml:"shell,omitempty"` Groups []string `json:"groups,omitempty" toml:"groups,omitempty"` UID *int `json:"uid,omitempty" toml:"uid,omitempty"` GID *int `json:"gid,omitempty" toml:"gid,omitempty"` ExpireDate *int `json:"expiredate,omitempty" toml:"expiredate,omitempty"` ForcePasswordReset *bool `json:"force_password_reset,omitempty" toml:"force_password_reset,omitempty"` }