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 @@ -10,11 +10,11 @@ import (

"github.com/spf13/cobra"
"github.com/windsorcli/cli/pkg/context/config"
"github.com/windsorcli/cli/pkg/context/shell"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/infrastructure/kubernetes"
"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/context/shell"
)

// =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion cmd/push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/spf13/cobra"
"github.com/windsorcli/cli/pkg/context/config"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/infrastructure/kubernetes"
"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/context/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 @@ -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/infrastructure/kubernetes"
"github.com/windsorcli/cli/pkg/provisioner/kubernetes"
blueprintpkg "github.com/windsorcli/cli/pkg/resources/blueprint"
"github.com/windsorcli/cli/pkg/context/secrets"
"github.com/windsorcli/cli/pkg/context/shell"
Expand Down
4 changes: 2 additions & 2 deletions pkg/pipelines/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/context/tools"
"github.com/windsorcli/cli/pkg/infrastructure/cluster"
"github.com/windsorcli/cli/pkg/infrastructure/kubernetes"
"github.com/windsorcli/cli/pkg/provisioner/cluster"
"github.com/windsorcli/cli/pkg/provisioner/kubernetes"
)

// The CheckPipeline is a specialized component that manages tool version checking and node health checking functionality.
Expand Down
4 changes: 2 additions & 2 deletions pkg/pipelines/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/windsorcli/cli/pkg/context/config"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/context/tools"
"github.com/windsorcli/cli/pkg/infrastructure/cluster"
"github.com/windsorcli/cli/pkg/infrastructure/kubernetes"
"github.com/windsorcli/cli/pkg/provisioner/cluster"
"github.com/windsorcli/cli/pkg/provisioner/kubernetes"
"github.com/windsorcli/cli/pkg/context/shell"
)

Expand Down
7 changes: 4 additions & 3 deletions pkg/pipelines/down.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import (

"github.com/windsorcli/cli/pkg/di"
envvars "github.com/windsorcli/cli/pkg/context/env"
"github.com/windsorcli/cli/pkg/infrastructure/kubernetes"
terraforminfra "github.com/windsorcli/cli/pkg/infrastructure/terraform"
"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/context/shell"
"github.com/windsorcli/cli/pkg/workstation/network"
Expand All @@ -33,7 +34,7 @@ type DownPipeline struct {
networkManager network.NetworkManager
stack terraforminfra.Stack
blueprintHandler blueprint.BlueprintHandler
kubernetesClient kubernetes.KubernetesClient
kubernetesClient k8sclient.KubernetesClient
kubernetesManager kubernetes.KubernetesManager
envPrinters []envvars.EnvPrinter
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/pipelines/down_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
blueprintv1alpha1 "github.com/windsorcli/cli/api/v1alpha1"
"github.com/windsorcli/cli/pkg/context/config"
envvars "github.com/windsorcli/cli/pkg/context/env"
"github.com/windsorcli/cli/pkg/infrastructure/kubernetes"
terraforminfra "github.com/windsorcli/cli/pkg/infrastructure/terraform"
"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/context/shell"
"github.com/windsorcli/cli/pkg/workstation/network"
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipelines/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/windsorcli/cli/pkg/context/tools"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/generators"
terraforminfra "github.com/windsorcli/cli/pkg/infrastructure/terraform"
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"
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 @@ -12,8 +12,8 @@ import (
"github.com/windsorcli/cli/pkg/context/config"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/context/tools"
"github.com/windsorcli/cli/pkg/infrastructure/kubernetes"
terraforminfra "github.com/windsorcli/cli/pkg/infrastructure/terraform"
"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/context/shell"
Expand Down
13 changes: 7 additions & 6 deletions pkg/pipelines/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import (
envpkg "github.com/windsorcli/cli/pkg/context/env"
"github.com/windsorcli/cli/pkg/context/tools"
"github.com/windsorcli/cli/pkg/generators"
"github.com/windsorcli/cli/pkg/infrastructure/cluster"
"github.com/windsorcli/cli/pkg/infrastructure/kubernetes"
terraforminfra "github.com/windsorcli/cli/pkg/infrastructure/terraform"
"github.com/windsorcli/cli/pkg/provisioner/cluster"
"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"
Expand Down Expand Up @@ -345,14 +346,14 @@ func (p *BasePipeline) withContainerRuntime() virt.ContainerRuntime {
}

// withKubernetesClient resolves or creates kubernetes client from DI container
func (p *BasePipeline) withKubernetesClient() kubernetes.KubernetesClient {
func (p *BasePipeline) withKubernetesClient() k8sclient.KubernetesClient {
if existing := p.injector.Resolve("kubernetesClient"); existing != nil {
if kubernetesClient, ok := existing.(kubernetes.KubernetesClient); ok {
if kubernetesClient, ok := existing.(k8sclient.KubernetesClient); ok {
return kubernetesClient
}
}

kubernetesClient := kubernetes.NewDynamicKubernetesClient()
kubernetesClient := k8sclient.NewDynamicKubernetesClient()
p.injector.Register("kubernetesClient", kubernetesClient)
return kubernetesClient
}
Expand Down
9 changes: 5 additions & 4 deletions pkg/pipelines/pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import (
"github.com/windsorcli/cli/pkg/di"
envvars "github.com/windsorcli/cli/pkg/context/env"
"github.com/windsorcli/cli/pkg/context/tools"
"github.com/windsorcli/cli/pkg/infrastructure/cluster"
"github.com/windsorcli/cli/pkg/infrastructure/kubernetes"
terraforminfra "github.com/windsorcli/cli/pkg/infrastructure/terraform"
"github.com/windsorcli/cli/pkg/provisioner/cluster"
"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/context/shell"
Expand Down Expand Up @@ -1995,7 +1996,7 @@ func TestBasePipeline_withKubernetesClient(t *testing.T) {
t.Run("ReusesExistingKubernetesClientWhenRegistered", func(t *testing.T) {
// Given a pipeline with existing kubernetes client
pipeline, _ := setup(t)
existingClient := kubernetes.NewDynamicKubernetesClient()
existingClient := k8sclient.NewDynamicKubernetesClient()
pipeline.injector.Register("kubernetesClient", existingClient)

// When getting kubernetes client
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipelines/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/windsorcli/cli/pkg/di"
envvars "github.com/windsorcli/cli/pkg/context/env"
"github.com/windsorcli/cli/pkg/context/tools"
terraforminfra "github.com/windsorcli/cli/pkg/infrastructure/terraform"
terraforminfra "github.com/windsorcli/cli/pkg/provisioner/terraform"
"github.com/windsorcli/cli/pkg/context/shell"
"github.com/windsorcli/cli/pkg/workstation/network"
"github.com/windsorcli/cli/pkg/workstation/virt"
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipelines/up_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/windsorcli/cli/pkg/context/config"
envvars "github.com/windsorcli/cli/pkg/context/env"
"github.com/windsorcli/cli/pkg/context/tools"
terraforminfra "github.com/windsorcli/cli/pkg/infrastructure/terraform"
terraforminfra "github.com/windsorcli/cli/pkg/provisioner/terraform"
"github.com/windsorcli/cli/pkg/context/shell"
"github.com/windsorcli/cli/pkg/workstation/network"
"github.com/windsorcli/cli/pkg/workstation/virt"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Package kubernetes provides Kubernetes resource management functionality
// Package client provides Kubernetes client functionality for resource operations.
// It implements server-side apply patterns for managing Kubernetes resources
// and provides a clean interface for kustomization and resource management
// and provides a clean interface for Kubernetes resource management.

package kubernetes
package client

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Package kubernetes provides Kubernetes resource management functionality
// Package client provides Kubernetes client functionality for resource operations.
// It implements server-side apply patterns for managing Kubernetes resources
// and provides a clean interface for kustomization and resource management
// and provides a clean interface for Kubernetes resource management.

package kubernetes
package client

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kubernetes
package client

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
blueprintv1alpha1 "github.com/windsorcli/cli/api/v1alpha1"
"github.com/windsorcli/cli/pkg/constants"
"github.com/windsorcli/cli/pkg/di"
"github.com/windsorcli/cli/pkg/provisioner/kubernetes/client"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -60,7 +61,7 @@ type KubernetesManager interface {
type BaseKubernetesManager struct {
injector di.Injector
shims *Shims
client KubernetesClient
client client.KubernetesClient

kustomizationWaitPollInterval time.Duration
kustomizationReconcileTimeout time.Duration
Expand All @@ -84,11 +85,11 @@ func NewKubernetesManager(injector di.Injector) *BaseKubernetesManager {

// Initialize sets up the BaseKubernetesManager by resolving dependencies
func (k *BaseKubernetesManager) Initialize() error {
client, ok := k.injector.Resolve("kubernetesClient").(KubernetesClient)
kubernetesClient, ok := k.injector.Resolve("kubernetesClient").(client.KubernetesClient)
if !ok {
return fmt.Errorf("error resolving kubernetesClient")
}
k.client = client
k.client = kubernetesClient
return nil
}

Expand Down
Loading
Loading