Skip to content

Commit

Permalink
Revert "Deprecate --chart flag (#413)" (#432)
Browse files Browse the repository at this point in the history
This reverts commit 47573af.
  • Loading branch information
divolgin authored Oct 16, 2024
1 parent 05b4ae4 commit 6522fac
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 23 deletions.
4 changes: 0 additions & 4 deletions cli/cmd/cluster_prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ Note:

// for builders plan (chart only)
cmd.Flags().StringVar(&r.args.prepareClusterChart, "chart", "", "Path to the helm chart package to deploy")
cmd.Flags().MarkHidden("chart")

addValueOptionsFlags(cmd.Flags(), &r.args.prepareClusterValueOpts)

cmd.Flags().StringVar(&r.args.prepareClusterNamespace, "namespace", "default", "The namespace into which to deploy the KOTS application or Helm chart.")
Expand Down Expand Up @@ -130,7 +128,6 @@ func validateClusterPrepareFlags(args runnerArgs) error {
}

if args.prepareClusterChart != "" {
printChartDeprecationWarning()
if args.prepareClusterKotsSharedPassword != "" {
return errors.New("The --shared-password flag cannot be used when deploying a Helm chart")
}
Expand Down Expand Up @@ -310,7 +307,6 @@ func prepareRelease(r *runners, log *logger.Logger) (*types.ReleaseInfo, error)
}

if r.args.prepareClusterChart != "" {
printChartDeprecationWarning()
fmt.Fprintln(r.w)
log.ActionWithSpinner("Reading chart from %s", r.args.prepareClusterChart)
var err error
Expand Down
5 changes: 0 additions & 5 deletions cli/cmd/release_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ func (r *runners) InitReleaseCreate(parent *cobra.Command) error {
cmd.Flags().MarkHidden("yaml-file")
cmd.Flags().MarkHidden("yaml")

// deprecated
cmd.Flags().MarkHidden("chart")

cmd.RunE = r.releaseCreate
return nil
}
Expand Down Expand Up @@ -245,8 +242,6 @@ Prepared to create release with defaults:
}

if r.args.createReleaseChart != "" {
printChartDeprecationWarning()

fmt.Fprint(r.w, "You are creating a release that will only be installable with the helm CLI.\n"+
"For more information, see \n"+
"https://docs.replicated.com/vendor/helm-install#about-helm-installations-with-replicated\n")
Expand Down
4 changes: 0 additions & 4 deletions cli/cmd/release_lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ func (r *runners) InitReleaseLint(parent *cobra.Command) {
cmd.Flags().StringVar(&r.args.lintReleaseFailOn, "fail-on", "error", "The minimum severity to cause the command to exit with a non-zero exit code. Supported values are [info, warn, error, none].")
cmd.Flags().StringVar(&r.outputFormat, "output", "table", "The output format to use. One of: json|table (default: table)")

// deprecated
cmd.Flags().MarkHidden("chart")

cmd.RunE = r.releaseLint
}

Expand All @@ -63,7 +60,6 @@ func (r *runners) releaseLint(cmd *cobra.Command, args []string) error {
isBuildersRelease = isHelmChartsOnly
contentType = "application/tar"
} else if r.args.lintReleaseChart != "" {
printChartDeprecationWarning()
data, err := os.ReadFile(r.args.lintReleaseChart)
if err != nil {
return errors.Wrap(err, "failed to read chart file")
Expand Down
4 changes: 0 additions & 4 deletions cli/cmd/release_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ func (r *runners) InitReleaseUpdate(parent *cobra.Command) {
cmd.Flags().StringVar(&r.args.updateReleaseYamlDir, "yaml-dir", "", "The directory containing multiple yamls for a Kots release. Cannot be used with the --yaml flag.")
cmd.Flags().StringVar(&r.args.updateReleaseChart, "chart", "", "Helm chart to create the release from. Cannot be used with the --yaml, --yaml-file, or --yaml-dir flags.")

// deprecated
cmd.Flags().MarkHidden("chart")

cmd.RunE = r.releaseUpdate
}

Expand Down Expand Up @@ -88,7 +85,6 @@ func (r *runners) releaseUpdate(cmd *cobra.Command, args []string) error {
return errors.Wrap(err, "make release from dir")
}
} else if r.args.updateReleaseChart != "" {
printChartDeprecationWarning()
r.args.updateReleaseYaml, err = makeReleaseFromChart(r.args.updateReleaseChart)
if err != nil {
return errors.Wrap(err, "make release from chart")
Expand Down
6 changes: 0 additions & 6 deletions cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"strings"
"text/tabwriter"

"github.com/fatih/color"
"github.com/pkg/errors"

"github.com/replicatedhq/replicated/pkg/credentials"
Expand Down Expand Up @@ -398,11 +397,6 @@ func printIfError(cmd *cobra.Command, err error) {
}
}

func printChartDeprecationWarning() {
red := color.New(color.FgHiRed)
red.Fprintf(os.Stderr, "\nThe --chart flag is deprecated and will be removed in a future release. Please use the --yaml or --yaml-dir flag instead.\n\n")
}

func parseTags(tags []string) ([]types.Tag, error) {
parsedTags := []types.Tag{}
for _, tag := range tags {
Expand Down

0 comments on commit 6522fac

Please sign in to comment.