Documentation
¶
Index ¶
- Constants
- func AddToScheme(s *runtime.Scheme) error
- func CreateAllBreadcrumbs() []*dashboardv1alpha1.Breadcrumb
- func CreateAllCustomColumnsOverrides() []*dashboardv1alpha1.CustomColumnsOverride
- func CreateAllCustomFormsOverrides() []*dashboardv1alpha1.CustomFormsOverride
- func CreateAllFactories() []*dashboardv1alpha1.Factory
- func CreateAllNavigations() []*dashboardv1alpha1.Navigation
- func CreateAllStaticResources() []client.Object
- func CreateAllTableUriMappings() []*dashboardv1alpha1.TableUriMapping
- type BadgeConfig
- type Manager
- func (m *Manager) CleanupOrphanedResources(ctx context.Context) error
- func (m *Manager) EnsureForCRD(ctx context.Context, crd *cozyv1alpha1.CozystackResourceDefinition) (reconcile.Result, error)
- func (m *Manager) InitializeStaticResources(ctx context.Context) error
- func (m *Manager) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (m *Manager) SetupWithManager(mgr ctrl.Manager) error
- type ResourceConfig
- type UnifiedResourceConfig
Constants ¶
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 ¶
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 ¶
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 {
Kind string // Resource kind in PascalCase (e.g., "VirtualMachine") - used for value and auto-generation
Text string // Optional abbreviation override (if empty, ResourceBadge auto-generates from Kind)
Color string // Optional custom backgroundColor override
}
BadgeConfig holds configuration for badge generation
type Manager ¶
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 ¶
NewManager constructs a dashboard Manager.
func (*Manager) CleanupOrphanedResources ¶
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 ¶
func (m *Manager) EnsureForCRD(ctx context.Context, crd *cozyv1alpha1.CozystackResourceDefinition) (reconcile.Result, error)
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 ¶
InitializeStaticResources creates all static dashboard resources once during controller startup
type ResourceConfig ¶
type ResourceConfig struct {
SpecID string
MetadataName string
Kind string
Title string
BadgeConfig BadgeConfig
}
ResourceConfig holds configuration for resource creation