Documentation ¶
Index ¶
- type ConfigurationCollector
- type ConfigurationProvider
- func (cp *ConfigurationProvider) FetchContextual(component string, namespace string, pipeline contract.PipelineInfo) Data
- func (cp *ConfigurationProvider) FetchFromFieldOrSecret(ctx context.Context, data *Data, namespace string, fieldKey string, ...) (string, error)
- func (cp *ConfigurationProvider) FetchGlobal(component string) Data
- func (cp *ConfigurationProvider) FetchSecretKey(ctx context.Context, name string, namespace string, key string, cache bool) (string, error)
- type ConfigurationProviderInterface
- type Data
- type FakeCollector
- func (f *FakeCollector) CanHandle(adapterName string) bool
- func (f *FakeCollector) CollectInitially() ([]*v1alpha1.PFConfig, error)
- func (f *FakeCollector) CollectOnRequest(info contract.PipelineInfo) ([]*v1alpha1.PFConfig, error)
- func (f *FakeCollector) GetImplementationName() string
- func (f *FakeCollector) InjectDependencies(recorder record.EventRecorder, kubeconfig *rest.Config) error
- func (f *FakeCollector) SetLogger(logger *logging.InternalLogger)
- type LocalFileConfigurationCollector
- func (lf *LocalFileConfigurationCollector) CanHandle(adapterName string) bool
- func (lf *LocalFileConfigurationCollector) CollectInitially() ([]*v1alpha1.PFConfig, error)
- func (lf *LocalFileConfigurationCollector) CollectOnRequest(info contract.PipelineInfo) ([]*v1alpha1.PFConfig, error)
- func (lf *LocalFileConfigurationCollector) GetImplementationName() string
- func (lf *LocalFileConfigurationCollector) InjectDependencies(recorder record.EventRecorder, kubeconfig *rest.Config) error
- func (lf *LocalFileConfigurationCollector) SetLogger(logger *logging.InternalLogger)
- type MultipleCollector
- func (mc *MultipleCollector) CanHandle(adapterName string) bool
- func (mc *MultipleCollector) CollectInitially() ([]*v1alpha1.PFConfig, error)
- func (mc *MultipleCollector) CollectOnRequest(info contract.PipelineInfo) ([]*v1alpha1.PFConfig, error)
- func (mc *MultipleCollector) GetImplementationName() string
- func (mc *MultipleCollector) SetLogger(logger *logging.InternalLogger)
- type Schema
- type SchemaValidator
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigurationCollector ¶
type ConfigurationProvider ¶
type ConfigurationProvider struct {
// contains filtered or unexported fields
}
ConfigurationProvider is serving already collected configuration. Served configuration is already merged from various sources
func (*ConfigurationProvider) FetchContextual ¶
func (cp *ConfigurationProvider) FetchContextual(component string, namespace string, pipeline contract.PipelineInfo) Data
FetchContextual is retrieving a final configuration in context of a given contract.PipelineInfo
func (*ConfigurationProvider) FetchFromFieldOrSecret ¶
func (cp *ConfigurationProvider) FetchFromFieldOrSecret(ctx context.Context, data *Data, namespace string, fieldKey string, referenceKey string, referenceSecretNameKey string) (string, error)
FetchFromFieldOrSecret allows to use an inline secret from configuration file (if present), fallbacks to fetching a secret key from a Kubernetes secret
func (*ConfigurationProvider) FetchGlobal ¶
func (cp *ConfigurationProvider) FetchGlobal(component string) Data
FetchGlobal is fetching a global configuration for given component (without a context of a Pipeline)
func (*ConfigurationProvider) FetchSecretKey ¶
func (cp *ConfigurationProvider) FetchSecretKey(ctx context.Context, name string, namespace string, key string, cache bool) (string, error)
FetchSecretKey is fetching a key from .data section from a Kubernetes Secret, directly from the Cluster's API Use this method in pair with FetchContextual() to at first fetch the key name, then to fetch the secret key
type ConfigurationProviderInterface ¶
type ConfigurationProviderInterface interface { FetchContextual(component string, namespace string, pipeline contract.PipelineInfo) Data FetchGlobal(component string) Data FetchSecretKey(ctx context.Context, name string, namespace string, key string, cache bool) (string, error) FetchFromFieldOrSecret(ctx context.Context, data *Data, namespace string, fieldKey string, referenceKey string, referenceSecretNameKey string) (string, error) }
func NewConfigurationProvider ¶
func NewConfigurationProvider(docStore config.IndexedDocumentStore, logger *logging.InternalLogger, client v1.CoreV1Interface, kvStore store.Operator, cfgSchema Validator) (ConfigurationProviderInterface, error)
NewConfigurationProvider is a constructor
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
func (*Data) Get ¶
Get retrieves a configuration value. For non-existing key it returns an empty string
func (*Data) GetOrDefault ¶
GetOrDefault retrieves a configuration value. For non-existing keys it returns a default value defined in `defaultVal` parameter
type FakeCollector ¶
type FakeCollector struct { }
func (*FakeCollector) CanHandle ¶
func (f *FakeCollector) CanHandle(adapterName string) bool
func (*FakeCollector) CollectInitially ¶
func (f *FakeCollector) CollectInitially() ([]*v1alpha1.PFConfig, error)
func (*FakeCollector) CollectOnRequest ¶
func (f *FakeCollector) CollectOnRequest(info contract.PipelineInfo) ([]*v1alpha1.PFConfig, error)
func (*FakeCollector) GetImplementationName ¶
func (f *FakeCollector) GetImplementationName() string
func (*FakeCollector) InjectDependencies ¶
func (f *FakeCollector) InjectDependencies(recorder record.EventRecorder, kubeconfig *rest.Config) error
func (*FakeCollector) SetLogger ¶
func (f *FakeCollector) SetLogger(logger *logging.InternalLogger)
type LocalFileConfigurationCollector ¶
type LocalFileConfigurationCollector struct {
// contains filtered or unexported fields
}
func NewLocalFileConfigurationCollector ¶
func NewLocalFileConfigurationCollector(logger *logging.InternalLogger, path string) *LocalFileConfigurationCollector
func (*LocalFileConfigurationCollector) CanHandle ¶
func (lf *LocalFileConfigurationCollector) CanHandle(adapterName string) bool
func (*LocalFileConfigurationCollector) CollectInitially ¶
func (lf *LocalFileConfigurationCollector) CollectInitially() ([]*v1alpha1.PFConfig, error)
CollectInitially is looking for a JSON file specified in CONFIG_PATH environment variable it falls back to "pipelines-feedback.json" local file path. If the file does not exist it is ignored.
func (*LocalFileConfigurationCollector) CollectOnRequest ¶
func (lf *LocalFileConfigurationCollector) CollectOnRequest(info contract.PipelineInfo) ([]*v1alpha1.PFConfig, error)
CollectOnRequest is not implemented as the "local" does not allow dynamic resolution
func (*LocalFileConfigurationCollector) GetImplementationName ¶
func (lf *LocalFileConfigurationCollector) GetImplementationName() string
func (*LocalFileConfigurationCollector) InjectDependencies ¶
func (lf *LocalFileConfigurationCollector) InjectDependencies(recorder record.EventRecorder, kubeconfig *rest.Config) error
func (*LocalFileConfigurationCollector) SetLogger ¶
func (lf *LocalFileConfigurationCollector) SetLogger(logger *logging.InternalLogger)
type MultipleCollector ¶
type MultipleCollector struct {
// contains filtered or unexported fields
}
MultipleCollector is an "adapter of adapters" pattern that lets you use multiple configuration sources at a single time
func CreateMultipleCollector ¶
func CreateMultipleCollector(collectors []ConfigurationCollector, logger *logging.InternalLogger) *MultipleCollector
func (*MultipleCollector) CanHandle ¶
func (mc *MultipleCollector) CanHandle(adapterName string) bool
func (*MultipleCollector) CollectInitially ¶
func (mc *MultipleCollector) CollectInitially() ([]*v1alpha1.PFConfig, error)
func (*MultipleCollector) CollectOnRequest ¶
func (mc *MultipleCollector) CollectOnRequest(info contract.PipelineInfo) ([]*v1alpha1.PFConfig, error)
func (*MultipleCollector) GetImplementationName ¶
func (mc *MultipleCollector) GetImplementationName() string
func (*MultipleCollector) SetLogger ¶
func (mc *MultipleCollector) SetLogger(logger *logging.InternalLogger)
type SchemaValidator ¶
type SchemaValidator struct { Debug bool // contains filtered or unexported fields }
func (*SchemaValidator) Add ¶
func (sm *SchemaValidator) Add(schema Schema)
func (*SchemaValidator) ValidateConfig ¶
func (sm *SchemaValidator) ValidateConfig(data v1alpha1.Data) error
func (*SchemaValidator) ValidateRequestedEntry ¶
func (sm *SchemaValidator) ValidateRequestedEntry(group string, key string) error