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

plume/azure: Add support for managed identity #535

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Some tests dealing with OEM partition were duplicated or adapted for the OEM partition mountpoint move. The older versions of Flatcar will run tests for the old mountpoint location, the new enough versions - for both mountpoint locations. ([#423](https://github.com/flatcar/mantle/pull/423))
- The `systemd.sysext.custom-docker` test now tries to figure out the distributed Docker version by searching for both `app-emulation/docker` and `app-containers/docker` package information. The older versions of Flatcar use the former, the new versions will use the latter ([#438](https://github.com/flatcar/mantle/pull/438))
- DigitalOcean now supports deleting images with the same name ([#440](https://github.com/flatcar/mantle/pull/440))
- Add support to plume azure release and pre-release to use managed identities ([#535](https://github.com/flatcar/mantle/pull/535))

### Removed

Expand Down
4 changes: 4 additions & 0 deletions cmd/plume/prerelease.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ var (
publishMarketplace bool
// username is the default user on instances launched by AWS Marketplace.
username string
// azureUseIdentity is a bool to use managed identity for authentication
azureUseIdentity bool
)

type imageMetadataAbstract struct {
Expand Down Expand Up @@ -117,6 +119,7 @@ func init() {
cmdPreRelease.Flags().StringVar(&azureAuth, "azure-auth", "", "Azure Credentials json file")
cmdPreRelease.Flags().StringVar(&azureCategory, "azure-category", "", "Azure category (empty/pro)")
cmdPreRelease.Flags().StringVar(&azureTestContainer, "azure-test-container", "", "Use test container instead of default")
cmdPreRelease.Flags().BoolVar(&azureUseIdentity, "azure-identity", false, "Use VM managed identity for authentication (default false)")
cmdPreRelease.Flags().StringVar(&awsCredentialsFile, "aws-credentials", "", "AWS credentials file")
cmdPreRelease.Flags().StringVar(&verifyKeyFile,
"verify-key", "", "path to ASCII-armored PGP public key to be used in verifying download signatures.")
Expand Down Expand Up @@ -314,6 +317,7 @@ func azurePreRelease(ctx context.Context, client *http.Client, src *storage.Buck
AzureProfile: azureProfile,
AzureAuthLocation: azureAuth,
AzureSubscription: environment.SubscriptionName,
UseIdentity: azureUseIdentity,
})
if err != nil {
return fmt.Errorf("failed to create Azure API: %v", err)
Expand Down
2 changes: 2 additions & 0 deletions cmd/plume/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func init() {
cmdRelease.Flags().StringVar(&azureProfile, "azure-profile", "", "Azure Profile json file")
cmdRelease.Flags().StringVar(&azureAuth, "azure-auth", "", "Azure Credentials json file")
cmdRelease.Flags().StringVar(&azureTestContainer, "azure-test-container", "", "Use test container instead of default")
cmdRelease.Flags().BoolVar(&azureUseIdentity, "azure-identity", false, "Use VM managed identity for authentication (default false)")
cmdRelease.Flags().StringVar(&gceReleaseKey, "gce-release-key", "", "GCE key file for releases")
cmdRelease.Flags().BoolVarP(&releaseDryRun, "dry-run", "n", false,
"perform a trial run, do not make changes")
Expand Down Expand Up @@ -394,6 +395,7 @@ func doAzure(ctx context.Context, client *http.Client, src *storage.Bucket, spec
AzureProfile: azureProfile,
AzureAuthLocation: azureAuth,
AzureSubscription: environment.SubscriptionName,
UseIdentity: azureUseIdentity,
})
if err != nil {
plog.Fatalf("failed to create Azure API: %v", err)
Expand Down