Skip to content

Commit

Permalink
remove flags from clusterctl boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
karan committed May 1, 2018
1 parent 3efe03d commit ce1e375
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 16 deletions.
15 changes: 9 additions & 6 deletions clusterctl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ Read the [experience doc here](https://docs.google.com/document/d/1-sYb3EdkRga49

### Prerequisites

Follow the steps listed at [CONTRIBUTING.md](https://github.com/kubernetes/kube-deploy/blob/master/cluster-api/clusterctl/CONTRIBUTING.md) to:
Follow the steps listed at [CONTRIBUTING.md](https://github.com/kubernetes-sigs/cluster-api/blob/master/cluster-api/clusterctl/CONTRIBUTING.md) to:

1. Build the `clusterctl` tool
3. Create a `machines.yaml` file configured for your cluster. See the provided template for an example.
1. Build the `clusterctl` tool

### Limitation
```
go build
```

2. Create a `machines.yaml` file configured for your cluster. See the provided template for an example.

### Limitations


### Creating a cluster
Expand All @@ -31,8 +36,6 @@ MachineSet controller, Machine Setup ConfigMap etc. Note that this is not a new
object. There will be defaults running. This will make the tool easily pluggage
(change the controller spec) instead of changing the tool or mucking with flags.

1. Create a cluster: `./clusterctl create cluster -c cluster.yaml -m machines.yaml -e extras.yaml`

### Interacting with your cluster

Once you have created a cluster, you can interact with the cluster and machine
Expand Down
5 changes: 0 additions & 5 deletions clusterctl/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package cmd
import (
"os"

//"fmt"
"github.com/golang/glog"
"github.com/spf13/cobra"
"sigs.k8s.io/cluster-api/errors"
Expand Down Expand Up @@ -63,9 +62,5 @@ func RunCreate(co *CreateOptions) error {
return errors.NotImplementedError
}
func init() {
createCmd.Flags().StringVarP(&co.Cluster, "cluster", "c", "", "cluster yaml file")
createCmd.Flags().StringVarP(&co.Machine, "machines", "m", "", "machine yaml file")
createCmd.Flags().StringVarP(&co.Extras, "extras", "e", "", "extras yaml file")

RootCmd.AddCommand(createCmd)
}
2 changes: 0 additions & 2 deletions clusterctl/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,5 @@ func RunDelete() error {
}

func init() {
deleteCmd.Flags().StringVarP(&do.ClusterName, "cluster-name", "n", "", "cluster name")

RootCmd.AddCommand(deleteCmd)
}
2 changes: 0 additions & 2 deletions clusterctl/cmd/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,5 @@ func RunRegister(co *RegisterOptions) error {
}

func init() {
registerCmd.Flags().StringVarP(&ro.RegistryEndpoint, "registry-endpoint", "r", "", "registry endpoint")

RootCmd.AddCommand(registerCmd)
}
1 change: 0 additions & 1 deletion clusterctl/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func parseMachinesYaml(file string) ([]*clusterv1.Machine, error) {
}

func init() {
RootCmd.PersistentFlags().StringVarP(&kubeConfig, "kubeconfig", "k", "", "location for the kubernetes config file. If not provided, $HOME/.kube/config is used")
flag.CommandLine.Parse([]string{})
logs.InitLogs()
}

0 comments on commit ce1e375

Please sign in to comment.