Skip to content

Commit b6ae98f

Browse files
committed
rename CloudInitSettingsSource -> VsphereGuestInfoSettingsSource
per PR feedback
1 parent f3e0fbe commit b6ae98f

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

infrastructure/settings_source_factory.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ type CDROMSourceOptions struct {
6464

6565
func (o CDROMSourceOptions) sourceOptionsInterface() {}
6666

67-
type CloudInitSourceOptions struct{}
67+
type VsphereGuestInfoSourceOptions struct{}
6868

69-
func (o CloudInitSourceOptions) sourceOptionsInterface() {}
69+
func (o VsphereGuestInfoSourceOptions) sourceOptionsInterface() {}
7070

7171
type InstanceMetadataSourceOptions struct {
7272
URI string
@@ -139,8 +139,8 @@ func (f SettingsSourceFactory) buildWithoutRegistry() (boshsettings.Source, erro
139139
f.logger,
140140
)
141141

142-
case CloudInitSourceOptions:
143-
settingsSource = NewCloudInitSettingsSource(
142+
case VsphereGuestInfoSourceOptions:
143+
settingsSource = NewVsphereGuestInfoSettingsSource(
144144
f.platform,
145145
f.logger,
146146
)
@@ -195,8 +195,8 @@ func (s *SourceOptionsSlice) UnmarshalJSON(data []byte) error {
195195
var o CDROMSourceOptions
196196
err, opts = mapstruc.Decode(m, &o), o
197197

198-
case optType == "CloudInit":
199-
var o CloudInitSourceOptions
198+
case optType == "VsphereGuestInfo":
199+
var o VsphereGuestInfoSourceOptions
200200
err, opts = mapstruc.Decode(m, &o), o
201201

202202
default:

infrastructure/cloudinit_settings_source.go renamed to infrastructure/vsphere_guest_info_settings_source.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,31 @@ import (
1515
boshsettings "github.com/cloudfoundry/bosh-agent/v2/settings"
1616
)
1717

18-
type CloudInitSettingsSource struct {
18+
type VsphereGuestInfoSettingsSource struct {
1919
platform boshplatform.Platform
2020
cmdRunner boshsys.CmdRunner
2121

2222
logTag string
2323
logger boshlog.Logger
2424
}
2525

26-
func NewCloudInitSettingsSource(
26+
func NewVsphereGuestInfoSettingsSource(
2727
platform boshplatform.Platform,
2828
logger boshlog.Logger,
29-
) *CloudInitSettingsSource {
30-
return &CloudInitSettingsSource{
29+
) *VsphereGuestInfoSettingsSource {
30+
return &VsphereGuestInfoSettingsSource{
3131
platform: platform,
3232
cmdRunner: platform.GetRunner(),
33-
logTag: "CloudInitSettingsSource",
33+
logTag: "VsphereGuestInfoSettingsSource",
3434
logger: logger,
3535
}
3636
}
3737

38-
func (s CloudInitSettingsSource) PublicSSHKeyForUsername(string) (string, error) {
38+
func (s VsphereGuestInfoSettingsSource) PublicSSHKeyForUsername(string) (string, error) {
3939
return "", nil
4040
}
4141

42-
func (s *CloudInitSettingsSource) Settings() (boshsettings.Settings, error) {
42+
func (s *VsphereGuestInfoSettingsSource) Settings() (boshsettings.Settings, error) {
4343
var settings boshsettings.Settings
4444

4545
// Try to get settings data from vmware-rpctool first, then fallback to vmtoolsd

infrastructure/cloudinit_settings_source_test.go renamed to infrastructure/vsphere_guest_info_settings_source_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import (
1818
boshsettings "github.com/cloudfoundry/bosh-agent/v2/settings"
1919
)
2020

21-
var _ = Describe("CloudInitSettingsSource", func() {
21+
var _ = Describe("VsphereGuestInfoSettingsSource", func() {
2222
var (
2323
platform *platformfakes.FakePlatform
2424
cmdRunner *fakes.FakeCmdRunner
25-
source *CloudInitSettingsSource
25+
source *VsphereGuestInfoSettingsSource
2626
settings boshsettings.Settings
2727
encodedSettings string
2828
)
@@ -32,7 +32,7 @@ var _ = Describe("CloudInitSettingsSource", func() {
3232
cmdRunner = fakes.NewFakeCmdRunner()
3333
platform.GetRunnerReturns(cmdRunner)
3434
logger := logger.NewLogger(logger.LevelNone)
35-
source = NewCloudInitSettingsSource(platform, logger)
35+
source = NewVsphereGuestInfoSettingsSource(platform, logger)
3636
settings = boshsettings.Settings{AgentID: "123"}
3737
settingsBytes, err := json.Marshal(settings)
3838
Expect(err).ToNot(HaveOccurred())

0 commit comments

Comments
 (0)