Skip to content

Commit

Permalink
Adding chart status subchart
Browse files Browse the repository at this point in the history
  • Loading branch information
jdewinne committed Sep 28, 2023
1 parent ac43ae2 commit 993783b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
12 changes: 7 additions & 5 deletions cli/cmd/cluster_prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Example:
replicated cluster prepare --distribution eks --version 1.27 --instance-type c6.xlarge --node-count 3 \
--entitlement seat_count=100 --entitlement license_type=enterprise \
--chart ./my-helm-chart --values ./values.yaml --set chart-key=value --set chart-key2=value2`,
RunE: r.prepareCluster,
RunE: r.prepareCluster,
}

cmd.PreRunE = func(cmd *cobra.Command, args []string) error {
Expand All @@ -69,11 +69,11 @@ replicated cluster prepare --distribution eks --version 1.27 --instance-type c6.
parent.AddCommand(cmd)

cmd.Flags().StringVar(&r.args.prepareClusterName, "name", "", "Cluster name")
cmd.Flags().StringVar(&r.args.prepareClusterKubernetesDistribution, "distribution", "kind", "Kubernetes distribution of the cluster to provision")
cmd.Flags().StringVar(&r.args.prepareClusterKubernetesVersion, "version", "v1.25.3", "Kubernetes version to provision (format is distribution dependent)")
cmd.Flags().StringVar(&r.args.prepareClusterKubernetesDistribution, "distribution", "", "Kubernetes distribution of the cluster to provision")
cmd.Flags().StringVar(&r.args.prepareClusterKubernetesVersion, "version", "", "Kubernetes version to provision (format is distribution dependent)")
cmd.Flags().IntVar(&r.args.prepareClusterNodeCount, "node-count", int(1), "Node count.")
cmd.Flags().Int64Var(&r.args.prepareClusterDiskGiB, "disk", int64(50), "Disk Size (GiB) to request per node.")
cmd.Flags().StringVar(&r.args.prepareClusterTTL, "ttl", "2h", "Cluster TTL (duration, max 48h)")
cmd.Flags().StringVar(&r.args.prepareClusterTTL, "ttl", "", "Cluster TTL (duration, max 48h)")
cmd.Flags().StringVar(&r.args.prepareClusterInstanceType, "instance-type", "", "the type of instance to use clusters (e.g. x5.xlarge)")
cmd.Flags().DurationVar(&r.args.prepareClusterWaitDuration, "wait", time.Minute*5, "Wait duration for cluster to be ready.")

Expand All @@ -96,6 +96,8 @@ replicated cluster prepare --distribution eks --version 1.27 --instance-type c6.
cmd.Flags().StringVar(&r.args.prepareClusterNamespace, "namespace", "default", "The namespace into which to deploy the KOTS application or Helm chart.")
cmd.Flags().DurationVar(&r.args.prepareClusterAppReadyTimeout, "app-ready-timeout", time.Minute*5, "Timeout to wait for the application to be ready. Must be in Go duration format (e.g., 10s, 2m).")

_ = cmd.MarkFlagRequired("distribution")

// TODO add json output
return cmd
}
Expand Down Expand Up @@ -367,7 +369,7 @@ func areReleaseChartsPushed(charts []types.Chart) (bool, error) {
pushedChartsCount := 0
for _, chart := range charts {
switch chart.Status {
case types.ChartStatusPushed:
case types.ChartStatusPushed, types.ChartStatusSubchart:
pushedChartsCount++
case types.ChartStatusUnknown, types.ChartStatusPushing:
// wait for the chart to be pushed
Expand Down
9 changes: 5 additions & 4 deletions pkg/types/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import "time"
type ChartStatus string

var (
ChartStatusUnknown ChartStatus = "unknown"
ChartStatusPushing ChartStatus = "pushing"
ChartStatusPushed ChartStatus = "pushed"
ChartStatusError ChartStatus = "error"
ChartStatusUnknown ChartStatus = "unknown"
ChartStatusPushing ChartStatus = "pushing"
ChartStatusPushed ChartStatus = "pushed"
ChartStatusError ChartStatus = "error"
ChartStatusSubchart ChartStatus = "subchart"
)

type ReleaseInfo struct {
Expand Down

0 comments on commit 993783b

Please sign in to comment.