Show correct vpc-resource-controller version in the userAgent
Brought this up with @orsenthil over slack
What would you like to be enhanced:
The cloudwatch EKS cluster logs for vpc-resource-controller actions shows the userAgent field as:
"userAgent": "controller/v0.0.0 (linux/amd64) kubernetes/$Format",
It would be better if instead of always showing v0.0.0 the logs showed which version of the vpc-resource-controller made the request.
Why is the change needed and what use case will it solve:
It would have been simpler for us to track and report the v1.5.0 trunk initialization issues if the userAgent version mapped to the version of the vpc-resource-controller that made the request.
@ClareCat thanks for reporting this. We have correct agent version showing in EC2 dashboards. I am not sure why CloudWatch doesn't have version correctly showing. I will take a look.
@haouc - I pointed out to the GitVersion that is displayed during the bootstrap ( https://github.com/aws/amazon-vpc-resource-controller-k8s/blob/964a3cce8281e25c185369f63859ed63bedd491f/main.go#L179) . this is different from that log; the request is if the controller version can be set in user agent.
Yeah, this is the userAgent that is set in the manager k8s client. It's probably an option value in there.
Right now it seems like it's just using this default: https://github.com/kubernetes/client-go/blob/master/rest/config.go#L491-L505
I have updated the userAgent to reflect the vpc-resource-controller and gitVersion in this PR https://github.com/aws/amazon-vpc-resource-controller-k8s/pull/455