Skip to content

RFE-9431: expose full openAPIV3Schema for pruner, scheduler, and networkpolicy configs - #3811

Merged
tekton-robot merged 1 commit into
tektoncd:mainfrom
anasalli:rfe-9431-crd-schema-expansion
Aug 5, 2026
Merged

RFE-9431: expose full openAPIV3Schema for pruner, scheduler, and networkpolicy configs#3811
tekton-robot merged 1 commit into
tektoncd:mainfrom
anasalli:rfe-9431-crd-schema-expansion

Conversation

@anasalli

@anasalli anasalli commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Changes

Removes +kubebuilder:validation:Schemaless from three configuration types so that oc explain shows the full schema for configurable fields in the TektonConfig CRD.

Before: oc explain tektonconfig.spec.tektonpruner.global-config shows just <Object> with no fields.

After: Shows all configurable fields (enforcedConfigLevel, ttlSecondsAfterFinished, historyLimit, namespaces, etc.)

Ref: https://redhat.atlassian.net/browse/RFE-9431

What was changed:

  • Removed // +kubebuilder:validation:Schemaless from:
    • SchedulerConfig.Config in tektonscheduler_types.go (exposes: queueName, multiKueueOverride, cel)
    • TektonPrunerConfig.GlobalConfig in tektonpruner_types.go (exposes: ttlSecondsAfterFinished, historyLimit, namespaces, etc.)
    • NetworkPolicyConfig.Policies in networkpolicy_config.go (exposes: podSelector, ingress, egress)
  • Kept +kubebuilder:pruning:PreserveUnknownFields on all three fields for backward compatibility
  • Regenerated all affected CRDs via controller-gen v0.18.0

Size Impact

CRD Before After Limit
TektonConfig 71 KB 111 KB 256 KB

All CRDs remain well under the 256 KB size constraint enforced by hack/sync-helm-crds.sh.

Why not expand AdditionalOptions?

The AdditionalOptions fields (Deployments, StatefulSets, ConfigMaps, HPAs) embed full Kubernetes types that would each add ~100 KB per instance across 11 components, pushing the CRD far over the 256 KB limit. These remain schemaless by necessity.

Testing

  • Applied the regenerated CRD to an OCP 4.21.18 cluster with OpenShift Pipelines 1.23.0
  • Verified oc explain now shows full field schemas for all three types
  • Verified TektonConfig resource remains Ready=True with all conditions healthy
  • No disruption to running Tekton components (18 pods in openshift-pipelines namespace)

Submitter Checklist

See the contribution guide for more details.

Release Notes

Exposed full openAPIV3Schema for TektonConfig CRD fields: tektonpruner global-config, scheduler config.yaml, and networkPolicy policies. Users can now run `oc explain tektonconfig.spec.tektonpruner.global-config` to see all configurable fields instead of just `<Object>`.

@tekton-robot
tekton-robot requested a review from infernus01 July 27, 2026 04:30
@tekton-robot tekton-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Jul 27, 2026
@tekton-robot
tekton-robot requested a review from jkhelil July 27, 2026 04:30
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 27, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: anasalli / name: Anas Ali (2f08675)

@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 27, 2026
@anasalli
anasalli force-pushed the rfe-9431-crd-schema-expansion branch from 846f7a2 to 2f08675 Compare July 27, 2026 04:35
@anasalli

Copy link
Copy Markdown
Contributor Author

Note on PR size: This PR shows +1721 lines but the actual manual change is only 3 lines removed from 3 Go files (removing // +kubebuilder:validation:Schemaless annotations). The remaining ~1718 lines are auto-generated CRD YAML produced by controller-gen v0.18.0.

Manual changes (3 lines):

  • pkg/apis/operator/v1alpha1/tektonscheduler_types.go — 1 line removed
  • pkg/apis/operator/v1alpha1/tektonpruner_types.go — 1 line removed
  • pkg/apis/operator/v1alpha1/networkpolicy_config.go — 1 line removed

Auto-generated (5 CRD files):

  • config/base/generated-crds/operator.tekton.dev_tektonconfigs.yaml
  • config/base/generated-crds/operator.tekton.dev_tektonpipelines.yaml
  • config/base/generated-crds/operator.tekton.dev_tektonpruners.yaml
  • config/base/generated-crds/operator.tekton.dev_tektonschedulers.yaml
  • config/base/generated-crds/operator.tekton.dev_tektontriggers.yaml

@anithapriyanatarajan

anithapriyanatarajan commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@anasalli please follow the PR template. Release Note section has to be populated as applicable. Also complete the EasyCLA

@codecov-commenter

codecov-commenter commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.41%. Comparing base (9529e3a) to head (3c0dd2c).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3811   +/-   ##
=======================================
  Coverage   25.41%   25.41%           
=======================================
  Files         450      450           
  Lines       23607    23607           
=======================================
  Hits         5999     5999           
  Misses      16918    16918           
  Partials      690      690           
Flag Coverage Δ
unit-tests 25.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jul 29, 2026
@jkhelil

jkhelil commented Jul 30, 2026

Copy link
Copy Markdown
Member

/approve

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 30, 2026
@jkhelil

jkhelil commented Aug 3, 2026

Copy link
Copy Markdown
Member

/approve cancel

@tekton-robot tekton-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 3, 2026
@jkhelil

jkhelil commented Aug 3, 2026

Copy link
Copy Markdown
Member

@anasalli Can you rebase and rerun hack/sync-helm-crds.sh ?

…orkpolicy configs

Remove +kubebuilder:validation:Schemaless from SchedulerConfig, TektonPrunerConfig,
and NetworkPolicyConfig so that kubectl explain / oc explain shows the full schema
for these configuration fields instead of just <Object>.

Keep +kubebuilder:pruning:PreserveUnknownFields for backward compatibility.

TektonConfig CRD size: 71 KB -> 111 KB (limit: 256 KB).

Signed-off-by: Anas Ali <aanasali@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@anasalli
anasalli force-pushed the rfe-9431-crd-schema-expansion branch from 2f08675 to 3c0dd2c Compare August 4, 2026 06:59
@anasalli

anasalli commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@jkhelil Done! Rebased on latest main and ran hack/sync-helm-crds.sh. The Helm chart CRDs are now included and all size validations passed:

Step 2: Validating CRD sizes...
  operator.tekton.dev_tektonconfigs.yaml: 62837 bytes
  ...
Done! CRDs synced and validated successfully.

All CRDs are well under the 256 KB limit.

@jkhelil

jkhelil commented Aug 4, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@pratap0007

Copy link
Copy Markdown
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 4, 2026
@jkhelil

jkhelil commented Aug 5, 2026

Copy link
Copy Markdown
Member

/approve

@tekton-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jkhelil

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

The pull request process is described here

Details 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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 5, 2026
@tekton-robot
tekton-robot merged commit ec540d6 into tektoncd:main Aug 5, 2026
18 checks passed
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. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

6 participants