Skip to content

Commit

Permalink
libvmi: rename WithCloudInitConfigDriveData consistently
Browse files Browse the repository at this point in the history
The names of all other WithCloudInit* functions that set the UserData
field end with `UserData`, not place `Data`. Let us conform.

There are too many WithCloudInit* functions with long confusing names.
This is left as a future excercise.

Signed-off-by: Dan Kenigsberg <[email protected]>
  • Loading branch information
dankenigsberg committed Feb 3, 2024
1 parent b97c9e2 commit e2b38db
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/compute/credentials_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ var _ = SIGDescribe("Guest Access Credentials", func() {
})

vmi := libvmi.NewFedora(
libvmi.WithCloudInitConfigDriveData(userData),
libvmi.WithCloudInitConfigDriveUserData(userData),
withSSHPK(secretID, propagationMethod))
vmi = tests.RunVMIAndExpectLaunch(vmi, fedoraRunningTimeout)
verifySSHKeys(vmi)
Expand Down
4 changes: 2 additions & 2 deletions tests/libvmi/cloudinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ func WithCloudInitNoCloudNetworkData(data string) Option {
}
}

// WithCloudInitConfigDriveData adds cloud-init config-drive user data.
func WithCloudInitConfigDriveData(data string) Option {
// WithCloudInitConfigDriveUserData adds cloud-init config-drive user data.
func WithCloudInitConfigDriveUserData(data string) Option {
return func(vmi *v1.VirtualMachineInstance) {
addDiskVolumeWithCloudInitConfigDrive(vmi, cloudInitDiskName, v1.DiskBusVirtio)

Expand Down
2 changes: 1 addition & 1 deletion tests/vmi_cloudinit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ var _ = Describe("[rfe_id:151][crit:high][vendor:[email protected]][level:compon
"#cloud-config\npassword: %s\nchpasswd: { expire: False }",
fedoraPassword,
)
vmi := libvmi.NewFedora(libvmi.WithCloudInitConfigDriveData(userData))
vmi := libvmi.NewFedora(libvmi.WithCloudInitConfigDriveUserData(userData))
// runStrategy := v1.RunStrategyManual
vm := &v1.VirtualMachine{
ObjectMeta: vmi.ObjectMeta,
Expand Down

0 comments on commit e2b38db

Please sign in to comment.