[ ] Leave this box unchecked if features are not yet available in production
What
We want to be able to pass the CLI version information to the backend server for CMF to perform compatibility checks.
All the commands except web-ui-forward use a SDK which sets up the UserAgent header. We simply pass the value of the version to the same header.
In case of web-ui-forward, since the origin of the calls will be from user's browser, we did not want to override the user agent header as it might be used by browsers for checks of their own, we have introduced a new header for just that API.
Validation
I have verified that the version is being propagated into the request by using ldflags and validating that it has the same behaviour for the flink commands as the base version command
> go run -ldflags "-X main.version=1.2.0" cmd/confluent/main.go flink environment list --unsafe-trace
2024/10/15 22:21:27
GET /cmf/api/v1/environments?page=0&size=100 HTTP/1.1
Host: localhost:8080
User-Agent: Confluent-CLI/v1.2.0 (https://confluent.io; support@confluent.io)
Accept: application/json
Accept-Encoding: gzip
go run -ldflags "-X main.version=1.2.0" cmd/confluent/main.go --version
confluent version v1.2.0
:tada: All Contributor License Agreements have been signed. Ready to merge. Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.
Release Notes
Breaking Changes
New Features
Bug Fixes
Checklist
What
We want to be able to pass the CLI version information to the backend server for CMF to perform compatibility checks. All the commands except
web-ui-forward
use a SDK which sets up theUserAgent
header. We simply pass the value of the version to the same header. In case ofweb-ui-forward
, since the origin of the calls will be from user's browser, we did not want to override the user agent header as it might be used by browsers for checks of their own, we have introduced a new header for just that API.Validation
ldflags
and validating that it has the same behaviour for the flink commands as the baseversion
commandReferences
Test & Review