Zenithar/chaos controller/kubernetes 1 35 support#1047
Draft
Zenithar/chaos controller/kubernetes 1 35 support#1047
Conversation
Package was declared as `controllers` instead of `controller`, causing a build failure across all CI jobs (fmt, lint, test, docker-build, codegen validation). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: cb5c492 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Kubernetes] Update to Kubernetes 1.35 and controller-runtime v0.23.1
Summary
This PR upgrades the chaos-controller to support Kubernetes 1.35 by bumping all core
k8s.io/*dependencies tov0.35.0andsigs.k8s.io/controller-runtimetov0.23.1. The upgrade required adopting the kubebuilder v4 project layout (moving controllers tointernal/controller/, entrypoint tocmd/main.go) and migrating webhooks to the new typed generics API (admission.Defaulter[T]/admission.Validator[T]). CI workflows were hardened by pinning all GitHub Actions to commit SHAs, and the generated protobuf code was regenerated with modern tooling.Changes
Domain Logic / Webhooks:
Disruptionwebhook fromwebhook.CustomDefaulter/webhook.CustomValidatorto typedadmission.Defaulter[*Disruption]/admission.Validator[*Disruption]-- eliminates runtime type assertionsDisruptionCronwebhook with the same typed generics patternctrl.NewWebhookManagedBy()call signature: object passed as argument,.For()removedk8s.io/api/authentication/v1beta1.UserInfowithauthV1.UserInfoProject Layout (kubebuilder v4):
controllers->internal/controller(all source + test files)main.go->cmd/main.goPROJECTfile layout fromgo.kubebuilder.io/v3togo.kubebuilder.io/v4.goreleaser.ymlto setmain: ./cmdbin/manager/Dockerfilebuild path to./cmdinternal/controllerDependencies (go.mod):
k8s.io/api,k8s.io/apimachinery,k8s.io/client-go,k8s.io/cli-runtime:v0.34.3->v0.35.0k8s.io/apiextensions-apiserver:v0.33.0->v0.35.0sigs.k8s.io/controller-runtime:v0.21.0->v0.23.1controller-gen:v0.19.0->v0.20.1(CRD manifests regenerated)Mocks:
Applymethod mock toK8SClientMock(new inclient.Clientinterface)GetEventRecorderandGetConverterRegistrymethod mocks toManagerMock(new inmanager.Managerinterface)Generated Protobuf Code:
chaosdogfoodanddisruptionlistenerprotobuf/gRPC stubs withprotoc-gen-go v1.36.11/protoc v6.33.4/protoc-gen-go-grpc v1.6.1protogen:"open.v1"struct layout, removed legacyprotoimpl.UnsafeEnabledguardsSupportPackageIsVersion9,grpc.StaticMethod(), and exportedFullMethodNameconstantsUnimplementedServertypes now embed by value withtestEmbeddedByValue()safety checkCI/CD Hardening (GitHub Actions pinned to SHA):
actions/checkout->@34e114876b0b11c390a56381ad16ebd13914f8d5(v4.3.1)actions/setup-go->@40f1582b2485089dde7abd97c1529aa768e1baff(v5.6.0)actions/upload-artifact->@ea165f8d65b6e75b540449e92b4886f43607fa02(v4.6.2)actions/download-artifact->@d3f86a106a0bac45b974a628896c90dbdf5c8093(v4.3.0)goreleaser/goreleaser-action->@e435ccd777264be153ace6237001ef4d979d3a7a(v6.4.0)azure/setup-helm->@1a275c3b69536ee54be43f2070a358922e12c8d4(v4.3.1)DataDog/dd-sts-action@mainreplaced byDataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80(v1.0.3)CI/CD Tooling Updates:
git fetch --prune --unshallowwithfetch-depth: 0, usego-version-filev3.6.3->v3.19.0protoc:3.17.3->29.6,protoc-gen-go:v1.27.1->v1.36.11,protoc-gen-go-grpc:v1.1.0->v1.6.1yamlfmt:v0.9.0->v0.21.0cert-manager:v1.9.1->v1.19.3longhorn:v1.4.0->v1.11.0Lint/Format/Licenses:
cmd/main.goLICENSE-3rdparty.csvupdated to reflect new/changed transitive dependencies (storagemigration v1alpha1 -> v1beta1, new entries for events, watchlist, version, kyaml, conversion/metrics, etc.)Infrastructure (Lima/k3s):
lima.yaml:v1.26.3+k3s1->v1.35.1+k3s11.28->1.35Testing
Unit Tests:
internal/controller/with package renameE2E Tests:
Breaking Changes
Dependencies
k8s.io/apiv0.34.3->v0.35.0k8s.io/apimachineryv0.34.3->v0.35.0k8s.io/client-gov0.34.3->v0.35.0k8s.io/cli-runtimev0.33.3->v0.35.0sigs.k8s.io/controller-runtimev0.21.0->v0.23.1go.sumdiff)Checklist
runtime.Objectassertions)v0.20.1internal/controller/,cmd/main.go)