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

Read latest version from product-versions.json #609

Merged
merged 5 commits into from
Apr 23, 2024

Conversation

damonbarry
Copy link
Member

@damonbarry damonbarry commented Apr 18, 2024

The "aziot-version" check in aziotctl check reads the latest identity service version from https://github.com/Azure/azure-iotedge/blob/main/latest-aziot-identity-service.json. This JSON file has no ability to accomodate multiple releases (e.g., 1.4 and 1.5). However, https://github.com/Azure/azure-iotedge/blob/main/product-versions.json was recently introduced and, while it has a more complex structure, it is capable of providing information about multiple versions of the same product.

This change updates aziotctl check to read the latest identity service version from product-versions.json. Since the logic needs to contend with multiple versions, it now uses the MAJOR.MINOR version from the actual version string to match the expected version. For example, if the user has 1.5.0 installed and 1.5.2 and 1.4.10 are the latest versions, it will match on 1.5 and return 1.5.2 as the expected version. It does not differentiate between the same versions on different channels (e.g., stable vs. LTS); it assumes they are the same (in other words, it assumes product-versions.json will never legitimately show version 1.5.3 in the stable channel and 1.5.2 in the LTS channel).

@damonbarry
Copy link
Member Author

@arsing @gordonwang0 I had to dust off my Rust skills for this, which were basic to begin with. I'm open to any feedback about idiomatic usage, etc.

@kodiakhq kodiakhq bot merged commit b9fff6b into Azure:main Apr 23, 2024
57 checks passed
@damonbarry damonbarry deleted the product-versions-json branch April 23, 2024 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants