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

chore(tools): Simplify resource-gen.go by generatingResourceDescriptor #2511

Merged
merged 4 commits into from
Aug 9, 2021

Conversation

lahabana
Copy link
Contributor

@lahabana lahabana commented Aug 6, 2021

This descriptor defines everything there is about a resource:

  • kds
  • kumactl
  • ws

We then simplify a lot of the redundant code to use this descriptor.
While refactoring some of the deep references to the global registry were removed

…ceDescriptor`

This descriptor defines everything there is about a resource:

- kds
- kumactl
- ws

We then simplify a lot of the redundant code to use this descriptor.
While refactoring some of the deep references to the global registry were removed

Signed-off-by: Charly Molter <charly.molter@konghq.com>
@lahabana lahabana requested a review from a team as a code owner August 6, 2021 11:52
@lahabana lahabana requested a review from jpeach August 6, 2021 11:53
@lahabana
Copy link
Contributor Author

lahabana commented Aug 6, 2021

@jpeach I think this is the last one :) It also adds the kumactl for gateway for free!

I need to add my virtual-outbound policy after so I'll be able to see how this works out.
I can guess some tests will maybe be deleted because they were there to ensure that manual code additions were done which are automatic now.

@codecov-commenter
Copy link

codecov-commenter commented Aug 6, 2021

Codecov Report

Merging #2511 (a135b91) into master (7561bd0) will increase coverage by 0.00%.
The diff coverage is 84.07%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2511   +/-   ##
=======================================
  Coverage   52.30%   52.31%           
=======================================
  Files         867      865    -2     
  Lines       48182    48098   -84     
=======================================
- Hits        25204    25161   -43     
+ Misses      20942    20903   -39     
+ Partials     2036     2034    -2     
Impacted Files Coverage Δ
api/mesh/v1alpha1/gateway.pb.go 33.57% <ø> (ø)
app/kuma-dp/cmd/dataplane.go 52.17% <0.00%> (ø)
app/kuma-dp/cmd/run.go 71.14% <0.00%> (ø)
pkg/core/resources/store/store.go 52.23% <0.00%> (ø)
pkg/core/xds/metadata.go 65.43% <0.00%> (ø)
pkg/insights/components.go 100.00% <ø> (+30.00%) ⬆️
pkg/kds/global/components.go 12.96% <0.00%> (-0.25%) ⬇️
pkg/kds/zone/components.go 18.96% <0.00%> (-0.34%) ⬇️
pkg/xds/auth/k8s/authenticator.go 0.00% <0.00%> (ø)
pkg/xds/auth/universal/authenticator.go 78.00% <0.00%> (ø)
... and 58 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7561bd0...a135b91. Read the comment docs.

Copy link
Contributor

@jpeach jpeach left a comment

Choose a reason for hiding this comment

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

Mainly nits about naming :)

pkg/test/kumactl/context.go Outdated Show resolved Hide resolved
pkg/core/resources/model/resource.go Show resolved Hide resolved
pkg/core/resources/model/resource.go Show resolved Hide resolved
pkg/core/resources/model/resource.go Show resolved Hide resolved
pkg/core/resources/model/resource.go Outdated Show resolved Hide resolved
pkg/core/resources/registry/registry.go Outdated Show resolved Hide resolved
pkg/core/resources/registry/registry.go Outdated Show resolved Hide resolved
pkg/insights/resyncer.go Show resolved Hide resolved
tools/resource-gen.go Show resolved Hide resolved
tools/resource-gen.go Outdated Show resolved Hide resolved
…source-gen

Signed-off-by: Charly Molter <charly.molter@konghq.com>
Signed-off-by: Charly Molter <charly.molter@konghq.com>
@lahabana lahabana merged commit 5721243 into kumahq:master Aug 9, 2021
mergify bot pushed a commit that referenced this pull request Aug 9, 2021
…or` (#2511)

This descriptor defines everything there is about a resource:

- kds
- kumactl
- ws

We then simplify a lot of the redundant code to use this descriptor.
While refactoring some of the deep references to the global registry were removed

Signed-off-by: Charly Molter <charly.molter@konghq.com>
(cherry picked from commit 5721243)

# Conflicts:
#	api/mesh/v1alpha1/gateway.pb.go
#	api/mesh/v1alpha1/gateway.proto
#	app/kuma-dp/cmd/dataplane.go
#	app/kuma-dp/cmd/run.go
#	app/kumactl/cmd/apply/apply_test.go
#	app/kumactl/cmd/delete/delete.go
#	app/kumactl/cmd/get/get.go
#	app/kumactl/cmd/get/get_dataplanes_test.go
#	app/kumactl/cmd/get/get_external_services_test.go
#	app/kumactl/cmd/get/get_healthchecks_test.go
#	app/kumactl/cmd/get/get_proxytemplates_test.go
#	app/kumactl/cmd/get/get_resource.go
#	app/kumactl/cmd/get/get_resources.go
#	app/kumactl/cmd/get/get_retries_test.go
#	app/kumactl/cmd/get/get_secrets_test.go
#	app/kumactl/cmd/get/get_test.go
#	app/kumactl/cmd/get/get_traffic_routes_test.go
#	mk/generate.mk
#	pkg/api-server/definitions/api.go
#	pkg/api-server/resource_api_client_test.go
#	pkg/api-server/resource_endpoints.go
#	pkg/api-server/server.go
#	pkg/core/resources/model/rest/resource.go
#	pkg/kds/cache/snapshot.go
#	pkg/kds/global/components.go
#	pkg/kds/global/components_test.go
#	pkg/kds/server/server_test.go
#	pkg/kds/types.go
#	pkg/kds/zone/components.go
#	pkg/kds/zone/components_test.go
#	pkg/plugins/runtime/gateway/enabled.go
#	pkg/plugins/runtime/gateway/register/enabled.go
#	pkg/plugins/runtime/k8s/webhooks/validation.go
#	tools/resource-gen.go
jpeach pushed a commit that referenced this pull request Aug 12, 2021
…or` (#2511)

This descriptor defines everything there is about a resource:

- kds
- kumactl
- ws

We then simplify a lot of the redundant code to use this descriptor.
While refactoring some of the deep references to the global registry were removed

Signed-off-by: Charly Molter <charly.molter@konghq.com>
(cherry picked from commit 5721243)
jpeach pushed a commit that referenced this pull request Aug 12, 2021
…or` (#2511)

This descriptor defines everything there is about a resource:

- kds
- kumactl
- ws

We then simplify a lot of the redundant code to use this descriptor.
While refactoring some of the deep references to the global registry were removed

Signed-off-by: Charly Molter <charly.molter@konghq.com>
(cherry picked from commit 5721243)
jpeach added a commit that referenced this pull request Aug 12, 2021
…or` (backport #2511) (#2527)

* chore(kumactl) remove kumactl plugin hooks (#2508)

Remove files that were left over from the previous backport in #2519.

Signed-off-by: James Peach <james.peach@konghq.com>

* chore(tools): Simplify resource-gen.go by generating`ResourceDescriptor` (#2511)

This descriptor defines everything there is about a resource:

- kds
- kumactl
- ws

We then simplify a lot of the redundant code to use this descriptor.
While refactoring some of the deep references to the global registry were removed

Signed-off-by: Charly Molter <charly.molter@konghq.com>
(cherry picked from commit 5721243)

Co-authored-by: James Peach <james.peach@konghq.com>
Co-authored-by: Charly Molter <charly.molter@konghq.com>
@lahabana lahabana deleted the chore/simpler-resource-gen branch March 29, 2024 12:38
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.

None yet

3 participants