Add some deprecated info warning

This commit is contained in:
xianlubird 2018-05-07 11:39:37 +08:00
parent 1a2928eb47
commit c26ff8e759
2 changed files with 9 additions and 9 deletions

View File

@ -103,9 +103,9 @@ func init() {
// Kubernetes only // Kubernetes only
convertCmd.Flags().BoolVarP(&ConvertChart, "chart", "c", false, "Create a Helm chart for converted objects") convertCmd.Flags().BoolVarP(&ConvertChart, "chart", "c", false, "Create a Helm chart for converted objects")
convertCmd.Flags().BoolVar(&ConvertDaemonSet, "daemon-set", false, "Generate a Kubernetes daemonset object") convertCmd.Flags().BoolVar(&ConvertDaemonSet, "daemon-set", false, "Generate a Kubernetes daemonset object (deprecated, use --controller instead)")
convertCmd.Flags().BoolVarP(&ConvertDeployment, "deployment", "d", false, "Generate a Kubernetes deployment object") convertCmd.Flags().BoolVarP(&ConvertDeployment, "deployment", "d", false, "Generate a Kubernetes deployment object (deprecated, use --controller instead)")
convertCmd.Flags().BoolVar(&ConvertReplicationController, "replication-controller", false, "Generate a Kubernetes replication controller object") convertCmd.Flags().BoolVar(&ConvertReplicationController, "replication-controller", false, "Generate a Kubernetes replication controller object (deprecated, use --controller instead)")
convertCmd.Flags().StringVar(&ConvertController, "controller", "", `Set the output controller ("deployment"|"daemonSet"|"replicationController")`) convertCmd.Flags().StringVar(&ConvertController, "controller", "", `Set the output controller ("deployment"|"daemonSet"|"replicationController")`)
convertCmd.Flags().MarkDeprecated("daemon-set", "use --controller") convertCmd.Flags().MarkDeprecated("daemon-set", "use --controller")
convertCmd.Flags().MarkDeprecated("deployment", "use --controller") convertCmd.Flags().MarkDeprecated("deployment", "use --controller")
@ -156,10 +156,10 @@ Available Commands:{{range .Commands}}{{if .IsAvailableCommand}}
{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{ if .HasAvailableLocalFlags}} {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{ if .HasAvailableLocalFlags}}
Kubernetes Flags: Kubernetes Flags:
--daemon-set Generate a Kubernetes daemonset object --daemon-set Generate a Kubernetes daemonset object (deprecated, use --controller instead)
-d, --deployment Generate a Kubernetes deployment object -d, --deployment Generate a Kubernetes deployment object (deprecated, use --controller instead)
-c, --chart Create a Helm chart for converted objects -c, --chart Create a Helm chart for converted objects
--replication-controller Generate a Kubernetes replication controller object --replication-controller Generate a Kubernetes replication controller object (deprecated, use --controller instead)
OpenShift Flags: OpenShift Flags:
--build-branch Specify repository branch to use for buildconfig (default is current branch name) --build-branch Specify repository branch to use for buildconfig (default is current branch name)

View File

@ -246,17 +246,17 @@ INFO Kubernetes file "web-deployment.json" created
The `*-deployment.json` files contain the Deployment objects. The `*-deployment.json` files contain the Deployment objects.
```sh ```sh
$ kompose convert --replication-controller $ kompose convert --controller replicationController
INFO Kubernetes file "redis-svc.yaml" created INFO Kubernetes file "redis-svc.yaml" created
INFO Kubernetes file "web-svc.yaml" created INFO Kubernetes file "web-svc.yaml" created
INFO Kubernetes file "redis-replicationcontroller.yaml" created INFO Kubernetes file "redis-replicationcontroller.yaml" created
INFO Kubernetes file "web-replicationcontroller.yaml" created INFO Kubernetes file "web-replicationcontroller.yaml" created
``` ```
The `*-replicationcontroller.yaml` files contain the Replication Controller objects. If you want to specify replicas (default is 1), use `--replicas` flag: `$ kompose convert --replication-controller --replicas 3` The `*-replicationcontroller.yaml` files contain the Replication Controller objects. If you want to specify replicas (default is 1), use `--replicas` flag: `$ kompose convert --controller replicationController --replicas 3`
```sh ```sh
$ kompose convert --daemon-set $ kompose convert --controller daemonSet
INFO Kubernetes file "redis-svc.yaml" created INFO Kubernetes file "redis-svc.yaml" created
INFO Kubernetes file "web-svc.yaml" created INFO Kubernetes file "web-svc.yaml" created
INFO Kubernetes file "redis-daemonset.yaml" created INFO Kubernetes file "redis-daemonset.yaml" created