Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: object store services #18108

Merged
merged 7 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion agent/agenttest/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,17 @@ func AssertManifoldsDependencies(c *gc.C, manifolds dependency.Manifolds, expect
c.Assert(expectedNames.Difference(names), gc.DeepEquals, empty)

for _, n := range manifoldNames.SortedValues() {
c.Check(dependencies[n], jc.SameContents, expected[n], gc.Commentf("mismatched dependencies for worker %q", n))
if !c.Check(dependencies[n], jc.SameContents, expected[n], gc.Commentf("mismatched dependencies for worker %q", n)) {
// Make life easier when attempting to interpret the output.
// We already know the answer, just tell us what to do!
add := set.NewStrings(dependencies[n]...).Difference(set.NewStrings(expected[n]...)).SortedValues()
remove := set.NewStrings(expected[n]...).Difference(set.NewStrings(dependencies[n]...)).SortedValues()
if len(add) == 0 && len(remove) == 0 {
c.Logf(" > changes required for %q:\n - remove duplicate dependencies\n", n)
} else {
c.Logf(" > changes required for %q:\n - add dependencies: %v\n - remove dependencies %v\n", n, add, remove)
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion apiserver/auditconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (s *auditConfigSuite) TestAuditLoggingUsesExcludeMethods(c *gc.C) {
func (s *auditConfigSuite) TestNewServerValidatesConfig(c *gc.C) {
cfg := testing.DefaultServerConfig(c, nil)
cfg.GetAuditConfig = nil
cfg.ServiceFactoryGetter = s.ServiceFactoryGetter(c)
cfg.ServiceFactoryGetter = s.ServiceFactoryGetter(c, s.NoopObjectStore(c))

srv, err := apiserver.NewServer(context.Background(), cfg)
c.Assert(err, gc.ErrorMatches, "missing GetAuditConfig not valid")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ func (s *withoutControllerSuite) TestSetInstanceInfo(c *gc.C) {
dummystorage.StorageProviders(),
provider.CommonStorageProviders(),
}
serviceFactoryGetter := s.ServiceFactoryGetter(c)
serviceFactoryGetter := s.ServiceFactoryGetter(c, s.NoopObjectStore(c))

st := s.ControllerModel(c).State()
storageService := serviceFactoryGetter.FactoryForModel(model.UUID(st.ModelUUID())).Storage(registry)
Expand Down
4 changes: 2 additions & 2 deletions apiserver/facades/agent/provisioner/provisioninginfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (s *withoutControllerSuite) TestProvisioningInfoWithStorage(c *gc.C) {
dummystorage.StorageProviders(),
provider.CommonStorageProviders(),
}
serviceFactoryGetter := s.ServiceFactoryGetter(c)
serviceFactoryGetter := s.ServiceFactoryGetter(c, s.NoopObjectStore(c))

st := s.ControllerModel(c).State()
storageService := serviceFactoryGetter.FactoryForModel(model.UUID(st.ModelUUID())).Storage(registry)
Expand Down Expand Up @@ -137,7 +137,7 @@ func (s *withoutControllerSuite) TestProvisioningInfoRootDiskVolume(c *gc.C) {
dummystorage.StorageProviders(),
provider.CommonStorageProviders(),
}
serviceFactoryGetter := s.ServiceFactoryGetter(c)
serviceFactoryGetter := s.ServiceFactoryGetter(c, s.NoopObjectStore(c))

st := s.ControllerModel(c).State()
storageService := serviceFactoryGetter.FactoryForModel(model.UUID(st.ModelUUID())).Storage(registry)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (s *caasProvisionerSuite) SetUpTest(c *gc.C) {
broker, err := stateenvirons.GetNewCAASBrokerFunc(caas.New)(m, serviceFactory.Cloud(), serviceFactory.Credential())
c.Assert(err, jc.ErrorIsNil)
registry := stateenvirons.NewStorageProviderRegistry(broker)
serviceFactoryGetter := s.ServiceFactoryGetter(c)
serviceFactoryGetter := s.ServiceFactoryGetter(c, s.NoopObjectStore(c))
storageService := serviceFactoryGetter.FactoryForModel(model.UUID(s.st.ModelUUID())).Storage(registry)

s.authorizer = &apiservertesting.FakeAuthorizer{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (s *iaasProvisionerSuite) newApi(c *gc.C, blockDeviceService storageprovisi
c.Assert(err, jc.ErrorIsNil)
registry := stateenvirons.NewStorageProviderRegistry(env)
s.st = s.ControllerModel(c).State()
serviceFactoryGetter := s.ServiceFactoryGetter(c)
serviceFactoryGetter := s.ServiceFactoryGetter(c, s.NoopObjectStore(c))
storageService := serviceFactoryGetter.FactoryForModel(model.UUID(s.st.ModelUUID())).Storage(registry)

s.authorizer = &apiservertesting.FakeAuthorizer{
Expand Down
2 changes: 1 addition & 1 deletion apiserver/facades/agent/uniter/uniter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (s *uniterSuite) TestLife(c *gc.C) {
c.Assert(relStatus.Status, gc.Equals, status.Joining)

// We need to dual write to dqlite.
sf := s.ServiceFactorySuite.ServiceFactoryGetter(c).FactoryForModel(s.ServiceFactorySuite.ControllerModelUUID)
sf := s.ServiceFactorySuite.ServiceFactoryGetter(c, s.NoopObjectStore(c)).FactoryForModel(s.ServiceFactorySuite.ControllerModelUUID)
applicationService := sf.Application(service.ApplicationServiceParams{
StorageRegistry: storage.NotImplementedProviderRegistry{},
Secrets: service.NotImplementedSecretService{},
Expand Down
2 changes: 1 addition & 1 deletion apiserver/facades/client/application/application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (s *applicationSuite) makeAPI(c *gc.C) {
Type: model.IAAS,
}
registry := stateenvirons.NewStorageProviderRegistry(env)
serviceFactoryGetter := s.ServiceFactoryGetter(c)
serviceFactoryGetter := s.ServiceFactoryGetter(c, s.NoopObjectStore(c))
storageService := serviceFactoryGetter.FactoryForModel(model.UUID(st.ModelUUID())).Storage(registry)
applicationService := serviceFactory.Application(service.ApplicationServiceParams{
StorageRegistry: registry,
Expand Down
2 changes: 1 addition & 1 deletion apiserver/facades/client/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (s *controllerSuite) SetUpTest(c *gc.C) {
s.StateSuite.SetUpTest(c)
s.ServiceFactorySuite.ControllerConfig = controllerCfg
s.ServiceFactorySuite.SetUpTest(c)
jujujujutesting.SeedDatabase(c, s.ControllerSuite.TxnRunner(), s.ServiceFactoryGetter(c)(s.ControllerModelUUID), controllerCfg)
jujujujutesting.SeedDatabase(c, s.ControllerSuite.TxnRunner(), s.ServiceFactoryGetter(c, s.NoopObjectStore(c))(s.ControllerModelUUID), controllerCfg)

s.hub = pubsub.NewStructuredHub(nil)

Expand Down
Loading
Loading