Skip to content

Commit

Permalink
cleanup(pkg/driver): drop unused argument.
Browse files Browse the repository at this point in the history
Fixed up more linting issues.

Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Nov 6, 2023
1 parent 4c42896 commit 6a7390b
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions cmd/driver/driver_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

//go:build linux

// Package driver implements the driver related cmd line interface.
package driver

import (
Expand Down
2 changes: 1 addition & 1 deletion cmd/driver/prepare/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (o *driverPrepareOptions) RunDriverPrepare(_ context.Context, _ []string) e
return fmt.Errorf("detected an unsupported target system, please get in touch with the Falco community")
}
}
o.Printer.Logger.Info("found distro", o.Printer.Logger.Args("target", d.GetTargetID(info)))
o.Printer.Logger.Info("found distro", o.Printer.Logger.Args("target", d.GetTargetID()))

err = driver.Type.Prepare(o.Printer, o.Name)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/driver/select/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (o *driverSelectOptions) RunDriverSelect(_ context.Context, args []string)
if err != nil {
return nil, err
}
o.Printer.Logger.Info("found distro", o.Printer.Logger.Args("target", d.GetTargetID(info)))
o.Printer.Logger.Info("found distro", o.Printer.Logger.Args("target", d.GetTargetID()))

preferredDriver := d.PreferredDriver(info)
if preferredDriver == nil {
Expand Down
5 changes: 3 additions & 2 deletions pkg/driver/distro/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package driverdistro implements all the distro specific driver-related logic.
package driverdistro

import (
Expand Down Expand Up @@ -45,7 +46,7 @@ var ErrUnsupported = fmt.Errorf("failed to determine distro")
// Most of the distro-specific only partially override the default `generic` implementation.
type Distro interface {
init(i driverkernel.Info, id string, cfg *ini.File) error // private
GetTargetID(i driverkernel.Info) string
GetTargetID() string
fixupKernel(i driverkernel.Info) driverkernel.Info // private
PreferredDriver(i driverkernel.Info) drivertype.DriverType
}
Expand Down Expand Up @@ -119,7 +120,7 @@ func toLocalPath(driverVer, fileName string) string {
func driverToFilename(d Distro, i driverkernel.Info, driverName string, driverType drivertype.DriverType) string {
// Fixup kernel information before attempting to download
fixedInfo := d.fixupKernel(i)
return fmt.Sprintf("%s_%s_%s_%s%s", driverName, d.GetTargetID(i), fixedInfo.KernelRelease, fixedInfo.KernelVersion, driverType.Extension())
return fmt.Sprintf("%s_%s_%s_%s%s", driverName, d.GetTargetID(), fixedInfo.KernelRelease, fixedInfo.KernelVersion, driverType.Extension())
}

// GetArchitecture returns current arch as non-deb name (ie: x86_64/aarch64).
Expand Down
2 changes: 1 addition & 1 deletion pkg/driver/distro/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (g *generic) init(_ driverkernel.Info, id string, _ *ini.File) error {
return nil
}

func (g *generic) GetTargetID(_ driverkernel.Info) string {
func (g *generic) GetTargetID() string {
return g.targetID
}

Expand Down
1 change: 1 addition & 0 deletions pkg/driver/kernel/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package driverkernel implements the kernel info fetching helpers.
package driverkernel

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/driver/type/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package drivertype implements all the driver type specific logic.
package drivertype

import (
Expand Down

0 comments on commit 6a7390b

Please sign in to comment.