model

package
v0.0.0-...-f6f8319 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecretObjectKind    = "Secret"
	ConfigMapObjectKind = "ConfigMap"
)
View Source
const BackstageAppLabel = "rhdh.redhat.com/app"
View Source
const BackstageImageEnvVar = "RELATED_IMAGE_backstage"
View Source
const BackstageNameAnnotation = "rhdh.redhat.com/backstage-name"
View Source
const CatalogIndexImageEnvVar = "RELATED_IMAGE_catalog_index"
View Source
const ConfiguredNameAnnotation = "rhdh.redhat.com/configured-name"
View Source
const ContainersAnnotation = "rhdh.redhat.com/containers"
View Source
const DefaultMountDir = "/opt/app-root/src"
View Source
const DefaultMountPathAnnotation = "rhdh.redhat.com/mount-path"
View Source
const DynamicPluginsFile = "dynamic-plugins.yaml"
View Source
const ExtConfigHashAnnotation = "rhdh.redhat.com/ext-config-hash"
View Source
const ExtConfigSyncLabel = "rhdh.redhat.com/ext-config-sync"
View Source
const LocalDbImageEnvVar = "RELATED_IMAGE_postgresql"
View Source
const SecretEnvsObjectKey = "secret-envs.yaml"
View Source
const SecretFilesObjectKey = "secret-files.yaml"

Variables

This section is empty.

Functions

func AppConfigDefaultName

func AppConfigDefaultName(backstageName string) string

func BackstageContainerIndex

func BackstageContainerIndex(bsdPod *corev1.PodSpec) int

BackstageContainerIndex returns the index of backstage container in from deployment.spec.template.spec.containers array

func BackstageContainerName

func BackstageContainerName() string

func DbSecretDefaultName

func DbSecretDefaultName(backstageName string) string

func DbServiceName

func DbServiceName(backstageName string) string

func DbStatefulSetName

func DbStatefulSetName(backstageName string) string

func DeploymentName

func DeploymentName(backstageName string) string

func DynamicPluginsDefaultName

func DynamicPluginsDefaultName(backstageName string) string

func DynamicPluginsInitContainer

func DynamicPluginsInitContainer(initContainers []corev1.Container) (int, *corev1.Container)

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 PvcsName

func PvcsName(backstageName, originalName string) string

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 RouteName

func RouteName(backstageName string) string

func ServiceName

func ServiceName(backstageName string) string

Types

type AppConfig

type AppConfig struct {
	ConfigMap *corev1.ConfigMap
	// contains filtered or unexported fields
}

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

func (*AppConfig) Object

func (b *AppConfig) Object() runtime.Object

implementation of RuntimeObject interface

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

type ConfigMapEnvs struct {
	ConfigMap *corev1.ConfigMap
	// contains filtered or unexported fields
}

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

type DataObjectKeys struct {
	StringDataKey []string
	BinaryDataKey []string
}

func NewDataObjectKeys

func NewDataObjectKeys(stringData map[string]string, binaryData map[string][]byte) DataObjectKeys

func (DataObjectKeys) All

func (k DataObjectKeys) All() []string

type DbSecret

type DbSecret struct {
	// contains filtered or unexported fields
}

func (*DbSecret) Object

func (b *DbSecret) Object() runtime.Object

implementation of RuntimeObject interface

type DbSecretFactory

type DbSecretFactory struct{}

type DbService

type DbService struct {
	// contains filtered or unexported fields
}

func (*DbService) Object

func (b *DbService) Object() runtime.Object

implementation of RuntimeObject interface

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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