Documentation
¶
Overview ¶
Package common provides shared types and utilities used across the resolution and config packages.
Index ¶
- Constants
- func ChildName(parentName string, suffix string) string
- func ComponentLabels(component ComponentType, instance string) map[string]string
- func ConfigMapName(childName string) string
- func Ptr[T any](v T) *T
- func ResourceBaseName(childName string, componentType ComponentType) string
- func SubResourceName(childName string, suffix string) string
- type ComponentType
Constants ¶
const ( LabelKeyName = "app.kubernetes.io/name" LabelKeyComponent = "app.kubernetes.io/component" LabelKeyInstance = "app.kubernetes.io/instance" LabelKeyParent = "superset.apache.org/parent" )
Label keys.
const ( SuffixWebServer = "-web-server" // matches ComponentWebServer SuffixCeleryWorker = "-celery-worker" // matches ComponentCeleryWorker SuffixCeleryBeat = "-celery-beat" // matches ComponentCeleryBeat SuffixCeleryFlower = "-celery-flower" // matches ComponentCeleryFlower SuffixWebsocketServer = "-websocket-server" // matches ComponentWebsocketServer SuffixMcpServer = "-mcp-server" // matches ComponentMcpServer SuffixInit = "-init" // matches ComponentInit SuffixClone = "-clone" SuffixConfig = "-config" SuffixNetworkPolicy = "-netpol" )
Resource name suffixes. These map 1:1 to ComponentType values.
const ( LabelKeyInitTask = "superset.apache.org/init-task" LabelKeyInitInstance = "superset.apache.org/instance" )
Label keys for init pods.
const ( PortWebServer int32 = 8088 PortCeleryFlower int32 = 5555 PortWebsocket int32 = 8080 PortMcpServer int32 = 8088 )
Default ports.
const ( PortNameHTTP = "http" PortNameWebsocket = "ws" PortNameMcp = "mcp" )
Port names.
const ( ConfigVolumeName = "superset-config" ConfigMountPath = "/app/pythonpath" )
Config paths.
const ( CloneImagePostgres = "postgres:17-alpine" CloneImageMySQL = "mysql:8-alpine" )
Clone default images.
const ( // Operator-internal transport vars (used by rendered superset_config.py). EnvSecretKey = "SUPERSET_OPERATOR__SECRET_KEY" EnvDatabaseURI = "SUPERSET_OPERATOR__DB_URI" EnvDBHost = "SUPERSET_OPERATOR__DB_HOST" EnvDBPort = "SUPERSET_OPERATOR__DB_PORT" EnvDBName = "SUPERSET_OPERATOR__DB_NAME" EnvDBUser = "SUPERSET_OPERATOR__DB_USER" EnvDBPass = "SUPERSET_OPERATOR__DB_PASS" EnvForceReload = "SUPERSET_OPERATOR__FORCE_RELOAD" // Valkey operator-internal transport vars. EnvValkeyHost = "SUPERSET_OPERATOR__VALKEY_HOST" EnvValkeyPort = "SUPERSET_OPERATOR__VALKEY_PORT" EnvValkeyPass = "SUPERSET_OPERATOR__VALKEY_PASS" // Celery Flower env vars. EnvFlowerURLPrefix = "SUPERSET_OPERATOR__FLOWER_URL_PREFIX" // Admin user operator-internal transport vars (used by init command construction). EnvAdminUsername = "SUPERSET_OPERATOR__ADMIN_USERNAME" EnvAdminPassword = "SUPERSET_OPERATOR__ADMIN_PASSWORD" EnvAdminFirstName = "SUPERSET_OPERATOR__ADMIN_FIRST_NAME" EnvAdminLastName = "SUPERSET_OPERATOR__ADMIN_LAST_NAME" EnvAdminEmail = "SUPERSET_OPERATOR__ADMIN_EMAIL" // Clone source operator-internal transport vars. EnvCloneSrcHost = "SUPERSET_OPERATOR__CLONE_SRC_HOST" EnvCloneSrcPort = "SUPERSET_OPERATOR__CLONE_SRC_PORT" EnvCloneSrcDB = "SUPERSET_OPERATOR__CLONE_SRC_DB" EnvCloneSrcUser = "SUPERSET_OPERATOR__CLONE_SRC_USER" EnvCloneSrcPass = "SUPERSET_OPERATOR__CLONE_SRC_PASS" )
Env var names for operator-managed environment variables.
const ( EnvironmentDev = "Development" EnvironmentStaging = "Staging" EnvironmentProd = "Production" )
Environment mode values.
const (
AnnotationConfigChecksum = "superset.apache.org/config-checksum"
)
Annotation keys.
const Container = "superset"
Container name (uniform across all components — pods never collide).
const (
InitTaskInit = "init"
)
Init task names.
const (
LabelValueApp = "superset"
)
Label values.
Variables ¶
This section is empty.
Functions ¶
func ComponentLabels ¶
func ComponentLabels(component ComponentType, instance string) map[string]string
ComponentLabels returns the standard Kubernetes labels for a Superset component.
func ConfigMapName ¶
ConfigMapName constructs a ConfigMap name for a child component.
func ResourceBaseName ¶
func ResourceBaseName(childName string, componentType ComponentType) string
ResourceBaseName returns the sub-resource base name: {childName}-{componentType}.
func SubResourceName ¶
SubResourceName constructs a sub-resource name from the child CR name and suffix.
Types ¶
type ComponentType ¶
type ComponentType string
ComponentType identifies a Superset component.
const ( ComponentWebServer ComponentType = "web-server" ComponentCeleryWorker ComponentType = "celery-worker" ComponentCeleryBeat ComponentType = "celery-beat" ComponentCeleryFlower ComponentType = "celery-flower" ComponentWebsocketServer ComponentType = "websocket-server" ComponentMcpServer ComponentType = "mcp-server" ComponentInit ComponentType = "init" )