Skip to content

fix(controller): accept legacy manifest flags#862

Closed
5park1e wants to merge 1 commit into
opensandbox-group:mainfrom
5park1e:fix/controller-legacy-flags
Closed

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

Conversation

@5park1e

@5park1e 5park1e commented May 10, 2026

Copy link
Copy Markdown

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

CLAassistant commented May 10, 2026

Copy link
Copy Markdown

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

5park1e commented May 10, 2026

Copy link
Copy Markdown
Author

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

5park1e commented May 11, 2026

Copy link
Copy Markdown
Author

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.

@Pangjiping Pangjiping closed this Jun 16, 2026
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