dashboard

package
v0.37.3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label keys for dashboard resource management
	LabelManagedBy    = "dashboard.cozystack.io/managed-by"
	LabelResourceType = "dashboard.cozystack.io/resource-type"
	LabelCRDName      = "dashboard.cozystack.io/crd-name"
	LabelCRDGroup     = "dashboard.cozystack.io/crd-group"
	LabelCRDVersion   = "dashboard.cozystack.io/crd-version"
	LabelCRDKind      = "dashboard.cozystack.io/crd-kind"
	LabelCRDPlural    = "dashboard.cozystack.io/crd-plural"

	// Label values
	ManagedByValue      = "cozystack-dashboard-controller"
	ResourceTypeStatic  = "static"
	ResourceTypeDynamic = "dynamic"
)

Variables

This section is empty.

Functions

func AddToScheme

func AddToScheme(s *runtime.Scheme) error

AddToScheme exposes dashboard types registration for controller setup.

func CreateAllBreadcrumbs

func CreateAllBreadcrumbs() []*dashboardv1alpha1.Breadcrumb

CreateAllBreadcrumbs creates all breadcrumb resources using helper functions

func CreateAllCustomColumnsOverrides

func CreateAllCustomColumnsOverrides() []*dashboardv1alpha1.CustomColumnsOverride

CreateAllCustomColumnsOverrides creates all custom column override resources using helper functions

func CreateAllCustomFormsOverrides

func CreateAllCustomFormsOverrides() []*dashboardv1alpha1.CustomFormsOverride

CreateAllCustomFormsOverrides creates all custom forms override resources using helper functions

func CreateAllFactories

func CreateAllFactories() []*dashboardv1alpha1.Factory

CreateAllFactories creates all factory resources using helper functions

func CreateAllNavigations

func CreateAllNavigations() []*dashboardv1alpha1.Navigation

CreateAllNavigations creates all navigation resources using helper functions

func CreateAllStaticResources

func CreateAllStaticResources() []client.Object

CreateAllStaticResources creates all static dashboard resources using helper functions

func CreateAllTableUriMappings

func CreateAllTableUriMappings() []*dashboardv1alpha1.TableUriMapping

CreateAllTableUriMappings creates all table URI mapping resources using helper functions

Types

type BadgeConfig

type BadgeConfig struct {
	Text  string
	Color string
	Title string
	Size  BadgeSize
}

BadgeConfig holds configuration for badge generation

type BadgeSize

type BadgeSize int

BadgeSize represents the size of the badge

const (
	BadgeSizeSmall BadgeSize = iota
	BadgeSizeMedium
	BadgeSizeLarge
)

type Manager

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

Manager owns logic for creating/updating dashboard resources derived from CRDs. It’s easy to extend: add new ensure* methods and wire them into EnsureForCRD.

func NewManager

func NewManager(c client.Client, scheme *runtime.Scheme, opts ...Option) *Manager

NewManager constructs a dashboard Manager.

func (*Manager) CleanupOrphanedResources

func (m *Manager) CleanupOrphanedResources(ctx context.Context) error

CleanupOrphanedResources removes dashboard resources that are no longer needed This should be called after cache warming to ensure all current resources are known

func (*Manager) EnsureForCRD

EnsureForCRD is the single entry-point used by the controller. Add more ensure* calls here as you implement support for other resources:

  • ensureBreadcrumb (implemented)
  • ensureCustomColumnsOverride (implemented)
  • ensureCustomFormsOverride (implemented)
  • ensureCustomFormsPrefill (implemented)
  • ensureFactory
  • ensureMarketplacePanel (implemented)
  • ensureSidebar (implemented)
  • ensureTableUriMapping (implemented)

func (*Manager) InitializeStaticResources

func (m *Manager) InitializeStaticResources(ctx context.Context) error

InitializeStaticResources creates all static dashboard resources once during controller startup

type Option

type Option func(*Manager)

Option pattern so callers can inject a custom lister.

func WithCRDListFunc

func WithCRDListFunc(fn func(context.Context) ([]cozyv1alpha1.CozystackResourceDefinition, error)) Option

WithCRDListFunc overrides how Manager lists all CozystackResourceDefinitions.

type ResourceConfig

type ResourceConfig struct {
	SpecID       string
	MetadataName string
	Kind         string
	Title        string
	BadgeConfig  BadgeConfig
}

ResourceConfig holds configuration for resource creation

type UnifiedResourceConfig

type UnifiedResourceConfig struct {
	Name         string
	ResourceType string
	Kind         string
	Plural       string
	Title        string
	Color        string
	BadgeText    string
	Size         BadgeSize
}

UnifiedResourceConfig holds configuration for unified resource creation

Jump to

Keyboard shortcuts

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