Skip to content

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

Open
anasalli wants to merge 1 commit into
tektoncd:mainfrom
anasalli:rfe-9431-crd-schema-expansion
Open

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

Conversation

@anasalli

@anasalli anasalli commented Jul 27, 2026

Copy link
Copy Markdown

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
…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 846f7a2 to 2f08675 Compare July 27, 2026 04:35
@anasalli

Copy link
Copy Markdown
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.40%. Comparing base (3d8e72a) to head (2f08675).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3811   +/-   ##
=======================================
  Coverage   25.40%   25.40%           
=======================================
  Files         449      449           
  Lines       23477    23477           
=======================================
  Hits         5964     5964           
  Misses      16822    16822           
  Partials      691      691           
Flag Coverage Δ
unit-tests 25.40% <ø> (ø)

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

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign vdemeester after the PR has been reviewed.
You can assign the PR to them by writing /assign @vdemeester in a comment when ready.

The full list of commands accepted by this bot can be found 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 removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

5 participants