Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
rad bicep
to pull binaries from GHCR (#6426)
# Description We're switching to upload bicep binaries to GHCR. This updates the `rad bicep download` command to pull from GHCR instead of the existing Azure blob storage. ## Type of change <!-- Please select **one** of the following options that describes your change and delete the others. Clearly identifying the type of change you are making will help us review your PR faster, and is used in authoring release notes. If you are making a bug fix or functionality change to Radius and do not have an associated issue link please create one now. --> - This pull request adds or changes features of Radius and has an approved issue #6353. <!-- Please update the following to link the associated issue. This is required for some kinds of changes (see above). --> Fixes: #6353 ## Auto-generated summary <!-- GitHub Copilot for docs will auto-generate a summary of the PR --> <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at eb0ec9d</samp> ### Summary 🔄🐳🗑️ <!-- 1. 🔄 - This emoji represents the change in the download URI format and the use of the platform tag for the bicep binary. It suggests a switch or a rotation from one way of doing things to another. 2. 🐳 - This emoji represents the use of a container registry and the `oras` package to pull the bicep binary. It suggests a connection to the Docker ecosystem and the concept of containerization. 3. 🗑️ - This emoji represents the removal of the `net/http` dependency and the simplification of the `DownloadBicep` and `retry` functions. It suggests a cleanup or a deletion of unnecessary or redundant code. --> Refactored the `bicep` and `tools` packages to use `oras` to pull the bicep binary from a container registry instead of downloading it from a web server. This improves the reliability and security of the bicep installation process. Updated the tests to reflect the new download URI format and binary name. > _To pull bicep from a registry_ > _We changed the code in the bicep package_ > _We used oras to fetch_ > _And removed net/http_ > _And updated the tools and the test logic_ ### Walkthrough * Remove `net/http` package and use `oras` package to download bicep binary from container registry ([link](https://github.com/radius-project/radius/pull/6426/files?diff=unified&w=0#diff-23111ea5ee16104ce6f0692d59244d7fdca32266bac1d9bbbe93a9941dcfbd0aL21), [link](https://github.com/radius-project/radius/pull/6426/files?diff=unified&w=0#diff-0bb0df6a87062e6fad23c5f50750cb65e5e6e03112e526341f38a0e42ee06d6bL20-R34), [link](https://github.com/radius-project/radius/pull/6426/files?diff=unified&w=0#diff-23111ea5ee16104ce6f0692d59244d7fdca32266bac1d9bbbe93a9941dcfbd0aL106-R104), [link](https://github.com/radius-project/radius/pull/6426/files?diff=unified&w=0#diff-0bb0df6a87062e6fad23c5f50750cb65e5e6e03112e526341f38a0e42ee06d6bL132-R210)) * Modify `DownloadBicep` function in `bicep.go` to use new download URI format string and remove binary name parameter ([link](https://github.com/radius-project/radius/pull/6426/files?diff=unified&w=0#diff-23111ea5ee16104ce6f0692d59244d7fdca32266bac1d9bbbe93a9941dcfbd0aL77-R79)) * Simplify `retry` function in `bicep.go` to use `DownloadToFolder` function and remove HTTP status code and response body logic ([link](https://github.com/radius-project/radius/pull/6426/files?diff=unified&w=0#diff-23111ea5ee16104ce6f0692d59244d7fdca32266bac1d9bbbe93a9941dcfbd0aL115-R113)) * Modify `TestGetDownloadURI` function in `binary_tools_test.go` to use new download URI format string and remove binary name parameter ([link](https://github.com/radius-project/radius/pull/6426/files?diff=unified&w=0#diff-6fd23df318670a45c0e8a3d45d308dcb80200d6e71536500003ef7bd6fa3020eL31-R36)) * Modify `GetDownloadURI` function in `binary_tools.go` to take only download URI format string as parameter and remove filename logic ([link](https://github.com/radius-project/radius/pull/6426/files?diff=unified&w=0#diff-0bb0df6a87062e6fad23c5f50750cb65e5e6e03112e526341f38a0e42ee06d6bL121-R128))
- Loading branch information