Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/build-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: code-build
on:
push:
branches: [ main ]
tags:
tags:
- '*'
pull_request:
branches: [ main ]
Expand All @@ -20,6 +20,9 @@ jobs:
with:
go-version: '1.21'

- name: Run 'make check'
run: make check

- name: Build
run: |
go build -v ./...
Expand Down
4 changes: 2 additions & 2 deletions pkg/provider/azure/module/spot-price/spot-price.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func getPriceHistory(ctx context.Context, client *armresourcegraph.Client,
if err != nil {
return nil, err
}
spr := string(buffer.Bytes())
spr := buffer.String()
logging.Debug(spr)

qr, err := client.Resources(ctx,
Expand Down Expand Up @@ -178,7 +178,7 @@ func getEvictionRateInfoByVMTypes(ctx context.Context, client *armresourcegraph.
if err != nil {
return nil, err
}
evrr := string(buffer.Bytes())
evrr := buffer.String()
logging.Debug(evrr)

qr, err := client.Resources(ctx,
Expand Down
2 changes: 1 addition & 1 deletion pkg/provider/util/instancetypes/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (r *AwsInstanceRequest) GetMachineTypes() ([]string, error) {
MaxResults: &maxResults,
BareMetal: &r.NestedVirt,
}

//nolint:staticcheck // following method is deprecated but no replacement yet
instanceTypesSlice, err := instanceSelector.Filter(ctx, filters)
if err != nil {
return nil, err
Expand Down
12 changes: 2 additions & 10 deletions pkg/provider/util/instancetypes/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,8 @@ func (vm *virtualMachine) nestedVirtSupported() bool {
}

fSeries := regexp.MustCompile(fSeriesPattern)
if fSeries.Match([]byte(vm.Family)) {
return true
}
return false
}

func (vm *virtualMachine) getCPUCores() int32 {
if vm.VCPUsPerCore > 0 {
return (vm.VCPUs / vm.VCPUsPerCore)
}
return vm.VCPUs
return fSeries.Match([]byte(vm.Family))
}

func (vm *virtualMachine) hypervGen2Supported() bool {
Expand Down Expand Up @@ -250,6 +241,7 @@ func FilterVMs(skus armcompute.ResourceSKUsClientListResponse, filter filterFunc
return vmTypes
}
case <-c:
cancelFn()
return vmTypes
}
}
Expand Down