common

package
v0.0.0-...-1377e06 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package common provides shared types and utilities used across the resolution and config packages.

Index

Constants

View Source
const (
	LabelKeyName      = "app.kubernetes.io/name"
	LabelKeyComponent = "app.kubernetes.io/component"
	LabelKeyInstance  = "app.kubernetes.io/instance"
	LabelKeyParent    = "superset.apache.org/parent"
)

Label keys.

View Source
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.

View Source
const (
	LabelKeyInitTask     = "superset.apache.org/init-task"
	LabelKeyInitInstance = "superset.apache.org/instance"
)

Label keys for init pods.

View Source
const (
	PortWebServer    int32 = 8088
	PortCeleryFlower int32 = 5555
	PortWebsocket    int32 = 8080
	PortMcpServer    int32 = 8088
)

Default ports.

View Source
const (
	PortNameHTTP      = "http"
	PortNameWebsocket = "ws"
	PortNameMcp       = "mcp"
)

Port names.

View Source
const (
	ConfigVolumeName = "superset-config"
	ConfigMountPath  = "/app/pythonpath"
)

Config paths.

View Source
const (
	CloneImagePostgres = "postgres:17-alpine"
	CloneImageMySQL    = "mysql:8-alpine"
)

Clone default images.

View Source
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.

View Source
const (
	EnvironmentDev     = "Development"
	EnvironmentStaging = "Staging"
	EnvironmentProd    = "Production"
)

Environment mode values.

View Source
const (
	AnnotationConfigChecksum = "superset.apache.org/config-checksum"
)

Annotation keys.

View Source
const Container = "superset"

Container name (uniform across all components — pods never collide).

View Source
const (
	InitTaskInit = "init"
)

Init task names.

View Source
const (
	LabelValueApp = "superset"
)

Label values.

Variables

This section is empty.

Functions

func ChildName

func ChildName(parentName string, suffix string) string

ChildName constructs a child resource name from parent name and suffix.

func ComponentLabels

func ComponentLabels(component ComponentType, instance string) map[string]string

ComponentLabels returns the standard Kubernetes labels for a Superset component.

func ConfigMapName

func ConfigMapName(childName string) string

ConfigMapName constructs a ConfigMap name for a child component.

func Ptr

func Ptr[T any](v T) *T

Ptr returns a pointer to the given value.

func ResourceBaseName

func ResourceBaseName(childName string, componentType ComponentType) string

ResourceBaseName returns the sub-resource base name: {childName}-{componentType}.

func SubResourceName

func SubResourceName(childName string, suffix string) string

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

Jump to

Keyboard shortcuts

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