Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"testing"

"github.com/spf13/cobra"
"github.com/windsorcli/cli/pkg/artifact"
"github.com/windsorcli/cli/pkg/blueprint"
"github.com/windsorcli/cli/pkg/config"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/kubernetes"
"github.com/windsorcli/cli/pkg/resources/artifact"
"github.com/windsorcli/cli/pkg/resources/blueprint"
"github.com/windsorcli/cli/pkg/shell"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"testing"

"github.com/spf13/cobra"
"github.com/windsorcli/cli/pkg/artifact"
"github.com/windsorcli/cli/pkg/blueprint"
"github.com/windsorcli/cli/pkg/config"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/kubernetes"
"github.com/windsorcli/cli/pkg/resources/artifact"
"github.com/windsorcli/cli/pkg/resources/blueprint"
"github.com/windsorcli/cli/pkg/shell"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"testing"

"github.com/spf13/cobra"
blueprintpkg "github.com/windsorcli/cli/pkg/blueprint"
"github.com/windsorcli/cli/pkg/config"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/environment/envvars"
"github.com/windsorcli/cli/pkg/kubernetes"
blueprintpkg "github.com/windsorcli/cli/pkg/resources/blueprint"
"github.com/windsorcli/cli/pkg/secrets"
"github.com/windsorcli/cli/pkg/shell"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/environment/envvars/terraform_env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"testing"

blueprintv1alpha1 "github.com/windsorcli/cli/api/v1alpha1"
"github.com/windsorcli/cli/pkg/blueprint"
"github.com/windsorcli/cli/pkg/config"
"github.com/windsorcli/cli/pkg/resources/blueprint"
)

// =============================================================================
Expand Down
4 changes: 2 additions & 2 deletions pkg/generators/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package generators
import (
"fmt"

bundler "github.com/windsorcli/cli/pkg/artifact"
"github.com/windsorcli/cli/pkg/blueprint"
"github.com/windsorcli/cli/pkg/config"
"github.com/windsorcli/cli/pkg/di"
bundler "github.com/windsorcli/cli/pkg/resources/artifact"
"github.com/windsorcli/cli/pkg/resources/blueprint"
"github.com/windsorcli/cli/pkg/shell"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/generators/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"testing"

blueprintv1alpha1 "github.com/windsorcli/cli/api/v1alpha1"
bundler "github.com/windsorcli/cli/pkg/artifact"
"github.com/windsorcli/cli/pkg/blueprint"
"github.com/windsorcli/cli/pkg/config"
"github.com/windsorcli/cli/pkg/di"
bundler "github.com/windsorcli/cli/pkg/resources/artifact"
"github.com/windsorcli/cli/pkg/resources/blueprint"
"github.com/windsorcli/cli/pkg/shell"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/generators/terraform_generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (

"github.com/hashicorp/hcl/v2/hclwrite"
blueprintv1alpha1 "github.com/windsorcli/cli/api/v1alpha1"
bundler "github.com/windsorcli/cli/pkg/artifact"
"github.com/windsorcli/cli/pkg/config"
bundler "github.com/windsorcli/cli/pkg/resources/artifact"
"github.com/zclconf/go-cty/cty"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/pipelines/down.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os"
"path/filepath"

"github.com/windsorcli/cli/pkg/blueprint"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/environment/envvars"
"github.com/windsorcli/cli/pkg/kubernetes"
"github.com/windsorcli/cli/pkg/resources/blueprint"
"github.com/windsorcli/cli/pkg/shell"
"github.com/windsorcli/cli/pkg/stack"
"github.com/windsorcli/cli/pkg/workstation/network"
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipelines/down_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"strings"
"testing"

"github.com/windsorcli/cli/pkg/blueprint"
"github.com/windsorcli/cli/pkg/config"
"github.com/windsorcli/cli/pkg/environment/envvars"
"github.com/windsorcli/cli/pkg/kubernetes"
"github.com/windsorcli/cli/pkg/resources/blueprint"
"github.com/windsorcli/cli/pkg/shell"
"github.com/windsorcli/cli/pkg/stack"
"github.com/windsorcli/cli/pkg/workstation/network"
Expand Down
6 changes: 3 additions & 3 deletions pkg/pipelines/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import (
"runtime"
"strings"

"github.com/windsorcli/cli/pkg/artifact"
"github.com/windsorcli/cli/pkg/blueprint"
"github.com/windsorcli/cli/pkg/config"
"github.com/windsorcli/cli/pkg/constants"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/environment/envvars"
"github.com/windsorcli/cli/pkg/environment/tools"
"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/resources/terraform"
"github.com/windsorcli/cli/pkg/shell"
"github.com/windsorcli/cli/pkg/stack"
"github.com/windsorcli/cli/pkg/terraform"
"github.com/windsorcli/cli/pkg/workstation/network"
"github.com/windsorcli/cli/pkg/workstation/services"
"github.com/windsorcli/cli/pkg/workstation/virt"
Expand Down
4 changes: 2 additions & 2 deletions pkg/pipelines/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"time"

"github.com/windsorcli/cli/api/v1alpha1"
"github.com/windsorcli/cli/pkg/artifact"
"github.com/windsorcli/cli/pkg/blueprint"
"github.com/windsorcli/cli/pkg/config"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/environment/tools"
"github.com/windsorcli/cli/pkg/kubernetes"
"github.com/windsorcli/cli/pkg/resources/artifact"
"github.com/windsorcli/cli/pkg/resources/blueprint"
"github.com/windsorcli/cli/pkg/shell"
"github.com/windsorcli/cli/pkg/stack"
"github.com/windsorcli/cli/pkg/workstation/virt"
Expand Down
4 changes: 2 additions & 2 deletions pkg/pipelines/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"context"
"fmt"

"github.com/windsorcli/cli/pkg/artifact"
"github.com/windsorcli/cli/pkg/blueprint"
"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"
)

// The InstallPipeline is a specialized component that manages blueprint installation functionality.
Expand Down
4 changes: 2 additions & 2 deletions pkg/pipelines/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"strings"
"testing"

"github.com/windsorcli/cli/pkg/artifact"
"github.com/windsorcli/cli/pkg/blueprint"
"github.com/windsorcli/cli/pkg/config"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/resources/artifact"
"github.com/windsorcli/cli/pkg/resources/blueprint"
)

// =============================================================================
Expand Down
6 changes: 3 additions & 3 deletions pkg/pipelines/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"path/filepath"

secretsConfigType "github.com/windsorcli/cli/api/v1alpha1/secrets"
"github.com/windsorcli/cli/pkg/artifact"
"github.com/windsorcli/cli/pkg/blueprint"
"github.com/windsorcli/cli/pkg/cluster"
"github.com/windsorcli/cli/pkg/config"
"github.com/windsorcli/cli/pkg/constants"
Expand All @@ -17,11 +15,13 @@ import (
"github.com/windsorcli/cli/pkg/environment/tools"
"github.com/windsorcli/cli/pkg/generators"
"github.com/windsorcli/cli/pkg/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/secrets"
"github.com/windsorcli/cli/pkg/shell"
"github.com/windsorcli/cli/pkg/shell/ssh"
"github.com/windsorcli/cli/pkg/stack"
"github.com/windsorcli/cli/pkg/terraform"
"github.com/windsorcli/cli/pkg/workstation/network"
"github.com/windsorcli/cli/pkg/workstation/services"
"github.com/windsorcli/cli/pkg/workstation/virt"
Expand Down
4 changes: 2 additions & 2 deletions pkg/pipelines/pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import (
"github.com/windsorcli/cli/api/v1alpha1"
"github.com/windsorcli/cli/api/v1alpha1/docker"
secretsConfigType "github.com/windsorcli/cli/api/v1alpha1/secrets"
"github.com/windsorcli/cli/pkg/artifact"
"github.com/windsorcli/cli/pkg/blueprint"
"github.com/windsorcli/cli/pkg/cluster"
"github.com/windsorcli/cli/pkg/config"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/environment/envvars"
"github.com/windsorcli/cli/pkg/environment/tools"
"github.com/windsorcli/cli/pkg/kubernetes"
"github.com/windsorcli/cli/pkg/resources/artifact"
"github.com/windsorcli/cli/pkg/resources/blueprint"
"github.com/windsorcli/cli/pkg/shell"
"github.com/windsorcli/cli/pkg/stack"
"github.com/windsorcli/cli/pkg/workstation/virt"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
_ "embed"

"github.com/goccy/go-yaml"
"github.com/windsorcli/cli/pkg/artifact"
"github.com/windsorcli/cli/pkg/config"
"github.com/windsorcli/cli/pkg/constants"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/kubernetes"
"github.com/windsorcli/cli/pkg/resources/artifact"
"github.com/windsorcli/cli/pkg/shell"

"github.com/briandowns/spinner"
Expand Down Expand Up @@ -58,6 +58,7 @@ type BlueprintHandler interface {
WaitForKustomizations(message string, names ...string) error
GetDefaultTemplateData(contextName string) (map[string][]byte, error)
GetLocalTemplateData() (map[string][]byte, error)
Generate() *blueprintv1alpha1.Blueprint
Down() error
}

Expand Down Expand Up @@ -518,6 +519,54 @@ func (b *BaseBlueprintHandler) GetKustomizations() []blueprintv1alpha1.Kustomiza
return kustomizations
}

// Generate returns the fully processed blueprint with all defaults resolved,
// paths processed, and generation logic applied - equivalent to what would be deployed.
// It applies the same processing logic as GetKustomizations() but for the entire blueprint structure.
func (b *BaseBlueprintHandler) Generate() *blueprintv1alpha1.Blueprint {
generated := b.blueprint.DeepCopy()

// Process kustomizations with the same logic as GetKustomizations()
for i := range generated.Kustomizations {
if generated.Kustomizations[i].Source == "" {
generated.Kustomizations[i].Source = generated.Metadata.Name
}

if generated.Kustomizations[i].Path == "" {
generated.Kustomizations[i].Path = "kustomize"
} else {
generated.Kustomizations[i].Path = "kustomize/" + strings.ReplaceAll(generated.Kustomizations[i].Path, "\\", "/")
}

if generated.Kustomizations[i].Interval == nil || generated.Kustomizations[i].Interval.Duration == 0 {
generated.Kustomizations[i].Interval = &metav1.Duration{Duration: constants.DEFAULT_FLUX_KUSTOMIZATION_INTERVAL}
}
if generated.Kustomizations[i].RetryInterval == nil || generated.Kustomizations[i].RetryInterval.Duration == 0 {
generated.Kustomizations[i].RetryInterval = &metav1.Duration{Duration: constants.DEFAULT_FLUX_KUSTOMIZATION_RETRY_INTERVAL}
}
if generated.Kustomizations[i].Timeout == nil || generated.Kustomizations[i].Timeout.Duration == 0 {
generated.Kustomizations[i].Timeout = &metav1.Duration{Duration: constants.DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT}
}
if generated.Kustomizations[i].Wait == nil {
defaultWait := constants.DEFAULT_FLUX_KUSTOMIZATION_WAIT
generated.Kustomizations[i].Wait = &defaultWait
}
if generated.Kustomizations[i].Force == nil {
defaultForce := constants.DEFAULT_FLUX_KUSTOMIZATION_FORCE
generated.Kustomizations[i].Force = &defaultForce
}
if generated.Kustomizations[i].Destroy == nil {
defaultDestroy := true
generated.Kustomizations[i].Destroy = &defaultDestroy
}
}

// Process terraform components with source resolution
b.resolveComponentSources(generated)
b.resolveComponentPaths(generated)

return generated
}

// SetRenderedKustomizeData stores rendered kustomize data for use during install.
// This includes values and patches from template processing that should be composed with user-defined files.
func (b *BaseBlueprintHandler) SetRenderedKustomizeData(data map[string]any) {
Expand Down
Loading
Loading