amazon-vpc-resource-controller-k8s icon indicating copy to clipboard operation
amazon-vpc-resource-controller-k8s copied to clipboard

Show correct vpc-resource-controller version in the userAgent

Open ClareCat opened this issue 1 year ago • 4 comments

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 avatar Jul 16 '24 15:07 ClareCat

@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 avatar Jul 17 '24 17:07 haouc

@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.

orsenthil avatar Jul 17 '24 17:07 orsenthil

Yeah, this is the userAgent that is set in the manager k8s client. It's probably an option value in there.

ClareCat avatar Jul 17 '24 20:07 ClareCat

Right now it seems like it's just using this default: https://github.com/kubernetes/client-go/blob/master/rest/config.go#L491-L505

ClareCat avatar Jul 17 '24 20:07 ClareCat

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

orsenthil avatar Aug 21 '24 22:08 orsenthil