Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: styles json #1868

Merged
merged 5 commits into from
Oct 24, 2023
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
12 changes: 6 additions & 6 deletions cmd/aws/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func Create() *cobra.Command {
Short: "create the kubefirst platform running in aws",
TraverseChildren: true,
RunE: createAws,
PreRun: common.CheckDocker,
// PreRun: common.CheckDocker,
}

// todo review defaults and update descriptions
Expand All @@ -88,11 +88,11 @@ func Create() *cobra.Command {

func Destroy() *cobra.Command {
destroyCmd := &cobra.Command{
Use: "destroy",
Short: "destroy the kubefirst platform",
Long: "deletes the GitHub resources, aws resources, and local content to re-provision",
RunE: common.Destroy,
PreRun: common.CheckDocker,
Use: "destroy",
Short: "destroy the kubefirst platform",
Long: "deletes the GitHub resources, aws resources, and local content to re-provision",
RunE: common.Destroy,
// PreRun: common.CheckDocker,
}

return destroyCmd
Expand Down
12 changes: 6 additions & 6 deletions cmd/civo/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func Create() *cobra.Command {
Short: "create the kubefirst platform running on civo kubernetes",
TraverseChildren: true,
RunE: createCivo,
PreRun: common.CheckDocker,
// PreRun: common.CheckDocker,
}

// todo review defaults and update descriptions
Expand All @@ -98,11 +98,11 @@ func Create() *cobra.Command {

func Destroy() *cobra.Command {
destroyCmd := &cobra.Command{
Use: "destroy",
Short: "destroy the kubefirst platform",
Long: "destroy the kubefirst platform running in civo and remove all resources",
RunE: common.Destroy,
PreRun: common.CheckDocker,
Use: "destroy",
Short: "destroy the kubefirst platform",
Long: "destroy the kubefirst platform running in civo and remove all resources",
RunE: common.Destroy,
// PreRun: common.CheckDocker,
}

return destroyCmd
Expand Down
12 changes: 6 additions & 6 deletions cmd/digitalocean/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func Create() *cobra.Command {
Short: "create the kubefirst platform running on DigitalOcean Kubernetes",
TraverseChildren: true,
RunE: createDigitalocean,
PreRun: common.CheckDocker,
// PreRun: common.CheckDocker,
}

// todo review defaults and update descriptions
Expand All @@ -90,11 +90,11 @@ func Create() *cobra.Command {

func Destroy() *cobra.Command {
destroyCmd := &cobra.Command{
Use: "destroy",
Short: "destroy the kubefirst platform",
Long: "destroy the kubefirst platform running in DigitalOcean and remove all resources",
RunE: common.Destroy,
PreRun: common.CheckDocker,
Use: "destroy",
Short: "destroy the kubefirst platform",
Long: "destroy the kubefirst platform running in DigitalOcean and remove all resources",
RunE: common.Destroy,
// PreRun: common.CheckDocker,
}

return destroyCmd
Expand Down
12 changes: 6 additions & 6 deletions cmd/google/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func Create() *cobra.Command {
Short: "create the kubefirst platform running on GCP kubernetes",
TraverseChildren: true,
RunE: createGoogle,
PreRun: common.CheckDocker,
// PreRun: common.CheckDocker,
}

// todo review defaults and update descriptions
Expand Down Expand Up @@ -95,11 +95,11 @@ func Create() *cobra.Command {

func Destroy() *cobra.Command {
destroyCmd := &cobra.Command{
Use: "destroy",
Short: "destroy the kubefirst platform",
Long: "destroy the kubefirst platform running in Goole and remove all resources",
RunE: common.Destroy,
PreRun: common.CheckDocker,
Use: "destroy",
Short: "destroy the kubefirst platform",
Long: "destroy the kubefirst platform running in Goole and remove all resources",
RunE: common.Destroy,
// PreRun: common.CheckDocker,
}

return destroyCmd
Expand Down
17 changes: 8 additions & 9 deletions cmd/k3d/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
"github.com/kubefirst/runtime/configs"
"github.com/kubefirst/runtime/pkg"
"github.com/kubefirst/runtime/pkg/argocd"
"github.com/kubefirst/runtime/pkg/docker"
"github.com/kubefirst/runtime/pkg/gitClient"
"github.com/kubefirst/runtime/pkg/github"
gitlab "github.com/kubefirst/runtime/pkg/gitlab"
Expand Down Expand Up @@ -148,14 +147,14 @@ func runK3d(cmd *cobra.Command, args []string) error {
return fmt.Errorf("%s - this port is required to set up your kubefirst environment - please close any existing port forwards before continuing", err.Error())
}

// Verify Docker is running
dcli := docker.DockerClientWrapper{
Client: docker.NewDockerClient(),
}
_, err = dcli.CheckDockerReady()
if err != nil {
return err
}
// Verify Docker is running # TODO: reintroduce once we support more runtimes
// dcli := docker.DockerClientWrapper{
// Client: docker.NewDockerClient(),
// }
// _, err = dcli.CheckDockerReady()
// if err != nil {
// return err
// }

// Global context
var ctx context.Context
Expand Down
5 changes: 2 additions & 3 deletions cmd/launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package cmd
import (
"fmt"

"github.com/kubefirst/kubefirst/internal/common"
"github.com/kubefirst/kubefirst/internal/launch"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -82,7 +81,7 @@ func launchListClusters() *cobra.Command {
Use: "list",
Short: "list clusters created by the kubefirst console",
TraverseChildren: true,
PreRun: common.CheckDocker,
// PreRun: common.CheckDocker,
Run: func(cmd *cobra.Command, args []string) {
launch.ListClusters()
},
Expand All @@ -97,7 +96,7 @@ func launchDeleteCluster() *cobra.Command {
Use: "delete",
Short: "delete a cluster created by the kubefirst console",
TraverseChildren: true,
PreRun: common.CheckDocker,
// PreRun: common.CheckDocker,
Args: func(cmd *cobra.Command, args []string) error {
if err := cobra.ExactArgs(1)(cmd, args); err != nil {
return fmt.Errorf("you must provide a cluster name as the only argument to this command")
Expand Down
12 changes: 6 additions & 6 deletions cmd/vultr/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func Create() *cobra.Command {
Short: "create the kubefirst platform running on Vultr kubernetes",
TraverseChildren: true,
RunE: createVultr,
PreRun: common.CheckDocker,
// PreRun: common.CheckDocker,
}

// todo review defaults and update descriptions
Expand All @@ -91,11 +91,11 @@ func Create() *cobra.Command {

func Destroy() *cobra.Command {
destroyCmd := &cobra.Command{
Use: "destroy",
Short: "destroy the kubefirst platform",
Long: "destroy the kubefirst platform running in Vultr and remove all resources",
RunE: common.Destroy,
PreRun: common.CheckDocker,
Use: "destroy",
Short: "destroy the kubefirst platform",
Long: "destroy the kubefirst platform running in Vultr and remove all resources",
RunE: common.Destroy,
// PreRun: common.CheckDocker,
}

return destroyCmd
Expand Down
2 changes: 1 addition & 1 deletion internal/launch/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const (
helmChartName = "kubefirst"
helmChartRepoName = "kubefirst"
helmChartRepoURL = "https://charts.kubefirst.com"
helmChartVersion = "2.3.1"
helmChartVersion = "2.3.2"
namespace = "kubefirst"
secretName = "kubefirst-initial-secrets"
)
9 changes: 7 additions & 2 deletions internal/progress/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package progress

import (
"fmt"
"log"
"strconv"

"github.com/charmbracelet/glamour"
Expand All @@ -20,11 +21,15 @@ import (

func renderMessage(message string) string {
r, _ := glamour.NewTermRenderer(
glamour.WithStylesFromJSONFile("styles.json"),
glamour.WithStyles(StyleConfig),
glamour.WithEmoji(),
)

out, _ := r.Render(message)
out, err := r.Render(message)
if err != nil {
log.Println(err.Error())
return err.Error()
}
return out
}

Expand Down
Loading