Skip to content

Commit

Permalink
create the data directory before the cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
colesnodgrass committed Jul 8, 2024
1 parent 863a97f commit 73ab2d0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/cmd/local/k8s/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 73ab2d0

Please sign in to comment.