Documentation ¶
Overview ¶
This package is NOT FOR PRODUCTION USE CASE. EXAMPLE ONLY.
Index ¶
- Constants
- type ComponentsDisablers
- type ComponentsListProvider
- type CustomDisablerExample
- type GenericComponentDisabler
- type HTTPDoer
- type Installation
- type OptionalComponentDisabler
- type OptionalComponentsService
- func (f *OptionalComponentsService) ComputeComponentsToDisable(optComponentsToKeep []string) []string
- func (f *OptionalComponentsService) ExecuteDisablers(components internal.ComponentConfigurationInputList, names ...string) (internal.ComponentConfigurationInputList, error)
- func (f *OptionalComponentsService) GetAllOptionalComponentsNames() []string
Constants ¶
const CustomDisablerComponentName = "component-x"
CustomDisablerComponentName defines the component name
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentsDisablers ¶
type ComponentsDisablers map[string]OptionalComponentDisabler
ComponentsDisablers represents type for defining components disabler list
type ComponentsListProvider ¶
type ComponentsListProvider struct {
// contains filtered or unexported fields
}
ComponentsListProvider provides the whole components list for creating a Kyma Runtime
func NewComponentsListProvider ¶
func NewComponentsListProvider(managedRuntimeComponentsYAMLPath string) *ComponentsListProvider
NewComponentsListProvider returns new instance of the ComponentsListProvider
func (*ComponentsListProvider) AllComponents ¶
func (r *ComponentsListProvider) AllComponents(kymaVersion string) ([]v1alpha1.KymaComponent, error)
AllComponents returns all components for Kyma Runtime. It fetches always the Kyma open-source components from the given url and management components from the file system and merge them together.
type CustomDisablerExample ¶
type CustomDisablerExample struct{}
CustomDisablerExample provides example how to add functionality for disabling some which requires more complex logic
func NewCustomDisablerExample ¶
func NewCustomDisablerExample() *CustomDisablerExample
NewCustomDisablerExample returns new instance of CustomDisablerExample
func (CustomDisablerExample) Disable ¶
func (CustomDisablerExample) Disable(components internal.ComponentConfigurationInputList) internal.ComponentConfigurationInputList
Disable disables given component by adding new overrides to existing module
type GenericComponentDisabler ¶
type GenericComponentDisabler struct {
// contains filtered or unexported fields
}
GenericComponentDisabler provides functionality for removing configured component from given list
func NewGenericComponentDisabler ¶
func NewGenericComponentDisabler(name string, namespace string) *GenericComponentDisabler
NewGenericComponentDisabler returns new instance of GenericComponentDisabler
func (*GenericComponentDisabler) Disable ¶
func (g *GenericComponentDisabler) Disable(components internal.ComponentConfigurationInputList) internal.ComponentConfigurationInputList
Disable removes component form given lists. Filtering without allocating.
source: https://github.com/golang/go/wiki/SliceTricks#filtering-without-allocating
type Installation ¶
type Installation struct { Kind string `json:"kind"` Spec v1alpha1.InstallationSpec `json:"spec"` }
Installation represents the installer CR. It is copied because using directly the installer CR with such fields:
metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"`
is not working with "gopkg.in/yaml.v2" stream decoder. On the other hand "sigs.k8s.io/yaml" does not support stream decoding.
type OptionalComponentDisabler ¶
type OptionalComponentDisabler interface {
Disable(components internal.ComponentConfigurationInputList) internal.ComponentConfigurationInputList
}
OptionalComponentDisabler disables component form the given list and returns modified list
type OptionalComponentsService ¶
type OptionalComponentsService struct {
// contains filtered or unexported fields
}
OptionalComponentsService provides functionality for executing component disablers
func NewOptionalComponentsService ¶
func NewOptionalComponentsService(initialList ComponentsDisablers) *OptionalComponentsService
NewOptionalComponentsService returns new instance of ResourceSupervisorAggregator
func (*OptionalComponentsService) ComputeComponentsToDisable ¶
func (f *OptionalComponentsService) ComputeComponentsToDisable(optComponentsToKeep []string) []string
ComputeComponentsToDisable returns disabler names that needs to be executed. Comparing components names as case insensitive.
func (*OptionalComponentsService) ExecuteDisablers ¶
func (f *OptionalComponentsService) ExecuteDisablers(components internal.ComponentConfigurationInputList, names ...string) (internal.ComponentConfigurationInputList, error)
ExecuteDisablers executes disablers on given input and returns modified list.
BE AWARE: in current implementation the input is also modified.
func (*OptionalComponentsService) GetAllOptionalComponentsNames ¶
func (f *OptionalComponentsService) GetAllOptionalComponentsNames() []string
GetAllOptionalComponentsNames returns list of registered components disablers names