diff --git a/internal/cmd/local/k8s/cluster.go b/internal/cmd/local/k8s/cluster.go index 0ed7a09..c2fcea3 100644 --- a/internal/cmd/local/k8s/cluster.go +++ b/internal/cmd/local/k8s/cluster.go @@ -3,6 +3,8 @@ package k8s import ( "fmt" "github.com/airbytehq/abctl/internal/cmd/local/paths" + "github.com/pterm/pterm" + "os" "sigs.k8s.io/kind/pkg/cluster" "time" ) @@ -32,6 +34,12 @@ type kindCluster struct { const k8sVersion = "v1.29.1" func (k *kindCluster) Create(port int) error { + pterm.Debug.Println(fmt.Sprintf("Creating data directory '%s'", paths.Data)) + if err := os.MkdirAll(paths.Data, 0755); err != nil { + pterm.Error.Println(fmt.Sprintf("Error creating data directory '%s'", paths.Data)) + return fmt.Errorf("unable to create directory '%s': %w", paths.Data, err) + } + // see https://kind.sigs.k8s.io/docs/user/ingress/#create-cluster rawCfg := fmt.Sprintf(`kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4