Documentation ¶
Overview ¶
This package is NOT FOR PRODUCTION USE CASE. EXAMPLE ONLY.
Index ¶
- Constants
- func ReadOIDCDefaultValuesFromYAML(yamlFilePath string) (internal.OIDCConfigDTO, error)
- func ReadYAMLFromFile(t *testing.T, yamlFileName string) string
- type ComponentDisabler
- type ComponentsDisablers
- type ComponentsListProvider
- type ComponentsProvider
- type Converter
- type CustomDisablerExample
- type DisabledComponentsProvider
- type DisabledComponentsService
- type GenericComponentDisabler
- type HTTPDoer
- type HTTPFakeClient
- type Handler
- type Installation
- type OptionalComponentsService
- func (f *OptionalComponentsService) AddComponentToDisable(name string, disabler ComponentDisabler)
- 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 ¶
func ReadOIDCDefaultValuesFromYAML ¶
func ReadOIDCDefaultValuesFromYAML(yamlFilePath string) (internal.OIDCConfigDTO, error)
Types ¶
type ComponentDisabler ¶
type ComponentDisabler interface {
Disable(components internal.ComponentConfigurationInputList) internal.ComponentConfigurationInputList
}
ComponentDisabler disables component form the given list and returns modified list
type ComponentsDisablers ¶
type ComponentsDisablers map[string]ComponentDisabler
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, newAdditionalRuntimeComponentsYAMLPath string) *ComponentsListProvider
NewComponentsListProvider returns new instance of the ComponentsListProvider
func (*ComponentsListProvider) AllComponents ¶
func (r *ComponentsListProvider) AllComponents(kymaVersion internal.RuntimeVersionData, config *internal.ConfigForPlan) ([]internal.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.
func (*ComponentsListProvider) WithHTTPClient ¶
func (r *ComponentsListProvider) WithHTTPClient(doer HTTPDoer) *ComponentsListProvider
WithHTTPClient is a helper method to use ONLY in tests
type ComponentsProvider ¶
type ComponentsProvider struct {
// contains filtered or unexported fields
}
ComponentsProvider provides the list of required and additional components for creating a Kyma Runtime
func NewComponentsProvider ¶
func NewComponentsProvider() *ComponentsProvider
NewComponentsProvider returns new instance of the ComponentsProvider
func NewFakeComponentsProvider ¶
func NewFakeComponentsProvider() *ComponentsProvider
func (*ComponentsProvider) AllComponents ¶
func (p *ComponentsProvider) AllComponents(kymaVersion internal.RuntimeVersionData, config *internal.ConfigForPlan) ([]internal.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 ConfigMaps and merge them together
type Converter ¶
type Converter interface { NewDTO(instance internal.Instance) (pkg.RuntimeDTO, error) ApplyProvisioningOperation(dto *pkg.RuntimeDTO, pOpr *internal.ProvisioningOperation) ApplyDeprovisioningOperation(dto *pkg.RuntimeDTO, dOpr *internal.DeprovisioningOperation) ApplyUpgradingKymaOperations(dto *pkg.RuntimeDTO, oprs []internal.UpgradeKymaOperation, totalCount int) ApplyUpgradingClusterOperations(dto *pkg.RuntimeDTO, oprs []internal.UpgradeClusterOperation, totalCount int) ApplyUpdateOperations(dto *pkg.RuntimeDTO, oprs []internal.UpdatingOperation, totalCount int) ApplySuspensionOperations(dto *pkg.RuntimeDTO, oprs []internal.DeprovisioningOperation) ApplyUnsuspensionOperations(dto *pkg.RuntimeDTO, oprs []internal.ProvisioningOperation) }
func NewConverter ¶
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 DisabledComponentsProvider ¶
func NewDisabledComponentsProvider ¶
func NewDisabledComponentsProvider() DisabledComponentsProvider
func (DisabledComponentsProvider) DisabledComponentsPerPlan ¶
func (p DisabledComponentsProvider) DisabledComponentsPerPlan(planID string) (map[string]struct{}, error)
func (DisabledComponentsProvider) DisabledForAll ¶
func (p DisabledComponentsProvider) DisabledForAll() map[string]struct{}
type DisabledComponentsService ¶
type DisabledComponentsService struct {
// contains filtered or unexported fields
}
func NewDisabledComponentsService ¶
func NewDisabledComponentsService(disabledComponents map[string]struct{}) *DisabledComponentsService
NewDisabledComponentsService returns new instance of ResourceSupervisorAggregator
func (*DisabledComponentsService) DisableComponents ¶
func (f *DisabledComponentsService) DisableComponents(components internal.ComponentConfigurationInputList) (internal.ComponentConfigurationInputList, error)
DisableComponents executes disablers on given input and returns modified list.
BE AWARE: in current implementation the input is also modified.
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) *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 HTTPFakeClient ¶
type HTTPFakeClient struct { RequestURL string // contains filtered or unexported fields }
func NewTestClient ¶
func NewTestClient(t *testing.T, installerContent, componentsContent string, code int) *HTTPFakeClient
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(instanceDb storage.Instances, operationDb storage.Operations, runtimeStatesDb storage.RuntimeStates, defaultMaxPage int, defaultRequestRegion string) *Handler
func (*Handler) AttachRoutes ¶
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 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) AddComponentToDisable ¶
func (f *OptionalComponentsService) AddComponentToDisable(name string, disabler ComponentDisabler)
AddComponentToDisable adds a component to the list of registered components disablers names
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