kubernetes-sigs/cluster-api-provider-gcp

Invalid equality prevents the usage of local-ssd disks

silenteh opened this issue · 3 comments

/kind bug

While trying to use local-ssd disks I came across the following error:

Error 400: Invalid value for field 'resource.disks[1].type
Cannot create local SSD as persistent disk

After further inspection of the source code it turns out that the following equality can never be satisfied.

if additionalDisk.InitializeParams.DiskType == string(infrav1.LocalSsdDiskType) {

I have a fix ready for it, however, before I open a pull request I have a question about unit tests.
This seems to be a case where having unit tests could catch these classes of bugs.
In my fix I did provide a unit test to validate that the fix is correct but, it seems, you are preventing to push any _test.go files, via.gitignore

Is this done on purpose ?

Ping

i dont see a rule that blocks _test.go files to be added in the .gitignore

but feel free to open a PR :) thanks for the report

@cpanato here the open PR