Skip to content

Commit

Permalink
Merge pull request #532 from flatcar/krnowak/azure-new-stuff
Browse files Browse the repository at this point in the history
port to new azure SDK
  • Loading branch information
krnowak authored Jul 2, 2024
2 parents 60de9ff + 406952c commit 3321b58
Show file tree
Hide file tree
Showing 1,307 changed files with 284,287 additions and 227,303 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- 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))
- Azure platform uses new go SDK, changing the way we authenticate (using azidentity now) ([#532](https://github.com/flatcar/mantle/pull/532))

### Removed

- `ore azure upload-blob-arm` is renamed to `ore azure upload-blob`, replacing the old command. Same for `ore azure create-image-arm`. `ore azure replicate-image`, `ore azure unreplicate-image` and `ore azure share-image` commands are gone. Options related to Azure authentication in `kola`, `ore azure` and `plume` are gone ([#532](https://github.com/flatcar/mantle/pull/532))

### Fixed
- Remove /etc/samba with an -f option in `cl.overlay.cleanup` for samba 4.18+ ([#455](https://github.com/flatcar/mantle/pull/455))

Expand Down
213 changes: 0 additions & 213 deletions auth/azure.go

This file was deleted.

3 changes: 0 additions & 3 deletions cmd/kola/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ func init() {
sv(&kola.AWSOptions.IAMInstanceProfile, "aws-iam-profile", "kola", "AWS IAM instance profile name")

// azure-specific options
sv(&kola.AzureOptions.AzureProfile, "azure-profile", "", "Azure profile (default \"~/"+auth.AzureProfilePath+"\")")
sv(&kola.AzureOptions.AzureAuthLocation, "azure-auth", "", "Azure auth location (default \"~/"+auth.AzureAuthPath+"\")")
sv(&kola.AzureOptions.BlobURL, "azure-blob-url", "", "Azure source page blob to be copied from a public/SAS URL, recommended way (from \"plume pre-release\" or \"ore azure upload-blob-arm\")")
sv(&kola.AzureOptions.ImageFile, "azure-image-file", "", "Azure image file (local image to upload in the temporary kola resource group)")
sv(&kola.AzureOptions.DiskURI, "azure-disk-uri", "", "Azure disk uri (custom images)")
Expand All @@ -122,7 +120,6 @@ func init() {
sv(&kola.AzureOptions.VnetSubnetName, "azure-vnet-subnet-name", "", "Use a pre-existing virtual network for created instances. Specify as vnet-name/subnet-name. If subnet name is omitted then \"default\" is assumed")
bv(&kola.AzureOptions.UseGallery, "azure-use-gallery", false, "Use gallery image instead of managed image")
bv(&kola.AzureOptions.UsePrivateIPs, "azure-use-private-ips", false, "Assume nodes are reachable using private IP addresses")
bv(&kola.AzureOptions.UseIdentity, "azure-identity", false, "Use VM managed identity for authentication (default false)")
sv(&kola.AzureOptions.DiskController, "azure-disk-controller", "default", "Use a specific disk-controller for storage (default \"default\", also \"nvme\" and \"scsi\")")
sv(&kola.AzureOptions.ResourceGroup, "azure-resource-group", "", "Deploy resources in an existing resource group")
sv(&kola.AzureOptions.AvailabilitySet, "azure-availability-set", "", "Deploy instances with an existing availibity set")
Expand Down
3 changes: 0 additions & 3 deletions cmd/ore/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// The package github.com/Azure/azure-sdk-for-go needs go 1.7 for TLS
// renegotiation, so only link in the ore subcommands if we build with go 1.7.

package main

import (
Expand Down
21 changes: 3 additions & 18 deletions cmd/ore/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/coreos/pkg/capnslog"
"github.com/spf13/cobra"

"github.com/flatcar/mantle/auth"
"github.com/flatcar/mantle/cli"
"github.com/flatcar/mantle/platform/api/azure"
)
Expand All @@ -31,36 +30,22 @@ var (
Short: "azure image and vm utilities",
}

azureProfile string
azureAuth string
azureSubscription string
azureLocation string
useIdentity bool
azureLocation string

api *azure.API
)

func init() {
cli.WrapPreRun(Azure, preauth)

sv := Azure.PersistentFlags().StringVar
bv := Azure.PersistentFlags().BoolVar
sv(&azureProfile, "azure-profile", "", "Azure Profile json file")
sv(&azureAuth, "azure-auth", "", "Azure auth location (default \"~/"+auth.AzureAuthPath+"\")")
sv(&azureSubscription, "azure-subscription", "", "Azure subscription name. If unset, the first is used.")
sv(&azureLocation, "azure-location", "westus", "Azure location (default \"westus\")")
bv(&useIdentity, "azure-identity", false, "Use VM managed identity for authentication (default false)")
Azure.PersistentFlags().StringVar(&azureLocation, "azure-location", "westus", "Azure location (default \"westus\")")
}

func preauth(cmd *cobra.Command, args []string) error {
plog.Printf("Creating Azure API...")

a, err := azure.New(&azure.Options{
AzureProfile: azureProfile,
AzureAuthLocation: azureAuth,
AzureSubscription: azureSubscription,
Location: azureLocation,
UseIdentity: useIdentity,
Location: azureLocation,
})
if err != nil {
plog.Fatalf("Failed to create Azure API: %v", err)
Expand Down
74 changes: 0 additions & 74 deletions cmd/ore/azure/create-image-arm.go

This file was deleted.

Loading

0 comments on commit 3321b58

Please sign in to comment.