diff --git a/cmd/bundle_test.go b/cmd/bundle_test.go index 313ec7cf2..c9e300d0a 100644 --- a/cmd/bundle_test.go +++ b/cmd/bundle_test.go @@ -13,8 +13,8 @@ import ( "github.com/windsorcli/cli/pkg/context/shell" "github.com/windsorcli/cli/pkg/di" "github.com/windsorcli/cli/pkg/provisioner/kubernetes" - "github.com/windsorcli/cli/pkg/resources/artifact" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/artifact" + "github.com/windsorcli/cli/pkg/composer/blueprint" ) // ============================================================================= diff --git a/cmd/push_test.go b/cmd/push_test.go index d96b838b7..d20cd2d58 100644 --- a/cmd/push_test.go +++ b/cmd/push_test.go @@ -12,8 +12,8 @@ import ( "github.com/windsorcli/cli/pkg/context/config" "github.com/windsorcli/cli/pkg/di" "github.com/windsorcli/cli/pkg/provisioner/kubernetes" - "github.com/windsorcli/cli/pkg/resources/artifact" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/artifact" + "github.com/windsorcli/cli/pkg/composer/blueprint" "github.com/windsorcli/cli/pkg/context/shell" ) diff --git a/cmd/root_test.go b/cmd/root_test.go index 0d6ddb6c4..4b954d613 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -17,7 +17,7 @@ import ( "github.com/windsorcli/cli/pkg/di" envvars "github.com/windsorcli/cli/pkg/context/env" "github.com/windsorcli/cli/pkg/provisioner/kubernetes" - blueprintpkg "github.com/windsorcli/cli/pkg/resources/blueprint" + blueprintpkg "github.com/windsorcli/cli/pkg/composer/blueprint" "github.com/windsorcli/cli/pkg/context/secrets" "github.com/windsorcli/cli/pkg/context/shell" ) diff --git a/pkg/resources/artifact/artifact.go b/pkg/composer/artifact/artifact.go similarity index 100% rename from pkg/resources/artifact/artifact.go rename to pkg/composer/artifact/artifact.go diff --git a/pkg/resources/artifact/artifact_test.go b/pkg/composer/artifact/artifact_test.go similarity index 100% rename from pkg/resources/artifact/artifact_test.go rename to pkg/composer/artifact/artifact_test.go diff --git a/pkg/resources/artifact/mock_artifact.go b/pkg/composer/artifact/mock_artifact.go similarity index 100% rename from pkg/resources/artifact/mock_artifact.go rename to pkg/composer/artifact/mock_artifact.go diff --git a/pkg/resources/artifact/mock_artifact_test.go b/pkg/composer/artifact/mock_artifact_test.go similarity index 100% rename from pkg/resources/artifact/mock_artifact_test.go rename to pkg/composer/artifact/mock_artifact_test.go diff --git a/pkg/resources/artifact/shims.go b/pkg/composer/artifact/shims.go similarity index 100% rename from pkg/resources/artifact/shims.go rename to pkg/composer/artifact/shims.go diff --git a/pkg/resources/blueprint/blueprint_handler.go b/pkg/composer/blueprint/blueprint_handler.go similarity index 99% rename from pkg/resources/blueprint/blueprint_handler.go rename to pkg/composer/blueprint/blueprint_handler.go index 1d001884a..313bd702d 100644 --- a/pkg/resources/blueprint/blueprint_handler.go +++ b/pkg/composer/blueprint/blueprint_handler.go @@ -22,7 +22,7 @@ import ( "github.com/windsorcli/cli/pkg/constants" "github.com/windsorcli/cli/pkg/di" "github.com/windsorcli/cli/pkg/provisioner/kubernetes" - "github.com/windsorcli/cli/pkg/resources/artifact" + "github.com/windsorcli/cli/pkg/composer/artifact" "github.com/windsorcli/cli/pkg/context/shell" "github.com/briandowns/spinner" diff --git a/pkg/resources/blueprint/blueprint_handler_helper_test.go b/pkg/composer/blueprint/blueprint_handler_helper_test.go similarity index 100% rename from pkg/resources/blueprint/blueprint_handler_helper_test.go rename to pkg/composer/blueprint/blueprint_handler_helper_test.go diff --git a/pkg/resources/blueprint/blueprint_handler_private_test.go b/pkg/composer/blueprint/blueprint_handler_private_test.go similarity index 100% rename from pkg/resources/blueprint/blueprint_handler_private_test.go rename to pkg/composer/blueprint/blueprint_handler_private_test.go diff --git a/pkg/resources/blueprint/blueprint_handler_public_test.go b/pkg/composer/blueprint/blueprint_handler_public_test.go similarity index 99% rename from pkg/resources/blueprint/blueprint_handler_public_test.go rename to pkg/composer/blueprint/blueprint_handler_public_test.go index 76be126ef..421559002 100644 --- a/pkg/resources/blueprint/blueprint_handler_public_test.go +++ b/pkg/composer/blueprint/blueprint_handler_public_test.go @@ -19,7 +19,7 @@ import ( "github.com/windsorcli/cli/pkg/constants" "github.com/windsorcli/cli/pkg/di" "github.com/windsorcli/cli/pkg/provisioner/kubernetes" - "github.com/windsorcli/cli/pkg/resources/artifact" + "github.com/windsorcli/cli/pkg/composer/artifact" "github.com/windsorcli/cli/pkg/context/shell" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/pkg/resources/blueprint/defaults.go b/pkg/composer/blueprint/defaults.go similarity index 100% rename from pkg/resources/blueprint/defaults.go rename to pkg/composer/blueprint/defaults.go diff --git a/pkg/resources/blueprint/feature_evaluator.go b/pkg/composer/blueprint/feature_evaluator.go similarity index 100% rename from pkg/resources/blueprint/feature_evaluator.go rename to pkg/composer/blueprint/feature_evaluator.go diff --git a/pkg/resources/blueprint/feature_evaluator_test.go b/pkg/composer/blueprint/feature_evaluator_test.go similarity index 100% rename from pkg/resources/blueprint/feature_evaluator_test.go rename to pkg/composer/blueprint/feature_evaluator_test.go diff --git a/pkg/resources/blueprint/mock_blueprint_handler.go b/pkg/composer/blueprint/mock_blueprint_handler.go similarity index 99% rename from pkg/resources/blueprint/mock_blueprint_handler.go rename to pkg/composer/blueprint/mock_blueprint_handler.go index 342ec4edc..6caa5d6ea 100644 --- a/pkg/resources/blueprint/mock_blueprint_handler.go +++ b/pkg/composer/blueprint/mock_blueprint_handler.go @@ -3,7 +3,7 @@ package blueprint import ( blueprintv1alpha1 "github.com/windsorcli/cli/api/v1alpha1" "github.com/windsorcli/cli/pkg/di" - "github.com/windsorcli/cli/pkg/resources/artifact" + "github.com/windsorcli/cli/pkg/composer/artifact" ) // MockBlueprintHandler is a mock implementation of BlueprintHandler interface for testing diff --git a/pkg/resources/blueprint/mock_blueprint_handler_test.go b/pkg/composer/blueprint/mock_blueprint_handler_test.go similarity index 99% rename from pkg/resources/blueprint/mock_blueprint_handler_test.go rename to pkg/composer/blueprint/mock_blueprint_handler_test.go index 9a33a3f50..3ef371321 100644 --- a/pkg/resources/blueprint/mock_blueprint_handler_test.go +++ b/pkg/composer/blueprint/mock_blueprint_handler_test.go @@ -7,7 +7,7 @@ import ( blueprintv1alpha1 "github.com/windsorcli/cli/api/v1alpha1" "github.com/windsorcli/cli/pkg/di" - "github.com/windsorcli/cli/pkg/resources/artifact" + "github.com/windsorcli/cli/pkg/composer/artifact" ) // ============================================================================= diff --git a/pkg/resources/blueprint/shims.go b/pkg/composer/blueprint/shims.go similarity index 100% rename from pkg/resources/blueprint/shims.go rename to pkg/composer/blueprint/shims.go diff --git a/pkg/resources/blueprint/templates/default.jsonnet b/pkg/composer/blueprint/templates/default.jsonnet similarity index 100% rename from pkg/resources/blueprint/templates/default.jsonnet rename to pkg/composer/blueprint/templates/default.jsonnet diff --git a/pkg/resources/resources.go b/pkg/composer/composer.go similarity index 71% rename from pkg/resources/resources.go rename to pkg/composer/composer.go index ee9dfbd49..390d13283 100644 --- a/pkg/resources/resources.go +++ b/pkg/composer/composer.go @@ -1,15 +1,15 @@ -package resources +package composer import ( "fmt" + "github.com/windsorcli/cli/pkg/composer/artifact" + "github.com/windsorcli/cli/pkg/composer/blueprint" + "github.com/windsorcli/cli/pkg/composer/terraform" "github.com/windsorcli/cli/pkg/context" - "github.com/windsorcli/cli/pkg/resources/artifact" - "github.com/windsorcli/cli/pkg/resources/blueprint" - "github.com/windsorcli/cli/pkg/resources/terraform" ) -// The Resources package provides high-level resource management functionality +// The Composer package provides high-level resource management functionality // for artifact, blueprint, and terraform operations. It consolidates the creation // and management of these core resources, providing a unified interface for // resource lifecycle operations across the Windsor CLI. @@ -18,9 +18,9 @@ import ( // Types // ============================================================================= -// ResourcesExecutionContext holds the execution context for resource operations. +// ComposerExecutionContext holds the execution context for resource operations. // It embeds the base ExecutionContext and includes all resource-specific dependencies. -type ResourcesExecutionContext struct { +type ComposerExecutionContext struct { context.ExecutionContext // Resource-specific dependencies @@ -29,36 +29,36 @@ type ResourcesExecutionContext struct { TerraformResolver terraform.ModuleResolver } -// Resources manages the lifecycle of all resource types (artifact, blueprint, terraform). +// Composer manages the lifecycle of all resource types (artifact, blueprint, terraform). // It provides a unified interface for creating, initializing, and managing these resources // with proper dependency injection and error handling. -type Resources struct { - *ResourcesExecutionContext +type Composer struct { + *ComposerExecutionContext } // ============================================================================= // Constructor // ============================================================================= -// NewResources creates and initializes a new Resources instance with the provided execution context. +// NewComposer creates and initializes a new Composer instance with the provided execution context. // It sets up all required resource handlers—artifact builder, blueprint handler, and terraform resolver— // and registers each handler with the dependency injector for use throughout the resource lifecycle. -// Returns a pointer to the fully initialized Resources struct. -func NewResources(ctx *ResourcesExecutionContext) *Resources { - resources := &Resources{ - ResourcesExecutionContext: ctx, +// Returns a pointer to the fully initialized Composer struct. +func NewComposer(ctx *ComposerExecutionContext) *Composer { + composer := &Composer{ + ComposerExecutionContext: ctx, } - resources.ArtifactBuilder = artifact.NewArtifactBuilder() - resources.Injector.Register("artifactBuilder", resources.ArtifactBuilder) + composer.ArtifactBuilder = artifact.NewArtifactBuilder() + composer.Injector.Register("artifactBuilder", composer.ArtifactBuilder) - resources.BlueprintHandler = blueprint.NewBlueprintHandler(resources.Injector) - resources.Injector.Register("blueprintHandler", resources.BlueprintHandler) + composer.BlueprintHandler = blueprint.NewBlueprintHandler(composer.Injector) + composer.Injector.Register("blueprintHandler", composer.BlueprintHandler) - resources.TerraformResolver = terraform.NewStandardModuleResolver(resources.Injector) - resources.Injector.Register("terraformResolver", resources.TerraformResolver) + composer.TerraformResolver = terraform.NewStandardModuleResolver(composer.Injector) + composer.Injector.Register("terraformResolver", composer.TerraformResolver) - return resources + return composer } // ============================================================================= @@ -68,7 +68,7 @@ func NewResources(ctx *ResourcesExecutionContext) *Resources { // Bundle creates a complete artifact bundle from the project's templates, kustomize, and terraform files. // It initializes the artifact builder and creates a distributable artifact. // The outputPath specifies where to save the bundle file. Returns the actual output path or an error. -func (r *Resources) Bundle(outputPath, tag string) (string, error) { +func (r *Composer) Bundle(outputPath, tag string) (string, error) { if err := r.ArtifactBuilder.Initialize(r.Injector); err != nil { return "", fmt.Errorf("failed to initialize artifact builder: %w", err) } @@ -84,7 +84,7 @@ func (r *Resources) Bundle(outputPath, tag string) (string, error) { // Push creates and pushes an artifact to a container registry. // It bundles all project files and pushes them to the specified registry with the given tag. // Returns the registry URL or an error. -func (r *Resources) Push(registryBase, repoName, tag string) (string, error) { +func (r *Composer) Push(registryBase, repoName, tag string) (string, error) { if err := r.ArtifactBuilder.Initialize(r.Injector); err != nil { return "", fmt.Errorf("failed to initialize artifact builder: %w", err) } @@ -110,7 +110,7 @@ func (r *Resources) Push(registryBase, repoName, tag string) (string, error) { // for the project. The optional overwrite parameter determines whether existing files // should be overwritten during blueprint processing. This is the main deployment method. // Returns an error if any initialization or processing step fails. -func (r *Resources) Generate(overwrite ...bool) error { +func (r *Composer) Generate(overwrite ...bool) error { shouldOverwrite := false if len(overwrite) > 0 { shouldOverwrite = overwrite[0] @@ -142,9 +142,9 @@ func (r *Resources) Generate(overwrite ...bool) error { // Helper Functions // ============================================================================= -// CreateResources creates a new Resources instance with all dependencies properly initialized. -// This is a convenience function that creates a fully configured Resources +// CreateComposer creates a new Composer instance with all dependencies properly initialized. +// This is a convenience function that creates a fully configured Composer // with the provided execution context. -func CreateResources(ctx *ResourcesExecutionContext) *Resources { - return NewResources(ctx) +func CreateComposer(ctx *ComposerExecutionContext) *Composer { + return NewComposer(ctx) } diff --git a/pkg/resources/resources_test.go b/pkg/composer/composer_test.go similarity index 57% rename from pkg/resources/resources_test.go rename to pkg/composer/composer_test.go index 71ad940ec..8a047607d 100644 --- a/pkg/resources/resources_test.go +++ b/pkg/composer/composer_test.go @@ -1,4 +1,4 @@ -package resources +package composer import ( "testing" @@ -13,8 +13,8 @@ import ( // Test Setup // ============================================================================= -// setupResourcesMocks creates mock components for testing the Resources -func setupResourcesMocks(t *testing.T) *Mocks { +// setupComposerMocks creates mock components for testing the Composer +func setupComposerMocks(t *testing.T) *Mocks { t.Helper() injector := di.NewInjector() @@ -32,86 +32,86 @@ func setupResourcesMocks(t *testing.T) *Mocks { Shell: shell, } - // Create resources execution context - resourcesCtx := &ResourcesExecutionContext{ + // Create composer execution context + composerCtx := &ComposerExecutionContext{ ExecutionContext: *execCtx, } return &Mocks{ - Injector: injector, - ConfigHandler: configHandler, - Shell: shell, - ResourcesExecutionContext: resourcesCtx, + Injector: injector, + ConfigHandler: configHandler, + Shell: shell, + ComposerExecutionContext: composerCtx, } } // Mocks contains all the mock dependencies for testing type Mocks struct { - Injector di.Injector - ConfigHandler config.ConfigHandler - Shell shell.Shell - ResourcesExecutionContext *ResourcesExecutionContext + Injector di.Injector + ConfigHandler config.ConfigHandler + Shell shell.Shell + ComposerExecutionContext *ComposerExecutionContext } // ============================================================================= // Test Constructor // ============================================================================= -func TestNewResources(t *testing.T) { - t.Run("CreatesResourcesWithDependencies", func(t *testing.T) { - mocks := setupResourcesMocks(t) +func TestNewComposer(t *testing.T) { + t.Run("CreatesComposerWithDependencies", func(t *testing.T) { + mocks := setupComposerMocks(t) - resources := NewResources(mocks.ResourcesExecutionContext) + composer := NewComposer(mocks.ComposerExecutionContext) - if resources == nil { - t.Fatal("Expected Resources to be created") + if composer == nil { + t.Fatal("Expected Composer to be created") } - if resources.Injector != mocks.Injector { + if composer.Injector != mocks.Injector { t.Error("Expected injector to be set") } - if resources.Shell != mocks.Shell { + if composer.Shell != mocks.Shell { t.Error("Expected shell to be set") } - if resources.ConfigHandler != mocks.ConfigHandler { + if composer.ConfigHandler != mocks.ConfigHandler { t.Error("Expected config handler to be set") } - if resources.ArtifactBuilder == nil { + if composer.ArtifactBuilder == nil { t.Error("Expected artifact builder to be initialized") } - if resources.BlueprintHandler == nil { + if composer.BlueprintHandler == nil { t.Error("Expected blueprint handler to be initialized") } - if resources.TerraformResolver == nil { + if composer.TerraformResolver == nil { t.Error("Expected terraform resolver to be initialized") } }) } -func TestCreateResources(t *testing.T) { - t.Run("CreatesResourcesWithDependencies", func(t *testing.T) { - mocks := setupResourcesMocks(t) +func TestCreateComposer(t *testing.T) { + t.Run("CreatesComposerWithDependencies", func(t *testing.T) { + mocks := setupComposerMocks(t) - resources := CreateResources(mocks.ResourcesExecutionContext) + composer := CreateComposer(mocks.ComposerExecutionContext) - if resources == nil { - t.Fatal("Expected Resources to be created") + if composer == nil { + t.Fatal("Expected Composer to be created") } - if resources.Injector != mocks.Injector { + if composer.Injector != mocks.Injector { t.Error("Expected injector to be set") } - if resources.ConfigHandler != mocks.ConfigHandler { + if composer.ConfigHandler != mocks.ConfigHandler { t.Error("Expected config handler to be set") } - if resources.Shell != mocks.Shell { + if composer.Shell != mocks.Shell { t.Error("Expected shell to be set") } }) @@ -121,14 +121,14 @@ func TestCreateResources(t *testing.T) { // Test Public Methods // ============================================================================= -func TestResources_Bundle(t *testing.T) { +func TestComposer_Bundle(t *testing.T) { t.Run("HandlesBundleSuccessfully", func(t *testing.T) { - mocks := setupResourcesMocks(t) - resources := NewResources(mocks.ResourcesExecutionContext) + mocks := setupComposerMocks(t) + composer := NewComposer(mocks.ComposerExecutionContext) // This test would need proper mocking of the artifact builder // For now, we'll just test that the method exists and handles errors - _, err := resources.Bundle("/test/output", "v1.0.0") + _, err := composer.Bundle("/test/output", "v1.0.0") // We expect an error here because we don't have proper mocks set up if err == nil { t.Error("Expected error due to missing mocks, but got nil") @@ -136,14 +136,14 @@ func TestResources_Bundle(t *testing.T) { }) } -func TestResources_Push(t *testing.T) { +func TestComposer_Push(t *testing.T) { t.Run("HandlesPushSuccessfully", func(t *testing.T) { - mocks := setupResourcesMocks(t) - resources := NewResources(mocks.ResourcesExecutionContext) + mocks := setupComposerMocks(t) + composer := NewComposer(mocks.ComposerExecutionContext) // This test would need proper mocking of the artifact builder // For now, we'll just test that the method exists and handles errors - _, err := resources.Push("ghcr.io", "test/repo", "latest") + _, err := composer.Push("ghcr.io", "test/repo", "latest") // We expect an error here because we don't have proper mocks set up if err == nil { t.Error("Expected error due to missing mocks, but got nil") @@ -151,14 +151,14 @@ func TestResources_Push(t *testing.T) { }) } -func TestResources_Generate(t *testing.T) { +func TestComposer_Generate(t *testing.T) { t.Run("HandlesGenerateSuccessfully", func(t *testing.T) { - mocks := setupResourcesMocks(t) - resources := NewResources(mocks.ResourcesExecutionContext) + mocks := setupComposerMocks(t) + composer := NewComposer(mocks.ComposerExecutionContext) // This test would need proper mocking of the blueprint handler and terraform resolver // For now, we'll just test that the method exists and handles errors - err := resources.Generate() + err := composer.Generate() // We expect an error here because we don't have proper mocks set up if err == nil { t.Error("Expected error due to missing mocks, but got nil") @@ -166,12 +166,12 @@ func TestResources_Generate(t *testing.T) { }) t.Run("HandlesGenerateWithOverwrite", func(t *testing.T) { - mocks := setupResourcesMocks(t) - resources := NewResources(mocks.ResourcesExecutionContext) + mocks := setupComposerMocks(t) + composer := NewComposer(mocks.ComposerExecutionContext) // This test would need proper mocking of the blueprint handler and terraform resolver // For now, we'll just test that the method exists and handles errors - err := resources.Generate(true) + err := composer.Generate(true) // We expect an error here because we don't have proper mocks set up if err == nil { t.Error("Expected error due to missing mocks, but got nil") @@ -180,11 +180,11 @@ func TestResources_Generate(t *testing.T) { } // ============================================================================= -// Test ResourcesExecutionContext +// Test ComposerExecutionContext // ============================================================================= -func TestResourcesExecutionContext(t *testing.T) { - t.Run("CreatesResourcesExecutionContext", func(t *testing.T) { +func TestComposerExecutionContext(t *testing.T) { + t.Run("CreatesComposerExecutionContext", func(t *testing.T) { execCtx := &context.ExecutionContext{ ContextName: "test-context", ProjectRoot: "/test/project", @@ -192,24 +192,24 @@ func TestResourcesExecutionContext(t *testing.T) { TemplateRoot: "/test/project/contexts/_template", } - resourcesCtx := &ResourcesExecutionContext{ + composerCtx := &ComposerExecutionContext{ ExecutionContext: *execCtx, } - if resourcesCtx.ContextName != "test-context" { - t.Errorf("Expected context name 'test-context', got: %s", resourcesCtx.ContextName) + if composerCtx.ContextName != "test-context" { + t.Errorf("Expected context name 'test-context', got: %s", composerCtx.ContextName) } - if resourcesCtx.ProjectRoot != "/test/project" { - t.Errorf("Expected project root '/test/project', got: %s", resourcesCtx.ProjectRoot) + if composerCtx.ProjectRoot != "/test/project" { + t.Errorf("Expected project root '/test/project', got: %s", composerCtx.ProjectRoot) } - if resourcesCtx.ConfigRoot != "/test/project/contexts/test-context" { - t.Errorf("Expected config root '/test/project/contexts/test-context', got: %s", resourcesCtx.ConfigRoot) + if composerCtx.ConfigRoot != "/test/project/contexts/test-context" { + t.Errorf("Expected config root '/test/project/contexts/test-context', got: %s", composerCtx.ConfigRoot) } - if resourcesCtx.TemplateRoot != "/test/project/contexts/_template" { - t.Errorf("Expected template root '/test/project/contexts/_template', got: %s", resourcesCtx.TemplateRoot) + if composerCtx.TemplateRoot != "/test/project/contexts/_template" { + t.Errorf("Expected template root '/test/project/contexts/_template', got: %s", composerCtx.TemplateRoot) } }) } diff --git a/pkg/resources/terraform/mock_module_resolver.go b/pkg/composer/terraform/mock_module_resolver.go similarity index 100% rename from pkg/resources/terraform/mock_module_resolver.go rename to pkg/composer/terraform/mock_module_resolver.go diff --git a/pkg/resources/terraform/mock_module_resolver_test.go b/pkg/composer/terraform/mock_module_resolver_test.go similarity index 100% rename from pkg/resources/terraform/mock_module_resolver_test.go rename to pkg/composer/terraform/mock_module_resolver_test.go diff --git a/pkg/resources/terraform/module_resolver.go b/pkg/composer/terraform/module_resolver.go similarity index 99% rename from pkg/resources/terraform/module_resolver.go rename to pkg/composer/terraform/module_resolver.go index 0b2a43453..390e3034c 100644 --- a/pkg/resources/terraform/module_resolver.go +++ b/pkg/composer/terraform/module_resolver.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclwrite" "github.com/windsorcli/cli/pkg/di" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/blueprint" "github.com/windsorcli/cli/pkg/context/shell" "github.com/zclconf/go-cty/cty" ) diff --git a/pkg/resources/terraform/module_resolver_test.go b/pkg/composer/terraform/module_resolver_test.go similarity index 99% rename from pkg/resources/terraform/module_resolver_test.go rename to pkg/composer/terraform/module_resolver_test.go index 41581c55d..f3f733ce5 100644 --- a/pkg/resources/terraform/module_resolver_test.go +++ b/pkg/composer/terraform/module_resolver_test.go @@ -14,8 +14,8 @@ import ( blueprintv1alpha1 "github.com/windsorcli/cli/api/v1alpha1" "github.com/windsorcli/cli/pkg/context/config" "github.com/windsorcli/cli/pkg/di" - "github.com/windsorcli/cli/pkg/resources/artifact" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/artifact" + "github.com/windsorcli/cli/pkg/composer/blueprint" "github.com/windsorcli/cli/pkg/context/shell" ) diff --git a/pkg/resources/terraform/oci_module_resolver.go b/pkg/composer/terraform/oci_module_resolver.go similarity index 99% rename from pkg/resources/terraform/oci_module_resolver.go rename to pkg/composer/terraform/oci_module_resolver.go index ff3443309..63b7a765f 100644 --- a/pkg/resources/terraform/oci_module_resolver.go +++ b/pkg/composer/terraform/oci_module_resolver.go @@ -10,8 +10,8 @@ import ( "github.com/briandowns/spinner" blueprintv1alpha1 "github.com/windsorcli/cli/api/v1alpha1" "github.com/windsorcli/cli/pkg/di" - "github.com/windsorcli/cli/pkg/resources/artifact" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/artifact" + "github.com/windsorcli/cli/pkg/composer/blueprint" ) // The OCIModuleResolver is a terraform module resolver for OCI artifact sources. diff --git a/pkg/resources/terraform/oci_module_resolver_test.go b/pkg/composer/terraform/oci_module_resolver_test.go similarity index 99% rename from pkg/resources/terraform/oci_module_resolver_test.go rename to pkg/composer/terraform/oci_module_resolver_test.go index f32b2ca5f..4823e1303 100644 --- a/pkg/resources/terraform/oci_module_resolver_test.go +++ b/pkg/composer/terraform/oci_module_resolver_test.go @@ -10,7 +10,7 @@ import ( blueprintv1alpha1 "github.com/windsorcli/cli/api/v1alpha1" "github.com/windsorcli/cli/pkg/di" - "github.com/windsorcli/cli/pkg/resources/artifact" + "github.com/windsorcli/cli/pkg/composer/artifact" "github.com/windsorcli/cli/pkg/context/shell" ) diff --git a/pkg/resources/terraform/shims.go b/pkg/composer/terraform/shims.go similarity index 100% rename from pkg/resources/terraform/shims.go rename to pkg/composer/terraform/shims.go diff --git a/pkg/resources/terraform/standard_module_resolver.go b/pkg/composer/terraform/standard_module_resolver.go similarity index 99% rename from pkg/resources/terraform/standard_module_resolver.go rename to pkg/composer/terraform/standard_module_resolver.go index c7579075f..695d978d1 100644 --- a/pkg/resources/terraform/standard_module_resolver.go +++ b/pkg/composer/terraform/standard_module_resolver.go @@ -7,7 +7,7 @@ import ( "github.com/windsorcli/cli/pkg/context/config" "github.com/windsorcli/cli/pkg/di" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/blueprint" "github.com/windsorcli/cli/pkg/context/shell" ) diff --git a/pkg/resources/terraform/standard_module_resolver_test.go b/pkg/composer/terraform/standard_module_resolver_test.go similarity index 99% rename from pkg/resources/terraform/standard_module_resolver_test.go rename to pkg/composer/terraform/standard_module_resolver_test.go index 6cd2d6f61..2168ea218 100644 --- a/pkg/resources/terraform/standard_module_resolver_test.go +++ b/pkg/composer/terraform/standard_module_resolver_test.go @@ -11,7 +11,7 @@ import ( blueprintv1alpha1 "github.com/windsorcli/cli/api/v1alpha1" "github.com/windsorcli/cli/pkg/context/config" "github.com/windsorcli/cli/pkg/di" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/blueprint" "github.com/windsorcli/cli/pkg/context/shell" ) diff --git a/pkg/context/env/terraform_env_test.go b/pkg/context/env/terraform_env_test.go index 37624897a..1efb606aa 100644 --- a/pkg/context/env/terraform_env_test.go +++ b/pkg/context/env/terraform_env_test.go @@ -11,7 +11,7 @@ import ( blueprintv1alpha1 "github.com/windsorcli/cli/api/v1alpha1" "github.com/windsorcli/cli/pkg/context/config" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/blueprint" ) // ============================================================================= diff --git a/pkg/generators/generator.go b/pkg/generators/generator.go index 27d083845..963adf148 100644 --- a/pkg/generators/generator.go +++ b/pkg/generators/generator.go @@ -5,8 +5,8 @@ import ( "github.com/windsorcli/cli/pkg/context/config" "github.com/windsorcli/cli/pkg/di" - bundler "github.com/windsorcli/cli/pkg/resources/artifact" - "github.com/windsorcli/cli/pkg/resources/blueprint" + bundler "github.com/windsorcli/cli/pkg/composer/artifact" + "github.com/windsorcli/cli/pkg/composer/blueprint" "github.com/windsorcli/cli/pkg/context/shell" ) diff --git a/pkg/generators/generator_test.go b/pkg/generators/generator_test.go index 38cda89a3..76c4d5afc 100644 --- a/pkg/generators/generator_test.go +++ b/pkg/generators/generator_test.go @@ -11,8 +11,8 @@ import ( blueprintv1alpha1 "github.com/windsorcli/cli/api/v1alpha1" "github.com/windsorcli/cli/pkg/context/config" "github.com/windsorcli/cli/pkg/di" - bundler "github.com/windsorcli/cli/pkg/resources/artifact" - "github.com/windsorcli/cli/pkg/resources/blueprint" + bundler "github.com/windsorcli/cli/pkg/composer/artifact" + "github.com/windsorcli/cli/pkg/composer/blueprint" "github.com/windsorcli/cli/pkg/context/shell" ) diff --git a/pkg/generators/terraform_generator_test.go b/pkg/generators/terraform_generator_test.go index 0571ab77a..e8a536f3c 100644 --- a/pkg/generators/terraform_generator_test.go +++ b/pkg/generators/terraform_generator_test.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/hcl/v2/hclwrite" blueprintv1alpha1 "github.com/windsorcli/cli/api/v1alpha1" "github.com/windsorcli/cli/pkg/context/config" - bundler "github.com/windsorcli/cli/pkg/resources/artifact" + bundler "github.com/windsorcli/cli/pkg/composer/artifact" "github.com/zclconf/go-cty/cty" ) diff --git a/pkg/pipelines/down.go b/pkg/pipelines/down.go index 7f172ff08..9907306a7 100644 --- a/pkg/pipelines/down.go +++ b/pkg/pipelines/down.go @@ -11,7 +11,7 @@ import ( "github.com/windsorcli/cli/pkg/provisioner/kubernetes" k8sclient "github.com/windsorcli/cli/pkg/provisioner/kubernetes/client" terraforminfra "github.com/windsorcli/cli/pkg/provisioner/terraform" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/blueprint" "github.com/windsorcli/cli/pkg/context/shell" "github.com/windsorcli/cli/pkg/workstation/network" "github.com/windsorcli/cli/pkg/workstation/virt" diff --git a/pkg/pipelines/down_test.go b/pkg/pipelines/down_test.go index 63f2fd31e..a5ae3a83e 100644 --- a/pkg/pipelines/down_test.go +++ b/pkg/pipelines/down_test.go @@ -12,7 +12,7 @@ import ( envvars "github.com/windsorcli/cli/pkg/context/env" "github.com/windsorcli/cli/pkg/provisioner/kubernetes" terraforminfra "github.com/windsorcli/cli/pkg/provisioner/terraform" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/blueprint" "github.com/windsorcli/cli/pkg/context/shell" "github.com/windsorcli/cli/pkg/workstation/network" "github.com/windsorcli/cli/pkg/workstation/virt" diff --git a/pkg/pipelines/init.go b/pkg/pipelines/init.go index ac1fcc6d8..a30f64543 100644 --- a/pkg/pipelines/init.go +++ b/pkg/pipelines/init.go @@ -16,9 +16,9 @@ import ( "github.com/windsorcli/cli/pkg/di" "github.com/windsorcli/cli/pkg/generators" terraforminfra "github.com/windsorcli/cli/pkg/provisioner/terraform" - "github.com/windsorcli/cli/pkg/resources/artifact" - "github.com/windsorcli/cli/pkg/resources/blueprint" - "github.com/windsorcli/cli/pkg/resources/terraform" + "github.com/windsorcli/cli/pkg/composer/artifact" + "github.com/windsorcli/cli/pkg/composer/blueprint" + "github.com/windsorcli/cli/pkg/composer/terraform" "github.com/windsorcli/cli/pkg/workstation/network" "github.com/windsorcli/cli/pkg/workstation/services" "github.com/windsorcli/cli/pkg/workstation/virt" diff --git a/pkg/pipelines/init_test.go b/pkg/pipelines/init_test.go index d982d10e3..2692ec8bd 100644 --- a/pkg/pipelines/init_test.go +++ b/pkg/pipelines/init_test.go @@ -14,8 +14,8 @@ import ( "github.com/windsorcli/cli/pkg/context/tools" "github.com/windsorcli/cli/pkg/provisioner/kubernetes" terraforminfra "github.com/windsorcli/cli/pkg/provisioner/terraform" - "github.com/windsorcli/cli/pkg/resources/artifact" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/artifact" + "github.com/windsorcli/cli/pkg/composer/blueprint" "github.com/windsorcli/cli/pkg/context/shell" "github.com/windsorcli/cli/pkg/workstation/virt" ) diff --git a/pkg/pipelines/install.go b/pkg/pipelines/install.go index 73142e2bb..485e3ff3b 100644 --- a/pkg/pipelines/install.go +++ b/pkg/pipelines/install.go @@ -6,8 +6,8 @@ import ( "github.com/windsorcli/cli/pkg/di" "github.com/windsorcli/cli/pkg/generators" - "github.com/windsorcli/cli/pkg/resources/artifact" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/artifact" + "github.com/windsorcli/cli/pkg/composer/blueprint" ) // The InstallPipeline is a specialized component that manages blueprint installation functionality. diff --git a/pkg/pipelines/install_test.go b/pkg/pipelines/install_test.go index 9ac314644..8df3c16ff 100644 --- a/pkg/pipelines/install_test.go +++ b/pkg/pipelines/install_test.go @@ -8,8 +8,8 @@ import ( "github.com/windsorcli/cli/pkg/context/config" "github.com/windsorcli/cli/pkg/di" - "github.com/windsorcli/cli/pkg/resources/artifact" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/artifact" + "github.com/windsorcli/cli/pkg/composer/blueprint" ) // ============================================================================= diff --git a/pkg/pipelines/pipeline.go b/pkg/pipelines/pipeline.go index 2a1734b46..8c0ed9c6b 100644 --- a/pkg/pipelines/pipeline.go +++ b/pkg/pipelines/pipeline.go @@ -17,9 +17,9 @@ import ( "github.com/windsorcli/cli/pkg/provisioner/kubernetes" k8sclient "github.com/windsorcli/cli/pkg/provisioner/kubernetes/client" terraforminfra "github.com/windsorcli/cli/pkg/provisioner/terraform" - "github.com/windsorcli/cli/pkg/resources/artifact" - "github.com/windsorcli/cli/pkg/resources/blueprint" - "github.com/windsorcli/cli/pkg/resources/terraform" + "github.com/windsorcli/cli/pkg/composer/artifact" + "github.com/windsorcli/cli/pkg/composer/blueprint" + "github.com/windsorcli/cli/pkg/composer/terraform" "github.com/windsorcli/cli/pkg/context/secrets" "github.com/windsorcli/cli/pkg/context/shell" "github.com/windsorcli/cli/pkg/context/shell/ssh" diff --git a/pkg/pipelines/pipeline_test.go b/pkg/pipelines/pipeline_test.go index 0c9e9afe0..bf95ea36b 100644 --- a/pkg/pipelines/pipeline_test.go +++ b/pkg/pipelines/pipeline_test.go @@ -20,8 +20,8 @@ import ( "github.com/windsorcli/cli/pkg/provisioner/kubernetes" k8sclient "github.com/windsorcli/cli/pkg/provisioner/kubernetes/client" terraforminfra "github.com/windsorcli/cli/pkg/provisioner/terraform" - "github.com/windsorcli/cli/pkg/resources/artifact" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/artifact" + "github.com/windsorcli/cli/pkg/composer/blueprint" "github.com/windsorcli/cli/pkg/context/shell" "github.com/windsorcli/cli/pkg/workstation/virt" ) diff --git a/pkg/provisioner/terraform/stack.go b/pkg/provisioner/terraform/stack.go index bc86ca4db..120cb3fb4 100644 --- a/pkg/provisioner/terraform/stack.go +++ b/pkg/provisioner/terraform/stack.go @@ -19,7 +19,7 @@ import ( envvars "github.com/windsorcli/cli/pkg/context/env" "github.com/windsorcli/cli/pkg/context/shell" "github.com/windsorcli/cli/pkg/di" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/blueprint" ) // ============================================================================= diff --git a/pkg/provisioner/terraform/stack_test.go b/pkg/provisioner/terraform/stack_test.go index d3367955a..32ccf63f7 100644 --- a/pkg/provisioner/terraform/stack_test.go +++ b/pkg/provisioner/terraform/stack_test.go @@ -16,7 +16,7 @@ import ( "github.com/windsorcli/cli/pkg/context/config" "github.com/windsorcli/cli/pkg/di" envvars "github.com/windsorcli/cli/pkg/context/env" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/blueprint" "github.com/windsorcli/cli/pkg/context/shell" ) diff --git a/pkg/runtime/runtime.go b/pkg/runtime/runtime.go index 43f157ab7..0acf8b2f8 100644 --- a/pkg/runtime/runtime.go +++ b/pkg/runtime/runtime.go @@ -16,9 +16,9 @@ import ( "github.com/windsorcli/cli/pkg/generators" "github.com/windsorcli/cli/pkg/provisioner/cluster" "github.com/windsorcli/cli/pkg/provisioner/kubernetes" - "github.com/windsorcli/cli/pkg/resources/artifact" - "github.com/windsorcli/cli/pkg/resources/blueprint" - "github.com/windsorcli/cli/pkg/resources/terraform" + "github.com/windsorcli/cli/pkg/composer/artifact" + "github.com/windsorcli/cli/pkg/composer/blueprint" + "github.com/windsorcli/cli/pkg/composer/terraform" "github.com/windsorcli/cli/pkg/workstation" "github.com/windsorcli/cli/pkg/workstation/network" "github.com/windsorcli/cli/pkg/workstation/services" diff --git a/pkg/runtime/runtime_loaders.go b/pkg/runtime/runtime_loaders.go index 30ff6de86..aea6295a9 100644 --- a/pkg/runtime/runtime_loaders.go +++ b/pkg/runtime/runtime_loaders.go @@ -12,7 +12,7 @@ import ( "github.com/windsorcli/cli/pkg/provisioner/cluster" "github.com/windsorcli/cli/pkg/provisioner/kubernetes" k8sclient "github.com/windsorcli/cli/pkg/provisioner/kubernetes/client" - "github.com/windsorcli/cli/pkg/resources/blueprint" + "github.com/windsorcli/cli/pkg/composer/blueprint" "github.com/windsorcli/cli/pkg/context/secrets" "github.com/windsorcli/cli/pkg/context/shell" )