You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Recently my team has been working on a crossplane provider for AVI, which uses the go SDK (through the terraform AVI provider). We ran into an issue with our flag parser whenever a flag was passed. We were not using the default flag package.
We traced the issue back to this function:
For an SDK, I don't really understand why it should parse flags. Considering it cannot be built into an executable (AFAIK). Would like to hear others thoughts about this.
Cheers.
Describe alternatives you've considered
For the time being, my team has implemented a solution using the default flag package.
Additional context
No response
The text was updated successfully, but these errors were encountered:
We are using the SDK to implement a cert-manager webhook for the DNS01 challenge. The problem here is the same as above. The SDK is used as a library inside a command with command line parameters. As soon, as we try to get an AVI client (the session really), the parsing of the command line parameters will crash the program (as it does not recognize the command line parameters, that are for the webhook).
Our current workaround is to parse an empty slice with the following code right before calling clients.NewAviClient(...):
if!flag.CommandLine.Parsed() {
klog.Info("Workaround for AVI session")
flag.CommandLine.Parse([]string{})
}
aviClient, err:=clients.NewAviClient(cfg.ApiEndpoint, cfg.ApiUser, sessionOptions...)
I wasn't sure whether this was a bug or a feature so I might be wrong with my choice of label.
In our case, since crossplane providers by default use kingpin to parse flags, flags.parsed() would evaluate to false and then the function would throw an error because of the unrecognized flags. We solved this by changing the flag parser in the provider to the default flag package so flags.parsed() would return true.
I still have no idea why the sdk would need to parse flags, would like to hear from one of the maintainers why this was added in the first place.
Is your feature request related to a problem? Please describe.
Recently my team has been working on a crossplane provider for AVI, which uses the go SDK (through the terraform AVI provider). We ran into an issue with our flag parser whenever a flag was passed. We were not using the default
flag
package.We traced the issue back to this function:
alb-sdk/go/session/avisession.go
Lines 306 to 309 in cc85715
Describe the solution you'd like
For an SDK, I don't really understand why it should parse flags. Considering it cannot be built into an executable (AFAIK). Would like to hear others thoughts about this.
Cheers.
Describe alternatives you've considered
For the time being, my team has implemented a solution using the default
flag
package.Additional context
No response
The text was updated successfully, but these errors were encountered: