common

package
v0.121.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OCM_SCHEMA_VERSION      = "ocmSchemaVersion"
	SCHEMA_VERSION_V2       = cdv2.SchemaVersion
	SCHEMA_VERSION_V3ALPHA1 = v3alpha1.GroupVersion
)

Variables

This section is empty.

Functions

func ConvertCompDescV2ToMapCd

func ConvertCompDescV2ToMapCd(cd cdv2.ComponentDescriptor, ocmSchemaVersion string) (map[string]interface{}, error)

ConvertCompDescV2ToMapCd takes a component descriptor struct resembling the legacy component-spec schema version v2, converts it to the specified ocmSchemaVersion and unmarshals it into a map[string]interface{}. Possible ocmSchemaVersion values are currently v2 (which leads to a component descriptor adhering to the legacy component-spec v2 schema version for compatibility reasons) and v3alpha1.

func ConvertMapCdToCompDescV2

func ConvertMapCdToCompDescV2(mapCd map[string]interface{}) (*types.ComponentDescriptor, error)

ConvertMapCdToCompDescV2 takes a component descriptor that was unmarshalled into a map[string]interface{} and converts it to a component descriptor struct resembling the legacy component-spec schema version v2. The function can deal with component descriptors adhering to this legacy v2, the ocm-spec v2 and the ocm-spec v3alpha1 schema version. The legacy v2 schema version is currently used as the internal component descriptor version of the landscaper for compatibility reasons. It is largely compatible to the ocm-spec schema version v2.

func DetermineOCMSchemaVersion

func DetermineOCMSchemaVersion(blueprint *blueprints.Blueprint, componentVersion model.ComponentVersion) string

DetermineOCMSchemaVersion analyzes against which ocm schema version should be templated. This can be defined as a OCM_SCHEMA_VERSION blueprint annotation. If the blueprint does not have a respective annotation, the schema version is defaulted to the schema version of the provided component version.

func GetSchemaVersionFromMapCd

func GetSchemaVersionFromMapCd(mapCd map[string]interface{}) (string, error)

GetSchemaVersionFromMapCd takes a component descriptor that was unmarshalled into a map[string]interface{} and tries to extract the value of the schema version property.

func ParseResourceReference

func ParseResourceReference(ref string) (*v1.ResourceReference, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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