Skip to content

Commit

Permalink
Support full Console values
Browse files Browse the repository at this point in the history
The Console partial values are used for pragmatic reasons as genpartial does
not convert console.Values to console.PartialValues inside Redpanda Values
partial generation. In both structs the type is the same. Unit tests that
marshals Redpanda partial values into file does not work as expected. The
console part of the marshalled values have multiple empty strings or nulls.
It is caused by the fact omitempty is not always set in Console.Values. In
normal template evaluation those nulls and empty strings would be replaced by
default values from values.yaml file. To unblock operator integration
Console.PartialValues is used, until genpartail is smart enough.
  • Loading branch information
RafalKorepta committed Oct 17, 2024
1 parent 2e9d258 commit a0b4ad5
Show file tree
Hide file tree
Showing 4 changed files with 3,731 additions and 22 deletions.
10 changes: 2 additions & 8 deletions charts/redpanda/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/invopop/jsonschema"
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"github.com/redpanda-data/console/backend/pkg/config"
"github.com/redpanda-data/helm-charts/charts/console"
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
orderedmap "github.com/wk8/go-ordered-map/v2"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -59,7 +60,7 @@ type Values struct {
AuditLogging AuditLogging `json:"auditLogging"`
Enterprise Enterprise `json:"enterprise"`
RackAwareness RackAwareness `json:"rackAwareness"`
Console Console `json:"console"`
Console console.PartialValues `json:"console,omitempty"`
Connectors Connectors `json:"connectors"`
Auth Auth `json:"auth"`
TLS TLS `json:"tls"`
Expand All @@ -82,13 +83,6 @@ type Values struct {
Force bool `json:"force"`
}

type Console struct {
Enabled bool `json:"enabled"`
Console struct {
Config map[string]any `json:"config"`
} `json:"console"`
}

type Connectors struct {
Enabled bool `json:"enabled"`
Connectors ConnectorsChartValues `json:"connectors"`
Expand Down
Loading

0 comments on commit a0b4ad5

Please sign in to comment.