diff --git a/cli/cmd/cmds/run.go b/cli/cmd/cmds/run.go index 2fc0f3ab..09396d13 100644 --- a/cli/cmd/cmds/run.go +++ b/cli/cmd/cmds/run.go @@ -3,7 +3,7 @@ package cmds import ( "github.com/input-output-hk/catalyst-forge/cli/pkg/earthly" "github.com/input-output-hk/catalyst-forge/cli/pkg/run" - "github.com/input-output-hk/catalyst-forge/lib/tools/earthfile" + te "github.com/input-output-hk/catalyst-forge/lib/tools/earthly" ) type RunCmd struct { @@ -15,7 +15,7 @@ type RunCmd struct { } func (c *RunCmd) Run(ctx run.RunContext) error { - ref, err := earthfile.ParseEarthfileRef(c.Path) + ref, err := te.ParseEarthfileRef(c.Path) if err != nil { return err } diff --git a/cli/pkg/scan/earthfile.go b/cli/pkg/scan/earthfile.go index 0869217c..1496b83a 100644 --- a/cli/pkg/scan/earthfile.go +++ b/cli/pkg/scan/earthfile.go @@ -7,14 +7,14 @@ import ( "path/filepath" "strings" - "github.com/input-output-hk/catalyst-forge/lib/tools/earthfile" + "github.com/input-output-hk/catalyst-forge/lib/tools/earthly" w "github.com/input-output-hk/catalyst-forge/lib/tools/walker" ) // ScanEarthfiles scans the given root path for Earthfiles and returns a map // that maps the path of the Earthfile to the targets defined in the Earthfile. -func ScanEarthfiles(rootPath string, walker w.Walker, logger *slog.Logger) (map[string]earthfile.Earthfile, error) { - earthfiles := make(map[string]earthfile.Earthfile) +func ScanEarthfiles(rootPath string, walker w.Walker, logger *slog.Logger) (map[string]earthly.Earthfile, error) { + earthfiles := make(map[string]earthly.Earthfile) err := walker.Walk(rootPath, func(path string, fileType w.FileType, openFile func() (w.FileSeeker, error)) error { if fileType != w.FileTypeFile { @@ -30,7 +30,7 @@ func ScanEarthfiles(rootPath string, walker w.Walker, logger *slog.Logger) (map[ defer file.Close() logger.Info("parsing Earthfile", "path", path) - earthfile, err := earthfile.ParseEarthfile(context.Background(), file) + earthfile, err := earthly.ParseEarthfile(context.Background(), file) if err != nil { logger.Error("error parsing Earthfile", "path", path, "error", err) return fmt.Errorf("error parsing %s: %w", path, err) diff --git a/foundry/operator/config/rbac/role.yaml b/foundry/operator/config/rbac/role.yaml index 77ac15b5..d3caea97 100644 --- a/foundry/operator/config/rbac/role.yaml +++ b/foundry/operator/config/rbac/role.yaml @@ -7,7 +7,7 @@ rules: - apiGroups: - foundry.projectcatalyst.io resources: - - releases + - releasedeployments verbs: - create - delete @@ -19,13 +19,13 @@ rules: - apiGroups: - foundry.projectcatalyst.io resources: - - releases/finalizers + - releasedeployments/finalizers verbs: - update - apiGroups: - foundry.projectcatalyst.io resources: - - releases/status + - releasedeployments/status verbs: - get - patch diff --git a/lib/project/project/loader.go b/lib/project/project/loader.go index 3d61021f..fec8c6d2 100644 --- a/lib/project/project/loader.go +++ b/lib/project/project/loader.go @@ -13,7 +13,7 @@ import ( "github.com/input-output-hk/catalyst-forge/lib/project/injector" "github.com/input-output-hk/catalyst-forge/lib/project/secrets" sb "github.com/input-output-hk/catalyst-forge/lib/schema/blueprint" - "github.com/input-output-hk/catalyst-forge/lib/tools/earthfile" + "github.com/input-output-hk/catalyst-forge/lib/tools/earthly" "github.com/input-output-hk/catalyst-forge/lib/tools/fs" "github.com/input-output-hk/catalyst-forge/lib/tools/fs/billy" "github.com/input-output-hk/catalyst-forge/lib/tools/git" @@ -97,7 +97,7 @@ func (p *DefaultProjectLoader) Load(projectPath string) (Project, error) { return Project{}, fmt.Errorf("failed to check for Earthfile: %w", err) } - var ef *earthfile.Earthfile + var ef *earthly.Earthfile if exists { p.logger.Info("Parsing Earthfile", "path", efPath) eff, err := p.fs.Open(efPath) @@ -105,7 +105,7 @@ func (p *DefaultProjectLoader) Load(projectPath string) (Project, error) { p.logger.Error("Failed to read Earthfile", "error", err, "path", efPath) return Project{}, fmt.Errorf("failed to read Earthfile: %w", err) } - efs, err := earthfile.ParseEarthfile(context.Background(), eff) + efs, err := earthly.ParseEarthfile(context.Background(), eff) if err != nil { p.logger.Error("Failed to parse Earthfile", "error", err, "path", efPath) return Project{}, fmt.Errorf("failed to parse Earthfile: %w", err) diff --git a/lib/project/project/project.go b/lib/project/project/project.go index a0defc20..6e796ff9 100644 --- a/lib/project/project/project.go +++ b/lib/project/project/project.go @@ -10,7 +10,7 @@ import ( "github.com/input-output-hk/catalyst-forge/lib/project/blueprint" "github.com/input-output-hk/catalyst-forge/lib/project/secrets" sb "github.com/input-output-hk/catalyst-forge/lib/schema/blueprint" - "github.com/input-output-hk/catalyst-forge/lib/tools/earthfile" + "github.com/input-output-hk/catalyst-forge/lib/tools/earthly" "github.com/input-output-hk/catalyst-forge/lib/tools/git/repo" ) @@ -20,7 +20,7 @@ type Project struct { Blueprint sb.Blueprint // Earthfile is the project Earthfile. - Earthfile *earthfile.Earthfile + Earthfile *earthly.Earthfile // Name is the project name. Name string @@ -121,7 +121,7 @@ func (p *Project) Raw() blueprint.RawBlueprint { func NewProject( ctx *cue.Context, repo *repo.GitRepo, - earthfile *earthfile.Earthfile, + earthfile *earthly.Earthfile, name, path, repoRoot string, blueprint sb.Blueprint, tag *ProjectTag, diff --git a/lib/tools/earthfile/earthfile.go b/lib/tools/earthly/earthfile.go similarity index 99% rename from lib/tools/earthfile/earthfile.go rename to lib/tools/earthly/earthfile.go index 42da0114..5a28cbc8 100644 --- a/lib/tools/earthfile/earthfile.go +++ b/lib/tools/earthly/earthfile.go @@ -1,4 +1,4 @@ -package earthfile +package earthly import ( "context" diff --git a/lib/tools/earthfile/earthfile_test.go b/lib/tools/earthly/earthfile_test.go similarity index 99% rename from lib/tools/earthfile/earthfile_test.go rename to lib/tools/earthly/earthfile_test.go index ad7934b3..a90176b8 100644 --- a/lib/tools/earthfile/earthfile_test.go +++ b/lib/tools/earthly/earthfile_test.go @@ -1,4 +1,4 @@ -package earthfile +package earthly import ( "context"