Skip to content

Conversation

@smarterclayton
Copy link
Contributor

@smarterclayton smarterclayton commented Nov 29, 2018

Clean up the code paths that lead to objects being transformed and output
with negotiation. Remove some duplicate code that was not consistent. Now,
watch will respond correctly to Table and PartialObjectMetadata requests.

/kind bug

TODO

  • Add unit tests
  • Add e2e test
  • Only return Table headers on the first object
  • During early output negotiation, filter unsupported encodings
Watch will now support converting response objects into Table or PartialObjectMetadata forms.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 29, 2018
@k8s-ci-robot k8s-ci-robot added needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 29, 2018
@smarterclayton
Copy link
Contributor Author

/assign @liggitt

First two commits are from #71542

@fedebongio
Copy link
Contributor

/cc @mbohlool

@fedebongio
Copy link
Contributor

/cc @wenjiaswe

@caesarxuchao
Copy link
Contributor

/assign

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 7, 2018
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Dec 28, 2018
Clean up the code paths that lead to objects being transformed and output with negotiation.
Remove some duplicate code that was not consistent. Now, watch will respond correctly to
Table and PartialObjectMetadata requests. Add unit and integration tests.

When transforming responses to Tables, only the first watch event for a given type will
include the columns. Columns will not change unless the watch is restarted.

Add a volume attachment printer and tighten up table validation error cases.

Disable protobuf from table conversion because Tables don't have protobuf because they
use `interface{}`
@smarterclayton
Copy link
Contributor Author

/retest

1 similar comment
@smarterclayton
Copy link
Contributor Author

/retest

@liggitt
Copy link
Member

liggitt commented Mar 12, 2019

This lgtm. I'm inclined to hold it for 1.15 at this point.

@liggitt
Copy link
Member

liggitt commented Mar 12, 2019

/lgtm
/approve
/milestone v1.15

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 12, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.15 milestone Mar 12, 2019
@liggitt
Copy link
Member

liggitt commented Mar 12, 2019

/remove-label api-review

@k8s-ci-robot k8s-ci-robot removed the api-review Categorizes an issue or PR as actively needing an API review. label Mar 12, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, smarterclayton

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@liggitt
Copy link
Member

liggitt commented Mar 12, 2019

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 12, 2019
@liggitt
Copy link
Member

liggitt commented Mar 15, 2019

does this PR also fix the issue #62175 was trying to address?

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@smarterclayton
Copy link
Contributor Author

smarterclayton commented Mar 20, 2019 via email

@k8s-ci-robot k8s-ci-robot merged commit 6f9bf5f into kubernetes:master Mar 20, 2019
christarazi added a commit to christarazi/cilium that referenced this pull request Oct 15, 2020
The ability to watch metav1.PartialObjectMetadata (or POM) and
metav1.Table was introduced in K8s 1.15. [1]

This is relevant because our CRD controller attempts to fetch CRDs in
the cluster efficiently by requesting the CRD in a POM object. The CRD
controller does this in order to avoid requesting the full object, which
may contain a large validation schema and other irrelevant fields. This
is important because in large-scale environments, all agents will
request all the CRDs at once which will put unnecessary load on the
apiserver.

However, we cannot perform this request at all on versions of K8s
1.14 and below. Therefore, we must fullback to requesting the full CRD
object. Hence, this commit allows us to check whether the apiserver
supports this action, so that we can efficiently request CRDs on
versions that do support it.

[1]: KEP:
https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/20190322-server-side-get-to-ga.md#goals

[1]: PR: kubernetes/kubernetes#71548

Signed-off-by: Chris Tarazi <chris@isovalent.com>
aanm pushed a commit to cilium/cilium that referenced this pull request Oct 15, 2020
The ability to watch metav1.PartialObjectMetadata (or POM) and
metav1.Table was introduced in K8s 1.15. [1]

This is relevant because our CRD controller attempts to fetch CRDs in
the cluster efficiently by requesting the CRD in a POM object. The CRD
controller does this in order to avoid requesting the full object, which
may contain a large validation schema and other irrelevant fields. This
is important because in large-scale environments, all agents will
request all the CRDs at once which will put unnecessary load on the
apiserver.

However, we cannot perform this request at all on versions of K8s
1.14 and below. Therefore, we must fullback to requesting the full CRD
object. Hence, this commit allows us to check whether the apiserver
supports this action, so that we can efficiently request CRDs on
versions that do support it.

[1]: KEP:
https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/20190322-server-side-get-to-ga.md#goals

[1]: PR: kubernetes/kubernetes#71548

Signed-off-by: Chris Tarazi <chris@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants