metallb-ip-floater/internal/config_test.go

26 lines
468 B
Go
Raw Normal View History

2023-10-20 19:34:30 +00:00
package internal
import (
"reflect"
"testing"
)
var defaultConfig = Config{
LogLevel: "Info",
LabelSelector: "kops.k8s.io/instance-role=Node",
Protocol: "http",
HcloudToken: "",
FloatingIPName: "",
DryRun: false,
}
func TestConfigDefaults(t *testing.T) {
cfg, err := GenConfig()
if err != nil {
t.Errorf("%s", err.Error())
}
if !reflect.DeepEqual(&defaultConfig, cfg) {
t.Errorf("got %+v, want %+v", cfg, defaultConfig)
}
}