Documentation
¶
Index ¶
- Constants
- func AppConfigDefaultName(backstageName string) string
- func BackstageContainerIndex(bsdPod *corev1.PodSpec) int
- func BackstageContainerName() string
- func DbSecretDefaultName(backstageName string) string
- func DbServiceName(backstageName string) string
- func DbStatefulSetName(backstageName string) string
- func DeploymentName(backstageName string) string
- func DynamicPluginsDefaultName(backstageName string) string
- func DynamicPluginsInitContainer(initContainers []corev1.Container) (int, *corev1.Container)
- func GetPluginDeps(backstage bs.Backstage, plugins DynamicPlugins, scheme *runtime.Scheme) ([]*unstructured.Unstructured, error)
- func PvcsName(backstageName, originalName string) string
- func ReadPluginDeps(rootDir, bsName, bsNamespace string, enabled []string) ([]*unstructured.Unstructured, error)
- func RouteName(backstageName string) string
- func ServiceName(backstageName string) string
- type AppConfig
- type AppConfigFactory
- type BackstageDeployment
- type BackstageDeploymentFactory
- type BackstageModel
- type BackstagePvcs
- type BackstagePvcsFactory
- type BackstageRoute
- type BackstageRouteFactory
- type BackstageService
- type BackstageServiceFactory
- type ConfigMapEnvs
- type ConfigMapEnvsFactory
- type ConfigMapFiles
- type ConfigMapFilesFactory
- type DataObjectKeys
- type DbSecret
- type DbSecretFactory
- type DbService
- type DbServiceFactory
- type DbStatefulSet
- type DbStatefulSetFactory
- type Deployable
- type DeploymentObj
- func (d *DeploymentObj) ConvertTo(kind string) (Deployable, error)
- func (d *DeploymentObj) GetObject() client.Object
- func (d *DeploymentObj) PodObjectMeta() *metav1.ObjectMeta
- func (d *DeploymentObj) PodSpec() *corev1.PodSpec
- func (d *DeploymentObj) SetEmpty()
- func (d *DeploymentObj) SpecReplicas() *int32
- func (d *DeploymentObj) SpecSelector() *metav1.LabelSelector
- type DynaPlugin
- type DynaPluginsConfig
- type DynamicPlugins
- type DynamicPluginsFactory
- type ExternalConfig
- type ExternalConfigContributor
- type ObjectConfig
- type ObjectFactory
- type ObjectKind
- type PluginDependency
- type RuntimeObject
- type SecretEnvs
- type SecretEnvsFactory
- type SecretFiles
- type SecretFilesFactory
- type StatefulSetObj
- func (d *StatefulSetObj) ConvertTo(kind string) (Deployable, error)
- func (d *StatefulSetObj) GetObject() client.Object
- func (d *StatefulSetObj) PodObjectMeta() *metav1.ObjectMeta
- func (d *StatefulSetObj) PodSpec() *corev1.PodSpec
- func (d *StatefulSetObj) SetEmpty()
- func (d *StatefulSetObj) SpecReplicas() *int32
- func (d *StatefulSetObj) SpecSelector() *metav1.LabelSelector
Constants ¶
const ( SecretObjectKind = "Secret" ConfigMapObjectKind = "ConfigMap" )
const BackstageAppLabel = "rhdh.redhat.com/app"
const BackstageImageEnvVar = "RELATED_IMAGE_backstage"
const BackstageNameAnnotation = "rhdh.redhat.com/backstage-name"
const CatalogIndexImageEnvVar = "RELATED_IMAGE_catalog_index"
const ConfiguredNameAnnotation = "rhdh.redhat.com/configured-name"
const ContainersAnnotation = "rhdh.redhat.com/containers"
const DefaultMountDir = "/opt/app-root/src"
const DefaultMountPathAnnotation = "rhdh.redhat.com/mount-path"
const DynamicPluginsFile = "dynamic-plugins.yaml"
const ExtConfigHashAnnotation = "rhdh.redhat.com/ext-config-hash"
const ExtConfigSyncLabel = "rhdh.redhat.com/ext-config-sync"
const LocalDbImageEnvVar = "RELATED_IMAGE_postgresql"
const SecretEnvsObjectKey = "secret-envs.yaml"
const SecretFilesObjectKey = "secret-files.yaml"
Variables ¶
This section is empty.
Functions ¶
func AppConfigDefaultName ¶
func BackstageContainerIndex ¶
BackstageContainerIndex returns the index of backstage container in from deployment.spec.template.spec.containers array
func BackstageContainerName ¶
func BackstageContainerName() string
func DbSecretDefaultName ¶
func DbServiceName ¶
func DbStatefulSetName ¶
func DeploymentName ¶
func DynamicPluginsInitContainer ¶
returns initContainer supposed to initialize DynamicPlugins TODO consider to use a label to identify instead
func GetPluginDeps ¶
func GetPluginDeps(backstage bs.Backstage, plugins DynamicPlugins, scheme *runtime.Scheme) ([]*unstructured.Unstructured, error)
func ReadPluginDeps ¶
func ReadPluginDeps(rootDir, bsName, bsNamespace string, enabled []string) ([]*unstructured.Unstructured, error)
ReadPluginDeps reads the plugin dependencies from the specified directory and returns a slice of unstructured.Unstructured objects.
func ServiceName ¶
Types ¶
type AppConfig ¶
structure containing ConfigMap where keys are Backstage ConfigApp file names and vaues are contents of the files Mount path is a patch to the follder to place the files to
type AppConfigFactory ¶
type AppConfigFactory struct{}
type BackstageDeployment ¶
type BackstageDeployment struct {
// contains filtered or unexported fields
}
func (*BackstageDeployment) Object ¶
func (b *BackstageDeployment) Object() runtime.Object
implementation of RuntimeObject interface
type BackstageDeploymentFactory ¶
type BackstageDeploymentFactory struct{}
type BackstageModel ¶
type BackstageModel struct {
LocalDbService *DbService
LocalDbSecret *DbSecret
DynamicPlugins DynamicPlugins
RuntimeObjects []RuntimeObject
ExternalConfig ExternalConfig
// contains filtered or unexported fields
}
BackstageModel represents internal object model
func InitObjects ¶
func InitObjects(ctx context.Context, backstage bsv1.Backstage, externalConfig ExternalConfig, platform platform.Platform, scheme *runtime.Scheme) (*BackstageModel, error)
InitObjects performs a main loop for configuring and making the array of objects to reconcile
func (*BackstageModel) GetDeploymentGVK ¶
func (m *BackstageModel) GetDeploymentGVK() schema.GroupVersionKind
type BackstagePvcs ¶
type BackstagePvcs struct {
// contains filtered or unexported fields
}
func (*BackstagePvcs) Object ¶
func (b *BackstagePvcs) Object() runtime.Object
type BackstagePvcsFactory ¶
type BackstagePvcsFactory struct{}
type BackstageRoute ¶
type BackstageRoute struct {
// contains filtered or unexported fields
}
func (*BackstageRoute) Object ¶
func (b *BackstageRoute) Object() runtime.Object
implementation of RuntimeObject interface
type BackstageRouteFactory ¶
type BackstageRouteFactory struct{}
type BackstageService ¶
type BackstageService struct {
// contains filtered or unexported fields
}
func (*BackstageService) Object ¶
func (b *BackstageService) Object() runtime.Object
implementation of RuntimeObject interface
type BackstageServiceFactory ¶
type BackstageServiceFactory struct{}
type ConfigMapEnvs ¶
func (*ConfigMapEnvs) Object ¶
func (p *ConfigMapEnvs) Object() runtime.Object
Object implements RuntimeObject interface
type ConfigMapEnvsFactory ¶
type ConfigMapEnvsFactory struct{}
type ConfigMapFiles ¶
type ConfigMapFiles struct {
ConfigMap *corev1.ConfigMap
// contains filtered or unexported fields
}
func (*ConfigMapFiles) Object ¶
func (p *ConfigMapFiles) Object() runtime.Object
implementation of RuntimeObject interface
type ConfigMapFilesFactory ¶
type ConfigMapFilesFactory struct{}
type DataObjectKeys ¶
func NewDataObjectKeys ¶
func NewDataObjectKeys(stringData map[string]string, binaryData map[string][]byte) DataObjectKeys
func (DataObjectKeys) All ¶
func (k DataObjectKeys) All() []string
type DbSecretFactory ¶
type DbSecretFactory struct{}
type DbServiceFactory ¶
type DbServiceFactory struct{}
type DbStatefulSet ¶
type DbStatefulSet struct {
// contains filtered or unexported fields
}
func (*DbStatefulSet) Object ¶
func (b *DbStatefulSet) Object() runtime.Object
implementation of RuntimeObject interface
type DbStatefulSetFactory ¶
type DbStatefulSetFactory struct{}
type Deployable ¶
type Deployable interface {
// GetObject returns the underlying Kubernetes object
GetObject() client.Object
// PodSpec returns the spec.template.spec of the deployable object
PodSpec() *corev1.PodSpec
// PodObjectMeta returns the spec.template.metadata of the deployable object
PodObjectMeta() *metav1.ObjectMeta
// SpecSelector returns the spec.selector of the deployable object
SpecSelector() *metav1.LabelSelector
// SpecReplicas returns the spec.replicas of the deployable object
SpecReplicas() *int32
// ConvertTo converts the deployable object to the specified kind (Deployment or StatefulSet)
ConvertTo(kind string) (Deployable, error)
// SetEmpty sets the deployable object to an empty object of its type
SetEmpty()
}
Deployable is an interface for Kubernetes objects that can deploy Backstage Pods (Deployment, StatefulSet)
func CreateDeployable ¶
func CreateDeployable(obj runtime.Object) (Deployable, error)
CreateDeployable creates a new Deployable object
type DeploymentObj ¶
type DeploymentObj struct {
Obj *appv1.Deployment
}
func (*DeploymentObj) ConvertTo ¶
func (d *DeploymentObj) ConvertTo(kind string) (Deployable, error)
func (*DeploymentObj) GetObject ¶
func (d *DeploymentObj) GetObject() client.Object
func (*DeploymentObj) PodObjectMeta ¶
func (d *DeploymentObj) PodObjectMeta() *metav1.ObjectMeta
func (*DeploymentObj) PodSpec ¶
func (d *DeploymentObj) PodSpec() *corev1.PodSpec
func (*DeploymentObj) SetEmpty ¶
func (d *DeploymentObj) SetEmpty()
func (*DeploymentObj) SpecReplicas ¶
func (d *DeploymentObj) SpecReplicas() *int32
func (*DeploymentObj) SpecSelector ¶
func (d *DeploymentObj) SpecSelector() *metav1.LabelSelector
type DynaPlugin ¶
type DynaPlugin struct {
Package string `yaml:"package,omitempty"`
Integrity string `yaml:"integrity,omitempty"`
Disabled bool `yaml:"disabled"`
PluginConfig map[string]interface{} `yaml:"pluginConfig,omitempty"`
Dependencies []PluginDependency `yaml:"dependencies,omitempty"`
}
type DynaPluginsConfig ¶
type DynaPluginsConfig struct {
// we do not really support Includes here, that's what is processed by the installation script
// in the dynamic-plugins container. Keeping it here for the sake of completeness
Includes []string `yaml:"includes,omitempty"`
Plugins []DynaPlugin `yaml:"plugins,omitempty"`
}
type DynamicPlugins ¶
type DynamicPlugins struct {
ConfigMap *corev1.ConfigMap
// contains filtered or unexported fields
}
func (*DynamicPlugins) Dependencies ¶
func (p *DynamicPlugins) Dependencies() ([]PluginDependency, error)
Dependencies returns a list of plugin dependencies
func (*DynamicPlugins) GetPlugins ¶
func (p *DynamicPlugins) GetPlugins() ([]DynaPlugin, error)
returns a list of plugins from the configMap
func (*DynamicPlugins) Object ¶
func (p *DynamicPlugins) Object() runtime.Object
implementation of RuntimeObject interface
type DynamicPluginsFactory ¶
type DynamicPluginsFactory struct{}
type ExternalConfig ¶
type ExternalConfig struct {
RawConfig map[string]string
DynamicPlugins corev1.ConfigMap
AppConfigKeys map[string][]string
ExtraFileConfigMapKeys map[string]DataObjectKeys
ExtraFileSecretKeys map[string]DataObjectKeys
ExtraEnvConfigMapKeys map[string]DataObjectKeys
ExtraEnvSecretKeys map[string]DataObjectKeys
ExtraPvcKeys []string
OpenShiftIngressDomain string
WatchingHash string
}
func NewExternalConfig ¶
func NewExternalConfig() ExternalConfig
type ExternalConfigContributor ¶
type ExternalConfigContributor interface {
// contains filtered or unexported methods
}
type ObjectConfig ¶
type ObjectConfig struct {
// Factory to create the object
ObjectFactory ObjectFactory
// Unique key identifying the "kind" of Object which also is the name of config file.
// For example: "deployment.yaml" containing configuration of Backstage Deployment
Key string
// Single or multiple object
Multiple bool
}
Registered Object configuring Backstage runtime model
type ObjectFactory ¶
type ObjectFactory interface {
// contains filtered or unexported methods
}
Interface for Runtime Objects factory method
type ObjectKind ¶
type ObjectKind string
type PluginDependency ¶
type PluginDependency struct {
Ref string `yaml:"ref"`
}
type RuntimeObject ¶
type RuntimeObject interface {
// Object underlying Kubernetes object
Object() runtime.Object
// contains filtered or unexported methods
}
Abstraction for the model Backstage object taking part in deployment
type SecretEnvs ¶
type SecretEnvs struct {
// contains filtered or unexported fields
}
func (*SecretEnvs) Object ¶
func (p *SecretEnvs) Object() runtime.Object
implementation of RuntimeObject interface
type SecretEnvsFactory ¶
type SecretEnvsFactory struct{}
type SecretFiles ¶
type SecretFiles struct {
// contains filtered or unexported fields
}
func (*SecretFiles) Object ¶
func (p *SecretFiles) Object() runtime.Object
implementation of RuntimeObject interface
type SecretFilesFactory ¶
type SecretFilesFactory struct{}
type StatefulSetObj ¶
type StatefulSetObj struct {
Obj *appv1.StatefulSet
}
func (*StatefulSetObj) ConvertTo ¶
func (d *StatefulSetObj) ConvertTo(kind string) (Deployable, error)
func (*StatefulSetObj) GetObject ¶
func (d *StatefulSetObj) GetObject() client.Object
func (*StatefulSetObj) PodObjectMeta ¶
func (d *StatefulSetObj) PodObjectMeta() *metav1.ObjectMeta
func (*StatefulSetObj) PodSpec ¶
func (d *StatefulSetObj) PodSpec() *corev1.PodSpec
func (*StatefulSetObj) SetEmpty ¶
func (d *StatefulSetObj) SetEmpty()
func (*StatefulSetObj) SpecReplicas ¶
func (d *StatefulSetObj) SpecReplicas() *int32
func (*StatefulSetObj) SpecSelector ¶
func (d *StatefulSetObj) SpecSelector() *metav1.LabelSelector
Source Files
¶
- appconfig.go
- configmapenvs.go
- configmapfiles.go
- containers-filter.go
- db-secret.go
- db-service.go
- db-statefulset.go
- deployable.go
- deployment.go
- deployment_obj.go
- dynamic-plugins.go
- externalconfig.go
- interfaces.go
- model_tests.go
- plugin_deps.go
- pvcs.go
- route.go
- runtime.go
- secretenvs.go
- secretfiles.go
- service.go
- statefulset_obj.go