model

package
v0.0.0-...-4634687 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

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 ConfiguredNameAnnotation = "rhdh.redhat.com/configured-name"
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"

Variables

This section is empty.

Functions

func AppConfigDefaultName

func AppConfigDefaultName(backstageName string) string

func BackstageContainerIndex

func BackstageContainerIndex(bsd *appsv1.Deployment) int

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

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 PvcsName

func PvcsName(backstageName, originalName string) string

func RouteName

func RouteName(backstageName string) string

func ServiceName

func ServiceName(backstageName string) string

Types

type AppConfig

type AppConfig struct {
	ConfigMap *corev1.ConfigMap
}

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) EmptyObject

func (b *AppConfig) EmptyObject() client.Object

implementation of RuntimeObject interface

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) EmptyObject

func (b *BackstageDeployment) EmptyObject() client.Object

implementation of RuntimeObject interface

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

	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, isOpenshift bool, scheme *runtime.Scheme) (*BackstageModel, error)

InitObjects performs a main loop for configuring and making the array of objects to reconcile

type BackstagePvcs

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

func (*BackstagePvcs) EmptyObject

func (b *BackstagePvcs) EmptyObject() client.Object

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) EmptyObject

func (b *BackstageRoute) EmptyObject() client.Object

implementation of RuntimeObject interface

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) EmptyObject

func (b *BackstageService) EmptyObject() client.Object

implementation of RuntimeObject interface

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
}

func (*ConfigMapEnvs) EmptyObject

func (p *ConfigMapEnvs) EmptyObject() client.Object

EmptyObject implements RuntimeObject interface

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
}

func (*ConfigMapFiles) EmptyObject

func (p *ConfigMapFiles) EmptyObject() client.Object

implementation of RuntimeObject interface

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) EmptyObject

func (b *DbSecret) EmptyObject() client.Object

implementation of RuntimeObject interface

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) EmptyObject

func (b *DbService) EmptyObject() client.Object

implementation of RuntimeObject interface

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) EmptyObject

func (b *DbStatefulSet) EmptyObject() client.Object

implementation of RuntimeObject interface

func (*DbStatefulSet) Object

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

implementation of RuntimeObject interface

type DbStatefulSetFactory

type DbStatefulSetFactory struct{}

type DynamicPlugins

type DynamicPlugins struct {
	ConfigMap *corev1.ConfigMap
}

func (*DynamicPlugins) EmptyObject

func (p *DynamicPlugins) EmptyObject() client.Object

implementation of RuntimeObject interface

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

	WatchingHash string
}

func NewExternalConfig

func NewExternalConfig() ExternalConfig

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 RuntimeObject

type RuntimeObject interface {
	// Object underlying Kubernetes object
	Object() runtime.Object

	// EmptyObject an empty object: the same type as Object if Object is client.Object or Item type of Multiobject
	EmptyObject() client.Object
	// contains filtered or unexported methods
}

Abstraction for the model Backstage object taking part in deployment

type SecretEnvs

type SecretEnvs struct {
	Secret *corev1.Secret
}

func (*SecretEnvs) EmptyObject

func (p *SecretEnvs) EmptyObject() client.Object

implementation of RuntimeObject interface

func (*SecretEnvs) Object

func (p *SecretEnvs) Object() runtime.Object

implementation of RuntimeObject interface

type SecretEnvsFactory

type SecretEnvsFactory struct{}

type SecretFiles

type SecretFiles struct {
	Secret *corev1.Secret
}

func (*SecretFiles) EmptyObject

func (p *SecretFiles) EmptyObject() client.Object

implementation of RuntimeObject interface

func (*SecretFiles) Object

func (p *SecretFiles) Object() runtime.Object

implementation of RuntimeObject interface

type SecretFilesFactory

type SecretFilesFactory struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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