Merge pull request #6426 from mamachanko/topic/mamachanko/master/improve-config-file-tests

Rename `webhookConfig` to `controllerConfig`
This commit is contained in:
jetstack-bot 2023-10-18 18:11:05 +02:00 committed by GitHub
commit a51d7607ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,7 @@ func TestFSLoader_Load(t *testing.T) {
const expectedFilename = "/path/to/config/file"
const kubeConfigPath = "path/to/kubeconfig/file"
webhookConfig := New()
controllerConfig := New()
loader, err := configfile.NewConfigurationFSLoader(func(filename string) ([]byte, error) {
if filename != expectedFilename {
@ -42,13 +42,13 @@ kubeConfig: %s`, kubeConfigPath)), nil
t.Fatal(err)
}
if err := loader.Load(webhookConfig); err != nil {
if err := loader.Load(controllerConfig); err != nil {
t.Fatal(err)
}
// the config loader will force paths to be 'absolute' if they are provided as relative.
absKubeConfigPath := "/path/to/config/path/to/kubeconfig/file"
if webhookConfig.Config.KubeConfig != absKubeConfigPath {
t.Errorf("expected kubeConfig to be set to %q but got %q", absKubeConfigPath, webhookConfig.Config.KubeConfig)
if controllerConfig.Config.KubeConfig != absKubeConfigPath {
t.Errorf("expected kubeConfig to be set to %q but got %q", absKubeConfigPath, controllerConfig.Config.KubeConfig)
}
}