kubernetes-sigs / prow

Prow is a Kubernetes based CI/CD system developed to serve the Kubernetes community. This repository contains Prow source code and Hugo sources for Prow documentation site.
https://docs.prow.k8s.io
Apache License 2.0
127 stars 98 forks source link

Don't embed tekton schema in ProwJob CRD #196

Closed maboehm closed 4 months ago

maboehm commented 5 months ago

The CRD has become too large for standard kubernetes / etcd installations. With this change, the CRD generation is instructed to treat all tektoncd types as schema-less (while instructing the apiserver to keep unknown fields). This reduces the size down to around 500KB

Seems like upstream, tekton is doing something similar, their CRD does not have a schema: https://github.com/tektoncd/pipeline/blob/main/config/300-crds/300-pipelinerun.yaml#L62-L72

I also updated the admission component to use strict validation and to be able to handle CREATE requests as well. With this component deployed, you would get at least some level of safety back, even if the response is a bit lacking right now:

# non-existing field
Error from server: error when creating "test/integration/test/testdata/valid_bare_prowjob.yaml": admission webhook "prowjob-validator.prow.k8s.io" denied the request: decode new: strict decoding error: unknown field "spec.pipeline_run_spec.foo"

# wrong type on field
Error from server: error when creating "test/integration/test/testdata/valid_bare_prowjob.yaml": admission webhook "prowjob-validator.prow.k8s.io" denied the request: decode new: json: cannot unmarshal string into Go struct field PipelineRunSpec.spec.pipeline_run_spec.pipelineRef of type v1beta1.PipelineRef

(I also did not see the admission component installed in https://github.com/kubernetes/test-infra/tree/master/config/prow so not sure who uses it. We dont have it in our env.)

Fixes https://github.com/kubernetes-sigs/prow/issues/181

linux-foundation-easycla[bot] commented 5 months ago

CLA Signed


The committers listed above are authorized under a signed CLA.

k8s-ci-robot commented 5 months ago

Welcome @maboehm!

It looks like this is your first PR to kubernetes-sigs/prow πŸŽ‰. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/prow has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot commented 5 months ago

Hi @maboehm. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
netlify[bot] commented 5 months ago

Deploy Preview for k8s-prow ready!

Name Link
Latest commit 0ee99b9ee1bd56595519879d1e01224e0d74eceb
Latest deploy log https://app.netlify.com/sites/k8s-prow/deploys/667042ee55a39a0008078d05
Deploy Preview https://deploy-preview-196--k8s-prow.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

matthyx commented 5 months ago

awesome @maboehm can you check the CLA?

maboehm commented 5 months ago

Just an additional comment: we dont use the tekton stuff in our setup, so might be worth double checking (but I did check that the fields are in fact preserved, so confidence is high)

matthyx commented 5 months ago

/ok-to-test

stevekuznetsov commented 5 months ago

Do we know who's using the Tekton side in production? Could we get their input on this change? I think this is the right direction but I'm not sure if this would cause some hassle for them on upgrade.

maboehm commented 4 months ago

It's been two weeks, should we just move forward?

matthyx commented 4 months ago

It's been two weeks, should we just move forward?

I'd say yes. /approve /hold

k8s-ci-robot commented 4 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maboehm, matthyx

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: - ~~[OWNERS](https://github.com/kubernetes-sigs/prow/blob/main/OWNERS)~~ [matthyx] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
petr-muller commented 4 months ago

I agree

/lgtm /hold cancel