internal

package
v0.88.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RealIO = fileIO{}

Functions

func MergeAdditionalProductProperties

func MergeAdditionalProductProperties(configFile io.Reader, additionalProperties map[string]any) (io.Reader, error)

MergeAdditionalProductProperties takes product properties from the provided reader and merges them with data from the additionalProperties parameter. It also does some validation to ensure required fields are set.

Types

type CommandRunner

type CommandRunner interface {
	Run(string, ...string) (string, string, error)
}

type EnvironmentSharingCommandRunner

type EnvironmentSharingCommandRunner struct {
	// contains filtered or unexported fields
}

func NewEnvironmentSharingCommandRunner

func NewEnvironmentSharingCommandRunner(env []string) *EnvironmentSharingCommandRunner

func (*EnvironmentSharingCommandRunner) Run

func (e *EnvironmentSharingCommandRunner) Run(name string, args ...string) (string, string, error)

type FileIO

type FileIO interface {
	TempFile(string, string) (*os.File, error)
	Remove(string) error
}

type OMError

type OMError struct {
	// Messages: reconsider, the key here may change depending on the endpoint
	Messages []string `json:"base"`
}

type OMRunner

type OMRunner struct {
	FileIO FileIO
	// contains filtered or unexported fields
}

func NewOMRunner

func NewOMRunner(cmdRunner CommandRunner, fileIO FileIO) OMRunner

func (OMRunner) FindStagedProduct

func (o OMRunner) FindStagedProduct(productName string) (StagedProduct, error)

func (OMRunner) GetManifest

func (o OMRunner) GetManifest(productGUID string) (map[string]any, error)

func (OMRunner) ResetAndConfigure

func (o OMRunner) ResetAndConfigure(productName string, productVersion string, configJSON string) error

func (OMRunner) StagedProducts

func (o OMRunner) StagedProducts() ([]StagedProduct, error)

type OMRunnerI

type OMRunnerI interface {
	ResetAndConfigure(productName string, productVersion string, configJSON string) error
	GetManifest(productGUID string) (map[string]any, error)
	FindStagedProduct(productName string) (StagedProduct, error)
}

type OMService

type OMService struct {
	// contains filtered or unexported fields
}

func NewOMServiceWithRunner

func NewOMServiceWithRunner(omRunner OMRunnerI) (*OMService, error)

func (OMService) RenderManifest

func (o OMService) RenderManifest(tileConfig io.Reader, tileMetadata io.Reader) (string, error)

type OpsManifestRunner

type OpsManifestRunner struct {
	FileIO FileIO
	// contains filtered or unexported fields
}

func NewOpsManifestRunner

func NewOpsManifestRunner(cmdRunner CommandRunner, fileIO FileIO, additionalArgs ...string) OpsManifestRunner

func (OpsManifestRunner) GetManifest

func (o OpsManifestRunner) GetManifest(productProperties, metadataFilePath string) (map[string]any, error)

type OpsManifestRunnerI

type OpsManifestRunnerI interface {
	GetManifest(productProperties, metadataFilePath string) (map[string]any, error)
}

type OpsManifestService

type OpsManifestService struct {
	// contains filtered or unexported fields
}

func NewOpsManifestServiceWithRunner

func NewOpsManifestServiceWithRunner(opsManifestRunner OpsManifestRunnerI, fileIO FileIO) (*OpsManifestService, error)

func (OpsManifestService) RenderManifest

func (o OpsManifestService) RenderManifest(tileConfig io.Reader, tileMetadata io.Reader) (string, error)

type ProductConfiguration

type ProductConfiguration struct {
	ProductName              string                           `yaml:"product-name,omitempty"`
	ProductProperties        map[string]any                   `yaml:"product-properties"` // remove omitempty
	NetworkProperties        map[string]any                   `yaml:"network-properties,omitempty"`
	ResourceConfigProperties map[string]config.ResourceConfig `yaml:"resource-config,omitempty"`
	ErrandConfigs            map[string]config.ErrandConfig   `yaml:"errand-config,omitempty"`
	SyslogProperties         map[string]any                   `yaml:"syslog-properties,omitempty"`
}

ProductConfiguration is a data structure for configuring a tile. Formerly, we relied on om/config.ProductConfiguration for marshalling/unmarshalling the product configuration file. Unfortunately, they now set product-properties to omit-empty, which causes Ops Manifest to error when product-properties is set to an empty hash.

To work around this, we now have our own copy of ProductConfiguration without omit-empty on product-properties

type RenderService

type RenderService interface {
	RenderManifest(tileConfig io.Reader, tileMetadata io.Reader) (string, error)
}

type StagedProduct

type StagedProduct struct {
	GUID           string `json:"guid"`
	Type           string `json:"type"`
	ProductVersion string `json:"product_version"`
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL