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

Remove TypeMeta fields from derived kind objects #739

Merged

Conversation

nightkr
Copy link
Member

@nightkr nightkr commented Dec 3, 2021

Motivation

This aligns us better with k8s-openapi, and makes it slightly more convenient to construct these objects manually. It's also slightly more efficient at runtime, since it saves us two string copies per object.

Solution

Remove it from the generated structs, and inject it at serialization time instead.

@nightkr nightkr added the derive kube-derive proc_macro related label Dec 3, 2021
@nightkr nightkr requested a review from clux December 3, 2021 11:09
@nightkr nightkr self-assigned this Dec 3, 2021
Signed-off-by: Teo Klestrup Röijezon <teo@nullable.se>
Signed-off-by: Teo Klestrup Röijezon <teo@nullable.se>
@nightkr nightkr force-pushed the feature/derive-remove-typemeta-fields branch from 7b9a983 to eb1162d Compare December 3, 2021 11:10
@nightkr nightkr requested review from a team and removed request for clux December 3, 2021 11:10
To align with the old implementation

Signed-off-by: Teo Klestrup Röijezon <teo@nullable.se>
@nightkr nightkr merged commit 20642bb into kube-rs:master Dec 3, 2021
@nightkr nightkr deleted the feature/derive-remove-typemeta-fields branch December 3, 2021 19:26
@clux clux added this to the 0.65.0 milestone Dec 10, 2021
alpeb added a commit to linkerd/linkerd2 that referenced this pull request Dec 16, 2021
alpeb added a commit to linkerd/linkerd2 that referenced this pull request Dec 21, 2021
* build(deps): bump kube from 0.64.0 to 0.65.0

Bumps [kube](https://github.com/kube-rs/kube-rs) from 0.64.0 to 0.65.0.
- [Release notes](https://github.com/kube-rs/kube-rs/releases)
- [Changelog](https://github.com/kube-rs/kube-rs/blob/master/CHANGELOG.md)
- [Commits](kube-rs/kube@0.64.0...0.65.0)

---
updated-dependencies:
- dependency-name: kube
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Address kube-rs/kube#739: Remove 'api_version' and 'kind' from Server struct in tests

* Add a deny exception for tokio-rustls

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alejandro Pedraza <alejandro@buoyant.io>
Co-authored-by: Oliver Gould <ver@buoyant.io>
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Mar 31, 2022
* build(deps): bump kube from 0.64.0 to 0.65.0

Bumps [kube](https://github.com/kube-rs/kube-rs) from 0.64.0 to 0.65.0.
- [Release notes](https://github.com/kube-rs/kube-rs/releases)
- [Changelog](https://github.com/kube-rs/kube-rs/blob/master/CHANGELOG.md)
- [Commits](kube-rs/kube@0.64.0...0.65.0)

---
updated-dependencies:
- dependency-name: kube
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Address kube-rs/kube#739: Remove 'api_version' and 'kind' from Server struct in tests

* Add a deny exception for tokio-rustls

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alejandro Pedraza <alejandro@buoyant.io>
Co-authored-by: Oliver Gould <ver@buoyant.io>
(cherry picked from commit 1c29507)
Signed-off-by: Oliver Gould <ver@buoyant.io>
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Mar 31, 2022
* build(deps): bump kube from 0.64.0 to 0.65.0

Bumps [kube](https://github.com/kube-rs/kube-rs) from 0.64.0 to 0.65.0.
- [Release notes](https://github.com/kube-rs/kube-rs/releases)
- [Changelog](https://github.com/kube-rs/kube-rs/blob/master/CHANGELOG.md)
- [Commits](kube-rs/kube@0.64.0...0.65.0)

---
updated-dependencies:
- dependency-name: kube
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Address kube-rs/kube#739: Remove 'api_version' and 'kind' from Server struct in tests

* Add a deny exception for tokio-rustls

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alejandro Pedraza <alejandro@buoyant.io>
Co-authored-by: Oliver Gould <ver@buoyant.io>
(cherry picked from commit 1c29507)
Signed-off-by: Oliver Gould <ver@buoyant.io>
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Apr 7, 2022
* build(deps): bump kube from 0.64.0 to 0.65.0

Bumps [kube](https://github.com/kube-rs/kube-rs) from 0.64.0 to 0.65.0.
- [Release notes](https://github.com/kube-rs/kube-rs/releases)
- [Changelog](https://github.com/kube-rs/kube-rs/blob/master/CHANGELOG.md)
- [Commits](kube-rs/kube@0.64.0...0.65.0)

---
updated-dependencies:
- dependency-name: kube
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Address kube-rs/kube#739: Remove 'api_version' and 'kind' from Server struct in tests

* Add a deny exception for tokio-rustls

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alejandro Pedraza <alejandro@buoyant.io>
Co-authored-by: Oliver Gould <ver@buoyant.io>
(cherry picked from commit 1c29507)
Signed-off-by: Oliver Gould <ver@buoyant.io>
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Apr 8, 2022
* build(deps): bump kube from 0.64.0 to 0.65.0

Bumps [kube](https://github.com/kube-rs/kube-rs) from 0.64.0 to 0.65.0.
- [Release notes](https://github.com/kube-rs/kube-rs/releases)
- [Changelog](https://github.com/kube-rs/kube-rs/blob/master/CHANGELOG.md)
- [Commits](kube-rs/kube@0.64.0...0.65.0)

---
updated-dependencies:
- dependency-name: kube
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Address kube-rs/kube#739: Remove 'api_version' and 'kind' from Server struct in tests

* Add a deny exception for tokio-rustls

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alejandro Pedraza <alejandro@buoyant.io>
Co-authored-by: Oliver Gould <ver@buoyant.io>
(cherry picked from commit 1c29507)
Signed-off-by: Oliver Gould <ver@buoyant.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
derive kube-derive proc_macro related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants