Skip to content

Commit 6fdca6a

Browse files
committed
Loader changes due to FeatureGates no longer being a pointer
Signed-off-by: Shmuel Kallner <[email protected]>
1 parent a7bffdf commit 6fdca6a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pkg/epp/config/loader/configloader.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ func loadSchedulerConfig(configProfiles []configapi.SchedulingProfile, handle pl
125125
return scheduling.NewSchedulerConfig(profileHandler, profiles), nil
126126
}
127127

128-
func loadFeatureConfig(featureGates *configapi.FeatureGates) map[string]bool {
128+
func loadFeatureConfig(featureGates configapi.FeatureGates) map[string]bool {
129129
featureConfig := map[string]bool{}
130130

131131
for gate := range registeredFeatureGates {
132132
featureConfig[gate] = false
133133
}
134134

135135
if featureGates != nil {
136-
for gate, enabled := range *featureGates {
136+
for gate, enabled := range featureGates {
137137
featureConfig[gate] = enabled
138138
}
139139
}
@@ -226,12 +226,12 @@ func RegisterFeatureGate(gate string) {
226226
registeredFeatureGates[gate] = struct{}{}
227227
}
228228

229-
func validateFeatureGates(fg *configapi.FeatureGates) error {
229+
func validateFeatureGates(fg configapi.FeatureGates) error {
230230
if fg == nil {
231231
return nil
232232
}
233233

234-
for gate := range *fg {
234+
for gate := range fg {
235235
if _, ok := registeredFeatureGates[gate]; !ok {
236236
return errors.New(gate + " is an unregistered Feature Gate")
237237
}

pkg/epp/config/loader/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func setDefaultsPhaseOne(cfg *configapi.EndpointPickerConfig) {
5555

5656
// If no feature gates were specified, provide a default FeatureGates struct
5757
if cfg.FeatureGates == nil {
58-
cfg.FeatureGates = &configapi.FeatureGates{}
58+
cfg.FeatureGates = configapi.FeatureGates{}
5959
}
6060

6161
// If the SaturationDetector configuration wasn't specified setup a default one

0 commit comments

Comments
 (0)