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(*) generate DeepCopy interfaces #2222

Merged
merged 1 commit into from
Jul 5, 2021
Merged

chore(*) generate DeepCopy interfaces #2222

merged 1 commit into from
Jul 5, 2021

Conversation

jpeach
Copy link
Contributor

@jpeach jpeach commented Jun 26, 2021

Summary

Enable DeepCopy interface generation for Kubernetes resources. This takes
advantage of the fact that if a type already implementes the DeepCopy
interface, deepcopy-gen will use it. This means that we can wrap the
raw protbuf message fields in a type that supports the interface and
then generate everything else.

This updates #2130.

Full changelog

N/A

Issues resolved

N/A

Documentation

N/A

Testing

  • Unit tests
  • E2E tests
  • Manual testing on Universal
  • Manual testing on Kubernetes

@jpeach jpeach changed the title chore(*) generate DeepCopy interfacs chore(*) generate DeepCopy interfaces Jun 26, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2021

Codecov Report

Merging #2222 (2111f29) into master (3596f27) will increase coverage by 0.28%.
The diff coverage is 52.68%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2222      +/-   ##
==========================================
+ Coverage   51.77%   52.05%   +0.28%     
==========================================
  Files         909      895      -14     
  Lines       41004    41041      +37     
==========================================
+ Hits        21229    21364     +135     
+ Misses      17741    17619     -122     
- Partials     2034     2058      +24     
Impacted Files Coverage Δ
...es/k8s/native/api/v1alpha1/circuitbreaker_types.go 100.00% <ø> (ø)
...k8s/native/api/v1alpha1/dataplane_insight_types.go 100.00% <ø> (ø)
...sources/k8s/native/api/v1alpha1/dataplane_types.go 100.00% <ø> (ø)
...s/k8s/native/api/v1alpha1/externalservice_types.go 100.00% <ø> (ø)
...es/k8s/native/api/v1alpha1/faultinjection_types.go 100.00% <ø> (ø)
...urces/k8s/native/api/v1alpha1/healthcheck_types.go 100.00% <ø> (ø)
...rces/k8s/native/api/v1alpha1/mesh_insight_types.go 100.00% <ø> (ø)
...ns/resources/k8s/native/api/v1alpha1/mesh_types.go 100.00% <ø> (ø)
...ces/k8s/native/api/v1alpha1/proxytemplate_types.go 100.00% <ø> (ø)
...sources/k8s/native/api/v1alpha1/ratelimit_types.go 100.00% <ø> (ø)
... and 26 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 3596f27...2111f29. Read the comment docs.

@jpeach jpeach marked this pull request as ready for review June 26, 2021 12:19
@jpeach jpeach requested a review from a team as a code owner June 26, 2021 12:19
@jpeach
Copy link
Contributor Author

jpeach commented Jul 2, 2021

@jakubdyszkiewicz WDTY about this approach?

Enable DeepCopy interface generation for Kubernetes resources. This takes
advantage of the fact that if a type already implementes the DeepCopy
interface, deepcopy-gen will use it. This means that we can wrap the
raw protbuf message fields in a type that supports the interface and
then generate everything else.

This updates #2130.

Signed-off-by: James Peach <james.peach@konghq.com>
@jakubdyszkiewicz
Copy link
Contributor

I'm ok with this.

The bigger win here would be to do scaffolding for the whole policy with API, kumactl, K8S etc. etc., but that requires a couple of orders magnitude more effort than this.

@jakubdyszkiewicz jakubdyszkiewicz merged commit fb4d537 into kumahq:master Jul 5, 2021
mergify bot pushed a commit that referenced this pull request Jul 5, 2021
Enable DeepCopy interface generation for Kubernetes resources. This takes
advantage of the fact that if a type already implementes the DeepCopy
interface, deepcopy-gen will use it. This means that we can wrap the
raw protbuf message fields in a type that supports the interface and
then generate everything else.

This updates #2130.

Signed-off-by: James Peach <james.peach@konghq.com>
(cherry picked from commit fb4d537)

# Conflicts:
#	mk/generate.mk
@jpeach
Copy link
Contributor Author

jpeach commented Jul 5, 2021

I'm ok with this.

The bigger win here would be to do scaffolding for the whole policy with API, kumactl, K8S etc. etc., but that requires a couple of orders magnitude more effort than this.

Yep, that would be great. I think we can get there, but baby steps :)

@jpeach jpeach deleted the chore/deepcopy-gen branch July 5, 2021 21:41
bartsmykla pushed a commit that referenced this pull request Jul 5, 2021
Enable DeepCopy interface generation for Kubernetes resources. This takes
advantage of the fact that if a type already implementes the DeepCopy
interface, deepcopy-gen will use it. This means that we can wrap the
raw protbuf message fields in a type that supports the interface and
then generate everything else.

This updates #2130.

Signed-off-by: James Peach <james.peach@konghq.com>
(cherry picked from commit fb4d537)

# Conflicts:
#	mk/generate.mk
jpeach added a commit that referenced this pull request Jul 6, 2021
Enable DeepCopy interface generation for Kubernetes resources. This takes
advantage of the fact that if a type already implementes the DeepCopy
interface, deepcopy-gen will use it. This means that we can wrap the
raw protbuf message fields in a type that supports the interface and
then generate everything else.

This updates #2130.

Signed-off-by: James Peach <james.peach@konghq.com>
(cherry picked from commit fb4d537)
jpeach added a commit that referenced this pull request Jul 6, 2021
Enable DeepCopy interface generation for Kubernetes resources. This takes
advantage of the fact that if a type already implementes the DeepCopy
interface, deepcopy-gen will use it. This means that we can wrap the
raw protbuf message fields in a type that supports the interface and
then generate everything else.

This updates #2130.

Signed-off-by: James Peach <james.peach@konghq.com>
(cherry picked from commit fb4d537)

Co-authored-by: James Peach <james.peach@konghq.com>
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