Skip to content

Commit 7e0a224

Browse files
committed
Added datalayer config to text config definition
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
1 parent db8e7be commit 7e0a224

File tree

2 files changed

+85
-1
lines changed

2 files changed

+85
-1
lines changed

apix/config/v1alpha1/endpointpickerconfig_types.go

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,18 @@ type EndpointPickerConfig struct {
4949
// SaturationDetector when present specifies the configuration of the
5050
// Saturation detector. If not present, default values are used.
5151
SaturationDetector *SaturationDetector `json:"saturationDetector,omitempty"`
52+
53+
// +optional
54+
// Data configures the DataLayer. It is required if the new DataLayer is enabled.
55+
Data *DataLayerConfig `json:"data"`
5256
}
5357

5458
func (cfg EndpointPickerConfig) String() string {
5559
return fmt.Sprintf(
56-
"{Plugins: %v, SchedulingProfiles: %v, FeatureGates: %v, SaturationDetector: %v}",
60+
"{Plugins: %v, SchedulingProfiles: %v, Data: %v, FeatureGates: %v, SaturationDetector: %v}",
5761
cfg.Plugins,
5862
cfg.SchedulingProfiles,
63+
cfg.Data,
5964
cfg.FeatureGates,
6065
cfg.SaturationDetector,
6166
)
@@ -191,3 +196,35 @@ func (sd *SaturationDetector) String() string {
191196
}
192197
return "{" + result + "}"
193198
}
199+
200+
// DataLayerConfig contains the configuration of the V2 DataLayer feature
201+
type DataLayerConfig struct {
202+
// +required
203+
// +kubebuilder:validation:Required
204+
// Sources is the list of sources to define to the DataLayer
205+
Sources []DataLayerSource `json:"sources"`
206+
}
207+
208+
func (dlc DataLayerConfig) String() string {
209+
return fmt.Sprintf("{Sources: %v}", dlc.Sources)
210+
}
211+
212+
type DataLayerSource struct {
213+
// +required
214+
// +kubebuilder:validation:Required
215+
// PluginRef specifies a partiular Plugin instance to be associated with
216+
// this Source. The reference is to the name of an entry of the Plugins
217+
// defined in the configuration's Plugins section
218+
PluginRef string `json:"pluginRef"`
219+
220+
// +required
221+
// +kubebuilder:validation:Required
222+
// Extractors specifies the list of Plugin instances to be associated with
223+
// this Source. The entries are references to the names of entries of the Plugins
224+
// defined in the configuration's Plugins section
225+
Extractors []string `json:"extractors"`
226+
}
227+
228+
func (dls DataLayerSource) String() string {
229+
return fmt.Sprintf("{PluginRef: %s, Extractors: %v}", dls.PluginRef, dls.Extractors)
230+
}

apix/config/v1alpha1/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)