From f5bcf0646925eb5c1c3c3282b14ea5df9e720c0a Mon Sep 17 00:00:00 2001 From: Nader Ziada Date: Wed, 10 Jun 2015 11:07:44 -0400 Subject: [PATCH] Moved agent client out to bosh-agent project Also, two modules required by agentclient that used to live in bosh-init (property and httpclient) have moved to bosh-utils. Signed-off-by: Jonathan Fuerth --- Godeps/Godeps.json | 36 +- .../agentclient/agent_client_interface.go | 8 +- .../agentclient/agentclient_suite_test.go | 0 .../agentclient}/applyspec/apply_spec.go | 2 +- .../agentclient}/applyspec/apply_spec_test.go | 4 +- .../applyspec/applyspec_suite_test.go | 0 .../agentclient/fakes/fake_agent_client.go | 37 +- .../agentclient/get_state_retryable.go | 0 .../agentclient/get_state_retryable_test.go | 8 +- .../agentclient/http/agent_client.go | 36 +- .../agentclient/http/agent_client_factory.go | 12 +- .../agentclient/http/agent_client_test.go | 28 +- .../agentclient/http/agent_request.go | 4 +- .../agentclient/http/agent_response.go | 3 +- .../agentclient/http/agent_response_test.go | 2 +- .../http/fakes/fake_agent_client_factory.go | 6 +- .../agentclient/http/http_suite_test.go | 0 .../agentclient/http/mocks/mocks.go | 8 +- .../bosh-agent}/agentclient/mocks/mocks.go | 111 +++--- .../bosh-agent}/agentclient/ping_retryable.go | 0 .../agentclient/ping_retryable_test.go | 8 +- .../directories/directories_provider.go | 69 ++++ .../directories/directories_suite_test.go | 7 +- .../settings/fakes/fake_settings_service.go | 36 ++ .../bosh-agent/settings/service.go | 144 ++++++++ .../bosh-agent/settings/service_test.go | 276 ++++++++++++++ .../bosh-agent/settings/settings.go | 269 ++++++++++++++ .../settings/settings_suite_test.go | 7 +- .../bosh-agent/settings/settings_test.go | 346 ++++++++++++++++++ .../httpclient/fakes/fake_http_client.go | 0 .../bosh-utils}/httpclient/http_client.go | 0 .../httpclient/http_client_test.go | 6 +- .../httpclient/httpclient_suite_test.go | 12 + .../bosh-utils}/property/builders.go | 0 .../cloudfoundry/bosh-utils}/property/list.go | 0 .../cloudfoundry/bosh-utils}/property/map.go | 0 .../bosh-utils}/property/property.go | 0 .../property/property_suite_test.go | 12 + blobstore/blobstore_factory.go | 2 +- blobstore/blobstore_factory_test.go | 2 +- cloud/cloud.go | 2 +- cloud/cloud_test.go | 2 +- cloud/fakes/fake_cloud.go | 2 +- cloud/mocks/mocks.go | 2 +- cmd/deploy_cmd_test.go | 8 +- cmd/deployment_deleter.go | 2 +- cmd/deployment_deleteter_test.go | 8 +- cmd/deployment_preparer.go | 2 +- cmd/factory.go | 4 +- config/deployment_state_service.go | 2 +- config/disk_repo.go | 2 +- config/disk_repo_test.go | 2 +- config/fakes/fake_disk_repo.go | 2 +- ...le_system_deployment_state_service_test.go | 2 +- config/legacy_deployment_state_migrator.go | 2 +- deployment/deployer_test.go | 8 +- deployment/deployment_test.go | 6 +- deployment/disk/disk.go | 2 +- deployment/disk/disk_test.go | 2 +- deployment/disk/fakes/fake_disk.go | 2 +- deployment/disk/manager_test.go | 2 +- deployment/disk/mocks/mocks.go | 2 +- deployment/instance/instance_test.go | 2 +- deployment/instance/manager_test.go | 6 +- deployment/instance/state/builder.go | 2 +- deployment/instance/state/builder_factory.go | 2 +- deployment/instance/state/builder_test.go | 4 +- deployment/instance/state/mocks/mocks.go | 4 +- .../instance/state/remote_package_compiler.go | 2 +- .../state/remote_package_compiler_test.go | 4 +- deployment/instance/state/state.go | 4 +- deployment/instance/state/state_test.go | 4 +- deployment/manager_factory.go | 2 +- deployment/manager_test.go | 2 +- deployment/manifest/disk_pool.go | 2 +- deployment/manifest/fakes/fake_deployment.go | 2 +- deployment/manifest/job.go | 2 +- deployment/manifest/manifest.go | 2 +- deployment/manifest/manifest_test.go | 2 +- deployment/manifest/network.go | 2 +- deployment/manifest/network_test.go | 2 +- deployment/manifest/parser.go | 2 +- deployment/manifest/parser_test.go | 2 +- deployment/manifest/resource_pool.go | 2 +- deployment/manifest/validator_test.go | 2 +- deployment/mocks/mocks.go | 2 +- deployment/vm/disk_deployer_test.go | 2 +- deployment/vm/fakes/fake_vm.go | 4 +- deployment/vm/manager.go | 6 +- deployment/vm/manager_factory.go | 2 +- deployment/vm/manager_test.go | 4 +- deployment/vm/mocks/mocks.go | 2 +- deployment/vm/vm.go | 4 +- deployment/vm/vm_test.go | 8 +- installation/installer_test.go | 2 +- installation/job_renderer.go | 2 +- installation/job_renderer_test.go | 2 +- installation/job_resolver_test.go | 2 +- installation/manifest/manifest.go | 2 +- installation/manifest/parser.go | 2 +- installation/manifest/parser_test.go | 2 +- installation/manifest/validator_test.go | 2 +- installation/tarball/provider.go | 2 +- installation/tarball/provider_test.go | 2 +- integration/deploy_test.go | 14 +- release/job/job.go | 2 +- release/job/reader.go | 2 +- release/job/reader_test.go | 2 +- stemcell/extractor_test.go | 2 +- stemcell/manager_test.go | 2 +- stemcell/reader.go | 2 +- stemcell/reader_test.go | 2 +- stemcell/stemcell.go | 2 +- templatescompiler/job_evaluation_context.go | 2 +- .../job_evaluation_context_test.go | 2 +- templatescompiler/job_list_renderer.go | 2 +- templatescompiler/job_list_renderer_test.go | 2 +- templatescompiler/job_renderer.go | 2 +- templatescompiler/job_renderer_test.go | 2 +- templatescompiler/mocks/mocks.go | 2 +- 120 files changed, 1473 insertions(+), 254 deletions(-) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/agent_client_interface.go (59%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/agentclient_suite_test.go (100%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient}/applyspec/apply_spec.go (96%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient}/applyspec/apply_spec_test.go (95%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient}/applyspec/applyspec_suite_test.go (100%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/fakes/fake_agent_client.go (74%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/get_state_retryable.go (100%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/get_state_retryable_test.go (86%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/http/agent_client.go (78%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/http/agent_client_factory.go (59%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/http/agent_client_test.go (96%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/http/agent_request.go (92%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/http/agent_response.go (98%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/http/agent_response_test.go (97%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/http/fakes/fake_agent_client_factory.go (69%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/http/http_suite_test.go (100%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/http/mocks/mocks.go (73%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/mocks/mocks.go (78%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/ping_retryable.go (100%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent}/agentclient/ping_retryable_test.go (79%) create mode 100644 Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/directories/directories_provider.go rename common/property/property_suite_test.go => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/directories/directories_suite_test.go (52%) create mode 100644 Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/fakes/fake_settings_service.go create mode 100644 Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/service.go create mode 100644 Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/service_test.go create mode 100644 Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/settings.go rename deployment/httpclient/httpclient_suite_test.go => Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/settings_suite_test.go (53%) create mode 100644 Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/settings_test.go rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils}/httpclient/fakes/fake_http_client.go (100%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils}/httpclient/http_client.go (100%) rename {deployment => Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils}/httpclient/http_client_test.go (94%) create mode 100644 Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/httpclient/httpclient_suite_test.go rename {common => Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils}/property/builders.go (100%) rename {common => Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils}/property/list.go (100%) rename {common => Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils}/property/map.go (100%) rename {common => Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils}/property/property.go (100%) create mode 100644 Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/property/property_suite_test.go diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 715d02203..2a9b76ec3 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -14,6 +14,14 @@ "ImportPath": "code.google.com/p/gomock/gomock", "Rev": "526771f51633c1315ac61c3d832f536f479e1501" }, + { + "ImportPath": "github.com/cloudfoundry/bosh-agent/agentclient", + "Rev": "70cedfd71f7063d6bfab5efc7b601ff43f7a266e" + }, + { + "ImportPath": "github.com/cloudfoundry/bosh-agent/settings", + "Rev": "70cedfd71f7063d6bfab5efc7b601ff43f7a266e" + }, { "ImportPath": "github.com/cloudfoundry/bosh-davcli/client", "Rev": "fd7dbb3f3e88ec6516abf9f90f4feedb9413cc2e" @@ -24,43 +32,51 @@ }, { "ImportPath": "github.com/cloudfoundry/bosh-utils/blobstore", - "Rev": "d41ff2652f0e049819b2610c916f32615d37cfc9" + "Rev": "091666c15d455d50ef826625d40250bf96a83cf5" }, { "ImportPath": "github.com/cloudfoundry/bosh-utils/errors", - "Rev": "d41ff2652f0e049819b2610c916f32615d37cfc9" + "Rev": "091666c15d455d50ef826625d40250bf96a83cf5" }, { "ImportPath": "github.com/cloudfoundry/bosh-utils/fileutil", - "Rev": "d41ff2652f0e049819b2610c916f32615d37cfc9" + "Rev": "091666c15d455d50ef826625d40250bf96a83cf5" }, { "ImportPath": "github.com/cloudfoundry/bosh-utils/http", - "Rev": "d41ff2652f0e049819b2610c916f32615d37cfc9" + "Rev": "091666c15d455d50ef826625d40250bf96a83cf5" + }, + { + "ImportPath": "github.com/cloudfoundry/bosh-utils/httpclient", + "Rev": "091666c15d455d50ef826625d40250bf96a83cf5" }, { "ImportPath": "github.com/cloudfoundry/bosh-utils/internal/github.com/cloudfoundry/gofileutils/glob", - "Rev": "d41ff2652f0e049819b2610c916f32615d37cfc9" + "Rev": "091666c15d455d50ef826625d40250bf96a83cf5" }, { "ImportPath": "github.com/cloudfoundry/bosh-utils/internal/github.com/nu7hatch/gouuid", - "Rev": "d41ff2652f0e049819b2610c916f32615d37cfc9" + "Rev": "091666c15d455d50ef826625d40250bf96a83cf5" }, { "ImportPath": "github.com/cloudfoundry/bosh-utils/logger", - "Rev": "d41ff2652f0e049819b2610c916f32615d37cfc9" + "Rev": "091666c15d455d50ef826625d40250bf96a83cf5" + }, + { + "ImportPath": "github.com/cloudfoundry/bosh-utils/property", + "Rev": "091666c15d455d50ef826625d40250bf96a83cf5" }, { "ImportPath": "github.com/cloudfoundry/bosh-utils/retrystrategy", - "Rev": "d41ff2652f0e049819b2610c916f32615d37cfc9" + "Rev": "091666c15d455d50ef826625d40250bf96a83cf5" }, { "ImportPath": "github.com/cloudfoundry/bosh-utils/system", - "Rev": "d41ff2652f0e049819b2610c916f32615d37cfc9" + "Rev": "091666c15d455d50ef826625d40250bf96a83cf5" }, { "ImportPath": "github.com/cloudfoundry/bosh-utils/uuid", - "Rev": "d41ff2652f0e049819b2610c916f32615d37cfc9" + "Rev": "091666c15d455d50ef826625d40250bf96a83cf5" }, { "ImportPath": "github.com/onsi/ginkgo", diff --git a/deployment/agentclient/agent_client_interface.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/agent_client_interface.go similarity index 59% rename from deployment/agentclient/agent_client_interface.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/agent_client_interface.go index ca7a10fe5..eb5296e18 100644 --- a/deployment/agentclient/agent_client_interface.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/agent_client_interface.go @@ -1,13 +1,16 @@ package agentclient import ( - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" + "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" + "github.com/cloudfoundry/bosh-agent/settings" ) +//go:generate mockgen -source=agent_client_interface.go -package=mocks -destination=mocks/mocks.go -imports=.=github.com/cloudfoundry/bosh-agent/agentclient + type AgentClient interface { Ping() (string, error) Stop() error - Apply(bias.ApplySpec) error + Apply(applyspec.ApplySpec) error Start() error GetState() (AgentState, error) MountDisk(string) error @@ -15,6 +18,7 @@ type AgentClient interface { ListDisk() ([]string, error) MigrateDisk() error CompilePackage(packageSource BlobRef, compiledPackageDependencies []BlobRef) (compiledPackageRef BlobRef, err error) + UpdateSettings(settings settings.Settings) error } type AgentState struct { diff --git a/deployment/agentclient/agentclient_suite_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/agentclient_suite_test.go similarity index 100% rename from deployment/agentclient/agentclient_suite_test.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/agentclient_suite_test.go diff --git a/deployment/applyspec/apply_spec.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/applyspec/apply_spec.go similarity index 96% rename from deployment/applyspec/apply_spec.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/applyspec/apply_spec.go index 68d44f81f..425388d10 100644 --- a/deployment/applyspec/apply_spec.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/applyspec/apply_spec.go @@ -1,7 +1,7 @@ package applyspec import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" ) // ApplySpec is the transport layer model for communicating instance state to the bosh-agent. diff --git a/deployment/applyspec/apply_spec_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/applyspec/apply_spec_test.go similarity index 95% rename from deployment/applyspec/apply_spec_test.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/applyspec/apply_spec_test.go index 64d7e6e70..975110752 100644 --- a/deployment/applyspec/apply_spec_test.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/applyspec/apply_spec_test.go @@ -3,11 +3,11 @@ package applyspec_test import ( "encoding/json" - . "github.com/cloudfoundry/bosh-init/deployment/applyspec" + . "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" ) var _ = Describe("ApplySpec", func() { diff --git a/deployment/applyspec/applyspec_suite_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/applyspec/applyspec_suite_test.go similarity index 100% rename from deployment/applyspec/applyspec_suite_test.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/applyspec/applyspec_suite_test.go diff --git a/deployment/agentclient/fakes/fake_agent_client.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/fakes/fake_agent_client.go similarity index 74% rename from deployment/agentclient/fakes/fake_agent_client.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/fakes/fake_agent_client.go index 084a4684f..1c31b5148 100644 --- a/deployment/agentclient/fakes/fake_agent_client.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/fakes/fake_agent_client.go @@ -1,8 +1,9 @@ package fakes import ( - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" + "github.com/cloudfoundry/bosh-agent/agentclient" + "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" + "github.com/cloudfoundry/bosh-agent/settings" ) type FakeAgentClient struct { @@ -12,7 +13,7 @@ type FakeAgentClient struct { StopCalled bool stopErr error - ApplyApplySpec bias.ApplySpec + ApplyApplySpec applyspec.ApplySpec ApplyErr error StartCalled bool @@ -33,6 +34,9 @@ type FakeAgentClient struct { MigrateDiskCalledTimes int migrateDiskErr error + + UpdateSettingsCalledTimes int + updateSettingsErr error } type pingResponse struct { @@ -41,12 +45,12 @@ type pingResponse struct { } type getStateOutput struct { - state biagentclient.AgentState + state agentclient.AgentState err error } type compilePackageOutput struct { - blobRef biagentclient.BlobRef + blobRef agentclient.BlobRef err error } @@ -73,7 +77,7 @@ func (c *FakeAgentClient) Stop() error { return c.stopErr } -func (c *FakeAgentClient) Apply(applySpec bias.ApplySpec) error { +func (c *FakeAgentClient) Apply(applySpec applyspec.ApplySpec) error { c.ApplyApplySpec = applySpec return c.ApplyErr @@ -84,7 +88,7 @@ func (c *FakeAgentClient) Start() error { return c.startErr } -func (c *FakeAgentClient) GetState() (biagentclient.AgentState, error) { +func (c *FakeAgentClient) GetState() (agentclient.AgentState, error) { c.GetStateCalledTimes++ getStateReturn := c.getStateOutputs[0] @@ -114,14 +118,19 @@ func (c *FakeAgentClient) MigrateDisk() error { return c.migrateDiskErr } +func (c *FakeAgentClient) UpdateSettings(settings settings.Settings) error { + c.UpdateSettingsCalledTimes++ + return c.updateSettingsErr +} + func (c *FakeAgentClient) CompilePackage( - packageSource biagentclient.BlobRef, - compiledPackageDependencies []biagentclient.BlobRef, + packageSource agentclient.BlobRef, + compiledPackageDependencies []agentclient.BlobRef, ) ( - compiledPackageRef biagentclient.BlobRef, + compiledPackageRef agentclient.BlobRef, err error, ) { - return biagentclient.BlobRef{}, nil + return agentclient.BlobRef{}, nil } func (c *FakeAgentClient) SetPingBehavior(response string, err error) { @@ -139,7 +148,7 @@ func (c *FakeAgentClient) SetStartBehavior(err error) { c.startErr = err } -func (c *FakeAgentClient) SetGetStateBehavior(stateResponse biagentclient.AgentState, err error) { +func (c *FakeAgentClient) SetGetStateBehavior(stateResponse agentclient.AgentState, err error) { c.getStateOutputs = append(c.getStateOutputs, getStateOutput{ state: stateResponse, err: err, @@ -158,6 +167,10 @@ func (c *FakeAgentClient) SetMigrateDiskBehavior(err error) { c.migrateDiskErr = err } +func (c *FakeAgentClient) SetUpdateSettingsBehavior(err error) { + c.updateSettingsErr = err +} + func (c *FakeAgentClient) SetListDiskBehavior(disks []string, err error) { c.listDiskDisks = disks c.listDiskErr = err diff --git a/deployment/agentclient/get_state_retryable.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/get_state_retryable.go similarity index 100% rename from deployment/agentclient/get_state_retryable.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/get_state_retryable.go diff --git a/deployment/agentclient/get_state_retryable_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/get_state_retryable_test.go similarity index 86% rename from deployment/agentclient/get_state_retryable_test.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/get_state_retryable_test.go index 071110002..2278698fc 100644 --- a/deployment/agentclient/get_state_retryable_test.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/get_state_retryable_test.go @@ -3,8 +3,8 @@ package agentclient_test import ( "errors" - . "github.com/cloudfoundry/bosh-init/deployment/agentclient" - fakebiagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient/fakes" + . "github.com/cloudfoundry/bosh-agent/agentclient" + fakeagentclient "github.com/cloudfoundry/bosh-agent/agentclient/fakes" boshretry "github.com/cloudfoundry/bosh-utils/retrystrategy" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -13,12 +13,12 @@ import ( var _ = Describe("GetStateRetryable", func() { Describe("Attempt", func() { var ( - fakeAgentClient *fakebiagentclient.FakeAgentClient + fakeAgentClient *fakeagentclient.FakeAgentClient getStateRetryable boshretry.Retryable ) BeforeEach(func() { - fakeAgentClient = fakebiagentclient.NewFakeAgentClient() + fakeAgentClient = fakeagentclient.NewFakeAgentClient() getStateRetryable = NewGetStateRetryable(fakeAgentClient) }) diff --git a/deployment/agentclient/http/agent_client.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_client.go similarity index 78% rename from deployment/agentclient/http/agent_client.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_client.go index a4d1eff59..9e9a7fd65 100644 --- a/deployment/agentclient/http/agent_client.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_client.go @@ -4,10 +4,11 @@ import ( "fmt" "time" - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" - bihttpclient "github.com/cloudfoundry/bosh-init/deployment/httpclient" + "github.com/cloudfoundry/bosh-agent/agentclient" + "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" + "github.com/cloudfoundry/bosh-agent/settings" bosherr "github.com/cloudfoundry/bosh-utils/errors" + "github.com/cloudfoundry/bosh-utils/httpclient" boshlog "github.com/cloudfoundry/bosh-utils/logger" boshretry "github.com/cloudfoundry/bosh-utils/retrystrategy" ) @@ -23,9 +24,9 @@ func NewAgentClient( endpoint string, directorID string, getTaskDelay time.Duration, - httpClient bihttpclient.HTTPClient, + httpClient httpclient.HTTPClient, logger boshlog.Logger, -) biagentclient.AgentClient { +) agentclient.AgentClient { // if this were NATS, we would need the agentID, but since it's http, the endpoint is unique to the agent agentEndpoint := fmt.Sprintf("%s/agent", endpoint) agentRequest := agentRequest{ @@ -56,7 +57,7 @@ func (c *agentClient) Stop() error { return err } -func (c *agentClient) Apply(spec bias.ApplySpec) error { +func (c *agentClient) Apply(spec applyspec.ApplySpec) error { _, err := c.sendAsyncTaskMessage("apply", []interface{}{spec}) return err } @@ -75,14 +76,14 @@ func (c *agentClient) Start() error { return nil } -func (c *agentClient) GetState() (biagentclient.AgentState, error) { +func (c *agentClient) GetState() (agentclient.AgentState, error) { var response StateResponse err := c.agentRequest.Send("get_state", []interface{}{}, &response) if err != nil { - return biagentclient.AgentState{}, bosherr.WrapError(err, "Sending get_state to the agent") + return agentclient.AgentState{}, bosherr.WrapError(err, "Sending get_state to the agent") } - agentState := biagentclient.AgentState{ + agentState := agentclient.AgentState{ JobState: response.Value.JobState, } return agentState, nil @@ -113,6 +114,11 @@ func (c *agentClient) MigrateDisk() error { return err } +func (c *agentClient) UpdateSettings(settings settings.Settings) error { + _, err := c.sendAsyncTaskMessage("update_settings", []interface{}{settings}) + return err +} + func (c *agentClient) sendAsyncTaskMessage(method string, arguments []interface{}) (value map[string]interface{}, err error) { var response TaskResponse err = c.agentRequest.Send(method, arguments, &response) @@ -158,7 +164,7 @@ func (c *agentClient) sendAsyncTaskMessage(method string, arguments []interface{ return value, err } -func (c *agentClient) CompilePackage(packageSource biagentclient.BlobRef, compiledPackageDependencies []biagentclient.BlobRef) (compiledPackageRef biagentclient.BlobRef, err error) { +func (c *agentClient) CompilePackage(packageSource agentclient.BlobRef, compiledPackageDependencies []agentclient.BlobRef) (compiledPackageRef agentclient.BlobRef, err error) { dependencies := make(map[string]BlobRef, len(compiledPackageDependencies)) for _, dependency := range compiledPackageDependencies { dependencies[dependency.Name] = BlobRef{ @@ -179,25 +185,25 @@ func (c *agentClient) CompilePackage(packageSource biagentclient.BlobRef, compil responseValue, err := c.sendAsyncTaskMessage("compile_package", args) if err != nil { - return biagentclient.BlobRef{}, bosherr.WrapError(err, "Sending 'compile_package' to the agent") + return agentclient.BlobRef{}, bosherr.WrapError(err, "Sending 'compile_package' to the agent") } result, ok := responseValue["result"].(map[string]interface{}) if !ok { - return biagentclient.BlobRef{}, bosherr.Errorf("Unable to parse 'compile_package' response from the agent: %#v", responseValue) + return agentclient.BlobRef{}, bosherr.Errorf("Unable to parse 'compile_package' response from the agent: %#v", responseValue) } sha1, ok := result["sha1"].(string) if !ok { - return biagentclient.BlobRef{}, bosherr.Errorf("Unable to parse 'compile_package' response from the agent: %#v", responseValue) + return agentclient.BlobRef{}, bosherr.Errorf("Unable to parse 'compile_package' response from the agent: %#v", responseValue) } blobstoreID, ok := result["blobstore_id"].(string) if !ok { - return biagentclient.BlobRef{}, bosherr.Errorf("Unable to parse 'compile_package' response from the agent: %#v", responseValue) + return agentclient.BlobRef{}, bosherr.Errorf("Unable to parse 'compile_package' response from the agent: %#v", responseValue) } - compiledPackageRef = biagentclient.BlobRef{ + compiledPackageRef = agentclient.BlobRef{ Name: packageSource.Name, Version: packageSource.Version, SHA1: sha1, diff --git a/deployment/agentclient/http/agent_client_factory.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_client_factory.go similarity index 59% rename from deployment/agentclient/http/agent_client_factory.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_client_factory.go index 608905721..6c0b4aab2 100644 --- a/deployment/agentclient/http/agent_client_factory.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_client_factory.go @@ -1,15 +1,17 @@ package http +//go:generate mockgen -source=agent_client_factory.go -package=mocks -destination=mocks/mocks.go + import ( "time" - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" - bihttpclient "github.com/cloudfoundry/bosh-init/deployment/httpclient" + "github.com/cloudfoundry/bosh-agent/agentclient" + "github.com/cloudfoundry/bosh-utils/httpclient" boshlog "github.com/cloudfoundry/bosh-utils/logger" ) type AgentClientFactory interface { - NewAgentClient(directorID, mbusURL string) biagentclient.AgentClient + NewAgentClient(directorID, mbusURL string) agentclient.AgentClient } type agentClientFactory struct { @@ -27,7 +29,7 @@ func NewAgentClientFactory( } } -func (f *agentClientFactory) NewAgentClient(directorID, mbusURL string) biagentclient.AgentClient { - httpClient := bihttpclient.NewHTTPClient(bihttpclient.DefaultClient, f.logger) +func (f *agentClientFactory) NewAgentClient(directorID, mbusURL string) agentclient.AgentClient { + httpClient := httpclient.NewHTTPClient(httpclient.DefaultClient, f.logger) return NewAgentClient(mbusURL, directorID, f.getTaskDelay, httpClient, f.logger) } diff --git a/deployment/agentclient/http/agent_client_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_client_test.go similarity index 96% rename from deployment/agentclient/http/agent_client_test.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_client_test.go index e1a3cf25d..b9bb08949 100644 --- a/deployment/agentclient/http/agent_client_test.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_client_test.go @@ -4,11 +4,11 @@ import ( "encoding/json" "net/http" - . "github.com/cloudfoundry/bosh-init/deployment/agentclient/http" + . "github.com/cloudfoundry/bosh-agent/agentclient/http" - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" - fakebihttpclient "github.com/cloudfoundry/bosh-init/deployment/httpclient/fakes" + "github.com/cloudfoundry/bosh-agent/agentclient" + "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" + fakehttpclient "github.com/cloudfoundry/bosh-utils/httpclient/fakes" boshlog "github.com/cloudfoundry/bosh-utils/logger" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -16,13 +16,13 @@ import ( var _ = Describe("AgentClient", func() { var ( - fakeHTTPClient *fakebihttpclient.FakeHTTPClient - agentClient biagentclient.AgentClient + fakeHTTPClient *fakehttpclient.FakeHTTPClient + agentClient agentclient.AgentClient ) BeforeEach(func() { logger := boshlog.NewLogger(boshlog.LevelNone) - fakeHTTPClient = fakebihttpclient.NewFakeHTTPClient() + fakeHTTPClient = fakehttpclient.NewFakeHTTPClient() agentClient = NewAgentClient("http://localhost:6305", "fake-uuid", 0, fakeHTTPClient, logger) }) @@ -156,11 +156,11 @@ var _ = Describe("AgentClient", func() { Describe("Apply", func() { var ( specJSON []byte - spec bias.ApplySpec + spec applyspec.ApplySpec ) BeforeEach(func() { - spec = bias.ApplySpec{ + spec = applyspec.ApplySpec{ Deployment: "fake-deployment-name", } var err error @@ -301,7 +301,7 @@ var _ = Describe("AgentClient", func() { It("makes a POST request to the endpoint", func() { stateResponse, err := agentClient.GetState() Expect(err).ToNot(HaveOccurred()) - Expect(stateResponse).To(Equal(biagentclient.AgentState{JobState: "running"})) + Expect(stateResponse).To(Equal(agentclient.AgentState{JobState: "running"})) Expect(fakeHTTPClient.PostInputs).To(HaveLen(1)) Expect(fakeHTTPClient.PostInputs[0].Endpoint).To(Equal("http://localhost:6305/agent")) @@ -327,7 +327,7 @@ var _ = Describe("AgentClient", func() { stateResponse, err := agentClient.GetState() Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("status code: 500")) - Expect(stateResponse).To(Equal(biagentclient.AgentState{})) + Expect(stateResponse).To(Equal(agentclient.AgentState{})) }) }) @@ -340,7 +340,7 @@ var _ = Describe("AgentClient", func() { stateResponse, err := agentClient.GetState() Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("bad request")) - Expect(stateResponse).To(Equal(biagentclient.AgentState{})) + Expect(stateResponse).To(Equal(agentclient.AgentState{})) }) }) }) @@ -583,13 +583,13 @@ var _ = Describe("AgentClient", func() { }) It("makes a compile_package request and waits for the task to be done", func() { - packageSource := biagentclient.BlobRef{ + packageSource := agentclient.BlobRef{ Name: "fake-package-name", Version: "fake-package-version", SHA1: "fake-package-sha1", BlobstoreID: "fake-package-blobstore-id", } - dependencies := []biagentclient.BlobRef{ + dependencies := []agentclient.BlobRef{ { Name: "fake-compiled-package-dep-name", Version: "fake-compiled-package-dep-version", diff --git a/deployment/agentclient/http/agent_request.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_request.go similarity index 92% rename from deployment/agentclient/http/agent_request.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_request.go index b85f5212c..cb3a1e8db 100644 --- a/deployment/agentclient/http/agent_request.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_request.go @@ -5,8 +5,8 @@ import ( "io/ioutil" "net/http" - bihttpclient "github.com/cloudfoundry/bosh-init/deployment/httpclient" bosherr "github.com/cloudfoundry/bosh-utils/errors" + "github.com/cloudfoundry/bosh-utils/httpclient" ) type AgentRequestMessage struct { @@ -18,7 +18,7 @@ type AgentRequestMessage struct { type agentRequest struct { directorID string endpoint string - httpClient bihttpclient.HTTPClient + httpClient httpclient.HTTPClient } func (r agentRequest) Send(method string, arguments []interface{}, response Response) error { diff --git a/deployment/agentclient/http/agent_response.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_response.go similarity index 98% rename from deployment/agentclient/http/agent_response.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_response.go index 792121170..23518d2d5 100644 --- a/deployment/agentclient/http/agent_response.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_response.go @@ -4,6 +4,7 @@ import ( "encoding/json" bosherr "github.com/cloudfoundry/bosh-utils/errors" + "runtime/debug" ) type Response interface { @@ -109,7 +110,7 @@ func (r *TaskResponse) Unmarshal(message []byte) error { func (r *TaskResponse) TaskID() (string, error) { complexResponse, ok := r.Value.(map[string]interface{}) if !ok { - return "", bosherr.Errorf("Failed to convert agent response to map %#v", r.Value) + return "", bosherr.Errorf("Failed to convert agent response to map %#v\n%s", r.Value, debug.Stack()) } agentTaskID, ok := complexResponse["agent_task_id"] diff --git a/deployment/agentclient/http/agent_response_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_response_test.go similarity index 97% rename from deployment/agentclient/http/agent_response_test.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_response_test.go index 03ce82eb0..e2f234cfc 100644 --- a/deployment/agentclient/http/agent_response_test.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/agent_response_test.go @@ -1,7 +1,7 @@ package http_test import ( - . "github.com/cloudfoundry/bosh-init/deployment/agentclient/http" + . "github.com/cloudfoundry/bosh-agent/agentclient/http" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) diff --git a/deployment/agentclient/http/fakes/fake_agent_client_factory.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/fakes/fake_agent_client_factory.go similarity index 69% rename from deployment/agentclient/http/fakes/fake_agent_client_factory.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/fakes/fake_agent_client_factory.go index 17339daa6..e5a6663ac 100644 --- a/deployment/agentclient/http/fakes/fake_agent_client_factory.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/fakes/fake_agent_client_factory.go @@ -1,11 +1,11 @@ package fakes import ( - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" + "github.com/cloudfoundry/bosh-agent/agentclient" ) type FakeAgentClientFactory struct { - CreateAgentClient biagentclient.AgentClient + CreateAgentClient agentclient.AgentClient CreateDirectorID string CreateMbusURL string } @@ -14,7 +14,7 @@ func NewFakeAgentClientFactory() *FakeAgentClientFactory { return &FakeAgentClientFactory{} } -func (f *FakeAgentClientFactory) NewAgentClient(directorID, mbusURL string) biagentclient.AgentClient { +func (f *FakeAgentClientFactory) NewAgentClient(directorID, mbusURL string) agentclient.AgentClient { f.CreateDirectorID = directorID f.CreateMbusURL = mbusURL return f.CreateAgentClient diff --git a/deployment/agentclient/http/http_suite_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/http_suite_test.go similarity index 100% rename from deployment/agentclient/http/http_suite_test.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/http_suite_test.go diff --git a/deployment/agentclient/http/mocks/mocks.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/mocks/mocks.go similarity index 73% rename from deployment/agentclient/http/mocks/mocks.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/mocks/mocks.go index 8ce4e76d7..f6aa31196 100644 --- a/deployment/agentclient/http/mocks/mocks.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/http/mocks/mocks.go @@ -1,11 +1,11 @@ // Automatically generated by MockGen. DO NOT EDIT! -// Source: github.com/cloudfoundry/bosh-init/deployment/agentclient/http (interfaces: AgentClientFactory) +// Source: agent_client_factory.go package mocks import ( gomock "code.google.com/p/gomock/gomock" - agentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" + agentclient "github.com/cloudfoundry/bosh-agent/agentclient" ) // Mock of AgentClientFactory interface @@ -29,8 +29,8 @@ func (_m *MockAgentClientFactory) EXPECT() *_MockAgentClientFactoryRecorder { return _m.recorder } -func (_m *MockAgentClientFactory) NewAgentClient(_param0 string, _param1 string) agentclient.AgentClient { - ret := _m.ctrl.Call(_m, "NewAgentClient", _param0, _param1) +func (_m *MockAgentClientFactory) NewAgentClient(directorID string, mbusURL string) agentclient.AgentClient { + ret := _m.ctrl.Call(_m, "NewAgentClient", directorID, mbusURL) ret0, _ := ret[0].(agentclient.AgentClient) return ret0 } diff --git a/deployment/agentclient/mocks/mocks.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/mocks/mocks.go similarity index 78% rename from deployment/agentclient/mocks/mocks.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/mocks/mocks.go index 84a3e96d5..d2e334c12 100644 --- a/deployment/agentclient/mocks/mocks.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/mocks/mocks.go @@ -1,12 +1,13 @@ // Automatically generated by MockGen. DO NOT EDIT! -// Source: github.com/cloudfoundry/bosh-init/deployment/agentclient (interfaces: AgentClient) +// Source: agent_client_interface.go package mocks import ( + applyspec "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" + settings "github.com/cloudfoundry/bosh-agent/settings" gomock "code.google.com/p/gomock/gomock" - agentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" - applyspec "github.com/cloudfoundry/bosh-init/deployment/applyspec" + . "github.com/cloudfoundry/bosh-agent/agentclient" ) // Mock of AgentClient interface @@ -30,6 +31,27 @@ func (_m *MockAgentClient) EXPECT() *_MockAgentClientRecorder { return _m.recorder } +func (_m *MockAgentClient) Ping() (string, error) { + ret := _m.ctrl.Call(_m, "Ping") + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +func (_mr *_MockAgentClientRecorder) Ping() *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "Ping") +} + +func (_m *MockAgentClient) Stop() error { + ret := _m.ctrl.Call(_m, "Stop") + ret0, _ := ret[0].(error) + return ret0 +} + +func (_mr *_MockAgentClientRecorder) Stop() *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "Stop") +} + func (_m *MockAgentClient) Apply(_param0 applyspec.ApplySpec) error { ret := _m.ctrl.Call(_m, "Apply", _param0) ret0, _ := ret[0].(error) @@ -40,20 +62,19 @@ func (_mr *_MockAgentClientRecorder) Apply(arg0 interface{}) *gomock.Call { return _mr.mock.ctrl.RecordCall(_mr.mock, "Apply", arg0) } -func (_m *MockAgentClient) CompilePackage(_param0 agentclient.BlobRef, _param1 []agentclient.BlobRef) (agentclient.BlobRef, error) { - ret := _m.ctrl.Call(_m, "CompilePackage", _param0, _param1) - ret0, _ := ret[0].(agentclient.BlobRef) - ret1, _ := ret[1].(error) - return ret0, ret1 +func (_m *MockAgentClient) Start() error { + ret := _m.ctrl.Call(_m, "Start") + ret0, _ := ret[0].(error) + return ret0 } -func (_mr *_MockAgentClientRecorder) CompilePackage(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "CompilePackage", arg0, arg1) +func (_mr *_MockAgentClientRecorder) Start() *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "Start") } -func (_m *MockAgentClient) GetState() (agentclient.AgentState, error) { +func (_m *MockAgentClient) GetState() (AgentState, error) { ret := _m.ctrl.Call(_m, "GetState") - ret0, _ := ret[0].(agentclient.AgentState) + ret0, _ := ret[0].(AgentState) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -62,74 +83,64 @@ func (_mr *_MockAgentClientRecorder) GetState() *gomock.Call { return _mr.mock.ctrl.RecordCall(_mr.mock, "GetState") } -func (_m *MockAgentClient) ListDisk() ([]string, error) { - ret := _m.ctrl.Call(_m, "ListDisk") - ret0, _ := ret[0].([]string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockAgentClientRecorder) ListDisk() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "ListDisk") -} - -func (_m *MockAgentClient) MigrateDisk() error { - ret := _m.ctrl.Call(_m, "MigrateDisk") +func (_m *MockAgentClient) MountDisk(_param0 string) error { + ret := _m.ctrl.Call(_m, "MountDisk", _param0) ret0, _ := ret[0].(error) return ret0 } -func (_mr *_MockAgentClientRecorder) MigrateDisk() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "MigrateDisk") +func (_mr *_MockAgentClientRecorder) MountDisk(arg0 interface{}) *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "MountDisk", arg0) } -func (_m *MockAgentClient) MountDisk(_param0 string) error { - ret := _m.ctrl.Call(_m, "MountDisk", _param0) +func (_m *MockAgentClient) UnmountDisk(_param0 string) error { + ret := _m.ctrl.Call(_m, "UnmountDisk", _param0) ret0, _ := ret[0].(error) return ret0 } -func (_mr *_MockAgentClientRecorder) MountDisk(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "MountDisk", arg0) +func (_mr *_MockAgentClientRecorder) UnmountDisk(arg0 interface{}) *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "UnmountDisk", arg0) } -func (_m *MockAgentClient) Ping() (string, error) { - ret := _m.ctrl.Call(_m, "Ping") - ret0, _ := ret[0].(string) +func (_m *MockAgentClient) ListDisk() ([]string, error) { + ret := _m.ctrl.Call(_m, "ListDisk") + ret0, _ := ret[0].([]string) ret1, _ := ret[1].(error) return ret0, ret1 } -func (_mr *_MockAgentClientRecorder) Ping() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Ping") +func (_mr *_MockAgentClientRecorder) ListDisk() *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "ListDisk") } -func (_m *MockAgentClient) Start() error { - ret := _m.ctrl.Call(_m, "Start") +func (_m *MockAgentClient) MigrateDisk() error { + ret := _m.ctrl.Call(_m, "MigrateDisk") ret0, _ := ret[0].(error) return ret0 } -func (_mr *_MockAgentClientRecorder) Start() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Start") +func (_mr *_MockAgentClientRecorder) MigrateDisk() *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "MigrateDisk") } -func (_m *MockAgentClient) Stop() error { - ret := _m.ctrl.Call(_m, "Stop") - ret0, _ := ret[0].(error) - return ret0 +func (_m *MockAgentClient) CompilePackage(packageSource BlobRef, compiledPackageDependencies []BlobRef) (BlobRef, error) { + ret := _m.ctrl.Call(_m, "CompilePackage", packageSource, compiledPackageDependencies) + ret0, _ := ret[0].(BlobRef) + ret1, _ := ret[1].(error) + return ret0, ret1 } -func (_mr *_MockAgentClientRecorder) Stop() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Stop") +func (_mr *_MockAgentClientRecorder) CompilePackage(arg0, arg1 interface{}) *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "CompilePackage", arg0, arg1) } -func (_m *MockAgentClient) UnmountDisk(_param0 string) error { - ret := _m.ctrl.Call(_m, "UnmountDisk", _param0) +func (_m *MockAgentClient) UpdateSettings(settings settings.Settings) error { + ret := _m.ctrl.Call(_m, "UpdateSettings", settings) ret0, _ := ret[0].(error) return ret0 } -func (_mr *_MockAgentClientRecorder) UnmountDisk(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "UnmountDisk", arg0) +func (_mr *_MockAgentClientRecorder) UpdateSettings(arg0 interface{}) *gomock.Call { + return _mr.mock.ctrl.RecordCall(_mr.mock, "UpdateSettings", arg0) } diff --git a/deployment/agentclient/ping_retryable.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/ping_retryable.go similarity index 100% rename from deployment/agentclient/ping_retryable.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/ping_retryable.go diff --git a/deployment/agentclient/ping_retryable_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/ping_retryable_test.go similarity index 79% rename from deployment/agentclient/ping_retryable_test.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/ping_retryable_test.go index 3f6675d7b..ca2a54b9d 100644 --- a/deployment/agentclient/ping_retryable_test.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/agentclient/ping_retryable_test.go @@ -3,8 +3,8 @@ package agentclient_test import ( "errors" - . "github.com/cloudfoundry/bosh-init/deployment/agentclient" - fakebiagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient/fakes" + . "github.com/cloudfoundry/bosh-agent/agentclient" + fakeagentclient "github.com/cloudfoundry/bosh-agent/agentclient/fakes" boshretry "github.com/cloudfoundry/bosh-utils/retrystrategy" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -13,12 +13,12 @@ import ( var _ = Describe("PingRetryable", func() { Describe("Attempt", func() { var ( - fakeAgentClient *fakebiagentclient.FakeAgentClient + fakeAgentClient *fakeagentclient.FakeAgentClient pingRetryable boshretry.Retryable ) BeforeEach(func() { - fakeAgentClient = fakebiagentclient.NewFakeAgentClient() + fakeAgentClient = fakeagentclient.NewFakeAgentClient() pingRetryable = NewPingRetryable(fakeAgentClient) }) diff --git a/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/directories/directories_provider.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/directories/directories_provider.go new file mode 100644 index 000000000..c5c0fbed9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/directories/directories_provider.go @@ -0,0 +1,69 @@ +package directories + +import ( + "path/filepath" +) + +type Provider struct { + baseDir string +} + +func NewProvider(baseDir string) Provider { + return Provider{baseDir} +} + +func (p Provider) BaseDir() string { + return p.baseDir +} + +func (p Provider) BoshDir() string { + return filepath.Join(p.BaseDir(), "bosh") +} + +func (p Provider) EtcDir() string { + return filepath.Join(p.BoshDir(), "etc") +} + +func (p Provider) StoreDir() string { + return filepath.Join(p.BaseDir(), "store") +} + +func (p Provider) DataDir() string { + return filepath.Join(p.BaseDir(), "data") +} + +func (p Provider) StoreMigrationDir() string { + return filepath.Join(p.BaseDir(), "store_migration_target") +} + +func (p Provider) PkgDir() string { + return filepath.Join(p.DataDir(), "packages") +} + +func (p Provider) CompileDir() string { + return filepath.Join(p.DataDir(), "compile") +} + +func (p Provider) MonitJobsDir() string { + return filepath.Join(p.BaseDir(), "monit", "job") +} + +func (p Provider) JobsDir() string { + return filepath.Join(p.BaseDir(), "jobs") +} + +func (p Provider) MicroStore() string { + return filepath.Join(p.BaseDir(), "micro_bosh", "data", "cache") +} + +func (p Provider) SettingsDir() string { + return filepath.Join(p.BoshDir(), "settings") +} + +func (p Provider) TmpDir() string { + return filepath.Join(p.DataDir(), "tmp") +} + +func (p Provider) LogsDir() string { + return filepath.Join(p.DataDir(), "sys", "log") +} diff --git a/common/property/property_suite_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/directories/directories_suite_test.go similarity index 52% rename from common/property/property_suite_test.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/directories/directories_suite_test.go index 73497eacd..c8093941a 100644 --- a/common/property/property_suite_test.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/directories/directories_suite_test.go @@ -1,12 +1,13 @@ -package property_test +package directories_test import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "testing" ) -func TestProperty(t *testing.T) { +func TestDirectories(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Common Property Suite") + RunSpecs(t, "Directories Suite") } diff --git a/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/fakes/fake_settings_service.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/fakes/fake_settings_service.go new file mode 100644 index 000000000..db98a21de --- /dev/null +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/fakes/fake_settings_service.go @@ -0,0 +1,36 @@ +package fakes + +import ( + boshsettings "github.com/cloudfoundry/bosh-agent/settings" +) + +type FakeSettingsService struct { + PublicKey string + PublicKeyErr error + + LoadSettingsError error + SettingsWereLoaded bool + + InvalidateSettingsError error + SettingsWereInvalidated bool + + Settings boshsettings.Settings +} + +func (service *FakeSettingsService) InvalidateSettings() error { + service.SettingsWereInvalidated = true + return service.InvalidateSettingsError +} + +func (service *FakeSettingsService) PublicSSHKeyForUsername(_ string) (string, error) { + return service.PublicKey, service.PublicKeyErr +} + +func (service *FakeSettingsService) LoadSettings() error { + service.SettingsWereLoaded = true + return service.LoadSettingsError +} + +func (service FakeSettingsService) GetSettings() boshsettings.Settings { + return service.Settings +} diff --git a/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/service.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/service.go new file mode 100644 index 000000000..6d86d7293 --- /dev/null +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/service.go @@ -0,0 +1,144 @@ +package settings + +import ( + "encoding/json" + + bosherr "github.com/cloudfoundry/bosh-utils/errors" + boshlog "github.com/cloudfoundry/bosh-utils/logger" + boshsys "github.com/cloudfoundry/bosh-utils/system" +) + +type Service interface { + LoadSettings() error + + // GetSettings does not return error because without settings Agent cannot start. + GetSettings() Settings + + PublicSSHKeyForUsername(string) (string, error) + + InvalidateSettings() error +} + +const settingsServiceLogTag = "settingsService" + +type settingsService struct { + fs boshsys.FileSystem + settingsPath string + settings Settings + settingsSource Source + defaultNetworkResolver DefaultNetworkResolver + logger boshlog.Logger +} + +type DefaultNetworkResolver interface { + // Ideally we would find a network based on a MAC address + // but current CPI implementations do not include it + GetDefaultNetwork() (Network, error) +} + +func NewService( + fs boshsys.FileSystem, + settingsPath string, + settingsSource Source, + defaultNetworkResolver DefaultNetworkResolver, + logger boshlog.Logger, +) (service Service) { + return &settingsService{ + fs: fs, + settingsPath: settingsPath, + settings: Settings{}, + settingsSource: settingsSource, + defaultNetworkResolver: defaultNetworkResolver, + logger: logger, + } +} + +func (s *settingsService) PublicSSHKeyForUsername(username string) (string, error) { + return s.settingsSource.PublicSSHKeyForUsername(username) +} + +func (s *settingsService) LoadSettings() error { + s.logger.Debug(settingsServiceLogTag, "Loading settings from fetcher") + + newSettings, fetchErr := s.settingsSource.Settings() + if fetchErr != nil { + s.logger.Error(settingsServiceLogTag, "Failed loading settings via fetcher: %v", fetchErr) + + existingSettingsJSON, readError := s.fs.ReadFile(s.settingsPath) + if readError != nil { + s.logger.Error(settingsServiceLogTag, "Failed reading settings from file %s", readError.Error()) + return bosherr.WrapError(fetchErr, "Invoking settings fetcher") + } + + s.logger.Debug(settingsServiceLogTag, "Successfully read settings from file") + + err := json.Unmarshal(existingSettingsJSON, &s.settings) + if err != nil { + s.logger.Error(settingsServiceLogTag, "Failed unmarshalling settings from file %s", err.Error()) + return bosherr.WrapError(fetchErr, "Invoking settings fetcher") + } + + return nil + } + + s.logger.Debug(settingsServiceLogTag, "Successfully received settings from fetcher") + s.settings = newSettings + + newSettingsJSON, err := json.Marshal(newSettings) + if err != nil { + return bosherr.WrapError(err, "Marshalling settings json") + } + + err = s.fs.WriteFile(s.settingsPath, newSettingsJSON) + if err != nil { + return bosherr.WrapError(err, "Writing setting json") + } + + return nil +} + +// GetSettings returns setting even if it fails to resolve IPs for dynamic networks. +func (s *settingsService) GetSettings() Settings { + for networkName, network := range s.settings.Networks { + if !network.IsDHCP() { + continue + } + + resolvedNetwork, err := s.resolveNetwork(network) + if err != nil { + break + } + + s.settings.Networks[networkName] = resolvedNetwork + } + + return s.settings +} + +func (s *settingsService) InvalidateSettings() error { + err := s.fs.RemoveAll(s.settingsPath) + if err != nil { + return bosherr.WrapError(err, "Removing settings file") + } + + return nil +} + +func (s *settingsService) resolveNetwork(network Network) (Network, error) { + // Ideally this would be GetNetworkByMACAddress(mac string) + // Currently, we are relying that if the default network does not contain + // the MAC adddress the InterfaceConfigurationCreator will fail. + resolvedNetwork, err := s.defaultNetworkResolver.GetDefaultNetwork() + if err != nil { + s.logger.Error(settingsServiceLogTag, "Failed retrieving default network %s", err.Error()) + return Network{}, bosherr.WrapError(err, "Failed retrieving default network") + } + + // resolvedNetwork does not have all information for a network + network.IP = resolvedNetwork.IP + network.Netmask = resolvedNetwork.Netmask + network.Gateway = resolvedNetwork.Gateway + network.Resolved = true + + return network, nil +} diff --git a/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/service_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/service_test.go new file mode 100644 index 000000000..44f2b92f1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/service_test.go @@ -0,0 +1,276 @@ +package settings_test + +import ( + "encoding/json" + "errors" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + + "github.com/cloudfoundry/bosh-agent/infrastructure/fakes" + fakenet "github.com/cloudfoundry/bosh-agent/platform/net/fakes" + . "github.com/cloudfoundry/bosh-agent/settings" + boshlog "github.com/cloudfoundry/bosh-utils/logger" + fakesys "github.com/cloudfoundry/bosh-utils/system/fakes" +) + +func init() { + Describe("settingsService", func() { + var ( + fs *fakesys.FakeFileSystem + fakeDefaultNetworkResolver *fakenet.FakeDefaultNetworkResolver + fakeSettingsSource *fakes.FakeSettingsSource + ) + + BeforeEach(func() { + fs = fakesys.NewFakeFileSystem() + fakeDefaultNetworkResolver = &fakenet.FakeDefaultNetworkResolver{} + fakeSettingsSource = &fakes.FakeSettingsSource{} + }) + + buildService := func() (Service, *fakesys.FakeFileSystem) { + logger := boshlog.NewLogger(boshlog.LevelNone) + service := NewService(fs, "/setting/path.json", fakeSettingsSource, fakeDefaultNetworkResolver, logger) + return service, fs + } + + Describe("LoadSettings", func() { + var ( + fetchedSettings Settings + fetcherFuncErr error + service Service + ) + + BeforeEach(func() { + fetchedSettings = Settings{} + fetcherFuncErr = nil + }) + + JustBeforeEach(func() { + fakeSettingsSource.SettingsValue = fetchedSettings + fakeSettingsSource.SettingsErr = fetcherFuncErr + service, fs = buildService() + }) + + Context("when settings fetcher succeeds fetching settings", func() { + BeforeEach(func() { + fetchedSettings = Settings{AgentID: "some-new-agent-id"} + }) + + Context("when settings contain at most one dynamic network", func() { + BeforeEach(func() { + fetchedSettings.Networks = Networks{ + "fake-net-1": Network{Type: NetworkTypeDynamic}, + } + }) + + It("updates the service with settings from the fetcher", func() { + err := service.LoadSettings() + Expect(err).NotTo(HaveOccurred()) + Expect(service.GetSettings().AgentID).To(Equal("some-new-agent-id")) + }) + + It("persists settings to the settings file", func() { + err := service.LoadSettings() + Expect(err).NotTo(HaveOccurred()) + + json, err := json.Marshal(fetchedSettings) + Expect(err).NotTo(HaveOccurred()) + + fileContent, err := fs.ReadFile("/setting/path.json") + Expect(err).NotTo(HaveOccurred()) + Expect(fileContent).To(Equal(json)) + }) + + It("returns any error from writing to the setting file", func() { + fs.WriteFileError = errors.New("fs-write-file-error") + + err := service.LoadSettings() + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring("fs-write-file-error")) + }) + }) + }) + + Context("when settings fetcher fails fetching settings", func() { + BeforeEach(func() { + fetcherFuncErr = errors.New("fake-fetch-error") + }) + + Context("when a settings file exists", func() { + Context("when settings contain at most one dynamic network", func() { + BeforeEach(func() { + fs.WriteFile("/setting/path.json", []byte(`{ + "agent_id":"some-agent-id", + "networks": {"fake-net-1": {"type": "dynamic"}} + }`)) + + fakeDefaultNetworkResolver.GetDefaultNetworkNetwork = Network{ + IP: "fake-resolved-ip", + Netmask: "fake-resolved-netmask", + Gateway: "fake-resolved-gateway", + } + }) + + It("returns settings from the settings file with resolved network", func() { + err := service.LoadSettings() + Expect(err).ToNot(HaveOccurred()) + Expect(service.GetSettings()).To(Equal(Settings{ + AgentID: "some-agent-id", + Networks: Networks{ + "fake-net-1": Network{ + Type: NetworkTypeDynamic, + IP: "fake-resolved-ip", + Netmask: "fake-resolved-netmask", + Gateway: "fake-resolved-gateway", + Resolved: true, + }, + }, + })) + }) + }) + }) + + Context("when non-unmarshallable settings file exists", func() { + It("returns any error from the fetcher", func() { + fs.WriteFile("/setting/path.json", []byte(`$%^&*(`)) + + err := service.LoadSettings() + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring("fake-fetch-error")) + + Expect(service.GetSettings()).To(Equal(Settings{})) + }) + }) + + Context("when no settings file exists", func() { + It("returns any error from the fetcher", func() { + err := service.LoadSettings() + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring("fake-fetch-error")) + + Expect(service.GetSettings()).To(Equal(Settings{})) + }) + }) + }) + }) + + Describe("InvalidateSettings", func() { + It("removes the settings file", func() { + fakeSettingsSource.SettingsValue = Settings{} + fakeSettingsSource.SettingsErr = nil + service, fs := buildService() + + fs.WriteFile("/setting/path.json", []byte(`{}`)) + + err := service.InvalidateSettings() + Expect(err).ToNot(HaveOccurred()) + + Expect(fs.FileExists("/setting/path.json")).To(BeFalse()) + }) + + It("returns err if removing settings file errored", func() { + fakeSettingsSource.SettingsValue = Settings{} + fakeSettingsSource.SettingsErr = nil + service, fs := buildService() + + fs.RemoveAllError = errors.New("fs-remove-all-error") + + err := service.InvalidateSettings() + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring("fs-remove-all-error")) + }) + }) + + Describe("GetSettings", func() { + var ( + loadedSettings Settings + service Service + ) + + BeforeEach(func() { + loadedSettings = Settings{AgentID: "some-agent-id"} + }) + + JustBeforeEach(func() { + fakeSettingsSource.SettingsValue = loadedSettings + fakeSettingsSource.SettingsErr = nil + service, _ = buildService() + err := service.LoadSettings() + Expect(err).NotTo(HaveOccurred()) + }) + + Context("when there is are no dynamic networks", func() { + It("returns settings without modifying any networks", func() { + Expect(service.GetSettings()).To(Equal(loadedSettings)) + }) + + It("does not try to determine default network", func() { + _ = service.GetSettings() + Expect(fakeDefaultNetworkResolver.GetDefaultNetworkCalled).To(BeFalse()) + }) + }) + + Context("when there is network that needs to be resolved (ip, netmask, or mac are not set)", func() { + BeforeEach(func() { + loadedSettings = Settings{ + Networks: map[string]Network{ + "fake-net1": Network{ + IP: "fake-net1-ip", + Netmask: "fake-net1-netmask", + Mac: "fake-net1-mac", + Gateway: "fake-net1-gateway", + }, + "fake-net2": Network{ + Gateway: "fake-net2-gateway", + DNS: []string{"fake-net2-dns"}, + }, + }, + } + }) + + Context("when default network can be retrieved", func() { + BeforeEach(func() { + fakeDefaultNetworkResolver.GetDefaultNetworkNetwork = Network{ + IP: "fake-resolved-ip", + Netmask: "fake-resolved-netmask", + Gateway: "fake-resolved-gateway", + } + }) + + It("returns settings with resolved dynamic network ip, netmask, gateway and keeping everything else the same", func() { + settings := service.GetSettings() + Expect(settings).To(Equal(Settings{ + Networks: map[string]Network{ + "fake-net1": Network{ + IP: "fake-net1-ip", + Netmask: "fake-net1-netmask", + Mac: "fake-net1-mac", + Gateway: "fake-net1-gateway", + }, + "fake-net2": Network{ + IP: "fake-resolved-ip", + Netmask: "fake-resolved-netmask", + Gateway: "fake-resolved-gateway", + DNS: []string{"fake-net2-dns"}, + Resolved: true, + }, + }, + })) + }) + }) + + Context("when default network fails to be retrieved", func() { + BeforeEach(func() { + fakeDefaultNetworkResolver.GetDefaultNetworkErr = errors.New("fake-get-default-network-err") + }) + + It("returns error", func() { + settings := service.GetSettings() + Expect(settings).To(Equal(loadedSettings)) + }) + }) + }) + }) + }) +} diff --git a/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/settings.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/settings.go new file mode 100644 index 000000000..e05c56f45 --- /dev/null +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/settings.go @@ -0,0 +1,269 @@ +package settings + +import ( + "fmt" +) + +const ( + RootUsername = "root" + VCAPUsername = "vcap" + AdminGroup = "admin" + EphemeralUserPrefix = "bosh_" +) + +type Settings struct { + AgentID string `json:"agent_id"` + Blobstore Blobstore `json:"blobstore"` + Disks Disks `json:"disks"` + Env Env `json:"env"` + Networks Networks `json:"networks"` + Ntp []string `json:"ntp"` + Mbus string `json:"mbus"` + VM VM `json:"vm"` + TrustedCerts string `json:"trusted_certs"` +} + +type Source interface { + PublicSSHKeyForUsername(string) (string, error) + Settings() (Settings, error) +} + +type Blobstore struct { + Type string `json:"provider"` + Options map[string]interface{} `json:"options"` +} + +type Disks struct { + // e.g "/dev/sda", "1" + System string `json:"system"` + + // e.g "/dev/sdb", "2" + Ephemeral string `json:"ephemeral"` + + // Older CPIs returned disk settings as strings + // e.g {"disk-3845-43758-7243-38754" => "/dev/sdc"} + // {"disk-3845-43758-7243-38754" => "3"} + // Newer CPIs will populate it in a hash: + // e.g {"disk-3845-43758-7243-38754" => {"path" => "/dev/sdc"}} + // {"disk-3845-43758-7243-38754" => {"volume_id" => "3"}} + Persistent map[string]interface{} `json:"persistent"` +} + +type DiskSettings struct { + ID string + VolumeID string + Path string +} + +type VM struct { + Name string `json:"name"` +} + +func (s Settings) PersistentDiskSettings(diskID string) (DiskSettings, bool) { + diskSettings := DiskSettings{} + + for id, settings := range s.Disks.Persistent { + if id == diskID { + diskSettings.ID = diskID + + if hashSettings, ok := settings.(map[string]interface{}); ok { + diskSettings.Path = hashSettings["path"].(string) + diskSettings.VolumeID = hashSettings["volume_id"].(string) + } else { + // Old CPIs return disk path (string) or volume id (string) as disk settings + diskSettings.Path = settings.(string) + diskSettings.VolumeID = settings.(string) + } + + return diskSettings, true + } + } + + return diskSettings, false +} + +func (s Settings) EphemeralDiskSettings() DiskSettings { + return DiskSettings{ + VolumeID: s.Disks.Ephemeral, + Path: s.Disks.Ephemeral, + } +} + +type Env struct { + Bosh BoshEnv `json:"bosh"` +} + +func (e Env) GetPassword() string { + return e.Bosh.Password +} + +type BoshEnv struct { + Password string `json:"password"` +} + +type NetworkType string + +const ( + NetworkTypeDynamic NetworkType = "dynamic" + NetworkTypeVIP NetworkType = "vip" +) + +type Network struct { + Type NetworkType `json:"type"` + + IP string `json:"ip"` + Netmask string `json:"netmask"` + Gateway string `json:"gateway"` + Resolved bool `json:"resolved"` // was resolved via DHCP + + Default []string `json:"default"` + DNS []string `json:"dns"` + + Mac string `json:"mac"` +} + +type Networks map[string]Network + +func (n Networks) NetworkForMac(mac string) (Network, bool) { + for i := range n { + if n[i].Mac == mac { + return n[i], true + } + } + + return Network{}, false +} + +func (n Networks) DefaultNetworkFor(category string) (Network, bool) { + if len(n) == 1 { + for _, net := range n { + return net, true + } + } + + for _, net := range n { + if stringArrayContains(net.Default, category) { + return net, true + } + } + + return Network{}, false +} + +func stringArrayContains(stringArray []string, str string) bool { + for _, s := range stringArray { + if s == str { + return true + } + } + return false +} + +func (n Networks) DefaultIP() (ip string, found bool) { + for _, networkSettings := range n { + if ip == "" { + ip = networkSettings.IP + } + if len(networkSettings.Default) > 0 { + ip = networkSettings.IP + } + } + + if ip != "" { + found = true + } + return +} + +func (n Networks) IPs() (ips []string) { + for _, net := range n { + if net.IP != "" { + ips = append(ips, net.IP) + } + } + return +} + +func (n Network) String() string { + return fmt.Sprintf("type: '%s', ip: '%s', netmask: '%s', gateway: '%s', mac: '%s', resolved: '%t'", n.Type, n.IP, n.Netmask, n.Gateway, n.Mac, n.Resolved) +} + +func (n Network) IsDHCP() bool { + if n.IsVIP() { + return false + } + + if n.isDynamic() { + return true + } + + // If manual network does not have IP and Netmask it cannot be statically + // configured. We want to keep track how originally the network was resolved. + // Otherwise it will be considered as static on subsequent checks. + isStatic := (n.IP != "" && n.Netmask != "") + return n.Resolved || !isStatic +} + +func (n Network) isDynamic() bool { + return n.Type == NetworkTypeDynamic +} + +func (n Network) IsVIP() bool { + return n.Type == NetworkTypeVIP +} + +//{ +// "agent_id": "bm-xxxxxxxx", +// "blobstore": { +// "options": { +// "blobstore_path": "/var/vcap/micro_bosh/data/cache" +// }, +// "provider": "local" +// }, +// "disks": { +// "ephemeral": "/dev/sdb", +// "persistent": { +// "vol-xxxxxx": "/dev/sdf" +// }, +// "system": "/dev/sda1" +// }, +// "env": { +// "bosh": { +// "password": null +// } +// }, +// "trusted_certs": "very\nlong\nmultiline\nstring" +// "mbus": "https://vcap:b00tstrap@0.0.0.0:6868", +// "networks": { +// "bosh": { +// "cloud_properties": { +// "subnet": "subnet-xxxxxx" +// }, +// "default": [ +// "dns", +// "gateway" +// ], +// "dns": [ +// "xx.xx.xx.xx" +// ], +// "gateway": null, +// "ip": "xx.xx.xx.xx", +// "netmask": null, +// "type": "manual" +// }, +// "vip": { +// "cloud_properties": {}, +// "ip": "xx.xx.xx.xx", +// "type": "vip" +// } +// }, +// "ntp": [ +// "0.north-america.pool.ntp.org", +// "1.north-america.pool.ntp.org", +// "2.north-america.pool.ntp.org", +// "3.north-america.pool.ntp.org" +// ], +// "vm": { +// "name": "vm-xxxxxxxx" +// } +//} diff --git a/deployment/httpclient/httpclient_suite_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/settings_suite_test.go similarity index 53% rename from deployment/httpclient/httpclient_suite_test.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/settings_suite_test.go index c2e1740b9..588f2f173 100644 --- a/deployment/httpclient/httpclient_suite_test.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/settings_suite_test.go @@ -1,12 +1,13 @@ -package httpclient_test +package settings_test import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "testing" ) -func TestHttpclient(t *testing.T) { +func TestSettings(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Httpclient Suite") + RunSpecs(t, "Settings Suite") } diff --git a/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/settings_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/settings_test.go new file mode 100644 index 000000000..a7a00cf34 --- /dev/null +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-agent/settings/settings_test.go @@ -0,0 +1,346 @@ +package settings_test + +import ( + "encoding/json" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + + . "github.com/cloudfoundry/bosh-agent/matchers" + . "github.com/cloudfoundry/bosh-agent/settings" +) + +func init() { + Describe("Settings", func() { + var settings Settings + + Describe("PersistentDiskSettings", func() { + Context("when the disk settings are hash", func() { + BeforeEach(func() { + settings = Settings{ + Disks: Disks{ + Persistent: map[string]interface{}{ + "fake-disk-id": map[string]interface{}{ + "volume_id": "fake-disk-volume-id", + "path": "fake-disk-path", + }, + }, + }, + } + }) + + It("returns disk settings", func() { + diskSettings, found := settings.PersistentDiskSettings("fake-disk-id") + Expect(found).To(BeTrue()) + Expect(diskSettings).To(Equal(DiskSettings{ + ID: "fake-disk-id", + VolumeID: "fake-disk-volume-id", + Path: "fake-disk-path", + })) + }) + }) + + Context("when the disk settings is a string", func() { + BeforeEach(func() { + settings = Settings{ + Disks: Disks{ + Persistent: map[string]interface{}{ + "fake-disk-id": "fake-disk-value", + }, + }, + } + }) + + It("converts it to disk settings", func() { + diskSettings, found := settings.PersistentDiskSettings("fake-disk-id") + Expect(found).To(BeTrue()) + Expect(diskSettings).To(Equal(DiskSettings{ + ID: "fake-disk-id", + VolumeID: "fake-disk-value", + Path: "fake-disk-value", + })) + }) + }) + + Context("when disk with requested disk ID is not present", func() { + BeforeEach(func() { + settings = Settings{ + Disks: Disks{ + Persistent: map[string]interface{}{ + "fake-disk-id": "fake-disk-path", + }, + }, + } + }) + + It("returns false", func() { + diskSettings, found := settings.PersistentDiskSettings("fake-non-existent-disk-id") + Expect(found).To(BeFalse()) + Expect(diskSettings).To(Equal(DiskSettings{})) + }) + }) + }) + + Describe("EphemeralDiskSettings", func() { + BeforeEach(func() { + settings = Settings{ + Disks: Disks{ + Ephemeral: "fake-disk-value", + }, + } + }) + + It("converts disk settings", func() { + Expect(settings.EphemeralDiskSettings()).To(Equal(DiskSettings{ + ID: "", + VolumeID: "fake-disk-value", + Path: "fake-disk-value", + })) + }) + }) + + Describe("DefaultNetworkFor", func() { + Context("when networks is empty", func() { + It("returns found=false", func() { + networks := Networks{} + _, found := networks.DefaultNetworkFor("dns") + Expect(found).To(BeFalse()) + }) + }) + + Context("with a single network", func() { + It("returns that network (found=true)", func() { + networks := Networks{ + "first": Network{ + DNS: []string{"xx.xx.xx.xx"}, + }, + } + + network, found := networks.DefaultNetworkFor("dns") + Expect(found).To(BeTrue()) + Expect(network).To(Equal(networks["first"])) + }) + }) + + Context("with multiple networks and default is found for dns", func() { + It("returns the network marked default (found=true)", func() { + networks := Networks{ + "first": Network{ + Default: []string{}, + DNS: []string{"aa.aa.aa.aa"}, + }, + "second": Network{ + Default: []string{"something-else", "dns"}, + DNS: []string{"xx.xx.xx.xx", "yy.yy.yy.yy", "zz.zz.zz.zz"}, + }, + "third": Network{ + Default: []string{}, + DNS: []string{"aa.aa.aa.aa"}, + }, + } + + settings, found := networks.DefaultNetworkFor("dns") + Expect(found).To(BeTrue()) + Expect(settings).To(Equal(networks["second"])) + }) + }) + + Context("with multiple networks and default is not found", func() { + It("returns found=false", func() { + networks := Networks{ + "first": Network{ + Default: []string{"foo"}, + DNS: []string{"xx.xx.xx.xx", "yy.yy.yy.yy", "zz.zz.zz.zz"}, + }, + "second": Network{ + Default: []string{}, + DNS: []string{"aa.aa.aa.aa"}, + }, + } + + _, found := networks.DefaultNetworkFor("dns") + Expect(found).To(BeFalse()) + }) + }) + + Context("with multiple networks marked as default", func() { + It("returns one of them", func() { + networks := Networks{ + "first": Network{ + Default: []string{"dns"}, + DNS: []string{"xx.xx.xx.xx", "yy.yy.yy.yy", "zz.zz.zz.zz"}, + }, + "second": Network{ + Default: []string{"dns"}, + DNS: []string{"aa.aa.aa.aa"}, + }, + "third": Network{ + DNS: []string{"bb.bb.bb.bb"}, + }, + } + + for i := 0; i < 100; i++ { + settings, found := networks.DefaultNetworkFor("dns") + Expect(found).To(BeTrue()) + Expect(settings).Should(MatchOneOf(networks["first"], networks["second"])) + } + }) + }) + }) + + Describe("DefaultIP", func() { + It("with two networks", func() { + networks := Networks{ + "bosh": Network{ + IP: "xx.xx.xx.xx", + }, + "vip": Network{ + IP: "aa.aa.aa.aa", + }, + } + + ip, found := networks.DefaultIP() + Expect(found).To(BeTrue()) + Expect(ip).To(MatchOneOf("xx.xx.xx.xx", "aa.aa.aa.aa")) + }) + + It("with two networks only with defaults", func() { + networks := Networks{ + "bosh": Network{ + IP: "xx.xx.xx.xx", + }, + "vip": Network{ + IP: "aa.aa.aa.aa", + Default: []string{"dns"}, + }, + } + + ip, found := networks.DefaultIP() + Expect(found).To(BeTrue()) + Expect(ip).To(Equal("aa.aa.aa.aa")) + }) + + It("when none specified", func() { + networks := Networks{ + "bosh": Network{}, + "vip": Network{ + Default: []string{"dns"}, + }, + } + + _, found := networks.DefaultIP() + Expect(found).To(BeFalse()) + }) + }) + }) + + Describe("Settings", func() { + var expectSnakeCaseKeys func(map[string]interface{}) + + expectSnakeCaseKeys = func(value map[string]interface{}) { + for k, v := range value { + Expect(k).To(MatchRegexp("\\A[a-z0-9_]+\\z")) + + tv, isMap := v.(map[string]interface{}) + if isMap { + expectSnakeCaseKeys(tv) + } + } + } + + It("marshals into JSON in snake case to stay consistent with CPI agent env formatting", func() { + settings := Settings{} + settingsJSON, err := json.Marshal(settings) + Expect(err).NotTo(HaveOccurred()) + + var settingsMap map[string]interface{} + err = json.Unmarshal(settingsJSON, &settingsMap) + Expect(err).NotTo(HaveOccurred()) + expectSnakeCaseKeys(settingsMap) + }) + + It("allows different types for blobstore option values", func() { + var settings Settings + settingsJSON := `{"blobstore":{"options":{"string":"value", "int":443, "bool":true, "map":{}}}}` + + err := json.Unmarshal([]byte(settingsJSON), &settings) + Expect(err).NotTo(HaveOccurred()) + Expect(settings.Blobstore.Options).To(Equal(map[string]interface{}{ + "string": "value", + "int": 443.0, + "bool": true, + "map": map[string]interface{}{}, + })) + }) + }) + + Describe("Network", func() { + var network Network + BeforeEach(func() { + network = Network{} + }) + + Describe("IsDHCP", func() { + Context("when network is VIP", func() { + BeforeEach(func() { + network.Type = NetworkTypeVIP + }) + + It("returns false", func() { + Expect(network.IsDHCP()).To(BeFalse()) + }) + }) + + Context("when network is Dynamic", func() { + BeforeEach(func() { + network.Type = NetworkTypeDynamic + }) + + It("returns true", func() { + Expect(network.IsDHCP()).To(BeTrue()) + }) + }) + + Context("when IP is not set", func() { + BeforeEach(func() { + network.Netmask = "255.255.255.0" + }) + + It("returns true", func() { + Expect(network.IsDHCP()).To(BeTrue()) + }) + }) + + Context("when Netmask is not set", func() { + BeforeEach(func() { + network.IP = "127.0.0.5" + }) + + It("returns true", func() { + Expect(network.IsDHCP()).To(BeTrue()) + }) + }) + + Context("when IP and Netmask are set", func() { + BeforeEach(func() { + network.IP = "127.0.0.5" + network.Netmask = "255.255.255.0" + }) + + It("returns false", func() { + Expect(network.IsDHCP()).To(BeFalse()) + }) + }) + + Context("when network was previously resolved via DHCP", func() { + BeforeEach(func() { + network.Resolved = true + }) + + It("returns true", func() { + Expect(network.IsDHCP()).To(BeTrue()) + }) + }) + }) + }) +} diff --git a/deployment/httpclient/fakes/fake_http_client.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/httpclient/fakes/fake_http_client.go similarity index 100% rename from deployment/httpclient/fakes/fake_http_client.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/httpclient/fakes/fake_http_client.go diff --git a/deployment/httpclient/http_client.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/httpclient/http_client.go similarity index 100% rename from deployment/httpclient/http_client.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/httpclient/http_client.go diff --git a/deployment/httpclient/http_client_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/httpclient/http_client_test.go similarity index 94% rename from deployment/httpclient/http_client_test.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/httpclient/http_client_test.go index 4f191c92e..7ebf42561 100644 --- a/deployment/httpclient/http_client_test.go +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/httpclient/http_client_test.go @@ -5,10 +5,10 @@ import ( "net" "net/http" - . "github.com/cloudfoundry/bosh-init/deployment/httpclient" + . "github.com/cloudfoundry/bosh-utils/httpclient" boshlog "github.com/cloudfoundry/bosh-utils/logger" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" + . "github.com/cloudfoundry/bosh-utils/internal/github.com/onsi/ginkgo" + . "github.com/cloudfoundry/bosh-utils/internal/github.com/onsi/gomega" ) var _ = Describe("HttpClient", func() { diff --git a/Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/httpclient/httpclient_suite_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/httpclient/httpclient_suite_test.go new file mode 100644 index 000000000..ce5a388fe --- /dev/null +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/httpclient/httpclient_suite_test.go @@ -0,0 +1,12 @@ +package httpclient_test + +import ( + . "github.com/cloudfoundry/bosh-utils/internal/github.com/onsi/ginkgo" + . "github.com/cloudfoundry/bosh-utils/internal/github.com/onsi/gomega" + "testing" +) + +func TestHttpclient(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Httpclient Suite") +} diff --git a/common/property/builders.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/property/builders.go similarity index 100% rename from common/property/builders.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/property/builders.go diff --git a/common/property/list.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/property/list.go similarity index 100% rename from common/property/list.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/property/list.go diff --git a/common/property/map.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/property/map.go similarity index 100% rename from common/property/map.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/property/map.go diff --git a/common/property/property.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/property/property.go similarity index 100% rename from common/property/property.go rename to Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/property/property.go diff --git a/Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/property/property_suite_test.go b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/property/property_suite_test.go new file mode 100644 index 000000000..ee02cbe07 --- /dev/null +++ b/Godeps/_workspace/src/github.com/cloudfoundry/bosh-utils/property/property_suite_test.go @@ -0,0 +1,12 @@ +package property_test + +import ( + . "github.com/cloudfoundry/bosh-utils/internal/github.com/onsi/ginkgo" + . "github.com/cloudfoundry/bosh-utils/internal/github.com/onsi/gomega" + "testing" +) + +func TestProperty(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Common Property Suite") +} diff --git a/blobstore/blobstore_factory.go b/blobstore/blobstore_factory.go index 91022eebb..86d63dc12 100644 --- a/blobstore/blobstore_factory.go +++ b/blobstore/blobstore_factory.go @@ -6,7 +6,7 @@ import ( boshdavcli "github.com/cloudfoundry/bosh-davcli/client" boshdavcliconf "github.com/cloudfoundry/bosh-davcli/config" - bihttpclient "github.com/cloudfoundry/bosh-init/deployment/httpclient" + bihttpclient "github.com/cloudfoundry/bosh-utils/httpclient" bosherr "github.com/cloudfoundry/bosh-utils/errors" boshlog "github.com/cloudfoundry/bosh-utils/logger" boshsys "github.com/cloudfoundry/bosh-utils/system" diff --git a/blobstore/blobstore_factory_test.go b/blobstore/blobstore_factory_test.go index 0fea3eda0..bb6c1e231 100644 --- a/blobstore/blobstore_factory_test.go +++ b/blobstore/blobstore_factory_test.go @@ -9,7 +9,7 @@ import ( boshdavcli "github.com/cloudfoundry/bosh-davcli/client" boshdavcliconf "github.com/cloudfoundry/bosh-davcli/config" - bihttpclient "github.com/cloudfoundry/bosh-init/deployment/httpclient" + bihttpclient "github.com/cloudfoundry/bosh-utils/httpclient" boshlog "github.com/cloudfoundry/bosh-utils/logger" fakesys "github.com/cloudfoundry/bosh-utils/system/fakes" fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes" diff --git a/cloud/cloud.go b/cloud/cloud.go index 722470da4..893a80bb9 100644 --- a/cloud/cloud.go +++ b/cloud/cloud.go @@ -3,7 +3,7 @@ package cloud import ( "fmt" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bosherr "github.com/cloudfoundry/bosh-utils/errors" boshlog "github.com/cloudfoundry/bosh-utils/logger" ) diff --git a/cloud/cloud_test.go b/cloud/cloud_test.go index f0dacf109..3ecdb59e2 100644 --- a/cloud/cloud_test.go +++ b/cloud/cloud_test.go @@ -3,7 +3,7 @@ package cloud_test import ( "errors" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" boshlog "github.com/cloudfoundry/bosh-utils/logger" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" diff --git a/cloud/fakes/fake_cloud.go b/cloud/fakes/fake_cloud.go index 799f10506..6f2b33cae 100644 --- a/cloud/fakes/fake_cloud.go +++ b/cloud/fakes/fake_cloud.go @@ -2,7 +2,7 @@ package fakes import ( "github.com/cloudfoundry/bosh-init/cloud" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" ) type FakeCloud struct { diff --git a/cloud/mocks/mocks.go b/cloud/mocks/mocks.go index a7f6398fe..cfa96b7fe 100644 --- a/cloud/mocks/mocks.go +++ b/cloud/mocks/mocks.go @@ -6,7 +6,7 @@ package mocks import ( gomock "code.google.com/p/gomock/gomock" cloud "github.com/cloudfoundry/bosh-init/cloud" - property "github.com/cloudfoundry/bosh-init/common/property" + property "github.com/cloudfoundry/bosh-utils/property" installation "github.com/cloudfoundry/bosh-init/installation" ) diff --git a/cmd/deploy_cmd_test.go b/cmd/deploy_cmd_test.go index 5e3c05daa..8e23a7358 100644 --- a/cmd/deploy_cmd_test.go +++ b/cmd/deploy_cmd_test.go @@ -13,8 +13,8 @@ import ( mock_blobstore "github.com/cloudfoundry/bosh-init/blobstore/mocks" mock_cloud "github.com/cloudfoundry/bosh-init/cloud/mocks" mock_config "github.com/cloudfoundry/bosh-init/config/mocks" - mock_httpagent "github.com/cloudfoundry/bosh-init/deployment/agentclient/http/mocks" - mock_agentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient/mocks" + mock_httpagent "github.com/cloudfoundry/bosh-agent/agentclient/http/mocks" + mock_agentclient "github.com/cloudfoundry/bosh-agent/agentclient/mocks" mock_deployment "github.com/cloudfoundry/bosh-init/deployment/mocks" mock_vm "github.com/cloudfoundry/bosh-init/deployment/vm/mocks" mock_install "github.com/cloudfoundry/bosh-init/installation/mocks" @@ -23,7 +23,7 @@ import ( mock_stemcell "github.com/cloudfoundry/bosh-init/stemcell/mocks" bicloud "github.com/cloudfoundry/bosh-init/cloud" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biconfig "github.com/cloudfoundry/bosh-init/config" bicpirel "github.com/cloudfoundry/bosh-init/cpi/release" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" @@ -45,7 +45,7 @@ import ( fakebicloud "github.com/cloudfoundry/bosh-init/cloud/fakes" "github.com/cloudfoundry/bosh-init/crypto" "github.com/cloudfoundry/bosh-init/deployment" - fakebihttpclient "github.com/cloudfoundry/bosh-init/deployment/httpclient/fakes" + fakebihttpclient "github.com/cloudfoundry/bosh-utils/httpclient/fakes" fakebideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest/fakes" fakebideplval "github.com/cloudfoundry/bosh-init/deployment/manifest/fakes" fakebivm "github.com/cloudfoundry/bosh-init/deployment/vm/fakes" diff --git a/cmd/deployment_deleter.go b/cmd/deployment_deleter.go index 18687ac5e..751bfea6a 100644 --- a/cmd/deployment_deleter.go +++ b/cmd/deployment_deleter.go @@ -6,7 +6,7 @@ import ( biconfig "github.com/cloudfoundry/bosh-init/config" bicpirel "github.com/cloudfoundry/bosh-init/cpi/release" bidepl "github.com/cloudfoundry/bosh-init/deployment" - bihttpagent "github.com/cloudfoundry/bosh-init/deployment/agentclient/http" + bihttpagent "github.com/cloudfoundry/bosh-agent/agentclient/http" biinstall "github.com/cloudfoundry/bosh-init/installation" biinstallmanifest "github.com/cloudfoundry/bosh-init/installation/manifest" birel "github.com/cloudfoundry/bosh-init/release" diff --git a/cmd/deployment_deleteter_test.go b/cmd/deployment_deleteter_test.go index d5f1b2f32..e5f24ce3d 100644 --- a/cmd/deployment_deleteter_test.go +++ b/cmd/deployment_deleteter_test.go @@ -10,13 +10,13 @@ import ( "code.google.com/p/gomock/gomock" mock_blobstore "github.com/cloudfoundry/bosh-init/blobstore/mocks" mock_cloud "github.com/cloudfoundry/bosh-init/cloud/mocks" - mock_httpagent "github.com/cloudfoundry/bosh-init/deployment/agentclient/http/mocks" - mock_agentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient/mocks" + mock_httpagent "github.com/cloudfoundry/bosh-agent/agentclient/http/mocks" + mock_agentclient "github.com/cloudfoundry/bosh-agent/agentclient/mocks" mock_deployment "github.com/cloudfoundry/bosh-init/deployment/mocks" mock_install "github.com/cloudfoundry/bosh-init/installation/mocks" mock_release "github.com/cloudfoundry/bosh-init/release/mocks" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biconfig "github.com/cloudfoundry/bosh-init/config" bicpirel "github.com/cloudfoundry/bosh-init/cpi/release" biinstallmanifest "github.com/cloudfoundry/bosh-init/installation/manifest" @@ -34,7 +34,7 @@ import ( fakecmd "github.com/cloudfoundry/bosh-init/cmd/fakes" fakebicrypto "github.com/cloudfoundry/bosh-init/crypto/fakes" - fakebihttpclient "github.com/cloudfoundry/bosh-init/deployment/httpclient/fakes" + fakebihttpclient "github.com/cloudfoundry/bosh-utils/httpclient/fakes" fakebiui "github.com/cloudfoundry/bosh-init/ui/fakes" fakeui "github.com/cloudfoundry/bosh-init/ui/fakes" ) diff --git a/cmd/deployment_preparer.go b/cmd/deployment_preparer.go index 857846578..03c3e47f3 100644 --- a/cmd/deployment_preparer.go +++ b/cmd/deployment_preparer.go @@ -6,7 +6,7 @@ import ( biconfig "github.com/cloudfoundry/bosh-init/config" bicpirel "github.com/cloudfoundry/bosh-init/cpi/release" bidepl "github.com/cloudfoundry/bosh-init/deployment" - bihttpagent "github.com/cloudfoundry/bosh-init/deployment/agentclient/http" + bihttpagent "github.com/cloudfoundry/bosh-agent/agentclient/http" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" bivm "github.com/cloudfoundry/bosh-init/deployment/vm" biinstall "github.com/cloudfoundry/bosh-init/installation" diff --git a/cmd/factory.go b/cmd/factory.go index 915a2bcad..9356791f3 100644 --- a/cmd/factory.go +++ b/cmd/factory.go @@ -10,9 +10,9 @@ import ( bicpirel "github.com/cloudfoundry/bosh-init/cpi/release" bicrypto "github.com/cloudfoundry/bosh-init/crypto" bidepl "github.com/cloudfoundry/bosh-init/deployment" - bihttpagent "github.com/cloudfoundry/bosh-init/deployment/agentclient/http" + bihttpagent "github.com/cloudfoundry/bosh-agent/agentclient/http" bidisk "github.com/cloudfoundry/bosh-init/deployment/disk" - bihttpclient "github.com/cloudfoundry/bosh-init/deployment/httpclient" + bihttpclient "github.com/cloudfoundry/bosh-utils/httpclient" biinstance "github.com/cloudfoundry/bosh-init/deployment/instance" biinstancestate "github.com/cloudfoundry/bosh-init/deployment/instance/state" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" diff --git a/config/deployment_state_service.go b/config/deployment_state_service.go index 6d9299f5b..16ed3da88 100644 --- a/config/deployment_state_service.go +++ b/config/deployment_state_service.go @@ -1,7 +1,7 @@ package config import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" ) type DeploymentState struct { diff --git a/config/disk_repo.go b/config/disk_repo.go index 58fda4fe3..d966c2e4b 100644 --- a/config/disk_repo.go +++ b/config/disk_repo.go @@ -1,7 +1,7 @@ package config import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bosherr "github.com/cloudfoundry/bosh-utils/errors" boshuuid "github.com/cloudfoundry/bosh-utils/uuid" ) diff --git a/config/disk_repo_test.go b/config/disk_repo_test.go index fbed25898..e78c17cbe 100644 --- a/config/disk_repo_test.go +++ b/config/disk_repo_test.go @@ -5,7 +5,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" boshlog "github.com/cloudfoundry/bosh-utils/logger" fakesys "github.com/cloudfoundry/bosh-utils/system/fakes" fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes" diff --git a/config/fakes/fake_disk_repo.go b/config/fakes/fake_disk_repo.go index 9f745ce8c..21c6ad26c 100644 --- a/config/fakes/fake_disk_repo.go +++ b/config/fakes/fake_disk_repo.go @@ -1,7 +1,7 @@ package fakes import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biconfig "github.com/cloudfoundry/bosh-init/config" ) diff --git a/config/file_system_deployment_state_service_test.go b/config/file_system_deployment_state_service_test.go index 76184190c..9a47b3457 100644 --- a/config/file_system_deployment_state_service_test.go +++ b/config/file_system_deployment_state_service_test.go @@ -8,7 +8,7 @@ import ( "encoding/json" "errors" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" boshlog "github.com/cloudfoundry/bosh-utils/logger" fakesys "github.com/cloudfoundry/bosh-utils/system/fakes" fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes" diff --git a/config/legacy_deployment_state_migrator.go b/config/legacy_deployment_state_migrator.go index 3eeee4514..e77023e79 100644 --- a/config/legacy_deployment_state_migrator.go +++ b/config/legacy_deployment_state_migrator.go @@ -5,7 +5,7 @@ import ( "path" "regexp" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bosherr "github.com/cloudfoundry/bosh-utils/errors" boshlog "github.com/cloudfoundry/bosh-utils/logger" boshsys "github.com/cloudfoundry/bosh-utils/system" diff --git a/deployment/deployer_test.go b/deployment/deployer_test.go index b24210cce..539777a9a 100644 --- a/deployment/deployer_test.go +++ b/deployment/deployer_test.go @@ -8,16 +8,16 @@ import ( "code.google.com/p/gomock/gomock" mock_blobstore "github.com/cloudfoundry/bosh-init/blobstore/mocks" - mock_httpagent "github.com/cloudfoundry/bosh-init/deployment/agentclient/http/mocks" - mock_agentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient/mocks" + mock_httpagent "github.com/cloudfoundry/bosh-agent/agentclient/http/mocks" + mock_agentclient "github.com/cloudfoundry/bosh-agent/agentclient/mocks" mock_instance_state "github.com/cloudfoundry/bosh-init/deployment/instance/state/mocks" mock_vm "github.com/cloudfoundry/bosh-init/deployment/vm/mocks" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biconfig "github.com/cloudfoundry/bosh-init/config" - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" + bias "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" biinstance "github.com/cloudfoundry/bosh-init/deployment/instance" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" bisshtunnel "github.com/cloudfoundry/bosh-init/deployment/sshtunnel" diff --git a/deployment/deployment_test.go b/deployment/deployment_test.go index 4f421e167..7d91cedc6 100644 --- a/deployment/deployment_test.go +++ b/deployment/deployment_test.go @@ -10,13 +10,13 @@ import ( "code.google.com/p/gomock/gomock" mock_blobstore "github.com/cloudfoundry/bosh-init/blobstore/mocks" mock_cloud "github.com/cloudfoundry/bosh-init/cloud/mocks" - mock_agentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient/mocks" + mock_agentclient "github.com/cloudfoundry/bosh-agent/agentclient/mocks" mock_instance_state "github.com/cloudfoundry/bosh-init/deployment/instance/state/mocks" bicloud "github.com/cloudfoundry/bosh-init/cloud" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biconfig "github.com/cloudfoundry/bosh-init/config" - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" + bias "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" bidisk "github.com/cloudfoundry/bosh-init/deployment/disk" biinstance "github.com/cloudfoundry/bosh-init/deployment/instance" bisshtunnel "github.com/cloudfoundry/bosh-init/deployment/sshtunnel" diff --git a/deployment/disk/disk.go b/deployment/disk/disk.go index 19c3f34fb..5d8aa66cd 100644 --- a/deployment/disk/disk.go +++ b/deployment/disk/disk.go @@ -4,7 +4,7 @@ import ( "reflect" bicloud "github.com/cloudfoundry/bosh-init/cloud" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biconfig "github.com/cloudfoundry/bosh-init/config" bosherr "github.com/cloudfoundry/bosh-utils/errors" ) diff --git a/deployment/disk/disk_test.go b/deployment/disk/disk_test.go index bde343a3a..dcc83f93b 100644 --- a/deployment/disk/disk_test.go +++ b/deployment/disk/disk_test.go @@ -6,7 +6,7 @@ import ( . "github.com/onsi/gomega" bicloud "github.com/cloudfoundry/bosh-init/cloud" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biconfig "github.com/cloudfoundry/bosh-init/config" boshlog "github.com/cloudfoundry/bosh-utils/logger" fakesys "github.com/cloudfoundry/bosh-utils/system/fakes" diff --git a/deployment/disk/fakes/fake_disk.go b/deployment/disk/fakes/fake_disk.go index 5377cfb2c..fd0427772 100644 --- a/deployment/disk/fakes/fake_disk.go +++ b/deployment/disk/fakes/fake_disk.go @@ -1,7 +1,7 @@ package fakes import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" ) type FakeDisk struct { diff --git a/deployment/disk/manager_test.go b/deployment/disk/manager_test.go index 41acf87e7..c9bff053a 100644 --- a/deployment/disk/manager_test.go +++ b/deployment/disk/manager_test.go @@ -4,7 +4,7 @@ import ( "errors" fakebicloud "github.com/cloudfoundry/bosh-init/cloud/fakes" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biconfig "github.com/cloudfoundry/bosh-init/config" . "github.com/cloudfoundry/bosh-init/deployment/disk" bidisk "github.com/cloudfoundry/bosh-init/deployment/disk" diff --git a/deployment/disk/mocks/mocks.go b/deployment/disk/mocks/mocks.go index 81086bfad..9fe76e836 100644 --- a/deployment/disk/mocks/mocks.go +++ b/deployment/disk/mocks/mocks.go @@ -5,7 +5,7 @@ package mocks import ( gomock "code.google.com/p/gomock/gomock" - property "github.com/cloudfoundry/bosh-init/common/property" + property "github.com/cloudfoundry/bosh-utils/property" disk "github.com/cloudfoundry/bosh-init/deployment/disk" manifest "github.com/cloudfoundry/bosh-init/deployment/manifest" ui "github.com/cloudfoundry/bosh-init/ui" diff --git a/deployment/instance/instance_test.go b/deployment/instance/instance_test.go index 838495ef4..4eccdcb25 100644 --- a/deployment/instance/instance_test.go +++ b/deployment/instance/instance_test.go @@ -11,7 +11,7 @@ import ( mock_instance_state "github.com/cloudfoundry/bosh-init/deployment/instance/state/mocks" bicloud "github.com/cloudfoundry/bosh-init/cloud" - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" + bias "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" bidisk "github.com/cloudfoundry/bosh-init/deployment/disk" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" bisshtunnel "github.com/cloudfoundry/bosh-init/deployment/sshtunnel" diff --git a/deployment/instance/manager_test.go b/deployment/instance/manager_test.go index dd7b63947..4517ddaff 100644 --- a/deployment/instance/manager_test.go +++ b/deployment/instance/manager_test.go @@ -10,11 +10,11 @@ import ( "code.google.com/p/gomock/gomock" mock_blobstore "github.com/cloudfoundry/bosh-init/blobstore/mocks" - mock_agentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient/mocks" + mock_agentclient "github.com/cloudfoundry/bosh-agent/agentclient/mocks" mock_instance_state "github.com/cloudfoundry/bosh-init/deployment/instance/state/mocks" - biproperty "github.com/cloudfoundry/bosh-init/common/property" - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" + biproperty "github.com/cloudfoundry/bosh-utils/property" + bias "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" bidisk "github.com/cloudfoundry/bosh-init/deployment/disk" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" bisshtunnel "github.com/cloudfoundry/bosh-init/deployment/sshtunnel" diff --git a/deployment/instance/state/builder.go b/deployment/instance/state/builder.go index 118ccf4a9..f634e6e07 100644 --- a/deployment/instance/state/builder.go +++ b/deployment/instance/state/builder.go @@ -2,7 +2,7 @@ package state import ( biblobstore "github.com/cloudfoundry/bosh-init/blobstore" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" bideplrel "github.com/cloudfoundry/bosh-init/deployment/release" bireljob "github.com/cloudfoundry/bosh-init/release/job" diff --git a/deployment/instance/state/builder_factory.go b/deployment/instance/state/builder_factory.go index e05198043..0a4144094 100644 --- a/deployment/instance/state/builder_factory.go +++ b/deployment/instance/state/builder_factory.go @@ -2,7 +2,7 @@ package state import ( biblobstore "github.com/cloudfoundry/bosh-init/blobstore" - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" + biagentclient "github.com/cloudfoundry/bosh-agent/agentclient" bideplrel "github.com/cloudfoundry/bosh-init/deployment/release" bistatejob "github.com/cloudfoundry/bosh-init/state/job" bistatepkg "github.com/cloudfoundry/bosh-init/state/pkg" diff --git a/deployment/instance/state/builder_test.go b/deployment/instance/state/builder_test.go index cd6d9999d..683c64dbe 100644 --- a/deployment/instance/state/builder_test.go +++ b/deployment/instance/state/builder_test.go @@ -11,8 +11,8 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - biproperty "github.com/cloudfoundry/bosh-init/common/property" - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" + biproperty "github.com/cloudfoundry/bosh-utils/property" + bias "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" bireljob "github.com/cloudfoundry/bosh-init/release/job" birelpkg "github.com/cloudfoundry/bosh-init/release/pkg" diff --git a/deployment/instance/state/mocks/mocks.go b/deployment/instance/state/mocks/mocks.go index eaacceed8..c39ddc015 100644 --- a/deployment/instance/state/mocks/mocks.go +++ b/deployment/instance/state/mocks/mocks.go @@ -6,8 +6,8 @@ package mocks import ( gomock "code.google.com/p/gomock/gomock" blobstore "github.com/cloudfoundry/bosh-init/blobstore" - agentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" - applyspec "github.com/cloudfoundry/bosh-init/deployment/applyspec" + agentclient "github.com/cloudfoundry/bosh-agent/agentclient" + applyspec "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" state "github.com/cloudfoundry/bosh-init/deployment/instance/state" manifest "github.com/cloudfoundry/bosh-init/deployment/manifest" ui "github.com/cloudfoundry/bosh-init/ui" diff --git a/deployment/instance/state/remote_package_compiler.go b/deployment/instance/state/remote_package_compiler.go index b7100d453..3f10caf14 100644 --- a/deployment/instance/state/remote_package_compiler.go +++ b/deployment/instance/state/remote_package_compiler.go @@ -2,7 +2,7 @@ package state import ( biblobstore "github.com/cloudfoundry/bosh-init/blobstore" - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" + biagentclient "github.com/cloudfoundry/bosh-agent/agentclient" birelpkg "github.com/cloudfoundry/bosh-init/release/pkg" bistatepkg "github.com/cloudfoundry/bosh-init/state/pkg" bosherr "github.com/cloudfoundry/bosh-utils/errors" diff --git a/deployment/instance/state/remote_package_compiler_test.go b/deployment/instance/state/remote_package_compiler_test.go index 61776c409..7f321d351 100644 --- a/deployment/instance/state/remote_package_compiler_test.go +++ b/deployment/instance/state/remote_package_compiler_test.go @@ -5,11 +5,11 @@ import ( "code.google.com/p/gomock/gomock" mock_blobstore "github.com/cloudfoundry/bosh-init/blobstore/mocks" - mock_agentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient/mocks" + mock_agentclient "github.com/cloudfoundry/bosh-agent/agentclient/mocks" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" + biagentclient "github.com/cloudfoundry/bosh-agent/agentclient" biindex "github.com/cloudfoundry/bosh-init/index" birelpkg "github.com/cloudfoundry/bosh-init/release/pkg" bistatepkg "github.com/cloudfoundry/bosh-init/state/pkg" diff --git a/deployment/instance/state/state.go b/deployment/instance/state/state.go index 97865beda..1d509d31e 100644 --- a/deployment/instance/state/state.go +++ b/deployment/instance/state/state.go @@ -1,8 +1,8 @@ package state import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" + biproperty "github.com/cloudfoundry/bosh-utils/property" + bias "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" ) type State interface { diff --git a/deployment/instance/state/state_test.go b/deployment/instance/state/state_test.go index facf05676..d7f042b2e 100644 --- a/deployment/instance/state/state_test.go +++ b/deployment/instance/state/state_test.go @@ -3,8 +3,8 @@ package state_test import ( . "github.com/cloudfoundry/bosh-init/deployment/instance/state" - biproperty "github.com/cloudfoundry/bosh-init/common/property" - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" + biproperty "github.com/cloudfoundry/bosh-utils/property" + bias "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) diff --git a/deployment/manager_factory.go b/deployment/manager_factory.go index 6c9e2d613..7c27eeb24 100644 --- a/deployment/manager_factory.go +++ b/deployment/manager_factory.go @@ -3,7 +3,7 @@ package deployment import ( biblobstore "github.com/cloudfoundry/bosh-init/blobstore" bicloud "github.com/cloudfoundry/bosh-init/cloud" - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" + biagentclient "github.com/cloudfoundry/bosh-agent/agentclient" bidisk "github.com/cloudfoundry/bosh-init/deployment/disk" biinstance "github.com/cloudfoundry/bosh-init/deployment/instance" bivm "github.com/cloudfoundry/bosh-init/deployment/vm" diff --git a/deployment/manager_test.go b/deployment/manager_test.go index d9c285be9..193408820 100644 --- a/deployment/manager_test.go +++ b/deployment/manager_test.go @@ -6,7 +6,7 @@ import ( "code.google.com/p/gomock/gomock" mock_blobstore "github.com/cloudfoundry/bosh-init/blobstore/mocks" mock_cloud "github.com/cloudfoundry/bosh-init/cloud/mocks" - mock_agentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient/mocks" + mock_agentclient "github.com/cloudfoundry/bosh-agent/agentclient/mocks" mock_disk "github.com/cloudfoundry/bosh-init/deployment/disk/mocks" mock_instance "github.com/cloudfoundry/bosh-init/deployment/instance/mocks" mock_instance_state "github.com/cloudfoundry/bosh-init/deployment/instance/state/mocks" diff --git a/deployment/manifest/disk_pool.go b/deployment/manifest/disk_pool.go index 25a2ee1cd..d91e5ab86 100644 --- a/deployment/manifest/disk_pool.go +++ b/deployment/manifest/disk_pool.go @@ -1,7 +1,7 @@ package manifest import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" ) type DiskPool struct { diff --git a/deployment/manifest/fakes/fake_deployment.go b/deployment/manifest/fakes/fake_deployment.go index 78ca7eb27..968ad0def 100644 --- a/deployment/manifest/fakes/fake_deployment.go +++ b/deployment/manifest/fakes/fake_deployment.go @@ -1,7 +1,7 @@ package fakes import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" ) diff --git a/deployment/manifest/job.go b/deployment/manifest/job.go index f28c5e5f3..5f8ed67b9 100644 --- a/deployment/manifest/job.go +++ b/deployment/manifest/job.go @@ -1,7 +1,7 @@ package manifest import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" ) type Job struct { diff --git a/deployment/manifest/manifest.go b/deployment/manifest/manifest.go index a748c95a6..efd4bfc34 100644 --- a/deployment/manifest/manifest.go +++ b/deployment/manifest/manifest.go @@ -1,7 +1,7 @@ package manifest import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bosherr "github.com/cloudfoundry/bosh-utils/errors" ) diff --git a/deployment/manifest/manifest_test.go b/deployment/manifest/manifest_test.go index 0a9ae51b1..35820a3c6 100644 --- a/deployment/manifest/manifest_test.go +++ b/deployment/manifest/manifest_test.go @@ -5,7 +5,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" ) var _ = Describe("Manifest", func() { diff --git a/deployment/manifest/network.go b/deployment/manifest/network.go index 871352dd8..3fc06379c 100644 --- a/deployment/manifest/network.go +++ b/deployment/manifest/network.go @@ -5,7 +5,7 @@ import ( "fmt" "net" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bosherr "github.com/cloudfoundry/bosh-utils/errors" ) diff --git a/deployment/manifest/network_test.go b/deployment/manifest/network_test.go index 8610ea1e5..a4989bfeb 100644 --- a/deployment/manifest/network_test.go +++ b/deployment/manifest/network_test.go @@ -5,7 +5,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" ) var _ = Describe("Network", func() { diff --git a/deployment/manifest/parser.go b/deployment/manifest/parser.go index 7e1ce598a..c48625540 100644 --- a/deployment/manifest/parser.go +++ b/deployment/manifest/parser.go @@ -1,7 +1,7 @@ package manifest import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bosherr "github.com/cloudfoundry/bosh-utils/errors" boshlog "github.com/cloudfoundry/bosh-utils/logger" boshsys "github.com/cloudfoundry/bosh-utils/system" diff --git a/deployment/manifest/parser_test.go b/deployment/manifest/parser_test.go index 644f2e236..c548b74fb 100644 --- a/deployment/manifest/parser_test.go +++ b/deployment/manifest/parser_test.go @@ -7,7 +7,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" boshlog "github.com/cloudfoundry/bosh-utils/logger" fakesys "github.com/cloudfoundry/bosh-utils/system/fakes" ) diff --git a/deployment/manifest/resource_pool.go b/deployment/manifest/resource_pool.go index 370eb657f..d5f403a5d 100644 --- a/deployment/manifest/resource_pool.go +++ b/deployment/manifest/resource_pool.go @@ -1,7 +1,7 @@ package manifest import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" ) type ResourcePool struct { diff --git a/deployment/manifest/validator_test.go b/deployment/manifest/validator_test.go index 538d64c1a..a0f0c561e 100644 --- a/deployment/manifest/validator_test.go +++ b/deployment/manifest/validator_test.go @@ -1,7 +1,7 @@ package manifest_test import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" birel "github.com/cloudfoundry/bosh-init/release" bireljob "github.com/cloudfoundry/bosh-init/release/job" birelmanifest "github.com/cloudfoundry/bosh-init/release/manifest" diff --git a/deployment/mocks/mocks.go b/deployment/mocks/mocks.go index b72e801ff..31add5817 100644 --- a/deployment/mocks/mocks.go +++ b/deployment/mocks/mocks.go @@ -8,7 +8,7 @@ import ( blobstore "github.com/cloudfoundry/bosh-init/blobstore" cloud "github.com/cloudfoundry/bosh-init/cloud" deployment "github.com/cloudfoundry/bosh-init/deployment" - agentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" + agentclient "github.com/cloudfoundry/bosh-agent/agentclient" disk "github.com/cloudfoundry/bosh-init/deployment/disk" instance "github.com/cloudfoundry/bosh-init/deployment/instance" manifest0 "github.com/cloudfoundry/bosh-init/deployment/manifest" diff --git a/deployment/vm/disk_deployer_test.go b/deployment/vm/disk_deployer_test.go index 59d4fe512..4aabd52c7 100644 --- a/deployment/vm/disk_deployer_test.go +++ b/deployment/vm/disk_deployer_test.go @@ -3,7 +3,7 @@ package vm_test import ( . "github.com/cloudfoundry/bosh-init/deployment/vm" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biconfig "github.com/cloudfoundry/bosh-init/config" bidisk "github.com/cloudfoundry/bosh-init/deployment/disk" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" diff --git a/deployment/vm/fakes/fake_vm.go b/deployment/vm/fakes/fake_vm.go index 9712d2060..29e110ca5 100644 --- a/deployment/vm/fakes/fake_vm.go +++ b/deployment/vm/fakes/fake_vm.go @@ -3,8 +3,8 @@ package fakes import ( "time" - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" + biagentclient "github.com/cloudfoundry/bosh-agent/agentclient" + bias "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" bidisk "github.com/cloudfoundry/bosh-init/deployment/disk" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" biui "github.com/cloudfoundry/bosh-init/ui" diff --git a/deployment/vm/manager.go b/deployment/vm/manager.go index 30a88220c..57624cf07 100644 --- a/deployment/vm/manager.go +++ b/deployment/vm/manager.go @@ -2,10 +2,10 @@ package vm import ( bicloud "github.com/cloudfoundry/bosh-init/cloud" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biconfig "github.com/cloudfoundry/bosh-init/config" - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" - bihttpagent "github.com/cloudfoundry/bosh-init/deployment/agentclient/http" + biagentclient "github.com/cloudfoundry/bosh-agent/agentclient" + bihttpagent "github.com/cloudfoundry/bosh-agent/agentclient/http" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" bistemcell "github.com/cloudfoundry/bosh-init/stemcell" bosherr "github.com/cloudfoundry/bosh-utils/errors" diff --git a/deployment/vm/manager_factory.go b/deployment/vm/manager_factory.go index 767892902..bf08efcc1 100644 --- a/deployment/vm/manager_factory.go +++ b/deployment/vm/manager_factory.go @@ -3,7 +3,7 @@ package vm import ( bicloud "github.com/cloudfoundry/bosh-init/cloud" biconfig "github.com/cloudfoundry/bosh-init/config" - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" + biagentclient "github.com/cloudfoundry/bosh-agent/agentclient" boshlog "github.com/cloudfoundry/bosh-utils/logger" boshsys "github.com/cloudfoundry/bosh-utils/system" boshuuid "github.com/cloudfoundry/bosh-utils/uuid" diff --git a/deployment/vm/manager_test.go b/deployment/vm/manager_test.go index 1e2bdb81c..fab204f35 100644 --- a/deployment/vm/manager_test.go +++ b/deployment/vm/manager_test.go @@ -5,10 +5,10 @@ import ( "github.com/cloudfoundry/bosh-init/cloud" fakebicloud "github.com/cloudfoundry/bosh-init/cloud/fakes" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biconfig "github.com/cloudfoundry/bosh-init/config" fakebiconfig "github.com/cloudfoundry/bosh-init/config/fakes" - fakebiagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient/fakes" + fakebiagentclient "github.com/cloudfoundry/bosh-agent/agentclient/fakes" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" . "github.com/cloudfoundry/bosh-init/deployment/vm" fakebivm "github.com/cloudfoundry/bosh-init/deployment/vm/fakes" diff --git a/deployment/vm/mocks/mocks.go b/deployment/vm/mocks/mocks.go index eff717d55..1cfa1d24a 100644 --- a/deployment/vm/mocks/mocks.go +++ b/deployment/vm/mocks/mocks.go @@ -6,7 +6,7 @@ package mocks import ( gomock "code.google.com/p/gomock/gomock" cloud "github.com/cloudfoundry/bosh-init/cloud" - agentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" + agentclient "github.com/cloudfoundry/bosh-agent/agentclient" vm "github.com/cloudfoundry/bosh-init/deployment/vm" ) diff --git a/deployment/vm/vm.go b/deployment/vm/vm.go index ae7f8e97e..90e787b66 100644 --- a/deployment/vm/vm.go +++ b/deployment/vm/vm.go @@ -5,8 +5,8 @@ import ( bicloud "github.com/cloudfoundry/bosh-init/cloud" biconfig "github.com/cloudfoundry/bosh-init/config" - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" + biagentclient "github.com/cloudfoundry/bosh-agent/agentclient" + bias "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" bidisk "github.com/cloudfoundry/bosh-init/deployment/disk" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" biui "github.com/cloudfoundry/bosh-init/ui" diff --git a/deployment/vm/vm_test.go b/deployment/vm/vm_test.go index c695789ef..669710183 100644 --- a/deployment/vm/vm_test.go +++ b/deployment/vm/vm_test.go @@ -8,10 +8,10 @@ import ( . "github.com/onsi/gomega" bicloud "github.com/cloudfoundry/bosh-init/cloud" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biconfig "github.com/cloudfoundry/bosh-init/config" - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" + biagentclient "github.com/cloudfoundry/bosh-agent/agentclient" + bias "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" bidisk "github.com/cloudfoundry/bosh-init/deployment/disk" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" boshlog "github.com/cloudfoundry/bosh-utils/logger" @@ -19,7 +19,7 @@ import ( fakebicloud "github.com/cloudfoundry/bosh-init/cloud/fakes" fakebiconfig "github.com/cloudfoundry/bosh-init/config/fakes" - fakebiagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient/fakes" + fakebiagentclient "github.com/cloudfoundry/bosh-agent/agentclient/fakes" fakebidisk "github.com/cloudfoundry/bosh-init/deployment/disk/fakes" fakebivm "github.com/cloudfoundry/bosh-init/deployment/vm/fakes" fakebiui "github.com/cloudfoundry/bosh-init/ui/fakes" diff --git a/installation/installer_test.go b/installation/installer_test.go index 740605bd1..4f6ab210e 100644 --- a/installation/installer_test.go +++ b/installation/installer_test.go @@ -11,7 +11,7 @@ import ( mock_install_pkg "github.com/cloudfoundry/bosh-init/installation/pkg/mocks" mock_registry "github.com/cloudfoundry/bosh-init/registry/mocks" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biinstalljob "github.com/cloudfoundry/bosh-init/installation/job" biinstallmanifest "github.com/cloudfoundry/bosh-init/installation/manifest" biinstallpkg "github.com/cloudfoundry/bosh-init/installation/pkg" diff --git a/installation/job_renderer.go b/installation/job_renderer.go index c04d48cd0..19ee53b6a 100644 --- a/installation/job_renderer.go +++ b/installation/job_renderer.go @@ -1,7 +1,7 @@ package installation import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biinstalljob "github.com/cloudfoundry/bosh-init/installation/job" biinstallmanifest "github.com/cloudfoundry/bosh-init/installation/manifest" bireljob "github.com/cloudfoundry/bosh-init/release/job" diff --git a/installation/job_renderer_test.go b/installation/job_renderer_test.go index e93527f52..1493b7b20 100644 --- a/installation/job_renderer_test.go +++ b/installation/job_renderer_test.go @@ -9,7 +9,7 @@ import ( "code.google.com/p/gomock/gomock" mock_template "github.com/cloudfoundry/bosh-init/templatescompiler/mocks" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biinstalljob "github.com/cloudfoundry/bosh-init/installation/job" biinstallmanifest "github.com/cloudfoundry/bosh-init/installation/manifest" bireljob "github.com/cloudfoundry/bosh-init/release/job" diff --git a/installation/job_resolver_test.go b/installation/job_resolver_test.go index e0a3e2784..31cc96c2d 100644 --- a/installation/job_resolver_test.go +++ b/installation/job_resolver_test.go @@ -8,7 +8,7 @@ import ( "code.google.com/p/gomock/gomock" mock_deployment_release "github.com/cloudfoundry/bosh-init/deployment/release/mocks" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biinstallmanifest "github.com/cloudfoundry/bosh-init/installation/manifest" bireljob "github.com/cloudfoundry/bosh-init/release/job" diff --git a/installation/manifest/manifest.go b/installation/manifest/manifest.go index 6f08e348c..1605486fd 100644 --- a/installation/manifest/manifest.go +++ b/installation/manifest/manifest.go @@ -1,7 +1,7 @@ package manifest import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" ) type Manifest struct { diff --git a/installation/manifest/parser.go b/installation/manifest/parser.go index ffee14612..22f844b96 100644 --- a/installation/manifest/parser.go +++ b/installation/manifest/parser.go @@ -1,7 +1,7 @@ package manifest import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" birelsetmanifest "github.com/cloudfoundry/bosh-init/release/set/manifest" bosherr "github.com/cloudfoundry/bosh-utils/errors" boshlog "github.com/cloudfoundry/bosh-utils/logger" diff --git a/installation/manifest/parser_test.go b/installation/manifest/parser_test.go index 16d07e67f..7c5aeb1c2 100644 --- a/installation/manifest/parser_test.go +++ b/installation/manifest/parser_test.go @@ -8,7 +8,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" birelsetmanifest "github.com/cloudfoundry/bosh-init/release/set/manifest" boshlog "github.com/cloudfoundry/bosh-utils/logger" fakesys "github.com/cloudfoundry/bosh-utils/system/fakes" diff --git a/installation/manifest/validator_test.go b/installation/manifest/validator_test.go index ea18f54d6..53f61ea92 100644 --- a/installation/manifest/validator_test.go +++ b/installation/manifest/validator_test.go @@ -5,7 +5,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" birelmanifest "github.com/cloudfoundry/bosh-init/release/manifest" birelsetmanifest "github.com/cloudfoundry/bosh-init/release/set/manifest" boshlog "github.com/cloudfoundry/bosh-utils/logger" diff --git a/installation/tarball/provider.go b/installation/tarball/provider.go index 66863a4e9..39205d68a 100644 --- a/installation/tarball/provider.go +++ b/installation/tarball/provider.go @@ -9,7 +9,7 @@ import ( "time" bicrypto "github.com/cloudfoundry/bosh-init/crypto" - bihttpclient "github.com/cloudfoundry/bosh-init/deployment/httpclient" + bihttpclient "github.com/cloudfoundry/bosh-utils/httpclient" biui "github.com/cloudfoundry/bosh-init/ui" bosherr "github.com/cloudfoundry/bosh-utils/errors" boshlog "github.com/cloudfoundry/bosh-utils/logger" diff --git a/installation/tarball/provider_test.go b/installation/tarball/provider_test.go index f05133754..67ff981e9 100644 --- a/installation/tarball/provider_test.go +++ b/installation/tarball/provider_test.go @@ -6,7 +6,7 @@ import ( "os" fakebicrypto "github.com/cloudfoundry/bosh-init/crypto/fakes" - fakebihttpclient "github.com/cloudfoundry/bosh-init/deployment/httpclient/fakes" + fakebihttpclient "github.com/cloudfoundry/bosh-utils/httpclient/fakes" . "github.com/cloudfoundry/bosh-init/installation/tarball" fakebiui "github.com/cloudfoundry/bosh-init/ui/fakes" boshlog "github.com/cloudfoundry/bosh-utils/logger" diff --git a/integration/deploy_test.go b/integration/deploy_test.go index 211d49367..0bd74328a 100644 --- a/integration/deploy_test.go +++ b/integration/deploy_test.go @@ -20,21 +20,21 @@ import ( "code.google.com/p/gomock/gomock" mock_blobstore "github.com/cloudfoundry/bosh-init/blobstore/mocks" mock_cloud "github.com/cloudfoundry/bosh-init/cloud/mocks" - mock_httpagent "github.com/cloudfoundry/bosh-init/deployment/agentclient/http/mocks" - mock_agentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient/mocks" + mock_httpagent "github.com/cloudfoundry/bosh-agent/agentclient/http/mocks" + mock_agentclient "github.com/cloudfoundry/bosh-agent/agentclient/mocks" mock_instance_state "github.com/cloudfoundry/bosh-init/deployment/instance/state/mocks" mock_install "github.com/cloudfoundry/bosh-init/installation/mocks" mock_release "github.com/cloudfoundry/bosh-init/release/mocks" bicloud "github.com/cloudfoundry/bosh-init/cloud" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biconfig "github.com/cloudfoundry/bosh-init/config" bicpirel "github.com/cloudfoundry/bosh-init/cpi/release" bidepl "github.com/cloudfoundry/bosh-init/deployment" - biagentclient "github.com/cloudfoundry/bosh-init/deployment/agentclient" - bias "github.com/cloudfoundry/bosh-init/deployment/applyspec" + biagentclient "github.com/cloudfoundry/bosh-agent/agentclient" + bias "github.com/cloudfoundry/bosh-agent/agentclient/applyspec" bidisk "github.com/cloudfoundry/bosh-init/deployment/disk" - bihttp "github.com/cloudfoundry/bosh-init/deployment/httpclient" + bihttp "github.com/cloudfoundry/bosh-utils/httpclient" biinstance "github.com/cloudfoundry/bosh-init/deployment/instance" bideplmanifest "github.com/cloudfoundry/bosh-init/deployment/manifest" bisshtunnel "github.com/cloudfoundry/bosh-init/deployment/sshtunnel" @@ -56,7 +56,7 @@ import ( fakeuuid "github.com/cloudfoundry/bosh-utils/uuid/fakes" fakebicrypto "github.com/cloudfoundry/bosh-init/crypto/fakes" - fakebihttpclient "github.com/cloudfoundry/bosh-init/deployment/httpclient/fakes" + fakebihttpclient "github.com/cloudfoundry/bosh-utils/httpclient/fakes" fakebistemcell "github.com/cloudfoundry/bosh-init/stemcell/fakes" fakebiui "github.com/cloudfoundry/bosh-init/ui/fakes" ) diff --git a/release/job/job.go b/release/job/job.go index f2057a7db..3b124b924 100644 --- a/release/job/job.go +++ b/release/job/job.go @@ -1,7 +1,7 @@ package job import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" birelpkg "github.com/cloudfoundry/bosh-init/release/pkg" ) diff --git a/release/job/reader.go b/release/job/reader.go index b07a35e8f..4385fd3a9 100644 --- a/release/job/reader.go +++ b/release/job/reader.go @@ -3,7 +3,7 @@ package job import ( "path" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bireljobmanifest "github.com/cloudfoundry/bosh-init/release/job/manifest" bosherr "github.com/cloudfoundry/bosh-utils/errors" boshcmd "github.com/cloudfoundry/bosh-utils/fileutil" diff --git a/release/job/reader_test.go b/release/job/reader_test.go index 794df05b9..9761f4770 100644 --- a/release/job/reader_test.go +++ b/release/job/reader_test.go @@ -5,7 +5,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bosherr "github.com/cloudfoundry/bosh-utils/errors" fakesys "github.com/cloudfoundry/bosh-utils/system/fakes" diff --git a/stemcell/extractor_test.go b/stemcell/extractor_test.go index b96a91140..cb0d7e724 100644 --- a/stemcell/extractor_test.go +++ b/stemcell/extractor_test.go @@ -7,7 +7,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" fakesys "github.com/cloudfoundry/bosh-utils/system/fakes" fakebistemcell "github.com/cloudfoundry/bosh-init/stemcell/fakes" diff --git a/stemcell/manager_test.go b/stemcell/manager_test.go index 8fc60dffb..822b775b4 100644 --- a/stemcell/manager_test.go +++ b/stemcell/manager_test.go @@ -7,7 +7,7 @@ import ( "errors" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" biconfig "github.com/cloudfoundry/bosh-init/config" boshlog "github.com/cloudfoundry/bosh-utils/logger" fakesys "github.com/cloudfoundry/bosh-utils/system/fakes" diff --git a/stemcell/reader.go b/stemcell/reader.go index 868ea90ef..4291c683c 100644 --- a/stemcell/reader.go +++ b/stemcell/reader.go @@ -4,7 +4,7 @@ import ( "gopkg.in/yaml.v2" "path/filepath" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bosherr "github.com/cloudfoundry/bosh-utils/errors" boshcmd "github.com/cloudfoundry/bosh-utils/fileutil" boshsys "github.com/cloudfoundry/bosh-utils/system" diff --git a/stemcell/reader_test.go b/stemcell/reader_test.go index 1a3dc4bc6..15fc64f09 100644 --- a/stemcell/reader_test.go +++ b/stemcell/reader_test.go @@ -7,7 +7,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" fakecmd "github.com/cloudfoundry/bosh-utils/fileutil/fakes" fakesys "github.com/cloudfoundry/bosh-utils/system/fakes" ) diff --git a/stemcell/stemcell.go b/stemcell/stemcell.go index a123cea35..fa5941391 100644 --- a/stemcell/stemcell.go +++ b/stemcell/stemcell.go @@ -3,7 +3,7 @@ package stemcell import ( "fmt" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" boshsys "github.com/cloudfoundry/bosh-utils/system" ) diff --git a/templatescompiler/job_evaluation_context.go b/templatescompiler/job_evaluation_context.go index 8e9fdaf30..d97151680 100644 --- a/templatescompiler/job_evaluation_context.go +++ b/templatescompiler/job_evaluation_context.go @@ -3,7 +3,7 @@ package templatescompiler import ( "encoding/json" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bireljob "github.com/cloudfoundry/bosh-init/release/job" bierbrenderer "github.com/cloudfoundry/bosh-init/templatescompiler/erbrenderer" bosherr "github.com/cloudfoundry/bosh-utils/errors" diff --git a/templatescompiler/job_evaluation_context_test.go b/templatescompiler/job_evaluation_context_test.go index 1064163e1..1d2df8037 100644 --- a/templatescompiler/job_evaluation_context_test.go +++ b/templatescompiler/job_evaluation_context_test.go @@ -6,7 +6,7 @@ import ( "io/ioutil" "os" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bireljob "github.com/cloudfoundry/bosh-init/release/job" . "github.com/cloudfoundry/bosh-init/templatescompiler" "github.com/cloudfoundry/bosh-init/templatescompiler/erbrenderer" diff --git a/templatescompiler/job_list_renderer.go b/templatescompiler/job_list_renderer.go index eb38a35ee..eb0403f59 100644 --- a/templatescompiler/job_list_renderer.go +++ b/templatescompiler/job_list_renderer.go @@ -1,7 +1,7 @@ package templatescompiler import ( - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bireljob "github.com/cloudfoundry/bosh-init/release/job" bosherr "github.com/cloudfoundry/bosh-utils/errors" boshlog "github.com/cloudfoundry/bosh-utils/logger" diff --git a/templatescompiler/job_list_renderer_test.go b/templatescompiler/job_list_renderer_test.go index 0294801dd..0fc2b2966 100644 --- a/templatescompiler/job_list_renderer_test.go +++ b/templatescompiler/job_list_renderer_test.go @@ -8,7 +8,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bireljob "github.com/cloudfoundry/bosh-init/release/job" bosherr "github.com/cloudfoundry/bosh-utils/errors" boshlog "github.com/cloudfoundry/bosh-utils/logger" diff --git a/templatescompiler/job_renderer.go b/templatescompiler/job_renderer.go index 31eda01c7..c2bedeb0a 100644 --- a/templatescompiler/job_renderer.go +++ b/templatescompiler/job_renderer.go @@ -4,7 +4,7 @@ import ( "os" "path/filepath" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bireljob "github.com/cloudfoundry/bosh-init/release/job" bierbrenderer "github.com/cloudfoundry/bosh-init/templatescompiler/erbrenderer" bosherr "github.com/cloudfoundry/bosh-utils/errors" diff --git a/templatescompiler/job_renderer_test.go b/templatescompiler/job_renderer_test.go index 22a6e4af7..15d64b12f 100644 --- a/templatescompiler/job_renderer_test.go +++ b/templatescompiler/job_renderer_test.go @@ -3,7 +3,7 @@ package templatescompiler_test import ( "path/filepath" - biproperty "github.com/cloudfoundry/bosh-init/common/property" + biproperty "github.com/cloudfoundry/bosh-utils/property" bireljob "github.com/cloudfoundry/bosh-init/release/job" bierbrenderer "github.com/cloudfoundry/bosh-init/templatescompiler/erbrenderer" bosherr "github.com/cloudfoundry/bosh-utils/errors" diff --git a/templatescompiler/mocks/mocks.go b/templatescompiler/mocks/mocks.go index d27a47c1c..7c6bd4ebc 100644 --- a/templatescompiler/mocks/mocks.go +++ b/templatescompiler/mocks/mocks.go @@ -5,7 +5,7 @@ package mocks import ( gomock "code.google.com/p/gomock/gomock" - property "github.com/cloudfoundry/bosh-init/common/property" + property "github.com/cloudfoundry/bosh-utils/property" job "github.com/cloudfoundry/bosh-init/release/job" templatescompiler "github.com/cloudfoundry/bosh-init/templatescompiler" )