Documentation ¶
Index ¶
- func ConvertToAppendix(file *igntypes.File)
- func ConvertToRawExtension(config igntypes.Config) (runtime.RawExtension, error)
- func FileFromBytes(path string, username string, mode int, contents []byte) igntypes.File
- func FileFromString(path string, username string, mode int, contents string) igntypes.File
- func FilesFromAsset(pathPrefix string, username string, mode int, asset asset.WritableAsset) []igntypes.File
- func Marshal(input interface{}) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToAppendix ¶
ConvertToAppendix converts the contents of an ignition file to an appendix. In ignition config spec v2 the `Append` boolean value was used to denote whether the `Contents` field was an appendix or not. It was also permitted to define multiple file configs (appendix or not) that would be merged/overwritten sequentially in the order of the json data, which made them non-deterministic. In spec v3 this has changed with only one config allowed for each file config, and `Append` now being a list of objects that are being appended to `Contents`, with the `Contents` field itself never being an appendix. This function moves an ignition file's `Contents` object into the `Append` list. Since the resulting ignition file of this function has an empty `Contents` field, `Overwrite` must be set to false, per the spec. The output is an ignition file config that will write a new file with only the appendix contents in the case of a file not already existing on disk, or append the appendix contents to a file already existing.
func ConvertToRawExtension ¶
func ConvertToRawExtension(config igntypes.Config) (runtime.RawExtension, error)
ConvertToRawExtension converts and ignition config to a RawExtension containing the ignition as raw bytes
func FileFromBytes ¶
FileFromBytes creates an ignition-config file with the given contents.
func FileFromString ¶
FileFromString creates an ignition-config file with the given contents.
func FilesFromAsset ¶
func FilesFromAsset(pathPrefix string, username string, mode int, asset asset.WritableAsset) []igntypes.File
FilesFromAsset creates ignition files for each of the files in the specified asset.
func Marshal ¶
Marshal is a helper function to use the marshaler function from "github.com/clarketm/json". It supports zero values of structs with the omittempty annotation. In effect this excludes empty pointer struct fields from the marshaled data, instead of inserting nil values into them. This is necessary for ignition configs to pass openAPI validation on fields that are not supposed to contain nil pointers, but e.g. strings. It can be used as a dropin replacement for "encoding/json".Marshal
Types ¶
This section is empty.