Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonskie committed Dec 17, 2024
1 parent f24b03f commit a1796a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions infrastructure/devicepathresolver/id_device_path_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ type idDevicePathResolver struct {
diskWaitTimeout time.Duration
udev boshudev.UdevDevice
fs boshsys.FileSystem
DiskIDTransformPatern string
DiskIDTransformPattern string
DiskIDTransformReplacement string
}

func NewIDDevicePathResolver(
diskWaitTimeout time.Duration,
udev boshudev.UdevDevice,
fs boshsys.FileSystem,
DiskIDTransformPatern string,
DiskIDTransformPattern string,
DiskIDTransformReplacement string,
) DevicePathResolver {
return &idDevicePathResolver{
diskWaitTimeout: diskWaitTimeout,
udev: udev,
fs: fs,
DiskIDTransformPatern: DiskIDTransformPatern,
DiskIDTransformPattern: DiskIDTransformPattern,
DiskIDTransformReplacement: DiskIDTransformReplacement,
}
}
Expand Down Expand Up @@ -100,13 +100,13 @@ func (idpr *idDevicePathResolver) GetRealDevicePath(diskSettings boshsettings.Di
}

func (idpr *idDevicePathResolver) TransformDiskID(diskID string) (string, error) {
if idpr.DiskIDTransformPatern == "" {
if idpr.DiskIDTransformPattern == "" {
fmt.Println("DEBUG: DiskIDTransformRules is empty, returning diskID as is")
return diskID, nil
}

transformed := diskID
re := regexp.MustCompile(idpr.DiskIDTransformPatern)
re := regexp.MustCompile(idpr.DiskIDTransformPattern)
if re.MatchString(transformed) {
transformed = re.ReplaceAllString(transformed, idpr.DiskIDTransformReplacement)
}
Expand Down
2 changes: 1 addition & 1 deletion platform/linux_platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type LinuxOptions struct {

// Regular expression specifying what part of disk ID to strip and transform
// example: "pattern": "^(disk-.+)$", "replacement": "google-${1}",
DiskIDTransformPatern string
DiskIDTransformPattern string
DiskIDTransformReplacement string
}

Expand Down
2 changes: 1 addition & 1 deletion platform/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func NewProvider(logger boshlog.Logger, dirProvider boshdirs.Provider, statsColl
switch options.Linux.DevicePathResolutionType {
case "virtio":
udev := boshudev.NewConcreteUdevDevice(runner, logger)
idDevicePathResolver := devicepathresolver.NewIDDevicePathResolver(500*time.Millisecond, udev, fs, options.Linux.DiskIDTransformPatern, options.Linux.DiskIDTransformReplacement)
idDevicePathResolver := devicepathresolver.NewIDDevicePathResolver(500*time.Millisecond, udev, fs, options.Linux.DiskIDTransformPattern, options.Linux.DiskIDTransformReplacement)
mappedDevicePathResolver := devicepathresolver.NewMappedDevicePathResolver(30000*time.Millisecond, fs)
devicePathResolver = devicepathresolver.NewVirtioDevicePathResolver(idDevicePathResolver, mappedDevicePathResolver, logger)
case "scsi":
Expand Down

0 comments on commit a1796a0

Please sign in to comment.