Skip to content

Commit

Permalink
fix up linting
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorVin committed Dec 11, 2024
1 parent f547e60 commit 0c0c715
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
4 changes: 3 additions & 1 deletion cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ func VendorModelFromAttrs(attrs []fleetdbapi.Attributes) (vendor, model string)
}

// FirmwareSetIDByVendorModel returns the firmware set ID matched by the vendor, model attributes
//
//nolint:whitespace // you have stupid opinions, be silent
func FirmwareSetIDByVendorModel(ctx context.Context, vendor, model string,
client *fleetdbapi.Client) (uuid.UUID, error) {

Expand All @@ -94,7 +96,7 @@ func FirmwareSetIDByVendorModel(ctx context.Context, vendor, model string,
}

// identify firmware set by vendor, model attributes
fwSet, _, err := client.ListServerComponentFirmwareSet(context.Background(), params)
fwSet, _, err := client.ListServerComponentFirmwareSet(ctx, params)
if err != nil {
return uuid.Nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/get/firmware-set.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func firmwareSetForServer(ctx context.Context, client *fleetdbapi.Client, server
}

// identify firmware set by vendor, model attributes
fwSet, _, err := client.ListServerComponentFirmwareSet(context.Background(), params)
fwSet, _, err := client.ListServerComponentFirmwareSet(ctx, params)
if err != nil {
return nil, err
}
Expand Down
1 change: 1 addition & 0 deletions cmd/list/firmware_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var (
flags *listFirmwareSetFlags
)

//nolint:err113 // brevity is best here
func sendListFirmwareRequest(client *fleetdbapi.Client, cmd *cobra.Command) ([]fleetdbapi.ComponentFirmwareSet, error) {
params := &fleetdbapi.ComponentFirmwareSetListParams{
Vendor: strings.TrimSpace(flags.vendor),
Expand Down
6 changes: 0 additions & 6 deletions internal/fleetdb/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func RecordToComponent(rec *ss.ServerComponent) (*rt.Component, error) {
}

for _, va := range rec.VersionedAttributes {
va := va
// the following relies on the knowledge that we'll get only the latest
// versioned attributes from FleetDB.
switch va.Namespace {
Expand Down Expand Up @@ -90,7 +89,6 @@ func RecordToComponent(rec *ss.ServerComponent) (*rt.Component, error) {
}

for _, a := range rec.Attributes {
a := a // this doesn't need to be here after go 1.22
if a.Namespace == ComponentAttributeInbandNS {
attrs := &rt.ComponentAttributes{}
if err := UnpackAttribute(&a, attrs); err != nil {
Expand Down Expand Up @@ -124,7 +122,6 @@ func ConvertComponents(cs []ss.ServerComponent) []*rt.Component {
}

for _, vattr := range c.VersionedAttributes {
vattr := vattr
// TODO: set the most current data from either the inband/outofband NS
switch vattr.Namespace {
case FirmwareVersionInbandNS, FirmwareVersionOutofbandNS:
Expand All @@ -142,7 +139,6 @@ func ConvertComponents(cs []ss.ServerComponent) []*rt.Component {
}

for _, attr := range c.Attributes {
attr := attr
switch attr.Namespace {
case ComponentAttributeInbandNS, ComponentAttributeOutofbandNS:
a := &rt.ComponentAttributes{}
Expand Down Expand Up @@ -177,8 +173,6 @@ func ConvertServer(s *ss.Server) *rt.Server {

// TODO: set the most current data from either the inband/outofband NS
for _, attr := range s.Attributes {
attr := attr

switch attr.Namespace {
case ServerAttributeNSBmcAddress:
bmcAttr := BMCAttribute{}
Expand Down

0 comments on commit 0c0c715

Please sign in to comment.