Skip to content

fix(controller): accept legacy manifest flags#862

Open
5park1e wants to merge 1 commit into
alibaba:mainfrom
5park1e:fix/controller-legacy-flags
Open

fix(controller): accept legacy manifest flags#862
5park1e wants to merge 1 commit into
alibaba:mainfrom
5park1e:fix/controller-legacy-flags

Conversation

@5park1e
Copy link
Copy Markdown

@5park1e 5park1e commented May 10, 2026

Summary

  • extract controller flag registration into a testable options binder in cmd/controller/options.go
  • keep accepting kube client rate-limit flags used by older manifests
  • accept the legacy --v flag from early controller Helm charts and log a deprecation message
  • add unit coverage for legacy controller manifest argument sets in cmd/controller/options_test.go

Validation

  • docker run --rm -u 1000:1000 -v /home/zhanghaojie/code/OpenSandbox/kubernetes:/workspace -v /tmp/opensandbox-go-build:/tmp/go-build -v /tmp/opensandbox-go-mod:/tmp/go-mod -w /workspace -e GOCACHE=/tmp/go-build -e GOMODCACHE=/tmp/go-mod golang:1.24 bash -lc '/usr/local/go/bin/gofmt -w cmd/controller/main.go cmd/controller/options.go cmd/controller/options_test.go && /usr/local/go/bin/go test ./cmd/controller'

Fixes #855

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 10, 2026

CLA assistant check
All committers have signed the CLA.

@5park1e 5park1e marked this pull request as ready for review May 10, 2026 13:48
@5park1e
Copy link
Copy Markdown
Author

5park1e commented May 10, 2026

This PR touches the Kubernetes controller compatibility path. Could a maintainer please add the component/k8s label?

Comment thread kubernetes/cmd/controller/options_test.go
@Pangjiping Pangjiping added the component/k8s For kubernetes runtime label May 10, 2026
@5park1e 5park1e force-pushed the fix/controller-legacy-flags branch from 67d7d12 to b1183c1 Compare May 10, 2026 14:33
@5park1e 5park1e force-pushed the fix/controller-legacy-flags branch from b1183c1 to f9b5d66 Compare May 11, 2026 01:57
@5park1e
Copy link
Copy Markdown
Author

5park1e commented May 11, 2026

Thanks for the suggestion. I moved the controller options binding logic out of main.go and kept the coverage in options_test.go, so the test now targets the extracted options layer instead of main.go directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/k8s For kubernetes runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Controller manager v0.1.13 crashes on startup: flag provided but not defined: -kube-client-qps

4 participants