Skip to content

Fix KUBERNETES_MIN_VERSION propagation to operand workloads - #2245

Merged
knative-prow[bot] merged 1 commit into
knative:mainfrom
eXist-FraGGer:main
Mar 19, 2026
Merged

knative-prow[bot] merged 1 commit into
knative:mainfrom
eXist-FraGGer:main

Conversation

@eXist-FraGGer

Copy link
Copy Markdown
Contributor

Fixes #2233

Proposed Changes

  • Add a common reconciler transformer that propagates KUBERNETES_MIN_VERSION from operator env to managed workloads.
  • Inject/override KUBERNETES_MIN_VERSION for containers and initContainers in Deployment, StatefulSet, DaemonSet, and Job resources.
  • Wire the transformer into the shared transform pipeline and add unit tests for both injection and no-op behavior when the env var is unset.

Release Note

Fixes a regression where `KUBERNETES_MIN_VERSION` configured for the operator was not propagated to Knative Serving/Eventing workloads managed by the operator.

Verification

  • go test ./pkg/reconciler/common -count=1 passed.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Feb 28, 2026 •

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: eXist-FraGGer / name: Ivan Sarokin (16ff35a)

@knative-prow

knative-prow Bot commented Feb 28, 2026

Copy link
Copy Markdown

Welcome @eXist-FraGGer! It looks like this is your first PR to knative/operator 🎉

@knative-prow

knative-prow Bot commented Feb 28, 2026

Copy link
Copy Markdown

Hi @eXist-FraGGer. Thanks for your PR.

I'm waiting for a knative 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.

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-sigs/prow repository.

@knative-prow knative-prow Bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 28, 2026
@knative-prow
knative-prow Bot requested review from aliok and houshengbo February 28, 2026 00:20

@knative-prow knative-prow Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eXist-FraGGer: 0 warnings.

Details

In response to this:

Fixes #2233

Proposed Changes

  • Add a common reconciler transformer that propagates KUBERNETES_MIN_VERSION from operator env to managed workloads.
  • Inject/override KUBERNETES_MIN_VERSION for containers and initContainers in Deployment, StatefulSet, DaemonSet, and Job resources.
  • Wire the transformer into the shared transform pipeline and add unit tests for both injection and no-op behavior when the env var is unset.

Release Note

Fixes a regression where `KUBERNETES_MIN_VERSION` configured for the operator was not propagated to Knative Serving/Eventing workloads managed by the operator.

Verification

  • go test ./pkg/reconciler/common -count=1 passed.

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-sigs/prow repository.

@dprotaso

Copy link
Copy Markdown
Member

/ok-to-test

Assigning to Vincent in case there's a simpler way of accomplishing this. Otherwise seems good to use a transformer

/assign @houshengbo

@knative-prow knative-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 11, 2026
@codecov

codecov Bot commented Mar 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.07407% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.85%. Comparing base (f9b286d) to head (16ff35a).
⚠️ Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
pkg/reconciler/common/kubernetes_min_version.go 73.58% 7 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2245      +/-   ##
==========================================
+ Coverage   63.45%   63.85%   +0.39%     
==========================================
  Files          49       50       +1     
  Lines        1899     1953      +54     
==========================================
+ Hits         1205     1247      +42     
- Misses        600      605       +5     
- Partials       94      101       +7     

☔ View full report in Codecov by Sentry.
📢 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.

@eXist-FraGGer

Copy link
Copy Markdown
Contributor Author

/ok-to-test

Hey @dprotaso, I have added few more tests to cover the code, not sure if the @codecov will run this again.

}
for i := range podSpec.InitContainers {
mergeEnv(&minVersionEnv, &podSpec.InitContainers[i].Env)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to fill in the EphemeralContainers as well for debugging debugging/ephemeral containers, though they are not common to use:

// Add this to cover debugging/ephemeral containers
    for i := range podSpec.EphemeralContainers {
        mergeEnv(&minVersionEnv, &podSpec.EphemeralContainers[i].Env)
    }

@houshengbo houshengbo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve
Based on the knative's perspective, it should have covered all resources. We need to pay attention later, especially when knative serving or eventing adds more resources like CronJob or Pod.

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 19, 2026
@knative-prow

knative-prow Bot commented Mar 19, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eXist-FraGGer, houshengbo

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

@knative-prow knative-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 19, 2026
@knative-prow
knative-prow Bot merged commit 257d0a0 into knative:main Mar 19, 2026
25 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken KUBERNETES_MIN_VERSION

3 participants