Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add insecure data plane #127

Merged
merged 3 commits into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"list"
]
},
{
{
"name": "Describe Kafka",
"type": "go",
"request": "launch",
Expand All @@ -62,6 +62,21 @@
"kafka",
"describe"
]
},
{
"name": "Create topic",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/rhoas",
"env": {},
"args": [
"kafka",
"topics",
"create",
"--name=my-topic",
"--insecure"
]
}
]
}
2 changes: 1 addition & 1 deletion docs/commands/rhoas.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Application Services cluster
* link:rhoas_serviceaccount.adoc[rhoas serviceaccount] - Manage your
service accounts

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_cluster.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ currently selected Kafka to your OpenShift cluster
* link:rhoas_cluster_info.adoc[rhoas cluster info] - Prints information
about your OpenShift cluster connection

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_cluster_connect.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ rhoas cluster connect [flags]
* link:rhoas_cluster.adoc[rhoas cluster] - Managed your services in
OpenShift Cluster

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_cluster_info.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ rhoas cluster info [flags]
* link:rhoas_cluster.adoc[rhoas cluster] - Managed your services in
OpenShift Cluster

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_completion.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ rhoas completion [bash|zsh|fish|powershell]

* link:rhoas.adoc[rhoas] - rhoas cli

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_docs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ rhoas docs [flags]

* link:rhoas.adoc[rhoas] - rhoas cli

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_kafka.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Kafka instance
* link:rhoas_kafka_use.adoc[rhoas kafka use] - Set the current Kafka
instance context

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_kafka_create.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ rhoas kafka create [flags]

* link:rhoas_kafka.adoc[rhoas kafka] - Manage your Kafka instances

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_kafka_delete.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ $ rhoas kafka delete --id=1iSY6RQ3JKI8Q0OTmjQFd3ocFRg

* link:rhoas_kafka.adoc[rhoas kafka] - Manage your Kafka instances

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_kafka_describe.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ $ rhoas kafka describe --id=1iSY6RQ3JKI8Q0OTmjQFd3ocFRg

* link:rhoas_kafka.adoc[rhoas kafka] - Manage your Kafka instances

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_kafka_list.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ rhoas kafka list [flags]

* link:rhoas_kafka.adoc[rhoas kafka] - Manage your Kafka instances

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_kafka_status.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ rhoas kafka status [flags]

* link:rhoas_kafka.adoc[rhoas kafka] - Manage your Kafka instances

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_kafka_topics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ topic
topic
* link:rhoas_kafka_topics_list.adoc[rhoas kafka topics list] - List topics

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
5 changes: 3 additions & 2 deletions docs/commands/rhoas_kafka_topics_create.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Create topic

=== Synopsis

Create topic in the current selected Managed Kafka instance
Create topic in the current selected Managed Kafka cluster

....
rhoas kafka topics create [flags]
Expand All @@ -14,6 +14,7 @@ rhoas kafka topics create [flags]

....
-h, --help help for create
--insecure Enables insecure communication with the server. This disables verification of TLS certificates and host names.
-n, --name string Topic name (required)
-p, --partitions int32 Set number of partitions (default 1)
-r, --replicas int32 Set number of replicas (default 1)
Expand All @@ -23,4 +24,4 @@ rhoas kafka topics create [flags]

* link:rhoas_kafka_topics.adoc[rhoas kafka topics] - Manage topics

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
5 changes: 3 additions & 2 deletions docs/commands/rhoas_kafka_topics_delete.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Delete topic

=== Synopsis

Delete topic from the current selected Managed Kafka instance
Delete topic from the current selected Managed Kafka cluster

....
rhoas kafka topics delete [flags]
Expand All @@ -14,11 +14,12 @@ rhoas kafka topics delete [flags]

....
-h, --help help for delete
--insecure Enables insecure communication with the server. This disables verification of TLS certificates and host names.
-n, --name string Topic name (required)
....

=== SEE ALSO

* link:rhoas_kafka_topics.adoc[rhoas kafka topics] - Manage topics

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
5 changes: 3 additions & 2 deletions docs/commands/rhoas_kafka_topics_list.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ List topics

=== Synopsis

List all topics in the current selected Managed Kafka instance
List all topics in the current selected Managed Kafka cluster

....
rhoas kafka topics list [flags]
Expand All @@ -14,11 +14,12 @@ rhoas kafka topics list [flags]

....
-h, --help help for list
--insecure Enables insecure communication with the server. This disables verification of TLS certificates and host names.
-o, --output string The output format as 'plain-text', 'json', or 'yaml' (default "plain-text")
....

=== SEE ALSO

* link:rhoas_kafka_topics.adoc[rhoas kafka topics] - Manage topics

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_kafka_use.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ $ rhoas kafka use --id=1iSY6RQ3JKI8Q0OTmjQFd3ocFRg

* link:rhoas_kafka.adoc[rhoas kafka] - Manage your Kafka instances

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_login.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ rhoas login [flags]

* link:rhoas.adoc[rhoas] - rhoas cli

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_logout.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ rhoas logout [flags]

* link:rhoas.adoc[rhoas] - rhoas cli

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_serviceaccount.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ application to managed services
* link:rhoas_serviceaccount_create.adoc[rhoas serviceaccount create] -
Create a new service account with credentials

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
2 changes: 1 addition & 1 deletion docs/commands/rhoas_serviceaccount_create.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ $ rhoas serviceaccount create -o json
* link:rhoas_serviceaccount.adoc[rhoas serviceaccount] - Manage your
service accounts

==== Auto generated by spf13/cobra on 14-Dec-2020
==== Auto generated by spf13/cobra on 15-Dec-2020
11 changes: 11 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
Expand Down Expand Up @@ -186,6 +187,7 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
Expand Down Expand Up @@ -232,6 +234,7 @@ github.com/landoop/tableprinter v0.0.0-20200805134727-ea32388e35c1 h1:xUwSaTDYl+
github.com/landoop/tableprinter v0.0.0-20200805134727-ea32388e35c1/go.mod h1:f0X1c0za3TbET/rl5ThtCSel0+G3/yZ8iuU9BxnyVK0=
github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a h1:weJVJJRzAJBFRlAiJQROKQs8oC9vOxvm4rZmBBk0ONw=
github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/manifoldco/promptui v0.8.0 h1:R95mMF+McvXZQ7j1g8ucVZE1gLP3Sv6j9vlF9kyRqQo=
Expand Down Expand Up @@ -259,6 +262,7 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
Expand All @@ -276,6 +280,7 @@ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc=
Expand Down Expand Up @@ -319,15 +324,19 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4=
github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI=
github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand All @@ -337,6 +346,7 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk=
Expand Down Expand Up @@ -528,6 +538,7 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
Expand Down
19 changes: 12 additions & 7 deletions pkg/cmd/kafka/topics/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import (
"fmt"
"os"

"github.com/bf2fc6cc711aee1a0c2a/cli/pkg/cmd/kafka/topics/flags"
topicflags "github.com/bf2fc6cc711aee1a0c2a/cli/pkg/cmd/kafka/topics/flags"

"github.com/bf2fc6cc711aee1a0c2a/cli/pkg/sdk/kafka/topics"
"github.com/segmentio/kafka-go"
"github.com/spf13/cobra"
Expand All @@ -18,26 +19,30 @@ const (
)

var topicName string
var insecure bool

// NewCreateTopicCommand gets a new command for creating kafka topic.
func NewCreateTopicCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "create",
Short: "Create topic",
Long: "Create topic in the current selected Managed Kafka instance",
Run: createTopic,
Long: "Create topic in the current selected Managed Kafka cluster",
Run: func(cmd *cobra.Command, _ []string) {
createTopic(insecure)
},
}

cmd.Flags().StringVarP(&topicName, flags.FlagName, "n", "", "Topic name (required)")
_ = cmd.MarkFlagRequired(flags.FlagName)
cmd.Flags().StringVarP(&topicName, topicflags.FlagName, "n", "", "Topic name (required)")
_ = cmd.MarkFlagRequired(topicflags.FlagName)
wtrocki marked this conversation as resolved.
Show resolved Hide resolved
cmd.Flags().Int32VarP(&partitions, Partitions, "p", 1, "Set number of partitions")
cmd.Flags().Int32VarP(&replicas, Replicas, "r", 1, "Set number of replicas")
cmd.Flags().BoolVar(&insecure, "insecure", false, "Enables insecure communication with the server. This disables verification of TLS certificates and host names.")

// TODO define file format etc
return cmd
}

func createTopic(cmd *cobra.Command, _ []string) {
func createTopic(insecure bool) {
topicConfigs := []kafka.TopicConfig{
{
Topic: topicName,
Expand All @@ -50,7 +55,7 @@ func createTopic(cmd *cobra.Command, _ []string) {
fmt.Fprintf(os.Stderr, "Error creating credentials for topic: %v\n", err)
return
}
err = topics.CreateKafkaTopic(topicConfigs)
err = topics.CreateKafkaTopic(topicConfigs, insecure)
if err != nil {
fmt.Fprintf(os.Stderr, "Error creating topic: %v\n", err)
return
Expand Down
15 changes: 10 additions & 5 deletions pkg/cmd/kafka/topics/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,36 @@ import (
)

var topicName string
var insecure bool

// NewDeleteTopicCommand gets a new command for deleting kafka topic.
func NewDeleteTopicCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "delete",
Short: "Delete topic",
Long: "Delete topic from the current selected Managed Kafka instance",
Run: deleteTopic,
Long: "Delete topic from the current selected Managed Kafka cluster",
Run: func(cmd *cobra.Command, _ []string) {
deleteTopic(insecure)
},
}

cmd.Flags().StringVarP(&topicName, flags.FlagName, "n", "", "Topic name (required)")
cmd.Flags().BoolVar(&insecure, "insecure", false, "Enables insecure communication with the server. This disables verification of TLS certificates and host names.")

_ = cmd.MarkFlagRequired(flags.FlagName)
return cmd
}

func deleteTopic(cmd *cobra.Command, _ []string) {
func deleteTopic(insecure bool) {
fmt.Fprintf(os.Stderr, "Deleting topic %v\n", topicName)
err := topics.ValidateCredentials()
if err != nil {
fmt.Fprintf(os.Stderr, "Error creating credentials for topic: %v\n", topicName)
return
}
err = topics.DeleteKafkaTopic(topicName)
err = topics.DeleteKafkaTopic(topicName, insecure)
if err != nil {
fmt.Fprintf(os.Stderr, "Error deleting topic: %v\n", topicName)
fmt.Fprintf(os.Stderr, "Error deleting topic: %v\n", err)
return
}

Expand Down
Loading