From 77aca33b213a258f3dbc9fc6a1083fb52589cd18 Mon Sep 17 00:00:00 2001 From: Will Dollman Date: Wed, 17 Apr 2024 12:03:23 +0100 Subject: [PATCH 1/2] Include PkgPath when referencing config file --- pkg/update/update.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/update/update.go b/pkg/update/update.go index 7ce7b0b15..d70208828 100644 --- a/pkg/update/update.go +++ b/pkg/update/update.go @@ -369,7 +369,9 @@ func (o *Options) updateGitPackage(ctx context.Context, repo *git.Repository, pa root := worktree.Filesystem.Root() log.Printf("working directory: %s", root) - configFile := filepath.Join(root, pc.Filename) + configFilepath := filepath.Join(o.PkgPath, pc.Filename) + + configFile := filepath.Join(root, configFilepath) if configFile == "" { return "", fmt.Errorf("no config filename found for package %s", packageName) } @@ -416,7 +418,7 @@ func (o *Options) updateGitPackage(ctx context.Context, repo *git.Repository, pa } // now make sure update config is configured - updated, err := config.ParseConfiguration(ctx, filepath.Join(root, pc.Filename)) + updated, err := config.ParseConfiguration(ctx, filepath.Join(root, configFilepath)) if err != nil { return "", fmt.Errorf("failed to parse %v", err) } @@ -435,7 +437,7 @@ func (o *Options) updateGitPackage(ctx context.Context, repo *git.Repository, pa // Skip any processing for definitions with a single pipeline if len(updated.Pipeline) > 1 && deps.ContainsGoBumpPipeline(updated) { - if err := o.updateGoBumpDeps(updated, root, pc.Filename, mutations); err != nil { + if err := o.updateGoBumpDeps(updated, root, configFilepath, mutations); err != nil { return fmt.Sprintf("error cleaning up go/bump deps: %v", err), nil } } @@ -447,12 +449,12 @@ func (o *Options) updateGitPackage(ctx context.Context, repo *git.Repository, pa o.Logger.Printf("after clean go bumps: %s git status: %s", packageName, string(rs)) // Run yam formatter - err = yam.FormatConfigurationFile(root, pc.Filename) + err = yam.FormatConfigurationFile(filepath.Join(root, o.PkgPath), pc.Filename) if err != nil { return fmt.Sprintf("failed to format configuration file: %v", err), nil } - _, err = worktree.Add(pc.Filename) + _, err = worktree.Add(configFilepath) if err != nil { return "", fmt.Errorf("failed to git add %s: %w", configFile, err) } From 4753ac0690e77a68e08307fe551b1c423e4979c6 Mon Sep 17 00:00:00 2001 From: Will Dollman Date: Wed, 9 Apr 2025 13:05:28 +0100 Subject: [PATCH 2/2] Update go version --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index e470b2d6f..9aed027f4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/wolfi-dev/wolfictl -go 1.21.8 +go 1.24.2 require ( chainguard.dev/apko v0.14.1-0.20240308000904-c510767a86aa