arv, err := arvadosclient.MakeArvadosClient()
c.Assert(err, check.Equals, nil)
- cache := DefaultConfig(s.Config).Cache
+ cache := newConfig(s.Config).Cache
cache.registry = prometheus.NewRegistry()
// Hit the same collection 5 times using the same token. Only
arv, err := arvadosclient.MakeArvadosClient()
c.Assert(err, check.Equals, nil)
- cache := DefaultConfig(s.Config).Cache
+ cache := newConfig(s.Config).Cache
cache.registry = prometheus.NewRegistry()
for _, forceReload := range []bool{false, true, false, true} {
arv, err := arvadosclient.MakeArvadosClient()
c.Assert(err, check.Equals, nil)
- cache := DefaultConfig(s.Config).Cache
+ cache := newConfig(s.Config).Cache
cache.registry = prometheus.NewRegistry()
for _, forceReload := range []bool{false, true, false, true} {
}
func (s *UnitSuite) TestCORSPreflight(c *check.C) {
- h := handler{Config: DefaultConfig(s.Config)}
+ h := handler{Config: newConfig(s.Config)}
u := mustParseURL("http://keep-web.example/c=" + arvadostest.FooCollection + "/foo")
req := &http.Request{
Method: "OPTIONS",
RequestURI: u.RequestURI(),
}
resp := httptest.NewRecorder()
- cfg := DefaultConfig(s.Config)
+ cfg := newConfig(s.Config)
cfg.cluster.Users.AnonymousUserToken = arvadostest.AnonymousToken
h := handler{Config: cfg}
h.ServeHTTP(resp, req)
cluster *arvados.Cluster
}
-// DefaultConfig returns the default configuration.
-func DefaultConfig(arvCfg *arvados.Config) *Config {
+func newConfig(arvCfg *arvados.Config) *Config {
cfg := Config{}
var cls *arvados.Cluster
var err error
if err != nil {
log.Fatal(err)
}
- cfg := DefaultConfig(arvCfg)
+ cfg := newConfig(arvCfg)
if *dumpConfig {
out, err := yaml.Marshal(cfg)
ldr.Path = "-"
arvCfg, err := ldr.Load()
c.Check(err, check.IsNil)
- cfg := DefaultConfig(arvCfg)
+ cfg := newConfig(arvCfg)
c.Assert(err, check.IsNil)
cfg.Client = arvados.Client{
APIHost: testAPIHost,
)
func (s *UnitSuite) TestStatus(c *check.C) {
- h := handler{Config: DefaultConfig(s.Config)}
+ h := handler{Config: newConfig(s.Config)}
u, _ := url.Parse("http://keep-web.example/status.json")
req := &http.Request{
Method: "GET",