Skip to content

Commit

Permalink
refactor: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Jan 31, 2025
1 parent 02824e4 commit 9668644
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (c *Controller) updateTimestamp(pkg *config.Package) error {
func (c *Controller) install(ctx context.Context, logE *logrus.Entry, findResult *which.FindResult, policies []*policy.Config, param *config.Param) error {
checksums, updateChecksum, err := checksum.Open(
logE, c.fs, findResult.ConfigFilePath,
findResult.Config.ChecksumEnabled(param.EnforceChecksum, param.Checksum))
param.ChecksumEnabled(findResult.Config))
if err != nil {
return fmt.Errorf("read a checksum JSON: %w", err)
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/controller/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ func (c *Controller) getConfigFile(param *config.Param) (string, error) {

func (c *Controller) listPkgs(ctx context.Context, logE *logrus.Entry, param *config.Param, cfg *aqua.Config, cfgFilePath string, args ...string) ([]*aqua.Package, error) {
checksums, updateChecksum, err := checksum.Open(
logE, c.fs, cfgFilePath,
cfg.ChecksumEnabled(param.EnforceChecksum, param.Checksum))
logE, c.fs, cfgFilePath, param.ChecksumEnabled(cfg))
if err != nil {
return nil, fmt.Errorf("read a checksum JSON: %w", err)
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ func (c *Controller) install(ctx context.Context, logE *logrus.Entry, cfgFilePat
return err //nolint:wrapcheck
}

checksums, updateChecksum, err := checksum.Open(logE, c.fs, cfgFilePath, cfg.ChecksumEnabled(param.EnforceChecksum, param.Checksum))
checksums, updateChecksum, err := checksum.Open(
logE, c.fs, cfgFilePath, param.ChecksumEnabled(cfg))
if err != nil {
return fmt.Errorf("read a checksum JSON: %w", err)
}
Expand Down

0 comments on commit 9668644

Please sign in to comment.