diff --git a/cmd/metal-api/internal/grpc/boot-service_test.go b/cmd/metal-api/internal/grpc/boot-service_test.go index 6d181ec80..b0132ca8e 100644 --- a/cmd/metal-api/internal/grpc/boot-service_test.go +++ b/cmd/metal-api/internal/grpc/boot-service_test.go @@ -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{ diff --git a/cmd/metal-api/internal/service/asn.go b/cmd/metal-api/internal/service/asn.go index 6d0dea1fe..50969089d 100644 --- a/cmd/metal-api/internal/service/asn.go +++ b/cmd/metal-api/internal/service/asn.go @@ -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) } diff --git a/cmd/metal-api/internal/service/network-service.go b/cmd/metal-api/internal/service/network-service.go index d4f3d7d5e..8683a3223 100644 --- a/cmd/metal-api/internal/service/network-service.go +++ b/cmd/metal-api/internal/service/network-service.go @@ -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()) } } diff --git a/cmd/metal-api/internal/service/partition-service.go b/cmd/metal-api/internal/service/partition-service.go index efc55ac9d..012097ce2 100644 --- a/cmd/metal-api/internal/service/partition-service.go +++ b/cmd/metal-api/internal/service/partition-service.go @@ -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 diff --git a/cmd/metal-api/internal/service/project-service.go b/cmd/metal-api/internal/service/project-service.go index 4b5ef450b..db7731596 100644 --- a/cmd/metal-api/internal/service/project-service.go +++ b/cmd/metal-api/internal/service/project-service.go @@ -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