Skip to content

feat: update k8s to 0.36#3470

Open
kannon92 wants to merge 1 commit intokubeflow:masterfrom
kannon92:k8s-1-3-6
Open

feat: update k8s to 0.36#3470
kannon92 wants to merge 1 commit intokubeflow:masterfrom
kannon92:k8s-1-3-6

Conversation

@kannon92
Copy link
Copy Markdown
Contributor

@kannon92 kannon92 commented May 4, 2026

What this PR does / why we need it:

Update kubernetes dependencies to 0.36

Which issue(s) this PR fixes (optional, in Fixes #<issue number>, #<issue number>, ... format, will close the issue(s) when PR gets merged):
Fixes #

Checklist:

  • Docs included if any changes are user facing

Copilot AI review requested due to automatic review settings May 4, 2026 23:47
@google-oss-prow
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign astefanutti for approval. For more information see the Kubernetes Code Review Process.

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

@kannon92 kannon92 changed the title update k8s to 0.36 feat: update k8s to 0.36 May 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the project’s Kubernetes-related dependencies to k8s.io/* v0.36.0 (and related ecosystem libs), and regenerates the derived client/informer and OpenAPI/CRD artifacts to match the new upstream APIs and schemas.

Changes:

  • Bump Kubernetes and controller-runtime dependencies (plus related indirect deps) to align with Kubernetes 0.36.
  • Regenerate informer/client/openapi artifacts and update CRDs/charts accordingly (new/removed schema fields, updated descriptions).
  • Adjust unit test error assertions to match updated error representations.

Reviewed changes

Copilot reviewed 39 out of 40 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/runtime/framework/plugins/jobset/jobset_test.go Updates validation test assertions for error comparisons.
pkg/client/informers/externalversions/trainer/v1alpha1/trainjob.go Regenerated informer code updated for new client-go/informer options APIs.
pkg/client/informers/externalversions/trainer/v1alpha1/trainingruntime.go Regenerated informer code updated for new client-go/informer options APIs.
pkg/client/informers/externalversions/trainer/v1alpha1/clustertrainingruntime.go Regenerated informer code updated for new client-go/informer options APIs.
pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go Adds informer options + informer name plumbing for metrics identity.
pkg/client/informers/externalversions/factory.go Updates shared informer factory implementation for context-based start/sync and informer identity.
pkg/client/clientset/versioned/fake/clientset_generated.go Updates generated fake clientset behavior/docs for watchlist semantics + field management support.
pkg/apis/trainer/v1alpha1/zz_generated.openapi.go Regenerated OpenAPI definitions for updated Kubernetes types/schemas.
pkg/apis/config/v1alpha1/doc.go Adds API package doc for controller manager config v1alpha1.
manifests/base/crds/trainer.kubeflow.org_trainjobs.yaml Regenerated CRD schema changes for TrainJobs (k8s schema updates).
manifests/base/crds/trainer.kubeflow.org_trainingruntimes.yaml Regenerated CRD schema changes for TrainingRuntimes (k8s schema updates).
manifests/base/crds/trainer.kubeflow.org_clustertrainingruntimes.yaml Regenerated CRD schema changes for ClusterTrainingRuntimes (k8s schema updates).
charts/kubeflow-trainer/crds/trainer.kubeflow.org_trainjobs.yaml Helm chart CRD sync with regenerated TrainJobs CRD schema.
charts/kubeflow-trainer/crds/trainer.kubeflow.org_trainingruntimes.yaml Helm chart CRD sync with regenerated TrainingRuntimes CRD schema.
charts/kubeflow-trainer/crds/trainer.kubeflow.org_clustertrainingruntimes.yaml Helm chart CRD sync with regenerated ClusterTrainingRuntimes CRD schema.
api/python_api/kubeflow_trainer_api/models/io_k8s_apimachinery_pkg_apis_meta_v1_shard_info.py Adds generated Python model for new ShardInfo.
api/python_api/kubeflow_trainer_api/models/io_k8s_apimachinery_pkg_apis_meta_v1_list_options.py Adds generated Python support for shardSelector.
api/python_api/kubeflow_trainer_api/models/io_k8s_apimachinery_pkg_apis_meta_v1_list_meta.py Adds generated Python support for shardInfo in list responses.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_volume.py Regenerated Python model updates reflecting k8s schema doc changes.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_volume_status.py Adds generated Python model for new VolumeStatus.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_volume_source.py Regenerated Python model updates reflecting k8s schema doc changes.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_volume_mount_status.py Adds generated Python support for volumeStatus.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_security_context.py Regenerated Python model doc changes for procMount.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_resource_health.py Adds generated Python support for message on resource health.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_pod_status.py Adds generated Python support for node allocatable resource claim statuses.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_pod_spec.py Regenerated Python model updates (adds schedulingGroup, removes workloadRef).
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_pod_scheduling_group.py Adds generated Python model for new PodSchedulingGroup.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_pod_resource_claim.py Regenerated Python model doc updates for DRA workload resource claims.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_pod_resource_claim_status.py Regenerated Python model doc updates for DRA workload resource claims.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_pod_condition.py Regenerated Python model doc updates for observedGeneration.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_persistent_volume_spec.py Regenerated Python model doc updates for Portworx migration text.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_persistent_volume_source.py Regenerated Python model doc updates for Portworx migration text.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_node_allocatable_resource_claim_status.py Adds generated Python model for new node allocatable claim status type.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_core_v1_image_volume_status.py Adds generated Python model for new ImageVolumeStatus.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_batch_v1_cron_job.py Regenerated Python model making spec required.
api/python_api/kubeflow_trainer_api/models/io_k8s_api_autoscaling_v2_horizontal_pod_autoscaler.py Regenerated Python model making spec required.
api/python_api/kubeflow_trainer_api/models/init.py Updates generated exports for newly added models.
api/openapi-spec/swagger.json Regenerated OpenAPI spec reflecting Kubernetes 0.36 schema updates.
go.mod Bumps direct/indirect Go module dependencies to Kubernetes 0.36 ecosystem versions.
go.sum Updates module checksums to match the new dependency graph.

Comment thread pkg/client/informers/externalversions/factory.go
Comment on lines -1580 to +1586
if diff := cmp.Diff(tc.wantError, errs); len(diff) != 0 {
t.Errorf("Unexpected error from Validate (-want, +got): %s", diff)
if len(tc.wantError) != len(errs) {
t.Fatalf("Unexpected number of errors from Validate: want %d, got %d\nwant: %v\ngot: %v", len(tc.wantError), len(errs), tc.wantError, errs)
}
for i := range tc.wantError {
if tc.wantError[i].Error() != errs[i].Error() {
t.Errorf("Unexpected error[%d] from Validate:\nwant: %s\ngot: %s", i, tc.wantError[i], errs[i])
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think that we should change these. Please keep the error comparison.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was one of the main failues I got. I'll take a look more on how to fix it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

RCA summarized via AI.

Test Fix Summary

Problem

The test TestValidate/forbid_changes_to_runtimePatches_when_trainJob_is_suspended_but_jobSet_cannot_be_checked_due_to_a_client_error was failing with a panic when comparing field.ErrorList objects.

Root Cause

field.ErrorList contains pointers to field.Error structs
When field.InternalError() is called, it stores an error in the BadValue field
fmt.Errorf() returns *errors.errorString which has an unexported field s
cmp.Diff() panicked when trying to compare these unexported fields

Solution

Added a custom comparer for *field.Error that compares only the exported fields (Type, Field, and Detail) instead of trying to deep-compare the entire struct including the BadValue field with unexported content.
Changes Made
Modified [jobset_test.go:1580-1591] to use a custom cmp.Comparer function that compares field.Error pointers by their semantic content rather than pointer identity or deep struct comparison.

errComparer := cmp.Comparer(func(a, b *field.Error) bool {
    if a == nil && b == nil {
        return true
    }
    if a == nil || b == nil {
        return false
    }
    return a.Type == b.Type && a.Field == b.Field && a.Detail == b.Detail
})
if diff := cmp.Diff(tc.wantError, errs, errComparer); len(diff) != 0 {
    t.Errorf("Unexpected error from Validate (-want, +got): %s", diff)
}

@kannon92 kannon92 force-pushed the k8s-1-3-6 branch 2 times, most recently from 1560d3c to d1b1dc0 Compare May 5, 2026 16:51
@kannon92 kannon92 requested a review from tenzen-y May 6, 2026 13:58
Signed-off-by: Kevin Hannon <kehannon@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants