resolver

package
v0.62.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// DefaultEnableGitResolver is the default value for "enable-git-resolver".
	DefaultEnableGitResolver = true
	// DefaultEnableHubResolver is the default value for "enable-hub-resolver".
	DefaultEnableHubResolver = true
	// DefaultEnableBundlesResolver is the default value for "enable-bundles-resolver".
	DefaultEnableBundlesResolver = true
	// DefaultEnableClusterResolver is the default value for "enable-cluster-resolver".
	DefaultEnableClusterResolver = true
	// DefaultEnableHttpResolver is the default value for "enable-http-resolver".
	DefaultEnableHttpResolver = true

	// EnableGitResolver is the flag used to enable the git remote resolver
	EnableGitResolver = "enable-git-resolver"
	// EnableHubResolver is the flag used to enable the hub remote resolver
	EnableHubResolver = "enable-hub-resolver"
	// EnableBundlesResolver is the flag used to enable the bundle remote resolver
	EnableBundlesResolver = "enable-bundles-resolver"
	// EnableClusterResolver is the flag used to enable the cluster remote resolver
	EnableClusterResolver = "enable-cluster-resolver"
	// EnableHttpResolver is the flag used to enable the http remote resolver
	EnableHttpResolver = "enable-http-resolver"
)

Variables

This section is empty.

Functions

func GetFeatureFlagsConfigName

func GetFeatureFlagsConfigName() string

GetFeatureFlagsConfigName returns the name of the configmap containing all feature flags.

func ResolversNamespace

func ResolversNamespace(baseNS string) string

ResolversNamespace takes the pipelines namespace and appends "-resolvers" to it.

func ToContext

func ToContext(ctx context.Context, c *Config) context.Context

ToContext attaches the provided Config to the provided context, returning the new context with the Config attached.

Types

type Config

type Config struct {
	FeatureFlags *FeatureFlags
}

Config holds the collection of configurations that we attach to contexts. +k8s:deepcopy-gen=false

func FromContext

func FromContext(ctx context.Context) *Config

FromContext extracts a Config from the provided context.

func FromContextOrDefaults

func FromContextOrDefaults(ctx context.Context) *Config

FromContextOrDefaults is like FromContext, but when no Config is attached it returns a Config populated with the defaults for each of the Config fields.

type FeatureFlags

type FeatureFlags struct {
	EnableGitResolver     bool
	EnableHubResolver     bool
	EnableBundleResolver  bool
	EnableClusterResolver bool
	EnableHttpResolver    bool
}

FeatureFlags holds the features configurations +k8s:deepcopy-gen=true

func NewFeatureFlagsFromConfigMap

func NewFeatureFlagsFromConfigMap(config *corev1.ConfigMap) (*FeatureFlags, error)

NewFeatureFlagsFromConfigMap returns a Config for the given configmap

func NewFeatureFlagsFromMap

func NewFeatureFlagsFromMap(cfgMap map[string]string) (*FeatureFlags, error)

NewFeatureFlagsFromMap returns a Config given a map corresponding to a ConfigMap

func (*FeatureFlags) DeepCopy

func (in *FeatureFlags) DeepCopy() *FeatureFlags

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

func (*FeatureFlags) DeepCopyInto

func (in *FeatureFlags) DeepCopyInto(out *FeatureFlags)

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

type Store

type Store struct {
	*configmap.UntypedStore
}

Store is a typed wrapper around configmap.Untyped store to handle our configmaps. +k8s:deepcopy-gen=false

func NewStore

func NewStore(logger configmap.Logger, onAfterStore ...func(name string, value interface{})) *Store

NewStore creates a new store of Configs and optionally calls functions when ConfigMaps are updated.

func (*Store) Load

func (s *Store) Load() *Config

Load creates a Config from the current config state of the Store.

func (*Store) ToContext

func (s *Store) ToContext(ctx context.Context) context.Context

ToContext attaches the current Config state to the provided context.

Jump to

Keyboard shortcuts

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