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

*: Port to new Azure SDK #2

Merged
merged 3 commits into from
Jun 10, 2024
Merged

*: Port to new Azure SDK #2

merged 3 commits into from
Jun 10, 2024

Conversation

krnowak
Copy link
Member

@krnowak krnowak commented May 23, 2024

The changes mostly are:

  • making sure that the uploaded ranges are at most 4mb long and boundaries are at 512 byte offsets.
  • renamed MetaData to Metadata
  • use new Azure SDK
    • there still is the --stgaccountkey if there is a need to use the shared key credentials - these are discouraged now in favor of managed identities, but the upside of shared key credentials is that you don't need to assign the Storage Blob Data Contributor/Owner roles.

The follow-up PR will move the high-level upload code from vhdUploadCmdHandler.go to a separate op package, that mantle will be able to use for uploading VHD images.

New SDK's azblob package accepts page sets that are 4mb long now, with
an additional constraint that each page's boundaries are at 512 byte
offsets. This probably was usually the case, just make sure it really
is so.
It was jarring and inconsistent, some function names used MetaData,
some others used Metadata. Just stick to the latter. The only thing
left intact is the name of the JSON key.
Most of the changes are because pageblob.Client represents a specific
blob in storage, so it can be passed instead of a triplet of general
blob storage client, container name and blob name.

On the authentication side, we switch to the azidentity package, but
we preserve the possibility of using the discouraged shared key
crendetials if --stgaccountkey parameter is passed. Otherwise we will
use the managed identity, with an additional requirement that the
managed account already has a role that allows the account to save new
blobs.
@krnowak krnowak requested a review from a team May 23, 2024 14:57
@krnowak
Copy link
Member Author

krnowak commented May 23, 2024

I assigned flatcar-maintainers team the write role for this repo, so I can ask the team for the review properly.

Copy link
Member

@jepio jepio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as i can tell this looks correct

@krnowak krnowak merged commit ebb35dd into master Jun 10, 2024
@krnowak krnowak deleted the krnowak/port-to-new-sdk branch June 10, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants