From 0971b20d02a35fdf1b7fc183702a9e909e8ae933 Mon Sep 17 00:00:00 2001 From: Anjan Nath Date: Mon, 12 Aug 2024 23:23:11 +0530 Subject: [PATCH] convert vm specs to provider specific instance type name Signed-off-by: Anjan Nath --- cmd/mapt/cmd/aws/hosts/fedora.go | 9 + cmd/mapt/cmd/aws/hosts/rhel.go | 11 + cmd/mapt/cmd/aws/hosts/windows.go | 1 + cmd/mapt/cmd/azure/hosts/constants.go | 1 - cmd/mapt/cmd/azure/hosts/linux.go | 32 +- cmd/mapt/cmd/azure/hosts/windows.go | 14 +- cmd/mapt/cmd/constants/constants.go | 18 +- go.mod | 29 +- go.sum | 66 +- pkg/provider/aws/action/fedora/fedora.go | 24 +- pkg/provider/aws/action/rhel/rhel.go | 24 +- pkg/provider/azure/action/linux/linux.go | 45 +- .../azure/action/windows/constants.go | 1 + pkg/provider/azure/action/windows/windows.go | 47 +- .../azure/module/identity/azidentity.go | 24 + .../azure/module/spot-price/spot-price.go | 85 +- pkg/provider/util/instancetypes/aws.go | 62 + pkg/provider/util/instancetypes/azure.go | 270 + .../util/instancetypes/instancetypes.go | 33 + pkg/util/resources/resources.go | 4 +- .../azure-sdk-for-go/sdk/azcore/CHANGELOG.md | 6 + .../internal/resource/resource_identifier.go | 2 +- .../sdk/azcore/arm/runtime/pipeline.go | 8 +- .../sdk/azcore/internal/exported/request.go | 37 + .../sdk/azcore/internal/shared/constants.go | 2 +- .../sdk/azcore/runtime/request.go | 6 + .../sdk/azidentity/CHANGELOG.md | 24 + .../azure-sdk-for-go/sdk/azidentity/README.md | 1 + .../sdk/azidentity/TOKEN_CACHING.MD | 1 + .../sdk/azidentity/TROUBLESHOOTING.md | 10 + .../azidentity/azure_pipelines_credential.go | 50 +- .../azure-sdk-for-go/sdk/azidentity/errors.go | 2 + .../sdk/azidentity/version.go | 2 +- .../compute/armcompute/v6/CHANGELOG.md | 433 + .../compute/armcompute/v6/LICENSE.txt | 21 + .../compute/armcompute/v6/README.md | 113 + .../compute/armcompute/v6/assets.json | 6 + .../compute/armcompute/v6/autorest.md | 13 + .../armcompute/v6/availabilitysets_client.go | 485 + .../compute/armcompute/v6/build.go | 7 + .../v6/capacityreservationgroups_client.go | 437 + .../v6/capacityreservations_client.go | 443 + .../compute/armcompute/v6/ci.yml | 30 + .../compute/armcompute/v6/client_factory.go | 429 + .../v6/cloudserviceoperatingsystems_client.go | 301 + .../v6/cloudserviceroleinstances_client.go | 648 + .../armcompute/v6/cloudserviceroles_client.go | 180 + .../armcompute/v6/cloudservices_client.go | 1013 + .../v6/cloudservicesupdatedomain_client.go | 263 + .../v6/communitygalleries_client.go | 109 + .../v6/communitygalleryimages_client.go | 180 + .../communitygalleryimageversions_client.go | 192 + .../compute/armcompute/v6/constants.go | 2830 ++ .../v6/dedicatedhostgroups_client.go | 423 + .../armcompute/v6/dedicatedhosts_client.go | 680 + .../armcompute/v6/diskaccesses_client.go | 846 + .../v6/diskencryptionsets_client.go | 535 + .../armcompute/v6/diskrestorepoint_client.go | 367 + .../compute/armcompute/v6/disks_client.go | 623 + .../compute/armcompute/v6/galleries_client.go | 465 + .../v6/galleryapplications_client.go | 434 + .../v6/galleryapplicationversions_client.go | 464 + .../armcompute/v6/galleryimages_client.go | 433 + .../v6/galleryimageversions_client.go | 463 + .../v6/gallerysharingprofile_client.go | 125 + .../compute/armcompute/v6/images_client.go | 462 + .../armcompute/v6/loganalytics_client.go | 200 + .../compute/armcompute/v6/models.go | 8660 ++++ .../compute/armcompute/v6/models_serde.go | 20009 ++++++++ .../armcompute/v6/operations_client.go | 89 + .../compute/armcompute/v6/options.go | 1986 + .../v6/proximityplacementgroups_client.go | 421 + .../armcompute/v6/resourceskus_client.go | 105 + .../compute/armcompute/v6/responses.go | 1673 + .../v6/restorepointcollections_client.go | 447 + .../armcompute/v6/restorepoints_client.go | 283 + .../armcompute/v6/sharedgalleries_client.go | 172 + .../v6/sharedgalleryimages_client.go | 182 + .../v6/sharedgalleryimageversions_client.go | 195 + .../compute/armcompute/v6/snapshots_client.go | 625 + .../armcompute/v6/sshpublickeys_client.go | 489 + .../compute/armcompute/v6/time_rfc3339.go | 110 + .../compute/armcompute/v6/usage_client.go | 105 + .../virtualmachineextensionimages_client.go | 259 + .../v6/virtualmachineextensions_client.go | 437 + .../v6/virtualmachineimages_client.go | 470 + .../v6/virtualmachineimagesedgezone_client.go | 430 + .../v6/virtualmachineruncommands_client.go | 562 + .../armcompute/v6/virtualmachines_client.go | 1984 + ...virtualmachinescalesetextensions_client.go | 434 + ...almachinescalesetrollingupgrades_client.go | 346 + .../v6/virtualmachinescalesets_client.go | 1957 + ...rtualmachinescalesetvmextensions_client.go | 462 + ...tualmachinescalesetvmruncommands_client.go | 462 + .../v6/virtualmachinescalesetvms_client.go | 1494 + .../v6/virtualmachinesizes_client.go | 106 + .../amazon-ec2-instance-selector/v2/LICENSE | 175 + .../amazon-ec2-instance-selector/v2/NOTICE | 1 + .../v2/pkg/awsapi/selectorec2.go | 12 + .../v2/pkg/bytequantity/bytequantity.go | 153 + .../v2/pkg/ec2pricing/ec2pricing.go | 128 + .../v2/pkg/ec2pricing/odpricing.go | 326 + .../v2/pkg/ec2pricing/spotpricing.go | 281 + .../v2/pkg/instancetypes/instancetypes.go | 180 + .../v2/pkg/selector/aggregates.go | 122 + .../v2/pkg/selector/comparators.go | 425 + .../v2/pkg/selector/emr.go | 428 + .../v2/pkg/selector/outputs/bubbletea.go | 200 + .../v2/pkg/selector/outputs/outputs.go | 285 + .../v2/pkg/selector/outputs/sortingView.go | 260 + .../v2/pkg/selector/outputs/tableView.go | 473 + .../v2/pkg/selector/outputs/verboseView.go | 119 + .../v2/pkg/selector/selector.go | 706 + .../v2/pkg/selector/services.go | 91 + .../v2/pkg/selector/types.go | 304 + .../v2/pkg/sorter/sorter.go | 381 + .../service/pricing/CHANGELOG.md | 287 + .../aws-sdk-go-v2/service/pricing/LICENSE.txt | 202 + .../service/pricing/api_client.go | 526 + .../pricing/api_op_DescribeServices.go | 370 + .../pricing/api_op_GetAttributeValues.go | 374 + .../pricing/api_op_GetPriceListFileUrl.go | 275 + .../service/pricing/api_op_GetProducts.go | 371 + .../service/pricing/api_op_ListPriceLists.go | 396 + .../service/pricing/deserializers.go | 1680 + .../aws/aws-sdk-go-v2/service/pricing/doc.go | 28 + .../service/pricing/endpoints.go | 499 + .../service/pricing/generated.json | 34 + .../service/pricing/go_module_metadata.go | 6 + .../pricing/internal/endpoints/endpoints.go | 319 + .../service/pricing/serializers.go | 468 + .../service/pricing/types/enums.go | 19 + .../service/pricing/types/errors.go | 165 + .../service/pricing/types/types.go | 97 + .../service/pricing/validators.go | 222 + vendor/github.com/aws/aws-sdk-go/LICENSE.txt | 202 + vendor/github.com/aws/aws-sdk-go/NOTICE.txt | 3 + .../aws/aws-sdk-go/aws/awserr/error.go | 164 + .../aws/aws-sdk-go/aws/awserr/types.go | 221 + .../aws/aws-sdk-go/aws/endpoints/decode.go | 193 + .../aws/aws-sdk-go/aws/endpoints/defaults.go | 41704 ++++++++++++++++ .../aws/endpoints/dep_service_ids.go | 141 + .../aws/aws-sdk-go/aws/endpoints/doc.go | 65 + .../aws/aws-sdk-go/aws/endpoints/endpoints.go | 708 + .../aws/endpoints/legacy_regions.go | 24 + .../aws/aws-sdk-go/aws/endpoints/v3model.go | 594 + .../aws/endpoints/v3model_codegen.go | 412 + vendor/github.com/blang/semver/v4/LICENSE | 22 + vendor/github.com/blang/semver/v4/json.go | 23 + vendor/github.com/blang/semver/v4/range.go | 416 + vendor/github.com/blang/semver/v4/semver.go | 476 + vendor/github.com/blang/semver/v4/sort.go | 28 + vendor/github.com/blang/semver/v4/sql.go | 30 + .../charmbracelet/bubbles/help/help.go | 233 + .../charmbracelet/bubbles/list/README.md | 72 + .../charmbracelet/bubbles/list/defaultitem.go | 227 + .../charmbracelet/bubbles/list/keys.go | 97 + .../charmbracelet/bubbles/list/list.go | 1277 + .../charmbracelet/bubbles/list/style.go | 99 + .../bubbles/paginator/paginator.go | 193 + .../charmbracelet/bubbles/spinner/spinner.go | 230 + .../charmbracelet/bubbles/viewport/keymap.go | 48 + .../bubbles/viewport/viewport.go | 404 + .../github.com/evertras/bubble-table/LICENSE | 21 + .../evertras/bubble-table/table/border.go | 439 + .../evertras/bubble-table/table/calc.go | 30 + .../evertras/bubble-table/table/cell.go | 19 + .../evertras/bubble-table/table/column.go | 78 + .../evertras/bubble-table/table/data.go | 65 + .../evertras/bubble-table/table/dimensions.go | 73 + .../evertras/bubble-table/table/doc.go | 39 + .../evertras/bubble-table/table/events.go | 60 + .../evertras/bubble-table/table/filter.go | 71 + .../evertras/bubble-table/table/footer.go | 51 + .../evertras/bubble-table/table/header.go | 93 + .../evertras/bubble-table/table/keys.go | 73 + .../evertras/bubble-table/table/model.go | 119 + .../evertras/bubble-table/table/options.go | 393 + .../evertras/bubble-table/table/overflow.go | 22 + .../evertras/bubble-table/table/pagination.go | 112 + .../evertras/bubble-table/table/query.go | 88 + .../evertras/bubble-table/table/row.go | 198 + .../evertras/bubble-table/table/scrolling.go | 50 + .../evertras/bubble-table/table/sort.go | 178 + .../evertras/bubble-table/table/strlimit.go | 25 + .../evertras/bubble-table/table/update.go | 149 + .../evertras/bubble-table/table/view.go | 56 + .../github.com/imdario/mergo/.deepsource.toml | 12 + vendor/github.com/imdario/mergo/.gitignore | 33 + vendor/github.com/imdario/mergo/.travis.yml | 12 + .../imdario/mergo/CODE_OF_CONDUCT.md | 46 + .../github.com/imdario/mergo/CONTRIBUTING.md | 112 + vendor/github.com/imdario/mergo/LICENSE | 28 + vendor/github.com/imdario/mergo/README.md | 242 + vendor/github.com/imdario/mergo/SECURITY.md | 14 + vendor/github.com/imdario/mergo/doc.go | 143 + vendor/github.com/imdario/mergo/map.go | 178 + vendor/github.com/imdario/mergo/merge.go | 409 + vendor/github.com/imdario/mergo/mergo.go | 81 + .../github.com/mitchellh/go-homedir/LICENSE | 21 + .../github.com/mitchellh/go-homedir/README.md | 14 + .../mitchellh/go-homedir/homedir.go | 167 + .../github.com/oliveagle/jsonpath/.gitignore | 26 + .../github.com/oliveagle/jsonpath/.travis.yml | 8 + vendor/github.com/oliveagle/jsonpath/LICENSE | 22 + .../github.com/oliveagle/jsonpath/jsonpath.go | 722 + .../github.com/oliveagle/jsonpath/readme.md | 114 + .../patrickmn/go-cache/CONTRIBUTORS | 9 + vendor/github.com/patrickmn/go-cache/LICENSE | 19 + .../github.com/patrickmn/go-cache/README.md | 83 + vendor/github.com/patrickmn/go-cache/cache.go | 1161 + .../github.com/patrickmn/go-cache/sharded.go | 192 + vendor/github.com/sahilm/fuzzy/.editorconfig | 18 + vendor/github.com/sahilm/fuzzy/.gitignore | 2 + vendor/github.com/sahilm/fuzzy/.travis.yml | 5 + .../github.com/sahilm/fuzzy/CONTRIBUTING.md | 1 + vendor/github.com/sahilm/fuzzy/Gopkg.lock | 20 + vendor/github.com/sahilm/fuzzy/Gopkg.toml | 4 + vendor/github.com/sahilm/fuzzy/LICENSE | 21 + vendor/github.com/sahilm/fuzzy/Makefile | 57 + vendor/github.com/sahilm/fuzzy/README.md | 184 + vendor/github.com/sahilm/fuzzy/fuzzy.go | 235 + vendor/go.uber.org/multierr/CHANGELOG.md | 15 + vendor/go.uber.org/multierr/README.md | 22 +- vendor/go.uber.org/multierr/error.go | 63 +- .../go.uber.org/multierr/error_post_go120.go | 48 + .../go.uber.org/multierr/error_pre_go120.go | 79 + vendor/go.uber.org/multierr/glide.yaml | 8 - vendor/golang.org/x/crypto/blowfish/cipher.go | 2 +- vendor/golang.org/x/crypto/cast5/cast5.go | 2 +- .../x/crypto/curve25519/curve25519.go | 39 +- .../x/crypto/curve25519/curve25519_compat.go | 105 - .../x/crypto/curve25519/curve25519_go120.go | 46 - .../x/crypto/curve25519/internal/field/README | 7 - .../x/crypto/curve25519/internal/field/fe.go | 416 - .../curve25519/internal/field/fe_amd64.go | 15 - .../curve25519/internal/field/fe_amd64.s | 378 - .../internal/field/fe_amd64_noasm.go | 11 - .../curve25519/internal/field/fe_arm64.go | 15 - .../curve25519/internal/field/fe_arm64.s | 42 - .../internal/field/fe_arm64_noasm.go | 11 - .../curve25519/internal/field/fe_generic.go | 264 - .../curve25519/internal/field/sync.checkpoint | 1 - .../crypto/curve25519/internal/field/sync.sh | 19 - vendor/golang.org/x/crypto/hkdf/hkdf.go | 2 +- vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go | 2 +- vendor/golang.org/x/crypto/sha3/doc.go | 2 +- vendor/golang.org/x/crypto/sha3/hashes.go | 8 + vendor/golang.org/x/crypto/sha3/register.go | 18 - .../golang.org/x/crypto/ssh/agent/client.go | 2 +- vendor/golang.org/x/crypto/ssh/client_auth.go | 4 + vendor/golang.org/x/crypto/ssh/doc.go | 2 +- vendor/golang.org/x/net/http2/transport.go | 4 - vendor/golang.org/x/sys/unix/mremap.go | 5 + .../golang.org/x/sys/unix/syscall_darwin.go | 12 + vendor/golang.org/x/sys/unix/syscall_unix.go | 9 + .../x/sys/unix/zsyscall_darwin_amd64.go | 33 + .../x/sys/unix/zsyscall_darwin_amd64.s | 10 + .../x/sys/unix/zsyscall_darwin_arm64.go | 33 + .../x/sys/unix/zsyscall_darwin_arm64.s | 10 + .../x/sys/windows/security_windows.go | 24 +- .../x/sys/windows/zsyscall_windows.go | 9 + vendor/modules.txt | 66 +- 263 files changed, 127454 insertions(+), 1578 deletions(-) create mode 100644 pkg/provider/azure/module/identity/azidentity.go create mode 100644 pkg/provider/util/instancetypes/aws.go create mode 100644 pkg/provider/util/instancetypes/azure.go create mode 100644 pkg/provider/util/instancetypes/instancetypes.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/CHANGELOG.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/LICENSE.txt create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/README.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/assets.json create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/autorest.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/availabilitysets_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/build.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/capacityreservationgroups_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/capacityreservations_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/ci.yml create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/client_factory.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/cloudserviceoperatingsystems_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/cloudserviceroleinstances_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/cloudserviceroles_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/cloudservices_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/cloudservicesupdatedomain_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/communitygalleries_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/communitygalleryimages_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/communitygalleryimageversions_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/constants.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/dedicatedhostgroups_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/dedicatedhosts_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/diskaccesses_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/diskencryptionsets_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/diskrestorepoint_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/disks_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/galleries_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/galleryapplications_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/galleryapplicationversions_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/galleryimages_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/galleryimageversions_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/gallerysharingprofile_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/images_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/loganalytics_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/models_serde.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/operations_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/options.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/proximityplacementgroups_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/resourceskus_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/responses.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/restorepointcollections_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/restorepoints_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/sharedgalleries_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/sharedgalleryimages_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/sharedgalleryimageversions_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/snapshots_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/sshpublickeys_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/time_rfc3339.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/usage_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/virtualmachineextensionimages_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/virtualmachineextensions_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/virtualmachineimages_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/virtualmachineimagesedgezone_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/virtualmachineruncommands_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/virtualmachines_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/virtualmachinescalesetextensions_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/virtualmachinescalesetrollingupgrades_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/virtualmachinescalesets_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/virtualmachinescalesetvmextensions_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/virtualmachinescalesetvmruncommands_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/virtualmachinescalesetvms_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6/virtualmachinesizes_client.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/LICENSE create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/NOTICE create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/awsapi/selectorec2.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity/bytequantity.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/ec2pricing/ec2pricing.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/ec2pricing/odpricing.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/ec2pricing/spotpricing.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes/instancetypes.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/aggregates.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/comparators.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/emr.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs/bubbletea.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs/outputs.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs/sortingView.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs/tableView.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs/verboseView.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/selector.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/services.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/types.go create mode 100644 vendor/github.com/aws/amazon-ec2-instance-selector/v2/pkg/sorter/sorter.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/CHANGELOG.md create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/LICENSE.txt create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/api_client.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/api_op_DescribeServices.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/api_op_GetAttributeValues.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/api_op_GetPriceListFileUrl.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/api_op_GetProducts.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/api_op_ListPriceLists.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/deserializers.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/doc.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/endpoints.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/generated.json create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/go_module_metadata.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/internal/endpoints/endpoints.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/serializers.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/types/enums.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/types/errors.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/types/types.go create mode 100644 vendor/github.com/aws/aws-sdk-go-v2/service/pricing/validators.go create mode 100644 vendor/github.com/aws/aws-sdk-go/LICENSE.txt create mode 100644 vendor/github.com/aws/aws-sdk-go/NOTICE.txt create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/endpoints/dep_service_ids.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/endpoints/legacy_regions.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go create mode 100644 vendor/github.com/blang/semver/v4/LICENSE create mode 100644 vendor/github.com/blang/semver/v4/json.go create mode 100644 vendor/github.com/blang/semver/v4/range.go create mode 100644 vendor/github.com/blang/semver/v4/semver.go create mode 100644 vendor/github.com/blang/semver/v4/sort.go create mode 100644 vendor/github.com/blang/semver/v4/sql.go create mode 100644 vendor/github.com/charmbracelet/bubbles/help/help.go create mode 100644 vendor/github.com/charmbracelet/bubbles/list/README.md create mode 100644 vendor/github.com/charmbracelet/bubbles/list/defaultitem.go create mode 100644 vendor/github.com/charmbracelet/bubbles/list/keys.go create mode 100644 vendor/github.com/charmbracelet/bubbles/list/list.go create mode 100644 vendor/github.com/charmbracelet/bubbles/list/style.go create mode 100644 vendor/github.com/charmbracelet/bubbles/paginator/paginator.go create mode 100644 vendor/github.com/charmbracelet/bubbles/spinner/spinner.go create mode 100644 vendor/github.com/charmbracelet/bubbles/viewport/keymap.go create mode 100644 vendor/github.com/charmbracelet/bubbles/viewport/viewport.go create mode 100644 vendor/github.com/evertras/bubble-table/LICENSE create mode 100644 vendor/github.com/evertras/bubble-table/table/border.go create mode 100644 vendor/github.com/evertras/bubble-table/table/calc.go create mode 100644 vendor/github.com/evertras/bubble-table/table/cell.go create mode 100644 vendor/github.com/evertras/bubble-table/table/column.go create mode 100644 vendor/github.com/evertras/bubble-table/table/data.go create mode 100644 vendor/github.com/evertras/bubble-table/table/dimensions.go create mode 100644 vendor/github.com/evertras/bubble-table/table/doc.go create mode 100644 vendor/github.com/evertras/bubble-table/table/events.go create mode 100644 vendor/github.com/evertras/bubble-table/table/filter.go create mode 100644 vendor/github.com/evertras/bubble-table/table/footer.go create mode 100644 vendor/github.com/evertras/bubble-table/table/header.go create mode 100644 vendor/github.com/evertras/bubble-table/table/keys.go create mode 100644 vendor/github.com/evertras/bubble-table/table/model.go create mode 100644 vendor/github.com/evertras/bubble-table/table/options.go create mode 100644 vendor/github.com/evertras/bubble-table/table/overflow.go create mode 100644 vendor/github.com/evertras/bubble-table/table/pagination.go create mode 100644 vendor/github.com/evertras/bubble-table/table/query.go create mode 100644 vendor/github.com/evertras/bubble-table/table/row.go create mode 100644 vendor/github.com/evertras/bubble-table/table/scrolling.go create mode 100644 vendor/github.com/evertras/bubble-table/table/sort.go create mode 100644 vendor/github.com/evertras/bubble-table/table/strlimit.go create mode 100644 vendor/github.com/evertras/bubble-table/table/update.go create mode 100644 vendor/github.com/evertras/bubble-table/table/view.go create mode 100644 vendor/github.com/imdario/mergo/.deepsource.toml create mode 100644 vendor/github.com/imdario/mergo/.gitignore create mode 100644 vendor/github.com/imdario/mergo/.travis.yml create mode 100644 vendor/github.com/imdario/mergo/CODE_OF_CONDUCT.md create mode 100644 vendor/github.com/imdario/mergo/CONTRIBUTING.md create mode 100644 vendor/github.com/imdario/mergo/LICENSE create mode 100644 vendor/github.com/imdario/mergo/README.md create mode 100644 vendor/github.com/imdario/mergo/SECURITY.md create mode 100644 vendor/github.com/imdario/mergo/doc.go create mode 100644 vendor/github.com/imdario/mergo/map.go create mode 100644 vendor/github.com/imdario/mergo/merge.go create mode 100644 vendor/github.com/imdario/mergo/mergo.go create mode 100644 vendor/github.com/mitchellh/go-homedir/LICENSE create mode 100644 vendor/github.com/mitchellh/go-homedir/README.md create mode 100644 vendor/github.com/mitchellh/go-homedir/homedir.go create mode 100644 vendor/github.com/oliveagle/jsonpath/.gitignore create mode 100644 vendor/github.com/oliveagle/jsonpath/.travis.yml create mode 100644 vendor/github.com/oliveagle/jsonpath/LICENSE create mode 100644 vendor/github.com/oliveagle/jsonpath/jsonpath.go create mode 100644 vendor/github.com/oliveagle/jsonpath/readme.md create mode 100644 vendor/github.com/patrickmn/go-cache/CONTRIBUTORS create mode 100644 vendor/github.com/patrickmn/go-cache/LICENSE create mode 100644 vendor/github.com/patrickmn/go-cache/README.md create mode 100644 vendor/github.com/patrickmn/go-cache/cache.go create mode 100644 vendor/github.com/patrickmn/go-cache/sharded.go create mode 100644 vendor/github.com/sahilm/fuzzy/.editorconfig create mode 100644 vendor/github.com/sahilm/fuzzy/.gitignore create mode 100644 vendor/github.com/sahilm/fuzzy/.travis.yml create mode 100644 vendor/github.com/sahilm/fuzzy/CONTRIBUTING.md create mode 100644 vendor/github.com/sahilm/fuzzy/Gopkg.lock create mode 100644 vendor/github.com/sahilm/fuzzy/Gopkg.toml create mode 100644 vendor/github.com/sahilm/fuzzy/LICENSE create mode 100644 vendor/github.com/sahilm/fuzzy/Makefile create mode 100644 vendor/github.com/sahilm/fuzzy/README.md create mode 100644 vendor/github.com/sahilm/fuzzy/fuzzy.go create mode 100644 vendor/go.uber.org/multierr/error_post_go120.go create mode 100644 vendor/go.uber.org/multierr/error_pre_go120.go delete mode 100644 vendor/go.uber.org/multierr/glide.yaml delete mode 100644 vendor/golang.org/x/crypto/curve25519/curve25519_compat.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/curve25519_go120.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/README delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.s delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64_noasm.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.s delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64_noasm.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_generic.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/sync.checkpoint delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh delete mode 100644 vendor/golang.org/x/crypto/sha3/register.go diff --git a/cmd/mapt/cmd/aws/hosts/fedora.go b/cmd/mapt/cmd/aws/hosts/fedora.go index ea5b7b60b..dc7b5e1a6 100644 --- a/cmd/mapt/cmd/aws/hosts/fedora.go +++ b/cmd/mapt/cmd/aws/hosts/fedora.go @@ -4,6 +4,8 @@ import ( params "github.com/redhat-developer/mapt/cmd/mapt/cmd/constants" maptContext "github.com/redhat-developer/mapt/pkg/manager/context" "github.com/redhat-developer/mapt/pkg/provider/aws/action/fedora" + "github.com/redhat-developer/mapt/pkg/provider/util/instancetypes" + "github.com/redhat-developer/mapt/pkg/util" "github.com/redhat-developer/mapt/pkg/util/ghactions" "github.com/redhat-developer/mapt/pkg/util/logging" "github.com/spf13/cobra" @@ -60,6 +62,11 @@ func getFedoraCreate() *cobra.Command { logging.Error(err) } } + instanceRequest := &instancetypes.AwsInstanceRequest{ + CPUs: viper.GetInt32(params.CPUs), + MemoryGib: viper.GetInt32(params.Memory), + Arch: util.If(viper.GetString(params.LinuxArch) == "arm64", instancetypes.Arm64, instancetypes.Amd64), + } // Run create if err := fedora.Create( @@ -68,6 +75,7 @@ func getFedoraCreate() *cobra.Command { Version: viper.GetString(rhelVersion), Arch: viper.GetString(params.LinuxArch), VMType: viper.GetStringSlice(vmTypes), + InstanceRequest: instanceRequest, Spot: viper.IsSet(spot), SetupGHActionsRunner: viper.IsSet(params.InstallGHActionsRunner), Airgap: viper.IsSet(airgap)}); err != nil { @@ -85,6 +93,7 @@ func getFedoraCreate() *cobra.Command { flagSet.Bool(airgap, false, airgapDesc) flagSet.Bool(spot, false, spotDesc) flagSet.AddFlagSet(params.GetGHActionsFlagset()) + flagSet.AddFlagSet(params.GetCpusAndMemoryFlagset()) c.PersistentFlags().AddFlagSet(flagSet) return c } diff --git a/cmd/mapt/cmd/aws/hosts/rhel.go b/cmd/mapt/cmd/aws/hosts/rhel.go index bdaccdcd7..23910e749 100644 --- a/cmd/mapt/cmd/aws/hosts/rhel.go +++ b/cmd/mapt/cmd/aws/hosts/rhel.go @@ -4,6 +4,8 @@ import ( params "github.com/redhat-developer/mapt/cmd/mapt/cmd/constants" maptContext "github.com/redhat-developer/mapt/pkg/manager/context" "github.com/redhat-developer/mapt/pkg/provider/aws/action/rhel" + "github.com/redhat-developer/mapt/pkg/provider/util/instancetypes" + "github.com/redhat-developer/mapt/pkg/util" "github.com/redhat-developer/mapt/pkg/util/ghactions" "github.com/redhat-developer/mapt/pkg/util/logging" "github.com/spf13/cobra" @@ -67,12 +69,20 @@ func getRHELCreate() *cobra.Command { } } + instanceRequest := &instancetypes.AwsInstanceRequest{ + CPUs: viper.GetInt32(params.CPUs), + MemoryGib: viper.GetInt32(params.Memory), + Arch: util.If(viper.GetString(params.LinuxArch) == "arm64", instancetypes.Arm64, instancetypes.Amd64), + NestedVirt: viper.GetBool(profileSNC) || viper.GetBool(params.NestedVirt), + } + // Run create if err := rhel.Create( &rhel.Request{ Prefix: "main", Version: viper.GetString(rhelVersion), Arch: viper.GetString(params.LinuxArch), + InstanceRequest: instanceRequest, VMType: viper.GetStringSlice(vmTypes), SubsUsername: viper.GetString(subsUsername), SubsUserpass: viper.GetString(subsUserpass), @@ -98,6 +108,7 @@ func getRHELCreate() *cobra.Command { flagSet.Bool(spot, false, spotDesc) flagSet.Bool(profileSNC, false, profileSNCDesc) flagSet.AddFlagSet(params.GetGHActionsFlagset()) + flagSet.AddFlagSet(params.GetCpusAndMemoryFlagset()) c.PersistentFlags().AddFlagSet(flagSet) // if err := c.MarkFlagRequired(subsUsername); err != nil { // logging.Error(err) diff --git a/cmd/mapt/cmd/aws/hosts/windows.go b/cmd/mapt/cmd/aws/hosts/windows.go index 3397e8da8..f50e49eaf 100644 --- a/cmd/mapt/cmd/aws/hosts/windows.go +++ b/cmd/mapt/cmd/aws/hosts/windows.go @@ -101,6 +101,7 @@ func getWindowsCreate() *cobra.Command { flagSet.Bool(spot, false, spotDesc) flagSet.Bool(amiKeepCopy, false, amiKeepCopyDesc) flagSet.AddFlagSet(params.GetGHActionsFlagset()) + flagSet.AddFlagSet(params.GetCpusAndMemoryFlagset()) c.PersistentFlags().AddFlagSet(flagSet) return c } diff --git a/cmd/mapt/cmd/azure/hosts/constants.go b/cmd/mapt/cmd/azure/hosts/constants.go index 43b98acbf..861e74ff6 100644 --- a/cmd/mapt/cmd/azure/hosts/constants.go +++ b/cmd/mapt/cmd/azure/hosts/constants.go @@ -6,7 +6,6 @@ const ( defaultLocation = "West US" paramVMSize = "vmsize" paramVMSizeDesc = "size for the VM. Type requires to allow nested virtualization" - defaultVMSize = "Standard_D8as_v5" paramUsername = "username" paramUsernameDesc = "username for general user. SSH accessible + rdp with generated password" defaultUsername = "rhqp" diff --git a/cmd/mapt/cmd/azure/hosts/linux.go b/cmd/mapt/cmd/azure/hosts/linux.go index 6fdcf9a9e..8873da2cd 100644 --- a/cmd/mapt/cmd/azure/hosts/linux.go +++ b/cmd/mapt/cmd/azure/hosts/linux.go @@ -6,6 +6,8 @@ import ( params "github.com/redhat-developer/mapt/cmd/mapt/cmd/constants" maptContext "github.com/redhat-developer/mapt/pkg/manager/context" azureLinux "github.com/redhat-developer/mapt/pkg/provider/azure/action/linux" + "github.com/redhat-developer/mapt/pkg/provider/util/instancetypes" + "github.com/redhat-developer/mapt/pkg/util" spotprice "github.com/redhat-developer/mapt/pkg/provider/azure/module/spot-price" "github.com/redhat-developer/mapt/pkg/util/logging" @@ -19,6 +21,7 @@ const ( cmdUbuntuDesc = "ubuntu operations" cmdRHEL = "rhel" cmdRHELDesc = "ubuntu operations" + defaultVMSize = "Standard_D8as_v5" paramLinuxVersion = "version" paramLinuxVersionDesc = "linux version. Version should be formmated as X.Y (Major.minor)" @@ -74,17 +77,25 @@ func getCreateLinux(ostype azureLinux.OSType, defaultOSVersion string) *cobra.Co return fmt.Errorf("%s is not a valid spot tolerance value", viper.GetString(paramSpotTolerance)) } } + instanceRequest := &instancetypes.AzureInstanceRequest{ + CPUs: viper.GetInt32(params.CPUs), + MemoryGib: viper.GetInt32(params.Memory), + Arch: util.If(viper.GetString(params.LinuxArch) == "arm64", instancetypes.Arm64, instancetypes.Amd64), + NestedVirt: viper.GetBool(params.NestedVirt), + } + if err := azureLinux.Create( &azureLinux.LinuxRequest{ - Prefix: viper.GetString(params.ProjectName), - Location: viper.GetString(paramLocation), - VMSize: viper.GetString(paramVMSize), - Version: viper.GetString(paramLinuxVersion), - Arch: viper.GetString(params.LinuxArch), - OSType: ostype, - Username: viper.GetString(paramUsername), - Spot: viper.IsSet(paramSpot), - SpotTolerance: spotToleranceValue}); err != nil { + Prefix: viper.GetString(params.ProjectName), + Location: viper.GetString(paramLocation), + VMSizes: viper.GetStringSlice(paramVMSize), + InstanceRequest: instanceRequest, + Version: viper.GetString(paramLinuxVersion), + Arch: viper.GetString(params.LinuxArch), + OSType: ostype, + Username: viper.GetString(paramUsername), + Spot: viper.IsSet(paramSpot), + SpotTolerance: spotToleranceValue}); err != nil { logging.Error(err) } return nil @@ -95,11 +106,12 @@ func getCreateLinux(ostype azureLinux.OSType, defaultOSVersion string) *cobra.Co flagSet.StringToStringP(params.Tags, "", nil, params.TagsDesc) flagSet.StringP(paramLocation, "", defaultLocation, paramLocationDesc) flagSet.StringP(params.LinuxArch, "", params.LinuxArchDefault, params.LinuxArchDesc) - flagSet.StringP(paramVMSize, "", defaultVMSize, paramVMSizeDesc) + flagSet.StringSliceP(paramVMSize, "", []string{}, paramVMSizeDesc) flagSet.StringP(paramLinuxVersion, "", defaultOSVersion, paramLinuxVersionDesc) flagSet.StringP(paramUsername, "", defaultUsername, paramUsernameDesc) flagSet.Bool(paramSpot, false, paramSpotDesc) flagSet.StringP(paramSpotTolerance, "", defaultSpotTolerance, paramSpotToleranceDesc) + flagSet.AddFlagSet(params.GetCpusAndMemoryFlagset()) c.PersistentFlags().AddFlagSet(flagSet) return c } diff --git a/cmd/mapt/cmd/azure/hosts/windows.go b/cmd/mapt/cmd/azure/hosts/windows.go index 8a693e164..0d79165b9 100644 --- a/cmd/mapt/cmd/azure/hosts/windows.go +++ b/cmd/mapt/cmd/azure/hosts/windows.go @@ -7,6 +7,7 @@ import ( maptContext "github.com/redhat-developer/mapt/pkg/manager/context" azureWindows "github.com/redhat-developer/mapt/pkg/provider/azure/action/windows" spotprice "github.com/redhat-developer/mapt/pkg/provider/azure/module/spot-price" + "github.com/redhat-developer/mapt/pkg/provider/util/instancetypes" "github.com/redhat-developer/mapt/pkg/util/ghactions" "github.com/redhat-developer/mapt/pkg/util/logging" "github.com/spf13/cobra" @@ -83,11 +84,19 @@ func getCreateWindowsDesktop() *cobra.Command { } } + instanceRequest := &instancetypes.AzureInstanceRequest{ + CPUs: viper.GetInt32(params.CPUs), + MemoryGib: viper.GetInt32(params.Memory), + Arch: instancetypes.Amd64, + NestedVirt: viper.GetBool(params.NestedVirt), + } + if err := azureWindows.Create( &azureWindows.WindowsRequest{ Prefix: viper.GetString(params.ProjectName), Location: viper.GetString(paramLocation), - VMSize: viper.GetString(paramVMSize), + VMSizes: viper.GetStringSlice(paramVMSize), + InstaceTypeRequest: instanceRequest, Version: viper.GetString(paramWindowsVersion), Feature: viper.GetString(paramFeature), Username: viper.GetString(paramUsername), @@ -105,7 +114,7 @@ func getCreateWindowsDesktop() *cobra.Command { flagSet.StringP(params.ConnectionDetailsOutput, "", "", params.ConnectionDetailsOutputDesc) flagSet.StringToStringP(params.Tags, "", nil, params.TagsDesc) flagSet.StringP(paramLocation, "", defaultLocation, paramLocationDesc) - flagSet.StringP(paramVMSize, "", defaultVMSize, paramVMSizeDesc) + flagSet.StringSliceP(paramVMSize, "", []string{}, paramVMSizeDesc) flagSet.StringP(paramWindowsVersion, "", defaultWindowsVersion, paramWindowsVersionDesc) flagSet.StringP(paramFeature, "", defaultFeature, paramFeatureDesc) flagSet.StringP(paramUsername, "", defaultUsername, paramUsernameDesc) @@ -114,6 +123,7 @@ func getCreateWindowsDesktop() *cobra.Command { flagSet.Bool(paramSpot, false, paramSpotDesc) flagSet.StringP(paramSpotTolerance, "", defaultSpotTolerance, paramSpotToleranceDesc) flagSet.AddFlagSet(params.GetGHActionsFlagset()) + flagSet.AddFlagSet(params.GetCpusAndMemoryFlagset()) c.PersistentFlags().AddFlagSet(flagSet) return c } diff --git a/cmd/mapt/cmd/constants/constants.go b/cmd/mapt/cmd/constants/constants.go index 8905f6f9d..bb6c944e7 100644 --- a/cmd/mapt/cmd/constants/constants.go +++ b/cmd/mapt/cmd/constants/constants.go @@ -1,6 +1,8 @@ package constants -import "github.com/spf13/pflag" +import ( + "github.com/spf13/pflag" +) const ( ProjectName string = "project-name" @@ -38,6 +40,12 @@ const ( GHActionsRunnerTokenDesc string = "Token needed for registering the Github Actions Runner token" GHActionsRunnerNameDesc string = "Name for the Github Actions Runner" GHActionsRunnerRepoDesc string = "Full URL of the repository where the Github Actions Runner should be registered" + Memory string = "memory" + MemoryDesc string = "Amount of RAM for the cloud instance in GiB" + CPUs string = "cpus" + CPUsDesc string = "Number of CPUs for the cloud instance" + NestedVirt string = "nested-virt" + NestedVirtDesc string = "Use cloud instance that has nested virtualization support" CreateCmdName string = "create" DestroyCmdName string = "destroy" @@ -56,3 +64,11 @@ func GetGHActionsFlagset() *pflag.FlagSet { flagSet.StringP(GHActionsRunnerRepo, "", "", GHActionsRunnerRepoDesc) return flagSet } + +func GetCpusAndMemoryFlagset() *pflag.FlagSet { + flagSet := pflag.NewFlagSet(CreateCmdName, pflag.ExitOnError) + flagSet.Int32P(CPUs, "", 0, CPUsDesc) + flagSet.Int32P(Memory, "", 0, MemoryDesc) + flagSet.BoolP(NestedVirt, "", false, NestedVirtDesc) + return flagSet +} diff --git a/go.mod b/go.mod index 77a6d1938..9bb19b36d 100644 --- a/go.mod +++ b/go.mod @@ -13,9 +13,11 @@ require ( ) require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6 v6.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph v0.9.0 + github.com/aws/amazon-ec2-instance-selector/v2 v2.4.2-0.20231006140257-d989c5d76f0e github.com/aws/aws-sdk-go-v2 v1.27.2 github.com/aws/aws-sdk-go-v2/config v1.27.18 github.com/aws/aws-sdk-go-v2/service/ec2 v1.142.0 @@ -28,14 +30,23 @@ require ( ) require ( + github.com/aws/aws-sdk-go v1.45.6 // indirect + github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 // indirect + github.com/blang/semver/v4 v4.0.0 // indirect + github.com/evertras/bubble-table v0.15.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/imdario/mergo v0.3.16 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect + github.com/sahilm/fuzzy v0.1.0 // indirect golang.org/x/mod v0.18.0 // indirect golang.org/x/tools v0.22.0 // indirect ) require ( dario.cat/mergo v1.0.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/agext/levenshtein v1.2.3 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect @@ -93,7 +104,7 @@ require ( github.com/spf13/cast v1.6.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/zclconf/go-cty v1.13.2 // indirect - go.uber.org/multierr v1.9.0 // indirect + go.uber.org/multierr v1.11.0 // indirect golang.org/x/sync v0.7.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c // indirect gopkg.in/ini.v1 v1.67.0 // indirect @@ -125,7 +136,7 @@ require ( github.com/nxadm/tail v1.4.11 // indirect github.com/opentracing/basictracer-go v1.1.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pkg/errors v0.9.1 // indirect + github.com/pkg/errors v0.9.1 github.com/pkg/term v1.1.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -139,10 +150,10 @@ require ( github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect go.uber.org/atomic v1.9.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect + golang.org/x/crypto v0.25.0 // indirect + golang.org/x/net v0.27.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.34.2 // indirect diff --git a/go.sum b/go.sum index 6b64ea4c6..0d1e8fa59 100644 --- a/go.sum +++ b/go.sum @@ -1,13 +1,20 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0 h1:1nGuui+4POelzDwI7RG56yfQJHCnKvwfMoU7VsEp+Zg= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0/go.mod h1:99EvauvlcJ1U06amZiksfYz/3aFGyIhWGHVyiZXtBAI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0 h1:U2rTu3Ef+7w9FHKIAXM6ZyqF3UOWJZ12zIm8zECAFfg= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0 h1:H+U3Gk9zY56G3u872L82bk4thcsy2Gghb9ExT4Zvm1o= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0/go.mod h1:mgrmMSgaLp9hmax62XQTd0N4aAqSE5E0DulSpVYK7vc= +github.com/Azure/azure-sdk-for-go v66.0.0+incompatible h1:bmmC38SlE8/E81nNADlgmVGurPWMHDX2YNXVQMrBpEE= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6 v6.0.0 h1:ubTqH0Sqcc7KgjHGKstw446zi7SurSXESKgd4hJea7w= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6 v6.0.0/go.mod h1:zflC9v4VfViJrSvcvplqws/yGXVbUEMZi/iHpZdSPWA= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 h1:2qsIIvxVT+uE6yrNldntJKlLRgxGbZ85kgtz5SNBhMw= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0/go.mod h1:AW8VEadnhw9xox+VaVd9sP7NjzOAnaZBLRH6Tq3cJ38= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph v0.9.0 h1:zLzoX5+W2l95UJoVwiyNS4dX8vHyQ6x2xRLoBBL9wMk= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph v0.9.0/go.mod h1:wVEOJfGTj0oPAUGA1JuRAvz/lxXQsWW16axmHPP47Bk= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= @@ -31,6 +38,11 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= +github.com/aws/amazon-ec2-instance-selector/v2 v2.4.2-0.20231006140257-d989c5d76f0e h1:WWOuG4hx+k8KjLO0tHGrYUwY95nKJMMU9A/IGeIEKnU= +github.com/aws/amazon-ec2-instance-selector/v2 v2.4.2-0.20231006140257-d989c5d76f0e/go.mod h1:xN+IXvhDWtzz9rQrNVLK+wwXvNie/bc6gv9gSP1cxlg= +github.com/aws/aws-sdk-go v1.45.6 h1:Y2isQQBZsnO15dzUQo9YQRThtHgrV200XCH05BRHVJI= +github.com/aws/aws-sdk-go v1.45.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= github.com/aws/aws-sdk-go-v2 v1.27.2 h1:pLsTXqX93rimAOZG2FIYraDQstZaaGVVN4tNw65v0h8= github.com/aws/aws-sdk-go-v2 v1.27.2/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/aws-sdk-go-v2/config v1.27.18 h1:wFvAnwOKKe7QAyIxziwSKjmer9JBMH1vzIL6W+fYuKk= @@ -39,8 +51,10 @@ github.com/aws/aws-sdk-go-v2/credentials v1.17.18 h1:D/ALDWqK4JdY3OFgA2thcPO1c9a github.com/aws/aws-sdk-go-v2/credentials v1.17.18/go.mod h1:JuitCWq+F5QGUrmMPsk945rop6bB57jdscu+Glozdnc= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.5 h1:dDgptDO9dxeFkXy+tEgVkzSClHZje/6JkPW5aZyEvrQ= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.5/go.mod h1:gjvE2KBUgUQhcv89jqxrIxH9GaKs1JbZzWejj/DaHGA= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.9 h1:cy8ahBJuhtM8GTTSyOkfy6WVPV1IE+SS5/wfXUYuulw= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.9/go.mod h1:CZBXGLaJnEZI6EVNcPd7a6B5IC5cA/GkRWtu9fp3S6Y= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.9 h1:A4SYk07ef04+vxZToz9LWvAXl9LW0NClpPpMsi31cz0= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.9/go.mod h1:5jJcHuwDagxN+ErjQ3PU3ocf6Ylc/p9x+BLO/+X4iXw= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= @@ -51,18 +65,23 @@ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1x github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.11 h1:o4T+fKxA3gTMcluBNZZXE9DNaMkJuUL1O3mffCUjoJo= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.11/go.mod h1:84oZdJ+VjuJKs9v1UTC9NaodRZRseOXCTgku+vQJWR8= +github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 h1:k/f3T13s7wx/By6aKovlVsjdNkRVT0QRR2RlZEvaTGg= +github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6/go.mod h1:9n3tkRCngy3+Iw/8vK3C69iXh22SCGsy3yn16nTxH+s= github.com/aws/aws-sdk-go-v2/service/sso v1.20.11 h1:gEYM2GSpr4YNWc6hCd5nod4+d4kd9vWIAWrmGuLdlMw= github.com/aws/aws-sdk-go-v2/service/sso v1.20.11/go.mod h1:gVvwPdPNYehHSP9Rs7q27U1EU+3Or2ZpXvzAYJNh63w= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.5 h1:iXjh3uaH3vsVcnyZX7MqCoCfcyxIrVE9iOQruRaWPrQ= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.5/go.mod h1:5ZXesEuy/QcO0WUnt+4sDkxhdXRHTu2yG0uCSH8B6os= github.com/aws/aws-sdk-go-v2/service/sts v1.28.12 h1:M/1u4HBpwLuMtjlxuI2y6HoVLzF5e2mfxHCg7ZVMYmk= github.com/aws/aws-sdk-go-v2/service/sts v1.28.12/go.mod h1:kcfd+eTdEi/40FIbLq4Hif3XMXnl5b/+t/KTfLt9xIk= +github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -95,6 +114,8 @@ github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcej github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/evertras/bubble-table v0.15.2 h1:hVj27V9tk5TD5p6mVv0RK/KJu2sHq0U+mBMux/HptkU= +github.com/evertras/bubble-table v0.15.2/go.mod h1:SPOZKbIpyYWPHBNki3fyNpiPBQkvkULAtOT7NTD5fKY= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= @@ -124,6 +145,7 @@ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -139,6 +161,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.20.1 h1:M6hgdyz7HYt1UN9e61j+qKJBqR3orTWbI1HKBJEdxtc= github.com/hashicorp/hcl/v2 v2.20.1/go.mod h1:TZDqQ4kNKCbh1iJp99FdPiUaVDDUPivbqxZulxDYqL4= +github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= +github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= @@ -178,6 +202,8 @@ github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= @@ -194,6 +220,8 @@ github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= +github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI= +github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/opentracing/basictracer-go v1.1.0 h1:Oa1fTSBvAl8pa3U+IJYqrKm0NALwH9OsgwOqDv4xJW0= @@ -201,6 +229,8 @@ github.com/opentracing/basictracer-go v1.1.0/go.mod h1:V2HZueSJEp879yv285Aap1BS6 github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= +github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pgavlin/fx v0.1.6 h1:r9jEg69DhNoCd3Xh0+5mIbdbS3PqWrVWujkY76MFRTU= @@ -253,6 +283,8 @@ github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6ke github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI= +github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 h1:TToq11gyfNlrMFZiYujSekIsPd9AmsA2Bj/iv+s4JHE= github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= @@ -309,8 +341,8 @@ github.com/zclconf/go-cty v1.13.2 h1:4GvrUxe/QUDYuJKAav4EYqdM47/kZa672LwmXFmEKT0 github.com/zclconf/go-cty v1.13.2/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -318,8 +350,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 h1:LoYXNGAShUG3m/ehNk4iFctuhGX/+R1ZpfJ4/ia80JM= golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= @@ -338,11 +370,12 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -371,15 +404,16 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= diff --git a/pkg/provider/aws/action/fedora/fedora.go b/pkg/provider/aws/action/fedora/fedora.go index 235cb79ea..642077cec 100644 --- a/pkg/provider/aws/action/fedora/fedora.go +++ b/pkg/provider/aws/action/fedora/fedora.go @@ -22,20 +22,23 @@ import ( "github.com/redhat-developer/mapt/pkg/provider/aws/services/ec2/keypair" securityGroup "github.com/redhat-developer/mapt/pkg/provider/aws/services/ec2/security-group" "github.com/redhat-developer/mapt/pkg/provider/util/command" + "github.com/redhat-developer/mapt/pkg/provider/util/instancetypes" "github.com/redhat-developer/mapt/pkg/provider/util/output" "github.com/redhat-developer/mapt/pkg/util" "github.com/redhat-developer/mapt/pkg/util/file" "github.com/redhat-developer/mapt/pkg/util/ghactions" + "github.com/redhat-developer/mapt/pkg/util/logging" resourcesUtil "github.com/redhat-developer/mapt/pkg/util/resources" ) type Request struct { - Prefix string - Version string - Arch string - VMType []string - Spot bool - Airgap bool + Prefix string + Version string + Arch string + InstanceRequest instancetypes.InstanceRequest + VMType []string + Spot bool + Airgap bool // internal management // For airgap scenario there is an orchestation of // a phase with connectivity on the machine (allowing bootstraping) @@ -62,6 +65,15 @@ var CloudConfigBase []byte // If spot is enable it will run best spot option to get the best option to spin the machine // Then it will run the stack for windows dedicated host func Create(r *Request) error { + if len(r.VMType) == 0 { + vmTypes, err := r.InstanceRequest.GetMachineTypes() + if err != nil { + logging.Debugf("Unable to fetch desire instance types: %v", err) + } + if len(vmTypes) > 0 { + r.VMType = append(r.VMType, vmTypes...) + } + } if r.Spot { sr := spot.SpotOptionRequest{ Prefix: r.Prefix, diff --git a/pkg/provider/aws/action/rhel/rhel.go b/pkg/provider/aws/action/rhel/rhel.go index ab05c2446..bfff90851 100644 --- a/pkg/provider/aws/action/rhel/rhel.go +++ b/pkg/provider/aws/action/rhel/rhel.go @@ -22,21 +22,26 @@ import ( "github.com/redhat-developer/mapt/pkg/provider/aws/services/ec2/keypair" securityGroup "github.com/redhat-developer/mapt/pkg/provider/aws/services/ec2/security-group" "github.com/redhat-developer/mapt/pkg/provider/util/command" + "github.com/redhat-developer/mapt/pkg/provider/util/instancetypes" "github.com/redhat-developer/mapt/pkg/provider/util/output" "github.com/redhat-developer/mapt/pkg/util" "github.com/redhat-developer/mapt/pkg/util/file" "github.com/redhat-developer/mapt/pkg/util/ghactions" + "github.com/redhat-developer/mapt/pkg/util/logging" resourcesUtil "github.com/redhat-developer/mapt/pkg/util/resources" ) type Request struct { Prefix string // Basic info to setup on cloud-init - Version string - Arch string - VMType []string - SubsUsername string - SubsUserpass string + Version string + Arch string + CPUs int32 + Memory int32 + VMType []string + InstanceRequest instancetypes.InstanceRequest + SubsUsername string + SubsUserpass string // if profile SNC is enabled machine is setup to // be used as SNC runner ProfileSNC bool @@ -73,6 +78,15 @@ var CloudConfigSNC []byte // If spot is enable it will run best spot option to get the best option to spin the machine // Then it will run the stack for windows dedicated host func Create(r *Request) error { + if len(r.VMType) == 0 { + vmTypes, err := r.InstanceRequest.GetMachineTypes() + if err != nil { + logging.Debugf("Unable to fetch required instance types: %v", err) + } + if len(vmTypes) > 0 { + r.VMType = append(r.VMType, vmTypes...) + } + } if r.Spot { sr := spot.SpotOptionRequest{ Prefix: r.Prefix, diff --git a/pkg/provider/azure/action/linux/linux.go b/pkg/provider/azure/action/linux/linux.go index 56af42234..cf0665ccd 100644 --- a/pkg/provider/azure/action/linux/linux.go +++ b/pkg/provider/azure/action/linux/linux.go @@ -15,7 +15,9 @@ import ( spotprice "github.com/redhat-developer/mapt/pkg/provider/azure/module/spot-price" virtualmachine "github.com/redhat-developer/mapt/pkg/provider/azure/module/virtual-machine" "github.com/redhat-developer/mapt/pkg/provider/util/command" + "github.com/redhat-developer/mapt/pkg/provider/util/instancetypes" "github.com/redhat-developer/mapt/pkg/provider/util/output" + "github.com/redhat-developer/mapt/pkg/util" "github.com/redhat-developer/mapt/pkg/util/logging" resourcesUtil "github.com/redhat-developer/mapt/pkg/util/resources" ) @@ -28,21 +30,32 @@ const ( outputHost = "alsHost" outputUsername = "alsUsername" outputUserPrivateKey = "alsUserPrivatekey" + defaultVMSize = "Standard_D8as_v5" ) type LinuxRequest struct { - Prefix string - Location string - VMSize string - Arch string - OSType OSType - Version string - Username string - Spot bool - SpotTolerance spotprice.EvictionRate + Prefix string + Location string + VMSizes []string + Arch string + InstanceRequest instancetypes.InstanceRequest + OSType OSType + Version string + Username string + Spot bool + SpotTolerance spotprice.EvictionRate } func Create(r *LinuxRequest) (err error) { + if len(r.VMSizes) == 0 { + vmSizes, err := r.InstanceRequest.GetMachineTypes() + if err != nil { + logging.Debugf("Unable to fetch desired instance type: %v", err) + } + if len(vmSizes) > 0 { + r.VMSizes = append(r.VMSizes, vmSizes...) + } + } logging.Debug("Creating Linux Server") cs := manager.Stack{ StackName: maptContext.StackNameByProject(stackAzureLinux), @@ -65,7 +78,7 @@ func Destroy() error { // Main function to deploy all requried resources to azure func (r *LinuxRequest) deployer(ctx *pulumi.Context) error { // Get values for spot machine - location, spotPrice, err := r.valuesCheckingSpot() + location, vmType, spotPrice, err := r.valuesCheckingSpot() if err != nil { return err } @@ -112,7 +125,7 @@ func (r *LinuxRequest) deployer(ctx *pulumi.Context) error { ComponentID: azureLinuxID, ResourceGroup: rg, NetworkInteface: n.NetworkInterface, - VMSize: r.VMSize, + VMSize: vmType, Publisher: ir.publisher, Offer: ir.offer, Sku: ir.sku, @@ -145,21 +158,21 @@ func (r *LinuxRequest) deployer(ctx *pulumi.Context) error { return err } -func (r *LinuxRequest) valuesCheckingSpot() (*string, *float64, error) { +func (r *LinuxRequest) valuesCheckingSpot() (*string, string, *float64, error) { if r.Spot { bsc, err := spotprice.GetBestSpotChoice(spotprice.BestSpotChoiceRequest{ - VMTypes: []string{r.VMSize}, + VMTypes: util.If(len(r.VMSizes) > 0, r.VMSizes, []string{defaultVMSize}), OSType: "linux", EvictioRateTolerance: r.SpotTolerance, }) logging.Debugf("Best spot price option found: %v", bsc) if err != nil { - return nil, nil, err + return nil, "", nil, err } - return &bsc.Location, &bsc.Price, nil + return &bsc.Location, bsc.VMType, &bsc.Price, nil } - return &r.Location, nil, nil + return &r.Location, "", nil, nil } // Write exported values in context to files o a selected target folder diff --git a/pkg/provider/azure/action/windows/constants.go b/pkg/provider/azure/action/windows/constants.go index 4d2143c93..bc1c1fc61 100644 --- a/pkg/provider/azure/action/windows/constants.go +++ b/pkg/provider/azure/action/windows/constants.go @@ -14,6 +14,7 @@ const ( outputUserPrivateKey = "awdUserPrivatekey" outputAdminUsername = "awdAdminUsername" outputAdminUserPassword = "awdAdminUserPassword" + defaultVMSize = "Standard_D8as_v5" ProfileCRC = "crc" ) diff --git a/pkg/provider/azure/action/windows/windows.go b/pkg/provider/azure/action/windows/windows.go index dfc123345..9fd6d5ac3 100644 --- a/pkg/provider/azure/action/windows/windows.go +++ b/pkg/provider/azure/action/windows/windows.go @@ -19,6 +19,7 @@ import ( spotprice "github.com/redhat-developer/mapt/pkg/provider/azure/module/spot-price" virtualmachine "github.com/redhat-developer/mapt/pkg/provider/azure/module/virtual-machine" "github.com/redhat-developer/mapt/pkg/provider/util/command" + "github.com/redhat-developer/mapt/pkg/provider/util/instancetypes" "github.com/redhat-developer/mapt/pkg/provider/util/output" "github.com/redhat-developer/mapt/pkg/provider/util/security" "github.com/redhat-developer/mapt/pkg/util" @@ -33,16 +34,17 @@ import ( var RHQPCISetupScript []byte type WindowsRequest struct { - Prefix string - Location string - VMSize string - Version string - Feature string - Username string - AdminUsername string - Spot bool - SpotTolerance spotprice.EvictionRate - Profiles []string + Prefix string + Location string + VMSizes []string + InstaceTypeRequest instancetypes.InstanceRequest + Version string + Feature string + Username string + AdminUsername string + Spot bool + SpotTolerance spotprice.EvictionRate + Profiles []string // setup as github actions runner SetupGHActionsRunner bool } @@ -53,7 +55,15 @@ type ghActionsRunnerData struct { } func Create(r *WindowsRequest) (err error) { - logging.Debug("Creating Windows Desktop") + if len(r.VMSizes) == 0 { + vmSizes, err := r.InstaceTypeRequest.GetMachineTypes() + if err != nil { + logging.Debugf("Failed to get instance types: %v", err) + } + if len(vmSizes) > 0 { + r.VMSizes = append(r.VMSizes, vmSizes...) + } + } cs := manager.Stack{ StackName: maptContext.StackNameByProject(stackCreateWindowsDesktop), ProjectName: maptContext.ProjectName(), @@ -80,8 +90,9 @@ func Destroy() error { // Main function to deploy all requried resources to azure func (r *WindowsRequest) deployer(ctx *pulumi.Context) error { + logging.Debugf("Using these VM types for Spot price query: %v", r.VMSizes) // Get values for spot machine - location, spotPrice, err := r.valuesCheckingSpot() + location, vmType, spotPrice, err := r.valuesCheckingSpot() if err != nil { return err } @@ -122,7 +133,7 @@ func (r *WindowsRequest) deployer(ctx *pulumi.Context) error { ComponentID: azureWindowsDesktopID, ResourceGroup: rg, NetworkInteface: n.NetworkInterface, - VMSize: r.VMSize, + VMSize: vmType, Publisher: "MicrosoftWindowsDesktop", Offer: fmt.Sprintf("windows-%s", r.Version), Sku: fmt.Sprintf("win%s-%s", r.Version, r.Feature), @@ -161,21 +172,21 @@ func (r *WindowsRequest) deployer(ctx *pulumi.Context) error { return err } -func (r *WindowsRequest) valuesCheckingSpot() (*string, *float64, error) { +func (r *WindowsRequest) valuesCheckingSpot() (*string, string, *float64, error) { if r.Spot { bsc, err := spotprice.GetBestSpotChoice(spotprice.BestSpotChoiceRequest{ - VMTypes: []string{r.VMSize}, + VMTypes: util.If(len(r.VMSizes) > 0, r.VMSizes, []string{defaultVMSize}), OSType: "windows", EvictioRateTolerance: r.SpotTolerance, }) logging.Debugf("Best spot price option found: %v", bsc) if err != nil { - return nil, nil, err + return nil, "", nil, err } - return &bsc.Location, &bsc.Price, nil + return &bsc.Location, bsc.VMType, &bsc.Price, nil } - return &r.Location, nil, nil + return &r.Location, "", nil, nil } // Write exported values in context to files o a selected target folder diff --git a/pkg/provider/azure/module/identity/azidentity.go b/pkg/provider/azure/module/identity/azidentity.go new file mode 100644 index 000000000..ed1e107b2 --- /dev/null +++ b/pkg/provider/azure/module/identity/azidentity.go @@ -0,0 +1,24 @@ +package identity + +import ( + "os" + "strings" +) + +var azIdentityEnvs = []string{ + "AZURE_TENANT_ID", + "AZURE_SUBSCRIPTION_ID", + "AZURE_CLIENT_ID", + "AZURE_CLIENT_SECRET", +} + +// Envs required for auth with go sdk +// https://learn.microsoft.com/es-es/azure/developer/go/azure-sdk-authentication?tabs=bash#service-principal-with-a-secret +// do not match standard envs for pulumi envs for auth with native sdk +// https://www.pulumi.com/registry/packages/azure-native/installation-configuration/#set-configuration-using-environment-variables +func SetAZIdentityEnvs() { + for _, e := range azIdentityEnvs { + os.Setenv(e, + os.Getenv(strings.ReplaceAll(e, "AZURE", "ARM"))) + } +} diff --git a/pkg/provider/azure/module/spot-price/spot-price.go b/pkg/provider/azure/module/spot-price/spot-price.go index b74dfb030..4be3104dc 100644 --- a/pkg/provider/azure/module/spot-price/spot-price.go +++ b/pkg/provider/azure/module/spot-price/spot-price.go @@ -1,17 +1,19 @@ package spotprice import ( + "bytes" "context" "encoding/json" "fmt" - "os" "slices" "sort" "strings" + "text/template" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph" + maptAzIdentity "github.com/redhat-developer/mapt/pkg/provider/azure/module/identity" "github.com/redhat-developer/mapt/pkg/util" "github.com/redhat-developer/mapt/pkg/util/logging" "golang.org/x/exp/maps" @@ -19,13 +21,13 @@ import ( const ( querySpotPrice = "SpotResources | where type =~ 'microsoft.compute/skuspotpricehistory/ostype/location' " + - "and sku.name in~ (%s) and properties.osType =~ '%s'" + + "and sku.name in~ ({{range $index, $v := .VMTypes}}{{if $index}},{{end}}'{{$v}}'{{end}}) and properties.osType =~ '{{.OSType}}'" + "| project skuName=tostring(sku.name),osType=tostring(properties.osType)," + "location,latestSpotPriceUSD=todouble(properties.spotPrices[0].priceUSD)" + "| order by latestSpotPriceUSD asc" queryEvictionRate = "SpotResources | where type =~ 'microsoft.compute/skuspotevictionrate/location' " + - "and sku.name in~ (%s)" + + "and sku.name in~ ({{range $index, $v := .VMTypes}}{{if $index}},{{end}}'{{$v}}'{{end}})" + "| project skuName=tostring(sku.name),location,spotEvictionRate=tostring(properties.evictionRate) " Lowest EvictionRate = iota @@ -71,22 +73,13 @@ type evictionRate struct { EvictionRate string `json:"spotEvictionRate"` } -var ( - azIdentityEnvs = []string{ - "AZURE_TENANT_ID", - "AZURE_SUBSCRIPTION_ID", - "AZURE_CLIENT_ID", - "AZURE_CLIENT_SECRET", - } - - evictionRates = map[string]evictionRateSpec{ - "lowest": {Lowest, "lowest", 0, "0-5"}, - "low": {Low, "low", 1, "5-10"}, - "medium": {Medium, "medium", 2, "10-15"}, - "high": {High, "high", 3, "15-20"}, - "highest": {Highest, "highest", 4, "20+"}, - } -) +var evictionRates = map[string]evictionRateSpec{ + "lowest": {Lowest, "lowest", 0, "0-5"}, + "low": {Low, "low", 1, "5-10"}, + "medium": {Medium, "medium", 2, "10-15"}, + "high": {High, "high", 3, "15-20"}, + "highest": {Highest, "highest", 4, "20+"}, +} // This function will return the best spot option func GetBestSpotChoice(r BestSpotChoiceRequest) (*BestSpotChoiceResponse, error) { @@ -115,7 +108,7 @@ func GetBestSpotChoice(r BestSpotChoiceRequest) (*BestSpotChoiceResponse, error) func getGraphClient() (*armresourcegraph.Client, error) { // Auth identity - setAZIdentityEnvs() + maptAzIdentity.SetAZIdentityEnvs() cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { return nil, fmt.Errorf("error getting the best spot price choice: %v", err) @@ -124,22 +117,27 @@ func getGraphClient() (*armresourcegraph.Client, error) { return armresourcegraph.NewClient(cred, nil) } -// Envs required for auth with go sdk -// https://learn.microsoft.com/es-es/azure/developer/go/azure-sdk-authentication?tabs=bash#service-principal-with-a-secret -// do not match standard envs for pulumi envs for auth with native sdk -// https://www.pulumi.com/registry/packages/azure-native/installation-configuration/#set-configuration-using-environment-variables -func setAZIdentityEnvs() { - for _, e := range azIdentityEnvs { - os.Setenv(e, - os.Getenv(strings.ReplaceAll(e, "AZURE", "ARM"))) - } -} - func getPriceHistory(ctx context.Context, client *armresourcegraph.Client, r BestSpotChoiceRequest) ([]priceHistory, error) { - spr := fmt.Sprintf(querySpotPrice, - fmt.Sprintf("'%s'", strings.Join(r.VMTypes, ",")), - r.OSType) + data := struct { + VMTypes []string + OSType string + }{ + VMTypes: r.VMTypes, + OSType: r.OSType, + } + tmpl, err := template.New("graphQuery").Parse(querySpotPrice) + if err != nil { + return nil, err + } + buffer := new(bytes.Buffer) + err = tmpl.Execute(buffer, data) + if err != nil { + return nil, err + } + spr := string(buffer.Bytes()) + logging.Debug(spr) + qr, err := client.Resources(ctx, armresourcegraph.QueryRequest{ Query: to.Ptr(spr), @@ -166,8 +164,23 @@ func getPriceHistory(ctx context.Context, client *armresourcegraph.Client, func getEvictionRateInfoByVMTypes(ctx context.Context, client *armresourcegraph.Client, vmTypes []string) ([]evictionRate, error) { - evrr := fmt.Sprintf(queryEvictionRate, - fmt.Sprintf("'%s'", strings.Join(vmTypes, ","))) + data := struct { + VMTypes []string + }{ + VMTypes: vmTypes, + } + tmpl, err := template.New("graphQuery").Parse(queryEvictionRate) + if err != nil { + return nil, err + } + buffer := new(bytes.Buffer) + err = tmpl.Execute(buffer, data) + if err != nil { + return nil, err + } + evrr := string(buffer.Bytes()) + logging.Debug(evrr) + qr, err := client.Resources(ctx, armresourcegraph.QueryRequest{ Query: to.Ptr(evrr), diff --git a/pkg/provider/util/instancetypes/aws.go b/pkg/provider/util/instancetypes/aws.go new file mode 100644 index 000000000..bc2d8fc7b --- /dev/null +++ b/pkg/provider/util/instancetypes/aws.go @@ -0,0 +1,62 @@ +package instancetypes + +import ( + "context" + "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" + "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" + "github.com/aws/aws-sdk-go-v2/config" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" +) + +type AwsInstanceRequest struct { + CPUs int32 + MemoryGib int32 + Arch arch + NestedVirt bool +} + +func (r *AwsInstanceRequest) GetMachineTypes() ([]string, error) { + if err := validate(r.CPUs, r.MemoryGib, r.Arch); err != nil { + return nil, err + } + + ctx := context.Background() + cfg, err := config.LoadDefaultConfig(ctx) + if err != nil { + return nil, err + } + instanceSelector, err := selector.New(ctx, cfg) + if err != nil { + return nil, err + } + + vcpusRange := selector.Int32RangeFilter{ + LowerBound: r.CPUs, + UpperBound: r.CPUs, + } + memoryRange := selector.ByteQuantityRangeFilter{ + LowerBound: bytequantity.FromGiB(uint64(r.MemoryGib)), + UpperBound: bytequantity.FromGiB(uint64(r.MemoryGib)), + } + + arch := ec2types.ArchitectureTypeX8664 + if r.Arch == Arm64 { + arch = ec2types.ArchitectureTypeArm64 + } + + maxResults := maxResults + + filters := selector.Filters{ + VCpusRange: &vcpusRange, + MemoryRange: &memoryRange, + CPUArchitecture: &arch, + MaxResults: &maxResults, + BareMetal: &r.NestedVirt, + } + + instanceTypesSlice, err := instanceSelector.Filter(ctx, filters) + if err != nil { + return nil, err + } + return instanceTypesSlice, nil +} diff --git a/pkg/provider/util/instancetypes/azure.go b/pkg/provider/util/instancetypes/azure.go new file mode 100644 index 000000000..e9fc6c340 --- /dev/null +++ b/pkg/provider/util/instancetypes/azure.go @@ -0,0 +1,270 @@ +package instancetypes + +import ( + "context" + "os" + "regexp" + "slices" + "strconv" + "strings" + "sync" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + armcompute "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + maptAzIdenity "github.com/redhat-developer/mapt/pkg/provider/azure/module/identity" +) + +func getAzureVMSKUs(cpus, memory int32, arch arch, nestedVirt bool) ([]string, error) { + maptAzIdenity.SetAZIdentityEnvs() + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + return nil, err + } + ctx := context.Background() + subscriptionId := os.Getenv("AZURE_SUBSCRIPTION_ID") + clientFactory, err := armcompute.NewClientFactory(subscriptionId, cred, nil) + if err != nil { + return nil, err + } + pager := clientFactory.NewResourceSKUsClient().NewListPager(&armcompute.ResourceSKUsClientListOptions{Filter: nil, + IncludeExtendedLocations: nil, + }) + + vmTypes := []string{} + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + return nil, err + } + vmTypes = append(vmTypes, FilterVMs(page, filterCPUsAndMemory(cpus, memory, arch, nestedVirt))...) + } + return vmTypes, nil +} + +type filterFunc func(context.Context, *virtualMachine, *sync.WaitGroup, chan<- string) + +type virtualMachine struct { + Name string + Family string + VCPUs int32 + VCPUsPerCore int32 + Memory int32 + // Hyperv gen1 or gen2 + HyperVGenerations []string + Arch string + // Spot capable + LowPriorityCapable bool + MaxResourceVolumeMB int32 + // IaaS or PaaS + VMDeploymentTypes []string + // Fast SSD + PremiumIO bool + AcceleratedNetworkingEnabled bool + EncryptionAtHostSupported bool +} + +func (vm *virtualMachine) nestedVirtSupported() bool { + // standard D,E and F series are the VM families + // supporting nested virtualization + var dSeriesPattern = `standardD.*v[3-6]Family$` + var eSeriesPattern = `standardE.*v[3-6]Family$` + var fSeriesPattern = `standardF.*v\dFamily$` + + dSeries := regexp.MustCompile(dSeriesPattern) + if dSeries.Match([]byte(vm.Family)) { + return true + } + + eSeries := regexp.MustCompile(eSeriesPattern) + if eSeries.Match([]byte(vm.Family)) { + return true + } + + fSeries := regexp.MustCompile(fSeriesPattern) + if fSeries.Match([]byte(vm.Family)) { + return true + } + return false +} + +func (vm *virtualMachine) getCPUCores() int32 { + if vm.VCPUsPerCore > 0 { + return (vm.VCPUs / vm.VCPUsPerCore) + } + return vm.VCPUs +} + +func (vm *virtualMachine) hypervGen2Supported() bool { + return slices.Contains(vm.HyperVGenerations, "V2") +} + +func (vm *virtualMachine) emptyDiskSupported() bool { + return vm.MaxResourceVolumeMB == 0 +} + +func (vm *virtualMachine) baseFeaturesSupported() bool { + return vm.AcceleratedNetworkingEnabled && vm.PremiumIO && vm.EncryptionAtHostSupported && + vm.emptyDiskSupported() && vm.hypervGen2Supported() +} + +func resourceSKUToVirtualMachine(res *armcompute.ResourceSKU) *virtualMachine { + if res.ResourceType != nil && *res.ResourceType != "virtualMachines" { + return nil + } + vm := &virtualMachine{ + Name: *res.Name, + Family: *res.Family, + } + for _, capability := range res.Capabilities { + switch *capability.Name { + case "vCPUs": + vCpus, err := strconv.ParseInt(*capability.Value, 10, 32) + if err != nil { + return nil + } + vm.VCPUs = int32(vCpus) + case "vCPUsPerCore": + vCpusPerCore, err := strconv.ParseInt(*capability.Value, 10, 32) + if err != nil { + return nil + } + vm.VCPUsPerCore = int32(vCpusPerCore) + case "MemoryGB": + mem, err := strconv.ParseInt(*capability.Value, 10, 32) + if err != nil { + return nil + } + vm.Memory = int32(mem) + case "HyperVGenerations": + vm.HyperVGenerations = strings.Split(*capability.Value, ",") + case "AcceleratedNetworkingEnabled": + fastNet, err := strconv.ParseBool(*capability.Value) + if err != nil { + return nil + } + vm.AcceleratedNetworkingEnabled = fastNet + case "EncryptionAtHostSupported": + encryption, err := strconv.ParseBool(*capability.Value) + if err != nil { + return nil + } + vm.EncryptionAtHostSupported = encryption + case "CpuArchitectureType": + vm.Arch = *capability.Value + case "LowPriorityCapable": + lowPriority, err := strconv.ParseBool(*capability.Value) + if err != nil { + return nil + } + vm.LowPriorityCapable = lowPriority + case "PremiumIO": + premiumIO, err := strconv.ParseBool(*capability.Value) + if err != nil { + return nil + } + vm.PremiumIO = premiumIO + case "MaxResourceVolumeMB": + disk, err := strconv.ParseUint(*capability.Value, 10, 64) + if err != nil { + return nil + } + vm.MaxResourceVolumeMB = int32(disk) + case "VMDeploymentTypes": + vm.VMDeploymentTypes = strings.Split(*capability.Value, ",") + default: + continue + } + } + return vm +} + +func filterCPUsAndMemory(cpus, memory int32, arch arch, nestedVirt bool) filterFunc { + return func(ctx context.Context, vm *virtualMachine, wg *sync.WaitGroup, vmCh chan<- string) { + defer wg.Done() + select { + case <-ctx.Done(): + return + default: + if vm == nil { + return + } + if nestedVirt && !vm.nestedVirtSupported() { + return + } + + if vm.VCPUs >= cpus && vm.Memory >= memory && vm.Arch == arch.String() && + vm.baseFeaturesSupported() { + vmCh <- vm.Name + } + } + } +} + +// sort the VirtualMachine slice based on vcpus +// for the above to happen need to have a slice of VirtualMachines in memory first +// so no go routines needed + +func FilterVMs(skus armcompute.ResourceSKUsClientListResponse, filter filterFunc) []string { + chVmTypes := make(chan string, maxResults) + vmTypes := []string{} + virtualMachines := []*virtualMachine{} + wg := &sync.WaitGroup{} + ctx, cancelFn := context.WithCancel(context.Background()) + + for _, v := range skus.Value { + vm := resourceSKUToVirtualMachine(v) + if vm != nil { + virtualMachines = append(virtualMachines, vm) + } + } + + slices.SortStableFunc(virtualMachines, func(vm1, vm2 *virtualMachine) int { + if vm1.VCPUs > vm2.VCPUs { + return 1 + } + if vm1.VCPUs < vm2.VCPUs { + return -1 + } + return 0 + }) + + for _, v := range virtualMachines { + wg.Add(1) + go filter(ctx, v, wg, chVmTypes) + } + c := make(chan int) + + go func() { + defer close(c) + wg.Wait() + }() + + for { + select { + case vmtype := <-chVmTypes: + if !slices.Contains(vmTypes, vmtype) { + vmTypes = append(vmTypes, vmtype) + } + if len(vmTypes) == maxResults { + cancelFn() + return vmTypes + } + case <-c: + return vmTypes + } + } +} + +type AzureInstanceRequest struct { + CPUs int32 + MemoryGib int32 + Arch arch + NestedVirt bool +} + +func (r *AzureInstanceRequest) GetMachineTypes() ([]string, error) { + if err := validate(r.CPUs, r.MemoryGib, r.Arch); err != nil { + return nil, err + } + return getAzureVMSKUs(r.CPUs, r.MemoryGib, r.Arch, r.NestedVirt) +} diff --git a/pkg/provider/util/instancetypes/instancetypes.go b/pkg/provider/util/instancetypes/instancetypes.go new file mode 100644 index 000000000..ea5ac5d84 --- /dev/null +++ b/pkg/provider/util/instancetypes/instancetypes.go @@ -0,0 +1,33 @@ +package instancetypes + +import "fmt" + +type InstanceRequest interface { + GetMachineTypes() ([]string, error) +} + +type arch int + +func (a arch) String() string { + switch a { + case Amd64: + return "x64" + case Arm64: + return "Arm64" + } + return "" +} + +const ( + Amd64 arch = iota + 1 + Arm64 +) + +const maxResults = 15 // maximum number of VM types to fetch + +func validate(cpus, memory int32, arch arch) error { + if cpus > 0 && memory > 0 && arch.String() != "" { + return nil + } + return fmt.Errorf("Invalid values for CPUs: %d, Memory: %d and Arch: %s", cpus, memory, arch) +} diff --git a/pkg/util/resources/resources.go b/pkg/util/resources/resources.go index 5eb851170..9bd78cd35 100644 --- a/pkg/util/resources/resources.go +++ b/pkg/util/resources/resources.go @@ -1,6 +1,8 @@ package resources -import "fmt" +import ( + "fmt" +) // Returns the unique name to identify a resoruces within // pulumi context diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md index af095f1da..1a9cedbaf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 1.13.0 (2024-07-16) + +### Features Added + +- Added runtime.NewRequestFromRequest(), allowing for a policy.Request to be created from an existing *http.Request. + ## 1.12.0 (2024-06-06) ### Features Added diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go index 187fe82b9..00f2d5a0a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go @@ -192,7 +192,7 @@ func appendNext(parent *ResourceID, parts []string, id string) (*ResourceID, err } if strings.EqualFold(parts[0], providersKey) && (len(parts) == 2 || strings.EqualFold(parts[2], providersKey)) { - //provider resource can only be on a tenant or a subscription parent + // provider resource can only be on a tenant or a subscription parent if parent.ResourceType.String() != SubscriptionResourceType.String() && parent.ResourceType.String() != TenantResourceType.String() { return nil, fmt.Errorf("invalid resource ID: %s", id) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go index 039b758bf..6a7c916b4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go @@ -34,18 +34,22 @@ func NewPipeline(module, version string, cred azcore.TokenCredential, plOpts azr InsecureAllowCredentialWithHTTP: options.InsecureAllowCredentialWithHTTP, Scopes: []string{conf.Audience + "/.default"}, }) + // we don't want to modify the underlying array in plOpts.PerRetry perRetry := make([]azpolicy.Policy, len(plOpts.PerRetry), len(plOpts.PerRetry)+1) copy(perRetry, plOpts.PerRetry) - plOpts.PerRetry = append(perRetry, authPolicy, exported.PolicyFunc(httpTraceNamespacePolicy)) + perRetry = append(perRetry, authPolicy, exported.PolicyFunc(httpTraceNamespacePolicy)) + plOpts.PerRetry = perRetry if !options.DisableRPRegistration { regRPOpts := armpolicy.RegistrationOptions{ClientOptions: options.ClientOptions} regPolicy, err := NewRPRegistrationPolicy(cred, ®RPOpts) if err != nil { return azruntime.Pipeline{}, err } + // we don't want to modify the underlying array in plOpts.PerCall perCall := make([]azpolicy.Policy, len(plOpts.PerCall), len(plOpts.PerCall)+1) copy(perCall, plOpts.PerCall) - plOpts.PerCall = append(perCall, regPolicy) + perCall = append(perCall, regPolicy) + plOpts.PerCall = perCall } if plOpts.APIVersion.Name == "" { plOpts.APIVersion.Name = "api-version" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go index 3041984d9..e3e2d4e58 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go @@ -7,6 +7,7 @@ package exported import ( + "bytes" "context" "encoding/base64" "errors" @@ -67,6 +68,42 @@ func (ov opValues) get(value any) bool { return ok } +// NewRequestFromRequest creates a new policy.Request with an existing *http.Request +// Exported as runtime.NewRequestFromRequest(). +func NewRequestFromRequest(req *http.Request) (*Request, error) { + policyReq := &Request{req: req} + + if req.Body != nil { + // we can avoid a body copy here if the underlying stream is already a + // ReadSeekCloser. + readSeekCloser, isReadSeekCloser := req.Body.(io.ReadSeekCloser) + + if !isReadSeekCloser { + // since this is an already populated http.Request we want to copy + // over its body, if it has one. + bodyBytes, err := io.ReadAll(req.Body) + + if err != nil { + return nil, err + } + + if err := req.Body.Close(); err != nil { + return nil, err + } + + readSeekCloser = NopCloser(bytes.NewReader(bodyBytes)) + } + + // SetBody also takes care of updating the http.Request's body + // as well, so they should stay in-sync from this point. + if err := policyReq.SetBody(readSeekCloser, req.Header.Get("Content-Type")); err != nil { + return nil, err + } + } + + return policyReq, nil +} + // NewRequest creates a new Request with the specified input. // Exported as runtime.NewRequest(). func NewRequest(ctx context.Context, httpMethod string, endpoint string) (*Request, error) { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go index 79651fd96..e5b28a9b1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go @@ -40,5 +40,5 @@ const ( Module = "azcore" // Version is the semantic version (see http://semver.org) of this module. - Version = "v1.12.0" + Version = "v1.13.0" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go index 40ddc8d92..7d34b7803 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go @@ -15,6 +15,7 @@ import ( "fmt" "io" "mime/multipart" + "net/http" "net/textproto" "net/url" "path" @@ -45,6 +46,11 @@ func NewRequest(ctx context.Context, httpMethod string, endpoint string) (*polic return exported.NewRequest(ctx, httpMethod, endpoint) } +// NewRequestFromRequest creates a new policy.Request with an existing *http.Request +func NewRequestFromRequest(req *http.Request) (*policy.Request, error) { + return exported.NewRequestFromRequest(req) +} + // EncodeQueryParams will parse and encode any query parameters in the specified URL. // Any semicolons will automatically be escaped. func EncodeQueryParams(u string) (string, error) { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md index 6d4b6feb8..a8c2feb6d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md @@ -1,5 +1,29 @@ # Release History +## 1.7.0 (2024-06-20) + +### Features Added +* `AzurePipelinesCredential` authenticates an Azure Pipelines service connection with + workload identity federation + +### Breaking Changes +> These changes affect only code written against a beta version such as v1.7.0-beta.1 +* Removed the persistent token caching API. It will return in v1.8.0-beta.1 + +## 1.7.0-beta.1 (2024-06-10) + +### Features Added +* Restored `AzurePipelinesCredential` and persistent token caching API + +## Breaking Changes +> These changes affect only code written against a beta version such as v1.6.0-beta.4 +* Values which `NewAzurePipelinesCredential` read from environment variables in + prior versions are now parameters +* Renamed `AzurePipelinesServiceConnectionCredentialOptions` to `AzurePipelinesCredentialOptions` + +### Bugs Fixed +* Managed identity bug fixes + ## 1.6.0 (2024-06-10) ### Features Added diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md index b5acff0e6..7e201ea2f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md @@ -140,6 +140,7 @@ client := armresources.NewResourceGroupsClient("subscription ID", chain, nil) |Credential|Usage |-|- +|[AzurePipelinesCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzurePipelinesCredential)|Authenticate an Azure Pipelines [service connection](https://learn.microsoft.com/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml) |[ClientAssertionCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientAssertionCredential)|Authenticate a service principal with a signed client assertion |[ClientCertificateCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientCertificateCredential)|Authenticate a service principal with a certificate |[ClientSecretCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientSecretCredential)|Authenticate a service principal with a secret diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD index f9cc48943..fbaa29220 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD @@ -57,6 +57,7 @@ The following table indicates the state of in-memory and persistent caching in e |--------------------------------|---------------------------------------------------------------------|--------------------------| | `AzureCLICredential` | Not Supported | Not Supported | | `AzureDeveloperCLICredential` | Not Supported | Not Supported | +| `AzurePipelinesCredential` | Supported | Supported | | `ClientAssertionCredential` | Supported | Supported | | `ClientCertificateCredential` | Supported | Supported | | `ClientSecretCredential` | Supported | Supported | diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md index 3564e685e..54016a070 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md @@ -10,6 +10,7 @@ This troubleshooting guide covers failure investigation techniques, common error - [Enable and configure logging](#enable-and-configure-logging) - [Troubleshoot AzureCLICredential authentication issues](#troubleshoot-azureclicredential-authentication-issues) - [Troubleshoot AzureDeveloperCLICredential authentication issues](#troubleshoot-azuredeveloperclicredential-authentication-issues) +- [Troubleshoot AzurePipelinesCredential authentication issues](#troubleshoot-azurepipelinescredential-authentication-issues) - [Troubleshoot ClientCertificateCredential authentication issues](#troubleshoot-clientcertificatecredential-authentication-issues) - [Troubleshoot ClientSecretCredential authentication issues](#troubleshoot-clientsecretcredential-authentication-issues) - [Troubleshoot DefaultAzureCredential authentication issues](#troubleshoot-defaultazurecredential-authentication-issues) @@ -226,6 +227,15 @@ azd auth token --output json --scope https://management.core.windows.net/.defaul |---|---|---| |no client ID/tenant ID/token file specified|Incomplete configuration|In most cases these values are provided via environment variables set by Azure Workload Identity.