Skip to content

fix(chart): set preserveUnknownFields: false on CRDs - #3757

Open
aqeelat wants to merge 2 commits into
tektoncd:mainfrom
aqeelat:fix/chart-crd-preserve-unknown-fields
Open

fix(chart): set preserveUnknownFields: false on CRDs#3757
aqeelat wants to merge 2 commits into
tektoncd:mainfrom
aqeelat:fix/chart-crd-preserve-unknown-fields

Conversation

@aqeelat

@aqeelat aqeelat commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Changes

ArgoCD server-side-apply flags every CRD as OutOfSync because
kube-apiserver fills in spec.preserveUnknownFields: false server-side
on v1 CRDs where the field is omitted. Adding it explicitly in Git makes
the live-vs-source diff disappear.

  • Adds the field to all 14 CRDs in config/base/generated-crds/ (kustomize
    path) and 13 CRDs in charts/tekton-operator/templates/kubernetes-crds.yaml
    (Helm chart path). The 13 CRDs in openshift-crds.yaml pick it up via the
    regen in commit 2.
  • Wires an idempotent inject_preserve_unknown_false step into
    hack/sync-helm-crds.sh so future make sync-helm-crds runs preserve the
    field (single injection at the source covers both kustomize and chart paths).

Split into two commits:

  1. fix(chart): set preserveUnknownFields: false on CRDs — the actual fix
    • script wiring (~60 lines).
  2. chore(chart): regenerate openshift-crds.yaml to match generator
    pre-existing drift catch-up. The committed openshift-crds.yaml had 3
    CRDs while hack/sync-helm-crds.sh lists 13 (stale since 1ae0906b3
    rewired kustomize to generated-crds/ but did not regenerate this chart
    file). Surfaced when verifying the script change; isolated to keep
    commit 1 reviewable.

Submitter Checklist

  • Run make test lint before submitting a PR
    (make lint hit an env-specific golangci-lint download checksum
    failure; ran golangci-lint run ./pkg/... directly — 0 issues, no Go
    touched. Verified YAML via yq and script idempotency by re-running it.)
  • Includes tests
  • Includes docs
  • Commit messages follow commit message best practices

Release Notes

NONE

aqeelat added 2 commits July 19, 2026 14:40
Prevents ArgoCD server-side-apply from flagging every CRD as
OutOfSync due to apiserver-filled defaults.

Signed-off-by: Abdullah Alaqeel <abdullah.t.aqeel@gmail.com>
Assisted-by: GLM-5.2 (via opencode)
Reconciles stale chart file with hack/sync-helm-crds.sh, which
lists 13 CRDs while the committed file had only 3. Pre-existing
drift since 1ae0906 rewired kustomize to generated-crds/ but
did not regenerate this chart file.

Also picks up preserveUnknownFields: false on the 10 newly-added
CRD stanzas via the generator's injection step.

Signed-off-by: Abdullah Alaqeel <abdullah.t.aqeel@gmail.com>
Assisted-by: GLM-5.2 (via opencode)
@tekton-robot tekton-robot added the release-note-none Denotes a PR that doesnt merit a release note. label Jul 19, 2026
@tekton-robot
tekton-robot requested review from jkhelil and khrm July 19, 2026 13:05
@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 savitaashture after the PR has been reviewed.
You can assign the PR to them by writing /assign @savitaashture 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 added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 19, 2026
@codecov-commenter

codecov-commenter commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.49%. Comparing base (dd17bc5) to head (4c2a2cc).
⚠️ Report is 38 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3757   +/-   ##
=======================================
  Coverage   25.49%   25.49%           
=======================================
  Files         449      449           
  Lines       23370    23370           
=======================================
  Hits         5959     5959           
  Misses      16725    16725           
  Partials      686      686           
Flag Coverage Δ
unit-tests 25.49% <ø> (ø)

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.

@aqeelat

aqeelat commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

@jkhelil I only care about the first commit. The second one is up to you. It was the result of running hack/sync-helm-crds.sh

Note: shouldn't there be a check for this in CI? I can add a CI step either in this PR or in a new PR if you want.

@tekton-robot

Copy link
Copy Markdown
Contributor

@aqeelat: PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesnt merit a release note. 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.

3 participants