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/#252 - kumactl get for single entities #667

Merged
merged 30 commits into from
Apr 15, 2020

Conversation

tharun208
Copy link
Contributor

@tharun208 tharun208 commented Apr 6, 2020

Summary

kumactl get command for single entities

Full changelog

  • Implemented command to get information about a single entity of Kuma for the following

    • Fault Injection
    • Dataplane
    • Mesh
    • Health Check
    • proxyTemplate
    • trafficLog
    • trafficPermission
    • trafficRoute
    • trafficTrace
  • Added tests

  • Updated tests for kumactl apply

Issues resolved

Fix #252

* added validation for single resource
Feature #252
Copy link
Contributor

@jakubdyszkiewicz jakubdyszkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the current implementation suggest that the commands will be

kumactl get resource dataplane dp-1
kumactl get resource mesh mesh-1

I'd rather have the more straightforward commands like

kumactl get dataplane dp-1
kumactl get mesh mesh-1

Sorry if that was your question on Slack and I misunderstood it.

Please start with 2/3 commands (mesh, dataplane, traffic-permission) and let's see what we can do to avoid code duplication.

@tharun208
Copy link
Contributor Author

And we have commands like get meshes, get data planes, can I just create a get mesh mesh-name for now and later, can we think of a better approach ?.

Is this fine because if I start with the get root command to handle args, it will break our existing implementation of underlying sub-commands.

@jakubdyszkiewicz
Copy link
Contributor

Yes, I think the right approach for now is to create a separate sub commands get dataplane, get mesh etc.

* added get single resource command for mesh
Feature #252
* updated get mesh implementation and tests
Feature #252
* added get command for dataplane and tests
Feature #252
@tharun208
Copy link
Contributor Author

@jakubdyszkiewicz I have added the implementation for get mesh and get dataplane

@tharun208
Copy link
Contributor Author

I am not finding any possible abstraction between these two. I thought of abstracting out printTable but it should be specific to each resource type.

@jakubdyszkiewicz
Copy link
Contributor

Hey, yes please - reuse the same function for printing table. As you can see there is a difference already, get dataplane does not return tags where as get dataplanes returns tags.

For tests I think we can reuse YAML file for input and just have a one parametrized test https://github.com/Kong/kuma/commit/b4e56abe2bb81ec65dd9136f8a6fee8548175a90

tharun208 added 12 commits April 8, 2020 17:30
* resused printDataplanes for printing output
Feature #252
* made changes in printdataplanes to support both get dataplane
Feature #252
* added get fault injection and refractored printFaultInjection
Feature #252
* added get-healthcheck command
* changed types of printHealthCheck to support for single and multi resource
Feature #252
* added get proxytemplate command
* changed types of PrintProxyTemplate to support for single and multi resource
Feature #252
* renamed get_fault_injection file
Feature #252
* added get command to get single traffic-log
* refractored printTrafficLog
* added tests
* reverted back checking mesh type in apply cmd
Feature #252
* commenting out mesh in test
Feature #252
@tharun208 tharun208 marked this pull request as ready for review April 8, 2020 20:12
@tharun208 tharun208 requested a review from a team April 8, 2020 20:12
Copy link
Contributor

@jakubdyszkiewicz jakubdyszkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! That's awesome progress. I think there are still some resources left to be added

app/kumactl/cmd/get/get_fault_injections.go Outdated Show resolved Hide resolved
app/kumactl/cmd/get/get_fault_injections.go Outdated Show resolved Hide resolved
app/kumactl/cmd/get/get_proxytemplates.go Outdated Show resolved Hide resolved
app/kumactl/cmd/get/get_traffic_logs.go Outdated Show resolved Hide resolved
* Added get traffic permission to get single traffic permission resource
Feature #252
* Added get traffic route to get single traffic route resource
Feature #252
* Added get traffic trace to get single traffic trace resource
Feature #252
* made printProxyTemplates as private function
Feature #252
Copy link
Contributor

@jakubdyszkiewicz jakubdyszkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost there, can you add a changelog?

* added detailed configuration for healthCheck, proxyTemplate,TrafficRoute
Feature #252
Copy link
Contributor

@jakubdyszkiewicz jakubdyszkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would help a lot with the review if the commits were more meaningful instead of same name for every one of them. Thanks!

app/kumactl/cmd/get/get_dataplane.go Outdated Show resolved Hide resolved
@tharun208
Copy link
Contributor Author

It would help a lot with the review if the commits were more meaningful instead of same name for every one of them. Thanks!

sure noted it

@jakubdyszkiewicz jakubdyszkiewicz merged commit 6cccc6b into kumahq:master Apr 15, 2020
@jakubdyszkiewicz
Copy link
Contributor

Thank you for working on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduced describe as a new CLI command for our entities
3 participants