Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 committed Aug 26, 2024
2 parents 5f3287e + 58201a8 commit 1822069
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cmd/metal-api/internal/grpc/boot-service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ func TestBootService_Register(t *testing.T) {
Cpus: []*v1.MachineCPU{
{
Model: "Intel Xeon Silver",
Cores: uint32(tt.numcores),
Threads: uint32(tt.numcores),
Cores: uint32(tt.numcores), // nolint:gosec
Threads: uint32(tt.numcores), // nolint:gosec
},
},
Nics: []*v1.MachineNic{
Expand Down
2 changes: 1 addition & 1 deletion cmd/metal-api/internal/service/asn.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func acquireASN(ds *datastore.RethinkStore) (*uint32, error) {
if err != nil {
return nil, err
}
asn := ASNBase + uint32(i)
asn := ASNBase + uint32(i) // nolint:gosec
if asn > ASNMax {
return nil, fmt.Errorf("unable to calculate asn, got a asn larger than ASNMax: %d > %d", asn, ASNMax)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/metal-api/internal/service/network-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ func validatePrefixesAndAddressFamilies(prefixes, destinationPrefixes []string,
if ipprefix.Addr().Is6() && af == metal.IPv4AddressFamily {
continue
}
if length <= uint8(ipprefix.Bits()) {
if int(length) <= ipprefix.Bits() {
return nil, nil, nil, fmt.Errorf("given defaultchildprefixlength %d is not greater than prefix length of:%s", length, p.String())
}
}
Expand Down
1 change: 0 additions & 1 deletion cmd/metal-api/internal/service/partition-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ func (r *partitionResource) createPartition(request *restful.Request, response *
if requestPayload.Labels != nil {
labels = requestPayload.Labels
}

var imageURL string
if requestPayload.PartitionBootConfiguration.ImageURL != nil {
imageURL = *requestPayload.PartitionBootConfiguration.ImageURL
Expand Down
4 changes: 2 additions & 2 deletions cmd/metal-api/internal/service/project-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ func (r *projectResource) setProjectQuota(project *mdmv1.Project) (*v1.Project,
if qs.Ip == nil {
qs.Ip = &v1.Quota{}
}
machineUsage := int32(len(ms))
ipUsage := int32(len(ips))
machineUsage := int32(len(ms)) // nolint:gosec
ipUsage := int32(len(ips)) // nolint:gosec
qs.Machine.Used = &machineUsage
qs.Ip.Used = &ipUsage

Expand Down

0 comments on commit 1822069

Please sign in to comment.