Documentation ¶
Overview ¶
Package hembed manages the helm chart embedding mechanism. It is used when the user wants to embed a custom helm chart into the embedded-cluster binary. Writes the chart and adds a mark to the end of the file. The mark is on the format EMBEDDEDCLUSTERCHARTS0000000000 where the number is the length of the embedded data.
Index ¶
Constants ¶
const (
// EndMark is a string that is used to mark the end of the binary.
EndMark = "EMBEDDEDCLUSTERCHARTS"
)
Variables ¶
This section is empty.
Functions ¶
func CalculateRewind ¶
CalculateRewind calculates how far back we need to rewind inside the file to start reading the embedded data. Returns the number of bytes to rewind and the size of the embedded data to be read.
func ReadEmbeddedData ¶
ReadEmbeddedData reads the embedded data from the binary. It reads the binary from the disk and looks for a mark at the end of the file. If the mark is found, it reads the data that is embedded in the binary and returns it. The mark is on the format EMBEDDEDCLUSTERCHARTS0000000000 where the number is the length of the embedded data.
Types ¶
type Binary ¶
type Binary struct {
// contains filtered or unexported fields
}
Binary is a helpes struct that holds a closer and a reader separately. Reads happen on the reader and Closes happen on the closer.
type EmbedOptions ¶
EmbedOptions are the options for embedding helmcharts into embedded-cluster.
func ReadEmbedOptionsFromBinary ¶
func ReadEmbedOptionsFromBinary(fpath string) (*EmbedOptions, error)
ReadEmbedOptionsFromBinary reads the embedded charts from the binary. It reads the binary from the disk and looks for a mark at the end of the file.
type HelmChart ¶
HelmChart represents a helm chart. It has a base64 encoded content. Images that are used by the chart can be passed in the Images field if they need to be pulled for disconnected installs.
func (*HelmChart) ChartReader ¶
ChartReader returns an io.Reader that can be used to read the contents of the helm chart. Content is decoded from base64.