Skip to content

Commit aa6a525

Browse files
committed
Remove unimplemented AdvancedConfig from CRD (fixes feedback from #29)
Removed placeholder features that were not actually implemented: - AdvancedConfig type with enableDependencyAnalysis, enableMetricsAggregation, enableLayoutOptimization - Advanced field from DashboardSpec - Advanced config from multicluster sample file - Related tests These were design placeholders with no actual implementation, causing confusion. Thanks to @gberche-orange for spotting this.
1 parent ba54d1f commit aa6a525

File tree

6 files changed

+1
-171
lines changed

6 files changed

+1
-171
lines changed

api/v1alpha1/dashboard_types.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ type DashboardSpec struct {
8080
// HealthCheck configures health checking for discovered services.
8181
HealthCheck *ServiceHealthConfig `json:"healthCheck,omitempty"`
8282

83-
// Advanced configures advanced aggregation and analysis features.
84-
Advanced *AdvancedConfig `json:"advanced,omitempty"`
85-
8683
// RemoteClusters configures discovery from additional Kubernetes clusters.
8784
// When specified, the operator will connect to these clusters and discover
8885
// Ingress/HTTPRoute resources from them in addition to the local cluster.
@@ -365,25 +362,3 @@ type ServiceHealthConfig struct {
365362
// Headers to include in health check requests
366363
Headers map[string]string `json:"headers,omitempty"`
367364
}
368-
369-
// AdvancedConfig configures advanced aggregation and analysis features
370-
type AdvancedConfig struct {
371-
// EnableDependencyAnalysis enables automatic service dependency detection
372-
EnableDependencyAnalysis bool `json:"enableDependencyAnalysis,omitempty"`
373-
374-
// EnableMetricsAggregation enables service metrics collection and display
375-
EnableMetricsAggregation bool `json:"enableMetricsAggregation,omitempty"`
376-
377-
// EnableLayoutOptimization enables automatic service layout optimization
378-
EnableLayoutOptimization bool `json:"enableLayoutOptimization,omitempty"`
379-
380-
// MaxServicesPerGroup limits the number of services per group (0 = unlimited)
381-
// +kubebuilder:validation:Minimum=0
382-
// +kubebuilder:default=0
383-
MaxServicesPerGroup int `json:"maxServicesPerGroup,omitempty"`
384-
385-
// MaxItemsPerService limits the number of items per service (0 = unlimited)
386-
// +kubebuilder:validation:Minimum=0
387-
// +kubebuilder:default=0
388-
MaxItemsPerService int `json:"maxItemsPerService,omitempty"`
389-
}

api/v1alpha1/dashboard_types_test.go

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,11 @@ func TestDashboardSpecValidation(t *testing.T) {
7979
hasError: false,
8080
},
8181
{
82-
name: "Valid spec with advanced config",
82+
name: "Valid spec with remote clusters",
8383
spec: DashboardSpec{
8484
HomerConfig: homer.HomerConfig{
8585
Title: "Test Dashboard",
8686
},
87-
Advanced: &AdvancedConfig{
88-
EnableDependencyAnalysis: true,
89-
EnableMetricsAggregation: true,
90-
EnableLayoutOptimization: true,
91-
MaxServicesPerGroup: 10,
92-
MaxItemsPerService: 20,
93-
},
9487
},
9588
hasError: false,
9689
},
@@ -120,13 +113,6 @@ func TestDashboardSpecValidation(t *testing.T) {
120113
HealthPath: "/api/health",
121114
ExpectedCode: 200,
122115
},
123-
Advanced: &AdvancedConfig{
124-
EnableDependencyAnalysis: true,
125-
EnableMetricsAggregation: true,
126-
EnableLayoutOptimization: true,
127-
MaxServicesPerGroup: 15,
128-
MaxItemsPerService: 25,
129-
},
130116
DomainFilters: []string{"example.com", "internal.local"},
131117
},
132118
hasError: false,
@@ -175,15 +161,6 @@ func TestDashboardSpecValidation(t *testing.T) {
175161
}
176162
}
177163

178-
// Validate advanced config
179-
if dashboard.Spec.Advanced != nil {
180-
ac := dashboard.Spec.Advanced
181-
if ac.MaxServicesPerGroup < 0 || ac.MaxItemsPerService < 0 {
182-
if !tt.hasError {
183-
t.Error("Expected max values to be non-negative")
184-
}
185-
}
186-
}
187164
})
188165
}
189166
}
@@ -313,25 +290,6 @@ func TestServiceHealthConfigValidation(t *testing.T) {
313290
}
314291
}
315292

316-
func TestAdvancedConfigDefaults(t *testing.T) {
317-
config := &AdvancedConfig{}
318-
319-
// Check that default values work properly
320-
if config.MaxServicesPerGroup < 0 {
321-
t.Error("MaxServicesPerGroup should not be negative")
322-
}
323-
324-
if config.MaxItemsPerService < 0 {
325-
t.Error("MaxItemsPerService should not be negative")
326-
}
327-
328-
// Test that zero values (unlimited) are valid
329-
if config.MaxServicesPerGroup == 0 && config.MaxItemsPerService == 0 {
330-
// This should be valid (unlimited) - test passes by not erroring
331-
t.Log("Zero values are correctly treated as unlimited")
332-
}
333-
}
334-
335293
func TestDashboardCreation(t *testing.T) {
336294
dashboard := &Dashboard{
337295
ObjectMeta: metav1.ObjectMeta{
@@ -360,13 +318,6 @@ func TestDashboardCreation(t *testing.T) {
360318
"Authorization": "Bearer health-token",
361319
},
362320
},
363-
Advanced: &AdvancedConfig{
364-
EnableDependencyAnalysis: true,
365-
EnableMetricsAggregation: false,
366-
EnableLayoutOptimization: true,
367-
MaxServicesPerGroup: 12,
368-
MaxItemsPerService: 30,
369-
},
370321
},
371322
}
372323

@@ -399,17 +350,6 @@ func TestDashboardCreation(t *testing.T) {
399350
t.Errorf("Expected interval '45s', got '%s'", dashboard.Spec.HealthCheck.Interval)
400351
}
401352

402-
if dashboard.Spec.Advanced.MaxServicesPerGroup != 12 {
403-
t.Errorf("Expected max services per group 12, got %d", dashboard.Spec.Advanced.MaxServicesPerGroup)
404-
}
405-
406-
if dashboard.Spec.Advanced.EnableDependencyAnalysis != true {
407-
t.Error("Expected dependency analysis to be enabled")
408-
}
409-
410-
if dashboard.Spec.Advanced.EnableMetricsAggregation != false {
411-
t.Error("Expected metrics aggregation to be disabled")
412-
}
413353
}
414354

415355
// Helper function to create int32 pointer

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 0 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/homer-operator/templates/crd.yaml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -61,35 +61,6 @@ spec:
6161
spec:
6262
description: DashboardSpec defines the desired state of Dashboard
6363
properties:
64-
advanced:
65-
description: Advanced configures advanced aggregation and analysis
66-
features.
67-
properties:
68-
enableDependencyAnalysis:
69-
description: EnableDependencyAnalysis enables automatic service
70-
dependency detection
71-
type: boolean
72-
enableLayoutOptimization:
73-
description: EnableLayoutOptimization enables automatic service
74-
layout optimization
75-
type: boolean
76-
enableMetricsAggregation:
77-
description: EnableMetricsAggregation enables service metrics
78-
collection and display
79-
type: boolean
80-
maxItemsPerService:
81-
default: 0
82-
description: MaxItemsPerService limits the number of items per
83-
service (0 = unlimited)
84-
minimum: 0
85-
type: integer
86-
maxServicesPerGroup:
87-
default: 0
88-
description: MaxServicesPerGroup limits the number of services
89-
per group (0 = unlimited)
90-
minimum: 0
91-
type: integer
92-
type: object
9364
assets:
9465
description: Assets configures custom assets (logos, icons, CSS) for
9566
the dashboard.

config/crd/bases/homer.rajsingh.info_dashboards.yaml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -55,35 +55,6 @@ spec:
5555
spec:
5656
description: DashboardSpec defines the desired state of Dashboard
5757
properties:
58-
advanced:
59-
description: Advanced configures advanced aggregation and analysis
60-
features.
61-
properties:
62-
enableDependencyAnalysis:
63-
description: EnableDependencyAnalysis enables automatic service
64-
dependency detection
65-
type: boolean
66-
enableLayoutOptimization:
67-
description: EnableLayoutOptimization enables automatic service
68-
layout optimization
69-
type: boolean
70-
enableMetricsAggregation:
71-
description: EnableMetricsAggregation enables service metrics
72-
collection and display
73-
type: boolean
74-
maxItemsPerService:
75-
default: 0
76-
description: MaxItemsPerService limits the number of items per
77-
service (0 = unlimited)
78-
minimum: 0
79-
type: integer
80-
maxServicesPerGroup:
81-
default: 0
82-
description: MaxServicesPerGroup limits the number of services
83-
per group (0 = unlimited)
84-
minimum: 0
85-
type: integer
86-
type: object
8758
assets:
8859
description: Assets configures custom assets (logos, icons, CSS) for
8960
the dashboard.

config/samples/homer_v1alpha1_dashboard_multicluster.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,6 @@ spec:
185185
condition:
186186
"cluster": "production"
187187
priority: 1
188-
189-
# Advanced features
190-
advanced:
191-
enableDependencyAnalysis: true
192-
enableMetricsAggregation: true
193-
enableLayoutOptimization: true
194-
maxServicesPerGroup: 50 # Higher limit for multi-cluster
195188
---
196189
# Example Service Account and RBAC for remote cluster access
197190
# This should be created in each remote cluster

0 commit comments

Comments
 (0)