Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consuming cloud-provider appears problematic in 1.20 #44

Closed
NeilW opened this issue Dec 23, 2020 · 4 comments · Fixed by kubernetes/kubernetes#98210
Closed

Consuming cloud-provider appears problematic in 1.20 #44

NeilW opened this issue Dec 23, 2020 · 4 comments · Fixed by kubernetes/kubernetes#98210
Assignees

Comments

@NeilW
Copy link

NeilW commented Dec 23, 2020

I've just upgraded the Brightbox cloud-controller to 1.20 and, in common with the AWS updates, I found the new interfaces into the library to be problematic, and the sample 'main' code to not work as I'd expected.

Primarily the call to s.Config appears to be too early and the command line flags have not been enumerated at that point, so version and help doesn't work and neither do command line flags.

I had to rewrite the top level interface along the lines of the AWS controller and move the call to s.Config back within the Cobra command function.

Of course it's possible I've completely misunderstood how this interface is supposed to work in its new configuration and if anybody can explain that I'd be grateful.

The code I ended up with is here: https://github.com/brightbox/brightbox-cloud-controller-manager/blob/8acb44fc63a74ca14c96daec039a4d2473881e52/app/cloudcontroller.go

Which is based on the AWS main file here: https://github.com/kubernetes/cloud-provider-aws/blob/3b384bb6e144446cb8015ab83269d6f99ac00898/cmd/aws-cloud-controller-manager/main.go

@andrewsykim
Copy link
Member

@NeilW thanks for feedback, not rendering the command line flags prior to s.Config sounds like a bug to me. @cici37 is this something you can take a look at?

Which flags specifically were not being rendered? Seems like maybe those should be added here:

https://github.com/kubernetes/kubernetes/blob/9465d95ea69bb5ee140df605f0b7960d5ca0b758/staging/src/k8s.io/cloud-provider/options/options.go#L127-L147

@NeilW
Copy link
Author

NeilW commented Dec 23, 2020

All of them since the call to Config triggers a Validate which fails with '--cloud-provider cannot be empty'.

The flags aren't setup until

for _, f := range namedFlagSets.FlagSets {

@cici37
Copy link
Contributor

cici37 commented Dec 23, 2020

Thank you for raising it. I will work on it.
/assign

@andrewsykim
Copy link
Member

@cici37 any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants