diff --git a/TEST.Md b/TEST.Md index 420a3713b..156c1d2c0 100644 --- a/TEST.Md +++ b/TEST.Md @@ -9,22 +9,22 @@ IDS are coming from `/var/vcap/bosh/persistent_disk_hints.json` the agent json regex #### GCP ``` -"DiskIDTransformPatern" "^(disk-.+)$", +"DiskIDTransformPattern" "^(disk-.+)$", "DiskIDTransformReplacement": "google-${1}" ``` #### AWS: ``` -"DiskIDTransformPatern": "^(vol-(.+))$", +"DiskIDTransformPattern": "^(vol-(.+))$", "DiskIDTransformReplacement": "nvme-Amazon_Elastic_Block_Store_vol${2}" ``` #### OpenStack: ``` -"DiskIDTransformPatern": "^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$", +"DiskIDTransformPattern": "^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$", "DiskIDTransformReplacement": "scsi-${1}${2}${3}${4}${5}" ``` #### AliCloud: ``` -"DiskIDTransformPatern": "^d-(.+)$", +"DiskIDTransformPattern": "^d-(.+)$", "DiskIDTransformReplacement": "virtio-${1}" ``` diff --git a/agent.json b/agent.json new file mode 100644 index 000000000..dd5b29e96 --- /dev/null +++ b/agent.json @@ -0,0 +1,30 @@ +{ + "Platform": { + "Linux": { + "CreatePartitionIfNoEphemeralDisk": true, + "PartitionerType": "parted", + "DevicePathResolutionType": "virtio", + "VirtioDevicePrefix": "google", + "ServiceManager": "systemd", + "DiskIDTransformPattern": "^(disk-.+)$", + "DiskIDTransformReplacement": "google-${1}" + } + }, + "Infrastructure": { + "Settings": { + "Sources": [ + { + "Type": "InstanceMetadata", + "URI": "http://169.254.169.254", + "SettingsPath": "/computeMetadata/v1/instance/attributes/bosh_settings", + "Headers": { + "Metadata-Flavor": "Google" + } + } + ], + + "UseServerName": true, + "UseRegistry": false + } + } +} diff --git a/infrastructure/devicepathresolver/id_device_path_resolver_test.go b/infrastructure/devicepathresolver/id_device_path_resolver_test.go index 59a778a12..626c63c61 100644 --- a/infrastructure/devicepathresolver/id_device_path_resolver_test.go +++ b/infrastructure/devicepathresolver/id_device_path_resolver_test.go @@ -59,7 +59,7 @@ var _ = Describe("IDDevicePathResolver", func() { err = fs.Symlink("/dev/intermediate/fake-device-path", "/dev/disk/by-id/virtio-fake-disk-id-include-longname") Expect(err).ToNot(HaveOccurred()) - fs.SetGlob("/dev/disk/by-id/*fake-disk-id-include-longname", []string{"/dev/disk/by-id/virtio-fake-disk-id-include-longname"}) + fs.SetGlob("/dev/disk/by-id/fake-disk-id-include-longname", []string{"/dev/disk/by-id/virtio-fake-disk-id-include-longname"}) }) It("returns fully resolved the path (not potentially relative symlink target)", func() { @@ -86,7 +86,7 @@ var _ = Describe("IDDevicePathResolver", func() { err = fs.Symlink("fake-device-path-2", "/dev/disk/by-id/customprefix-fake-disk-id-include-longname") Expect(err).ToNot(HaveOccurred()) - fs.SetGlob("/dev/disk/by-id/*fake-disk-id-include-longname", []string{ + fs.SetGlob("/dev/disk/by-id/fake-disk-id-include-longname", []string{ "/dev/disk/by-id/virtio-fake-disk-id-include-longname", "/dev/disk/by-id/customprefix-fake-disk-id-include-longname", }) @@ -132,7 +132,7 @@ var _ = Describe("IDDevicePathResolver", func() { Expect(err).ToNot(HaveOccurred()) fs.GlobStub = func(pattern string) ([]string, error) { - fs.SetGlob("/dev/disk/by-id/*fake-disk-id-include-longname", []string{ + fs.SetGlob("/dev/disk/by-id/fake-disk-id-include-longname", []string{ "/dev/disk/by-id/virtio-fake-disk-id-include-longname", })