runtime

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Package runtime defines an internal runtime to work with resolver configurations.

Overall, this package makes it easier to work with embedded types due to its reliance on interfaces instead of Raw like the external versions.

This package should be preferred whenever working with non-serialization relevant routines (such as working with accesses or components).

This package SHOULD NOT be used for serialization, and any kind of attempt at serialization will fail on purpose, be buggy and is not supported!

Instead, use dedicated converters to the scheme versions available.

The conversions offered in this package are guaranteed to be lossless unless otherwise specified, so it is usually safe to convert back and forth between scheme versions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config deprecated

type Config struct {
	Type runtime.Type `json:"-"`
	// Resolvers define a list of OCM repository specifications to be used to resolve
	// dedicated component versions.
	// All matching entries are tried to lookup a component version in the following
	//    order:
	//    - highest priority first
	//
	// The default priority is spec.DefaultLookupPriority (10).
	//
	// Repositories with a specified prefix are only even tried if the prefix
	// matches the component name.
	//
	// If resolvers are defined, it is possible to use component version names on the
	// command line without a repository. The names are resolved with the specified
	// resolution rule.
	//
	// They are also used as default lookup repositories to lookup component references
	// for recursive operations on component versions («--lookup» option).
	Resolvers []Resolver `json:"-"`
}

Config is the OCM configuration type for configuring legacy fallback resolvers.

  • type: ocm.config.ocm.software resolvers:
  • repository: type: CommonTransportFormat/v1 filePath: ./ocm/primary-transport-archive priority: 100
  • repository: type: CommonTransportFormat/v1 filePath: ./ocm/primary-transport-archive priority: 10

Deprecated: Resolvers are deprecated and are only added for backwards compatibility. New concepts will likely be introduced in the future (contributions welcome!).

+k8s:deepcopy-gen:interfaces=ocm.software/open-component-model/bindings/go/runtime.Typed +k8s:deepcopy-gen=true +ocm:typegen=true

func ConvertFromV1 deprecated

func ConvertFromV1(repositoryScheme *runtime.Scheme, config *resolverv1.Config) (*Config, error)

ConvertFromV1 converts a resolver configuration from the v1 version to the runtime.Config type.

Deprecated: Resolvers are deprecated and are only added for backwards compatibility. New concepts will likely be introduced in the future (contributions welcome!).

func Merge deprecated

func Merge(configs ...*Config) *Config

Merge merges the provided configs into a single config. If the configs have multiple repositories with the same priority, the order of configs is relevant (first will be preferred).

Deprecated: Resolvers are deprecated and are only added for backwards compatibility. New concepts will likely be introduced in the future (contributions welcome!).

func (*Config) DeepCopy

func (in *Config) DeepCopy() *Config

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config.

func (*Config) DeepCopyInto

func (in *Config) DeepCopyInto(out *Config)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Config) DeepCopyTyped

func (in *Config) DeepCopyTyped() goruntime.Typed

DeepCopyTyped is an autogenerated deepcopy function, copying the receiver, creating a new goruntime.Typed.

func (*Config) GetType

func (t *Config) GetType() runtime.Type

GetType is an autogenerated getter function, useful for type inference and defaulting.

func (*Config) SetType

func (t *Config) SetType(typ runtime.Type)

SetType is an autogenerated setter function, useful for type inference and defaulting.

type Resolver deprecated

type Resolver struct {
	// Repository is the OCM repository specification to be used for resolving
	// component versions.
	Repository runtime.Typed `json:"-"`

	// Optionally, a component name prefix can be given.
	// It limits the usage of the repository to resolve only
	// components with the given name prefix (always complete name segments).
	Prefix string `json:"-"`

	// An optional priority can be used to influence the lookup order. Larger value
	// means higher priority (default DefaultLookupPriority).
	Priority int `json:"-"`
}

Resolver assigns a priority and a prefix to a single OCM repository specification to allow defining a lookup order for component versions.

Deprecated: Resolvers are deprecated and are only added for backwards compatibility. New concepts will likely be introduced in the future (contributions welcome!).

+k8s:deepcopy-gen=true

func (*Resolver) DeepCopy

func (in *Resolver) DeepCopy() *Resolver

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resolver.

func (*Resolver) DeepCopyInto

func (in *Resolver) DeepCopyInto(out *Resolver)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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