Skip to content

Commit d232ed5

Browse files
committed
remove core options
1 parent 587512e commit d232ed5

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func loadLegacyOptions(config string, extraFlags *pflag.FlagSet, args []string)
107107
func loadYamlOptions(yamlConfig, config string, extraFlags *pflag.FlagSet, args []string) (*options.Options, error) {
108108
opts, err := loadOptions(config, extraFlags, args)
109109
if err != nil {
110-
return nil, fmt.Errorf("failed to load core options: %v", err)
110+
return nil, fmt.Errorf("please convert all legacy options: %v", err)
111111
}
112112

113113
alphaOpts := options.NewAlphaOptions(opts)

main_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ redirect_url="http://localhost:4180/oauth2/callback"
3535
session_cookie_minimal="true"
3636
ping_path="/ping-pong"
3737
ready_path="/readysteady"
38+
errors_to_info_log="true"
39+
silence_ping_logging="true"
3840
`
3941

4042
const testAlphaConfig = `
@@ -89,6 +91,9 @@ session:
8991
probeOptions:
9092
pingPath: /ping-pong
9193
readyPath: /readysteady
94+
logging:
95+
errToInfo: true
96+
silencePing: true
9297
providers:
9398
- provider: google
9499
ID: google=oauth2-proxy
@@ -109,11 +114,6 @@ providers:
109114
- force
110115
`
111116

112-
const testCoreConfig = `
113-
errors_to_info_log="true"
114-
silence_ping_logging="true"
115-
`
116-
117117
boolPtr := func(b bool) *bool {
118118
return &b
119119
}
@@ -271,30 +271,30 @@ providers:
271271
Expect(opts).To(EqualOpts(in.expectedOptions()))
272272
},
273273
Entry("with legacy configuration", loadConfigurationTableInput{
274-
configContent: testCoreConfig + testLegacyConfig,
274+
configContent: testLegacyConfig,
275275
expectedOptions: testExpectedOptions,
276276
}),
277277
Entry("with alpha configuration", loadConfigurationTableInput{
278-
configContent: testCoreConfig,
278+
configContent: "",
279279
alphaConfigContent: testAlphaConfig,
280280
expectedOptions: testExpectedOptions,
281281
}),
282282
Entry("with bad legacy configuration", loadConfigurationTableInput{
283-
configContent: testCoreConfig + "unknown_field=\"something\"",
283+
configContent: testLegacyConfig + "unknown_field=\"something\"",
284284
expectedOptions: func() *options.Options { return nil },
285285
expectedErr: errors.New("failed to load config: error unmarshalling config: 1 error(s) decoding:\n\n* '' has invalid keys: unknown_field"),
286286
}),
287287
Entry("with bad alpha configuration", loadConfigurationTableInput{
288-
configContent: testCoreConfig,
288+
configContent: "",
289289
alphaConfigContent: testAlphaConfig + ":",
290290
expectedOptions: func() *options.Options { return nil },
291291
expectedErr: fmt.Errorf("failed to load alpha options: error unmarshalling config: error converting YAML to JSON: yaml: line %d: did not find expected key", strings.Count(testAlphaConfig, "\n")),
292292
}),
293-
Entry("with alpha configuration and bad core configuration", loadConfigurationTableInput{
294-
configContent: testCoreConfig + "unknown_field=\"something\"",
293+
Entry("with alpha configuration and legacy configuration", loadConfigurationTableInput{
294+
configContent: testLegacyConfig,
295295
alphaConfigContent: testAlphaConfig,
296296
expectedOptions: func() *options.Options { return nil },
297-
expectedErr: errors.New("has invalid keys: unknown_field"),
297+
expectedErr: errors.New("please convert all legacy options"),
298298
}),
299299
)
300300
})

pkg/apis/options/alpha_options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ type AlphaOptions struct {
7070
Logging Logging `json:"logging,omitempty"`
7171
}
7272

73-
// Initialize alpha options with default values and settings of the core options
73+
// Initialize alpha options with default values
7474
func NewAlphaOptions(opts *Options) *AlphaOptions {
7575
aOpts := &AlphaOptions{}
7676
aOpts.ExtractFrom(opts)

0 commit comments

Comments
 (0)