Skip to content

Commit

Permalink
Simplified code
Browse files Browse the repository at this point in the history
  • Loading branch information
dkapanidis committed May 27, 2016
1 parent 618a356 commit be24dab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 33 deletions.
2 changes: 1 addition & 1 deletion cmd/tide/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

const applyDesc = `
This command applys a chart archive.
This command applies a chart archive.
The apply argument must be either a relative
path to a chart directory or the name of a
Expand Down
6 changes: 1 addition & 5 deletions cmd/tide/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ func readManifest(installArg string) (string, error) {

overrides := map[string]interface{}{
"Release": map[string]interface{}{
"Name": "name",
"Time": "ts",
"Namespace": "s.env.Namespace",
"Service": "Tide",
"Service": "Tide",
},
"Chart": "req.Chart.Metadata",
}

files, err := env.EngineYard.Default().Render(chpb, vals, overrides)
Expand Down
28 changes: 1 addition & 27 deletions cmd/tide/tide.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
package main

import (
"fmt"
"os"
"strings"

"github.com/spf13/cobra"
)

var stdout = os.Stdout
var helmHome string

// flagVerbose is a signal that the user wants additional output.
var flagVerbose bool

Expand All @@ -20,15 +13,7 @@ Tide is a standalone CLI tool to render Kubernetes packages with the Helm format
It is a stateless tool, which uses the current directory to render the templates
and either outputs them for further usage (e.g. pipeline with kubectl or other
scripting methods) or installs them directly to Kubernetes.
Common actions from this point on include:
- tide search: search for charts
- tide fetch: download a chart to your local directory to view
- tide install: upload the chart to Kubernetes
- tide list: list releases of charts
`
scripting methods) or installs them directly to Kubernetes.`

// RootCommand is the top-level command for Helm.
var RootCommand = &cobra.Command{
Expand All @@ -44,14 +29,3 @@ func init() {
func main() {
RootCommand.Execute()
}

func checkArgsLength(expectedNum, actualNum int, requiredArgs ...string) error {
if actualNum != expectedNum {
arg := "arguments"
if expectedNum == 1 {
arg = "argument"
}
return fmt.Errorf("This command needs %v %s: %s", expectedNum, arg, strings.Join(requiredArgs, ", "))
}
return nil
}

0 comments on commit be24dab

Please sign in to comment.