diff --git a/go.mod b/go.mod index 50b58e285f68..9cefc9badc91 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/btubbs/datetime v0.1.0 github.com/davecgh/go-spew v1.1.1 github.com/gofrs/uuid v4.0.0+incompatible - github.com/google/go-cmp v0.5.6 + github.com/google/go-cmp v0.5.8 github.com/google/uuid v1.1.2 github.com/hashicorp/go-azure-helpers v0.33.0 github.com/hashicorp/go-multierror v1.1.1 @@ -53,7 +53,7 @@ require ( github.com/hashicorp/go-hclog v0.16.1 // indirect github.com/hashicorp/go-plugin v1.4.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.0 // indirect - github.com/hashicorp/hc-install v0.3.1 // indirect + github.com/hashicorp/hc-install v0.3.2 // indirect github.com/hashicorp/hcl/v2 v2.10.0 // indirect github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80 // indirect github.com/hashicorp/logutils v1.0.0 // indirect diff --git a/go.sum b/go.sum index 196604d33239..4df4d9e00605 100644 --- a/go.sum +++ b/go.sum @@ -225,8 +225,9 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -296,8 +297,9 @@ github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hc-install v0.3.1 h1:VIjllE6KyAI1A244G8kTaHXy+TL5/XYzvrtFi8po/Yk= github.com/hashicorp/hc-install v0.3.1/go.mod h1:3LCdWcCDS1gaHC9mhHCGbkYfoY6vdsKohGjugbZdZak= +github.com/hashicorp/hc-install v0.3.2 h1:oiQdJZvXmkNcRcEOOfM5n+VTsvNjWQeOjfAoO6dKSH8= +github.com/hashicorp/hc-install v0.3.2/go.mod h1:xMG6Tr8Fw1WFjlxH0A9v61cW15pFwgEGqEz0V4jisHs= github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= github.com/hashicorp/hcl/v2 v2.10.0 h1:1S1UnuhDGlv3gRFV4+0EdwB+znNP5HmcGbIqwnSCByg= github.com/hashicorp/hcl/v2 v2.10.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= diff --git a/internal/services/batch/batch_account.go b/internal/services/batch/batch_account.go index 108d987f3e8f..fa2c4bf438c3 100644 --- a/internal/services/batch/batch_account.go +++ b/internal/services/batch/batch_account.go @@ -3,7 +3,7 @@ package batch import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" ) // expandBatchAccountKeyVaultReference expands Batch account KeyVault reference diff --git a/internal/services/batch/batch_account_data_source.go b/internal/services/batch/batch_account_data_source.go index d42393af232d..825c26057bb5 100644 --- a/internal/services/batch/batch_account_data_source.go +++ b/internal/services/batch/batch_account_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/batch/batch_account_data_source_test.go b/internal/services/batch/batch_account_data_source_test.go index d89e4c193043..e42cd7cba39a 100644 --- a/internal/services/batch/batch_account_data_source_test.go +++ b/internal/services/batch/batch_account_data_source_test.go @@ -188,7 +188,7 @@ resource "azurerm_key_vault" "test" { resource "azurerm_role_assignment" "contribrole" { scope = "/subscriptions/%s" - role_definition_name = "Contributor" + role_definition_name = "Reader" principal_id = "${data.azuread_service_principal.test.object_id}" } diff --git a/internal/services/batch/batch_account_resource.go b/internal/services/batch/batch_account_resource.go index 48229f8b7e41..8837d0c58107 100644 --- a/internal/services/batch/batch_account_resource.go +++ b/internal/services/batch/batch_account_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/batch/batch_application_resource.go b/internal/services/batch/batch_application_resource.go index da55f29297fb..9741a8f2c81a 100644 --- a/internal/services/batch/batch_application_resource.go +++ b/internal/services/batch/batch_application_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/batch/batch_certificate_resource.go b/internal/services/batch/batch_certificate_resource.go index f5e93ee17ff0..8bacd6f201e4 100644 --- a/internal/services/batch/batch_certificate_resource.go +++ b/internal/services/batch/batch_certificate_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/batch/batch_pool.go b/internal/services/batch/batch_pool.go index c69a5d961ff1..85faf6ee25e1 100644 --- a/internal/services/batch/batch_pool.go +++ b/internal/services/batch/batch_pool.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) diff --git a/internal/services/batch/batch_pool_resource.go b/internal/services/batch/batch_pool_resource.go index 46657ea990ad..3094dabea019 100644 --- a/internal/services/batch/batch_pool_resource.go +++ b/internal/services/batch/batch_pool_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" diff --git a/internal/services/batch/client/client.go b/internal/services/batch/client/client.go index d75b15e64b94..b79ded39fcca 100644 --- a/internal/services/batch/client/client.go +++ b/internal/services/batch/client/client.go @@ -5,7 +5,7 @@ import ( "fmt" batchDataplane "github.com/Azure/azure-sdk-for-go/services/batch/2020-03-01.11.0/batch" - "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch" + "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" "github.com/Azure/go-autorest/autorest" "github.com/hashicorp/terraform-provider-azurerm/internal/common" "github.com/hashicorp/terraform-provider-azurerm/internal/services/batch/parse" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/CHANGELOG.md similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/CHANGELOG.md rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/CHANGELOG.md diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/_meta.json similarity index 80% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/_meta.json rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/_meta.json index a48ead25f3c8..fd8e0a2af323 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/_meta.json +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/_meta.json @@ -1,10 +1,10 @@ { - "commit": "b47572ab2069865484c493a4f679d4e72f8b303d", + "commit": "162460648e39b3cd20ef3d302008add138e90223", "readme": "/_/azure-rest-api-specs/specification/batch/resource-manager/readme.md", - "tag": "package-2021-06", + "tag": "package-2022-01", "use": "@microsoft.azure/autorest.go@2.1.187", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-06 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/batch/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2022-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/batch/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/account.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/account.go similarity index 82% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/account.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/account.go index 82d1ae2bfe86..85e1bf96682f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/account.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/account.go @@ -15,7 +15,7 @@ import ( "net/http" ) -// AccountClient is the client for the Account methods of the Batch service. +// AccountClient is the batch Client type AccountClient struct { BaseClient } @@ -92,7 +92,7 @@ func (client AccountClient) CreatePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -181,7 +181,7 @@ func (client AccountClient) DeletePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -274,7 +274,7 @@ func (client AccountClient) GetPreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -305,6 +305,92 @@ func (client AccountClient) GetResponder(resp *http.Response) (result Account, e return } +// GetDetector gets information about the given detector for a given Batch account. +// Parameters: +// resourceGroupName - the name of the resource group that contains the Batch account. +// accountName - the name of the Batch account. +// detectorID - the name of the detector. +func (client AccountClient) GetDetector(ctx context.Context, resourceGroupName string, accountName string, detectorID string) (result DetectorResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.GetDetector") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("batch.AccountClient", "GetDetector", err.Error()) + } + + req, err := client.GetDetectorPreparer(ctx, resourceGroupName, accountName, detectorID) + if err != nil { + err = autorest.NewErrorWithError(err, "batch.AccountClient", "GetDetector", nil, "Failure preparing request") + return + } + + resp, err := client.GetDetectorSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "batch.AccountClient", "GetDetector", resp, "Failure sending request") + return + } + + result, err = client.GetDetectorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "batch.AccountClient", "GetDetector", resp, "Failure responding to request") + return + } + + return +} + +// GetDetectorPreparer prepares the GetDetector request. +func (client AccountClient) GetDetectorPreparer(ctx context.Context, resourceGroupName string, accountName string, detectorID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "detectorId": autorest.Encode("path", detectorID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors/{detectorId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDetectorSender sends the GetDetector request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) GetDetectorSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetDetectorResponder handles the response to the GetDetector request. The method always +// closes the http.Response Body. +func (client AccountClient) GetDetectorResponder(resp *http.Response) (result DetectorResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // GetKeys this operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the // Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to // authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. @@ -360,7 +446,7 @@ func (client AccountClient) GetKeysPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -436,7 +522,7 @@ func (client AccountClient) ListPreparer(ctx context.Context) (*http.Request, er "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -552,7 +638,7 @@ func (client AccountClient) ListByResourceGroupPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -620,6 +706,132 @@ func (client AccountClient) ListByResourceGroupComplete(ctx context.Context, res return } +// ListDetectors gets information about the detectors available for a given Batch account. +// Parameters: +// resourceGroupName - the name of the resource group that contains the Batch account. +// accountName - the name of the Batch account. +func (client AccountClient) ListDetectors(ctx context.Context, resourceGroupName string, accountName string) (result DetectorListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.ListDetectors") + defer func() { + sc := -1 + if result.dlr.Response.Response != nil { + sc = result.dlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("batch.AccountClient", "ListDetectors", err.Error()) + } + + result.fn = client.listDetectorsNextResults + req, err := client.ListDetectorsPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListDetectors", nil, "Failure preparing request") + return + } + + resp, err := client.ListDetectorsSender(req) + if err != nil { + result.dlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListDetectors", resp, "Failure sending request") + return + } + + result.dlr, err = client.ListDetectorsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListDetectors", resp, "Failure responding to request") + return + } + if result.dlr.hasNextLink() && result.dlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListDetectorsPreparer prepares the ListDetectors request. +func (client AccountClient) ListDetectorsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListDetectorsSender sends the ListDetectors request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) ListDetectorsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListDetectorsResponder handles the response to the ListDetectors request. The method always +// closes the http.Response Body. +func (client AccountClient) ListDetectorsResponder(resp *http.Response) (result DetectorListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listDetectorsNextResults retrieves the next set of results, if any. +func (client AccountClient) listDetectorsNextResults(ctx context.Context, lastResults DetectorListResult) (result DetectorListResult, err error) { + req, err := lastResults.detectorListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listDetectorsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListDetectorsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "batch.AccountClient", "listDetectorsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListDetectorsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "batch.AccountClient", "listDetectorsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListDetectorsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountClient) ListDetectorsComplete(ctx context.Context, resourceGroupName string, accountName string) (result DetectorListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.ListDetectors") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListDetectors(ctx, resourceGroupName, accountName) + return +} + // ListOutboundNetworkDependenciesEndpoints lists the endpoints that a Batch Compute Node under this Batch Account may // call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you // specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these @@ -682,7 +894,7 @@ func (client AccountClient) ListOutboundNetworkDependenciesEndpointsPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -807,7 +1019,7 @@ func (client AccountClient) RegenerateKeyPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -894,7 +1106,7 @@ func (client AccountClient) SynchronizeAutoStorageKeysPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -978,7 +1190,7 @@ func (client AccountClient) UpdatePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/application.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/application.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/application.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/application.go index 310b0e621185..d7019f9a7f45 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/application.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/application.go @@ -15,7 +15,7 @@ import ( "net/http" ) -// ApplicationClient is the client for the Application methods of the Batch service. +// ApplicationClient is the batch Client type ApplicationClient struct { BaseClient } @@ -91,7 +91,7 @@ func (client ApplicationClient) CreatePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -186,7 +186,7 @@ func (client ApplicationClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -275,7 +275,7 @@ func (client ApplicationClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -365,7 +365,7 @@ func (client ApplicationClient) ListPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -496,7 +496,7 @@ func (client ApplicationClient) UpdatePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/applicationpackage.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/applicationpackage.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/applicationpackage.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/applicationpackage.go index 658007b194e8..eb01a9e23848 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/applicationpackage.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/applicationpackage.go @@ -15,7 +15,7 @@ import ( "net/http" ) -// ApplicationPackageClient is the client for the ApplicationPackage methods of the Batch service. +// ApplicationPackageClient is the batch Client type ApplicationPackageClient struct { BaseClient } @@ -101,7 +101,7 @@ func (client ApplicationPackageClient) ActivatePreparer(ctx context.Context, res "versionName": autorest.Encode("path", versionName), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -202,7 +202,7 @@ func (client ApplicationPackageClient) CreatePreparer(ctx context.Context, resou "versionName": autorest.Encode("path", versionName), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -303,7 +303,7 @@ func (client ApplicationPackageClient) DeletePreparer(ctx context.Context, resou "versionName": autorest.Encode("path", versionName), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -398,7 +398,7 @@ func (client ApplicationPackageClient) GetPreparer(ctx context.Context, resource "versionName": autorest.Encode("path", versionName), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -494,7 +494,7 @@ func (client ApplicationPackageClient) ListPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/certificate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/certificate.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/certificate.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/certificate.go index 791c09c212d3..4e9e43a2a2ab 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/certificate.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/certificate.go @@ -15,7 +15,7 @@ import ( "net/http" ) -// CertificateClient is the client for the Certificate methods of the Batch service. +// CertificateClient is the batch Client type CertificateClient struct { BaseClient } @@ -95,7 +95,7 @@ func (client CertificateClient) CancelDeletionPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -194,7 +194,7 @@ func (client CertificateClient) CreatePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -288,7 +288,7 @@ func (client CertificateClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -388,7 +388,7 @@ func (client CertificateClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -482,7 +482,7 @@ func (client CertificateClient) ListByBatchAccountPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -622,7 +622,7 @@ func (client CertificateClient) UpdatePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/client.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/client.go index 3e73220f58dd..aae03e039f8b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/client.go @@ -1,6 +1,6 @@ -// Package batch implements the Azure ARM Batch service API version 2021-06-01. -// +// Package batch implements the Azure ARM Batch service API version 2022-01-01. // +// Batch Client package batch // Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/enums.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/enums.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/enums.go index 71a325a5f49b..46526f60e854 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/enums.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/enums.go @@ -273,6 +273,22 @@ func PossibleDiskEncryptionTargetValues() []DiskEncryptionTarget { return []DiskEncryptionTarget{DiskEncryptionTargetOsDisk, DiskEncryptionTargetTemporaryDisk} } +// DynamicVNetAssignmentScope enumerates the values for dynamic v net assignment scope. +type DynamicVNetAssignmentScope string + +const ( + // DynamicVNetAssignmentScopeJob Dynamic VNet assignment is done per-job. Don't use this option unless your + // batch account has been approved to use this feature. + DynamicVNetAssignmentScopeJob DynamicVNetAssignmentScope = "job" + // DynamicVNetAssignmentScopeNone No dynamic VNet assignment is enabled. + DynamicVNetAssignmentScopeNone DynamicVNetAssignmentScope = "none" +) + +// PossibleDynamicVNetAssignmentScopeValues returns an array of possible values for the DynamicVNetAssignmentScope const type. +func PossibleDynamicVNetAssignmentScopeValues() []DynamicVNetAssignmentScope { + return []DynamicVNetAssignmentScope{DynamicVNetAssignmentScopeJob, DynamicVNetAssignmentScopeNone} +} + // ElevationLevel enumerates the values for elevation level. type ElevationLevel string diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/location.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/location.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/location.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/location.go index 7877074df7e5..725202832bb4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/location.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/location.go @@ -15,7 +15,7 @@ import ( "net/http" ) -// LocationClient is the client for the Location methods of the Batch service. +// LocationClient is the batch Client type LocationClient struct { BaseClient } @@ -82,7 +82,7 @@ func (client LocationClient) CheckNameAvailabilityPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -158,7 +158,7 @@ func (client LocationClient) GetQuotasPreparer(ctx context.Context, locationName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -240,7 +240,7 @@ func (client LocationClient) ListSupportedCloudServiceSkusPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -365,7 +365,7 @@ func (client LocationClient) ListSupportedVirtualMachineSkusPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/models.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/models.go index 95baead0627e..58e84aa89932 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/models.go @@ -18,7 +18,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch" // Account contains information about an Azure Batch account. type Account struct { @@ -1325,6 +1325,255 @@ type DeploymentConfiguration struct { VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` } +// DetectorListResult values returned by the List operation. +type DetectorListResult struct { + autorest.Response `json:"-"` + // Value - The collection of Batch account detectors returned by the listing operation. + Value *[]DetectorResponse `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// DetectorListResultIterator provides access to a complete listing of DetectorResponse values. +type DetectorListResultIterator struct { + i int + page DetectorListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DetectorListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DetectorListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DetectorListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DetectorListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DetectorListResultIterator) Response() DetectorListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DetectorListResultIterator) Value() DetectorResponse { + if !iter.page.NotDone() { + return DetectorResponse{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DetectorListResultIterator type. +func NewDetectorListResultIterator(page DetectorListResultPage) DetectorListResultIterator { + return DetectorListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dlr DetectorListResult) IsEmpty() bool { + return dlr.Value == nil || len(*dlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dlr DetectorListResult) hasNextLink() bool { + return dlr.NextLink != nil && len(*dlr.NextLink) != 0 +} + +// detectorListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dlr DetectorListResult) detectorListResultPreparer(ctx context.Context) (*http.Request, error) { + if !dlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dlr.NextLink))) +} + +// DetectorListResultPage contains a page of DetectorResponse values. +type DetectorListResultPage struct { + fn func(context.Context, DetectorListResult) (DetectorListResult, error) + dlr DetectorListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DetectorListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DetectorListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dlr) + if err != nil { + return err + } + page.dlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DetectorListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DetectorListResultPage) NotDone() bool { + return !page.dlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DetectorListResultPage) Response() DetectorListResult { + return page.dlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DetectorListResultPage) Values() []DetectorResponse { + if page.dlr.IsEmpty() { + return nil + } + return *page.dlr.Value +} + +// Creates a new instance of the DetectorListResultPage type. +func NewDetectorListResultPage(cur DetectorListResult, getNextPage func(context.Context, DetectorListResult) (DetectorListResult, error)) DetectorListResultPage { + return DetectorListResultPage{ + fn: getNextPage, + dlr: cur, + } +} + +// DetectorResponse contains the information for a detector. +type DetectorResponse struct { + autorest.Response `json:"-"` + // DetectorResponseProperties - The properties associated with the detector. + *DetectorResponseProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; The ETag of the resource, used for concurrency statements. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for DetectorResponse. +func (dr DetectorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dr.DetectorResponseProperties != nil { + objectMap["properties"] = dr.DetectorResponseProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DetectorResponse struct. +func (dr *DetectorResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var detectorResponseProperties DetectorResponseProperties + err = json.Unmarshal(*v, &detectorResponseProperties) + if err != nil { + return err + } + dr.DetectorResponseProperties = &detectorResponseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dr.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + dr.Etag = &etag + } + } + } + + return nil +} + +// DetectorResponseProperties detector response properties. +type DetectorResponseProperties struct { + // Value - A base64 encoded string that represents the content of a detector. + Value *string `json:"value,omitempty"` +} + // DiffDiskSettings ... type DiffDiskSettings struct { // Placement - This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. Possible values include: 'DiffDiskPlacementCacheDisk' @@ -1401,7 +1650,7 @@ type ImageReference struct { Publisher *string `json:"publisher,omitempty"` // Offer - For example, UbuntuServer or WindowsServer. Offer *string `json:"offer,omitempty"` - // Sku - For example, 18.04-LTS or 2019-Datacenter. + // Sku - For example, 18.04-LTS or 2022-datacenter. Sku *string `json:"sku,omitempty"` // Version - A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. Version *string `json:"version,omitempty"` @@ -2445,6 +2694,8 @@ type MountConfiguration struct { type NetworkConfiguration struct { // SubnetID - The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For pools created with a virtual machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. For pools created with a cloud service configuration, enable ports 10100, 20100, and 30100. Also enable outbound connections to Azure Storage on port 443. For cloudServiceConfiguration pools, only 'classic' VNETs are supported. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration SubnetID *string `json:"subnetId,omitempty"` + // DynamicVNetAssignmentScope - Possible values include: 'DynamicVNetAssignmentScopeNone', 'DynamicVNetAssignmentScopeJob' + DynamicVNetAssignmentScope DynamicVNetAssignmentScope `json:"dynamicVNetAssignmentScope,omitempty"` // EndpointConfiguration - Pool endpoint configuration is only supported on pools with the virtualMachineConfiguration property. EndpointConfiguration *PoolEndpointConfiguration `json:"endpointConfiguration,omitempty"` // PublicIPAddressConfiguration - This property is only supported on Pools with the virtualMachineConfiguration property. @@ -3412,7 +3663,7 @@ func (pr ProxyResource) MarshalJSON() ([]byte, error) { type PublicIPAddressConfiguration struct { // Provision - The default value is BatchManaged. Possible values include: 'IPAddressProvisioningTypeBatchManaged', 'IPAddressProvisioningTypeUserManaged', 'IPAddressProvisioningTypeNoPublicIPAddresses' Provision IPAddressProvisioningType `json:"provision,omitempty"` - // IPAddressIds - The number of IPs specified here limits the maximum size of the Pool - 100 dedicated nodes or 100 low-priority nodes can be allocated for each public IP. For example, a pool needing 250 dedicated VMs would need at least 3 public IPs specified. Each element of this collection is of the form: /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}. + // IPAddressIds - The number of IPs specified here limits the maximum size of the Pool - 100 dedicated nodes or 100 Spot/low-priority nodes can be allocated for each public IP. For example, a pool needing 250 dedicated VMs would need at least 3 public IPs specified. Each element of this collection is of the form: /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}. IPAddressIds *[]string `json:"ipAddressIds,omitempty"` } @@ -3513,7 +3764,7 @@ type StartTask struct { EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. UserIdentity *UserIdentity `json:"userIdentity,omitempty"` - // MaxTaskRetryCount - The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. + // MaxTaskRetryCount - The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit, however this is not recommended for a start task or any task. The default value is 0 (no retries). MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` // WaitForSuccess - If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and scheduling error detail. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is true. WaitForSuccess *bool `json:"waitForSuccess,omitempty"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/operations.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/operations.go index 4701728c7c92..eb2366d7cadf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/operations.go @@ -14,7 +14,7 @@ import ( "net/http" ) -// OperationsClient is the client for the Operations methods of the Batch service. +// OperationsClient is the batch Client type OperationsClient struct { BaseClient } @@ -71,7 +71,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/pool.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/pool.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/pool.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/pool.go index e95f0a08bbc8..8b8c2f7c85bc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/pool.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/pool.go @@ -15,7 +15,7 @@ import ( "net/http" ) -// PoolClient is the client for the Pool methods of the Batch service. +// PoolClient is the batch Client type PoolClient struct { BaseClient } @@ -127,7 +127,7 @@ func (client PoolClient) CreatePreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -220,7 +220,7 @@ func (client PoolClient) DeletePreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -319,7 +319,7 @@ func (client PoolClient) DisableAutoScalePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -409,7 +409,7 @@ func (client PoolClient) GetPreparer(ctx context.Context, resourceGroupName stri "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -514,7 +514,7 @@ func (client PoolClient) ListByBatchAccountPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -654,7 +654,7 @@ func (client PoolClient) StopResizePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -748,7 +748,7 @@ func (client PoolClient) UpdatePreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/privateendpointconnection.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/privateendpointconnection.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/privateendpointconnection.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/privateendpointconnection.go index 7e98e33574f0..61441bead880 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/privateendpointconnection.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/privateendpointconnection.go @@ -15,7 +15,7 @@ import ( "net/http" ) -// PrivateEndpointConnectionClient is the client for the PrivateEndpointConnection methods of the Batch service. +// PrivateEndpointConnectionClient is the batch Client type PrivateEndpointConnectionClient struct { BaseClient } @@ -92,7 +92,7 @@ func (client PrivateEndpointConnectionClient) GetPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -182,7 +182,7 @@ func (client PrivateEndpointConnectionClient) ListByBatchAccountPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -310,7 +310,7 @@ func (client PrivateEndpointConnectionClient) UpdatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/privatelinkresource.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/privatelinkresource.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/privatelinkresource.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/privatelinkresource.go index 058b72d8982b..74d5e5c5a284 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/privatelinkresource.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/privatelinkresource.go @@ -15,7 +15,7 @@ import ( "net/http" ) -// PrivateLinkResourceClient is the client for the PrivateLinkResource methods of the Batch service. +// PrivateLinkResourceClient is the batch Client type PrivateLinkResourceClient struct { BaseClient } @@ -91,7 +91,7 @@ func (client PrivateLinkResourceClient) GetPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -181,7 +181,7 @@ func (client PrivateLinkResourceClient) ListByBatchAccountPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-06-01" + const APIVersion = "2022-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/version.go similarity index 90% rename from vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/version.go index 1dbe11324b8f..d8de98dcf60e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch/version.go @@ -10,7 +10,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " batch/2021-06-01" + return "Azure-SDK-For-Go/" + Version() + " batch/2022-01-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/github.com/google/go-cmp/cmp/compare.go b/vendor/github.com/google/go-cmp/cmp/compare.go index 86d0903b8b54..fd2b3a42b2a2 100644 --- a/vendor/github.com/google/go-cmp/cmp/compare.go +++ b/vendor/github.com/google/go-cmp/cmp/compare.go @@ -36,11 +36,12 @@ import ( "strings" "github.com/google/go-cmp/cmp/internal/diff" - "github.com/google/go-cmp/cmp/internal/flags" "github.com/google/go-cmp/cmp/internal/function" "github.com/google/go-cmp/cmp/internal/value" ) +// TODO(≥go1.18): Use any instead of interface{}. + // Equal reports whether x and y are equal by recursively applying the // following rules in the given order to x and y and all of their sub-values: // @@ -319,7 +320,6 @@ func (s *state) tryMethod(t reflect.Type, vx, vy reflect.Value) bool { } func (s *state) callTRFunc(f, v reflect.Value, step Transform) reflect.Value { - v = sanitizeValue(v, f.Type().In(0)) if !s.dynChecker.Next() { return f.Call([]reflect.Value{v})[0] } @@ -343,8 +343,6 @@ func (s *state) callTRFunc(f, v reflect.Value, step Transform) reflect.Value { } func (s *state) callTTBFunc(f, x, y reflect.Value) bool { - x = sanitizeValue(x, f.Type().In(0)) - y = sanitizeValue(y, f.Type().In(1)) if !s.dynChecker.Next() { return f.Call([]reflect.Value{x, y})[0].Bool() } @@ -372,19 +370,6 @@ func detectRaces(c chan<- reflect.Value, f reflect.Value, vs ...reflect.Value) { ret = f.Call(vs)[0] } -// sanitizeValue converts nil interfaces of type T to those of type R, -// assuming that T is assignable to R. -// Otherwise, it returns the input value as is. -func sanitizeValue(v reflect.Value, t reflect.Type) reflect.Value { - // TODO(≥go1.10): Workaround for reflect bug (https://golang.org/issue/22143). - if !flags.AtLeastGo110 { - if v.Kind() == reflect.Interface && v.IsNil() && v.Type() != t { - return reflect.New(t).Elem() - } - } - return v -} - func (s *state) compareStruct(t reflect.Type, vx, vy reflect.Value) { var addr bool var vax, vay reflect.Value // Addressable versions of vx and vy diff --git a/vendor/github.com/google/go-cmp/cmp/export_panic.go b/vendor/github.com/google/go-cmp/cmp/export_panic.go index 5ff0b4218c6d..ae851fe53f29 100644 --- a/vendor/github.com/google/go-cmp/cmp/export_panic.go +++ b/vendor/github.com/google/go-cmp/cmp/export_panic.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build purego // +build purego package cmp diff --git a/vendor/github.com/google/go-cmp/cmp/export_unsafe.go b/vendor/github.com/google/go-cmp/cmp/export_unsafe.go index 21eb54858e03..e2c0f74e8393 100644 --- a/vendor/github.com/google/go-cmp/cmp/export_unsafe.go +++ b/vendor/github.com/google/go-cmp/cmp/export_unsafe.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !purego // +build !purego package cmp diff --git a/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go b/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go index 1daaaacc5ee6..36062a604ca3 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !cmp_debug // +build !cmp_debug package diff diff --git a/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go b/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go index 4b91dbcacaef..a3b97a1ad571 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build cmp_debug // +build cmp_debug package diff diff --git a/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go b/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go deleted file mode 100644 index 82d1d7fbf8a2..000000000000 --- a/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2019, The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !go1.10 - -package flags - -// AtLeastGo110 reports whether the Go toolchain is at least Go 1.10. -const AtLeastGo110 = false diff --git a/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go b/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go deleted file mode 100644 index 8646f0529343..000000000000 --- a/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2019, The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.10 - -package flags - -// AtLeastGo110 reports whether the Go toolchain is at least Go 1.10. -const AtLeastGo110 = true diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/name.go b/vendor/github.com/google/go-cmp/cmp/internal/value/name.go index b6c12cefb47e..7b498bb2cb95 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/name.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/name.go @@ -9,6 +9,8 @@ import ( "strconv" ) +var anyType = reflect.TypeOf((*interface{})(nil)).Elem() + // TypeString is nearly identical to reflect.Type.String, // but has an additional option to specify that full type names be used. func TypeString(t reflect.Type, qualified bool) string { @@ -20,6 +22,11 @@ func appendTypeName(b []byte, t reflect.Type, qualified, elideFunc bool) []byte // of the same name and within the same package, // but declared within the namespace of different functions. + // Use the "any" alias instead of "interface{}" for better readability. + if t == anyType { + return append(b, "any"...) + } + // Named type. if t.Name() != "" { if qualified && t.PkgPath() != "" { diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go index 44f4a5afddcb..1a71bfcbd39b 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build purego // +build purego package value diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go index a605953d4666..16e6860af6e1 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !purego // +build !purego package value diff --git a/vendor/github.com/google/go-cmp/cmp/path.go b/vendor/github.com/google/go-cmp/cmp/path.go index f01eff318c56..c7100346323b 100644 --- a/vendor/github.com/google/go-cmp/cmp/path.go +++ b/vendor/github.com/google/go-cmp/cmp/path.go @@ -178,7 +178,7 @@ type structField struct { unexported bool mayForce bool // Forcibly allow visibility paddr bool // Was parent addressable? - pvx, pvy reflect.Value // Parent values (always addressible) + pvx, pvy reflect.Value // Parent values (always addressable) field reflect.StructField // Field information } diff --git a/vendor/github.com/google/go-cmp/cmp/report_compare.go b/vendor/github.com/google/go-cmp/cmp/report_compare.go index 104bb30538bc..1ef65ac1db82 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_compare.go +++ b/vendor/github.com/google/go-cmp/cmp/report_compare.go @@ -116,7 +116,10 @@ func (opts formatOptions) FormatDiff(v *valueNode, ptrs *pointerReferences) (out } // For leaf nodes, format the value based on the reflect.Values alone. - if v.MaxDepth == 0 { + // As a special case, treat equal []byte as a leaf nodes. + isBytes := v.Type.Kind() == reflect.Slice && v.Type.Elem() == reflect.TypeOf(byte(0)) + isEqualBytes := isBytes && v.NumDiff+v.NumIgnored+v.NumTransformed == 0 + if v.MaxDepth == 0 || isEqualBytes { switch opts.DiffMode { case diffUnknown, diffIdentical: // Format Equal. diff --git a/vendor/github.com/google/go-cmp/cmp/report_reflect.go b/vendor/github.com/google/go-cmp/cmp/report_reflect.go index 33f03577f98f..287b893588ee 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_reflect.go +++ b/vendor/github.com/google/go-cmp/cmp/report_reflect.go @@ -207,10 +207,11 @@ func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, // Check whether this is a []byte of text data. if t.Elem() == reflect.TypeOf(byte(0)) { b := v.Bytes() - isPrintSpace := func(r rune) bool { return unicode.IsPrint(r) && unicode.IsSpace(r) } + isPrintSpace := func(r rune) bool { return unicode.IsPrint(r) || unicode.IsSpace(r) } if len(b) > 0 && utf8.Valid(b) && len(bytes.TrimFunc(b, isPrintSpace)) == 0 { out = opts.formatString("", string(b)) - return opts.WithTypeMode(emitType).FormatType(t, out) + skipType = true + return opts.FormatType(t, out) } } @@ -281,7 +282,12 @@ func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, } defer ptrs.Pop() - skipType = true // Let the underlying value print the type instead + // Skip the name only if this is an unnamed pointer type. + // Otherwise taking the address of a value does not reproduce + // the named pointer type. + if v.Type().Name() == "" { + skipType = true // Let the underlying value print the type instead + } out = opts.FormatValue(v.Elem(), t.Kind(), ptrs) out = wrapTrunkReference(ptrRef, opts.PrintAddresses, out) out = &textWrap{Prefix: "&", Value: out} @@ -292,7 +298,6 @@ func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, } // Interfaces accept different concrete types, // so configure the underlying value to explicitly print the type. - skipType = true // Print the concrete type instead return opts.WithTypeMode(emitType).FormatValue(v.Elem(), t.Kind(), ptrs) default: panic(fmt.Sprintf("%v kind not handled", v.Kind())) diff --git a/vendor/github.com/google/go-cmp/cmp/report_slices.go b/vendor/github.com/google/go-cmp/cmp/report_slices.go index 2ad3bc85ba82..68b5c1ae164d 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_slices.go +++ b/vendor/github.com/google/go-cmp/cmp/report_slices.go @@ -80,7 +80,7 @@ func (opts formatOptions) CanFormatDiffSlice(v *valueNode) bool { } // Use specialized string diffing for longer slices or strings. - const minLength = 64 + const minLength = 32 return vx.Len() >= minLength && vy.Len() >= minLength } @@ -563,10 +563,10 @@ func cleanupSurroundingIdentical(groups []diffStats, eq func(i, j int) bool) []d nx := ds.NumIdentical + ds.NumRemoved + ds.NumModified ny := ds.NumIdentical + ds.NumInserted + ds.NumModified var numLeadingIdentical, numTrailingIdentical int - for i := 0; i < nx && i < ny && eq(ix+i, iy+i); i++ { + for j := 0; j < nx && j < ny && eq(ix+j, iy+j); j++ { numLeadingIdentical++ } - for i := 0; i < nx && i < ny && eq(ix+nx-1-i, iy+ny-1-i); i++ { + for j := 0; j < nx && j < ny && eq(ix+nx-1-j, iy+ny-1-j); j++ { numTrailingIdentical++ } if numIdentical := numLeadingIdentical + numTrailingIdentical; numIdentical > 0 { diff --git a/vendor/github.com/hashicorp/hc-install/internal/releasesjson/checksum_downloader.go b/vendor/github.com/hashicorp/hc-install/internal/releasesjson/checksum_downloader.go index 4936dda2f935..2b85ea344964 100644 --- a/vendor/github.com/hashicorp/hc-install/internal/releasesjson/checksum_downloader.go +++ b/vendor/github.com/hashicorp/hc-install/internal/releasesjson/checksum_downloader.go @@ -121,12 +121,23 @@ func fileMapFromChecksums(checksums strings.Builder) (ChecksumFileMap, error) { return csMap, nil } -func compareChecksum(logger *log.Logger, r io.Reader, verifiedHashSum HashSum) error { +func compareChecksum(logger *log.Logger, r io.Reader, verifiedHashSum HashSum, filename string, expectedSize int64) error { h := sha256.New() - _, err := io.Copy(h, r) + + // This may take a while depending on network connection as the io.Reader + // is expected to be http.Response.Body which streams the bytes + // on demand over the network. + logger.Printf("copying %q (%d bytes) to calculate checksum", filename, expectedSize) + bytesCopied, err := io.Copy(h, r) if err != nil { return err } + logger.Printf("copied %d bytes of %q", bytesCopied, filename) + + if expectedSize != 0 && bytesCopied != int64(expectedSize) { + return fmt.Errorf("unexpected size (downloaded: %d, expected: %d)", + bytesCopied, expectedSize) + } calculatedSum := h.Sum(nil) if !bytes.Equal(calculatedSum, verifiedHashSum) { diff --git a/vendor/github.com/hashicorp/hc-install/internal/releasesjson/downloader.go b/vendor/github.com/hashicorp/hc-install/internal/releasesjson/downloader.go index 62ed6afd0561..e9cd94e43f43 100644 --- a/vendor/github.com/hashicorp/hc-install/internal/releasesjson/downloader.go +++ b/vendor/github.com/hashicorp/hc-install/internal/releasesjson/downloader.go @@ -12,7 +12,6 @@ import ( "os" "path/filepath" "runtime" - "strconv" "github.com/hashicorp/hc-install/internal/httpclient" ) @@ -95,14 +94,16 @@ func (d *Downloader) DownloadAndUnpack(ctx context.Context, pv *ProductVersion, contentType, zipMimeTypes) } + expectedSize := resp.ContentLength + if d.VerifyChecksum { - d.Logger.Printf("calculating checksum of %q", pb.Filename) + d.Logger.Printf("verifying checksum of %q", pb.Filename) // provide extra reader to calculate & compare checksum var buf bytes.Buffer r := io.TeeReader(resp.Body, &buf) pkgReader = &buf - err := compareChecksum(d.Logger, r, verifiedChecksum) + err := compareChecksum(d.Logger, r, verifiedChecksum, pb.Filename, expectedSize) if err != nil { return err } @@ -114,21 +115,17 @@ func (d *Downloader) DownloadAndUnpack(ctx context.Context, pv *ProductVersion, } defer pkgFile.Close() - d.Logger.Printf("copying downloaded file to %s", pkgFile.Name()) + d.Logger.Printf("copying %q (%d bytes) to %s", pb.Filename, expectedSize, pkgFile.Name()) + // Unless the bytes were already downloaded above for checksum verification + // this may take a while depending on network connection as the io.Reader + // is expected to be http.Response.Body which streams the bytes + // on demand over the network. bytesCopied, err := io.Copy(pkgFile, pkgReader) if err != nil { return err } d.Logger.Printf("copied %d bytes to %s", bytesCopied, pkgFile.Name()) - expectedSize := 0 - if length := resp.Header.Get("content-length"); length != "" { - var err error - expectedSize, err = strconv.Atoi(length) - if err != nil { - return err - } - } if expectedSize != 0 && bytesCopied != int64(expectedSize) { return fmt.Errorf("unexpected size (downloaded: %d, expected: %d)", bytesCopied, expectedSize) diff --git a/vendor/github.com/hashicorp/hc-install/internal/releasesjson/releases.go b/vendor/github.com/hashicorp/hc-install/internal/releasesjson/releases.go index 24e32ffc405f..849f16a526ab 100644 --- a/vendor/github.com/hashicorp/hc-install/internal/releasesjson/releases.go +++ b/vendor/github.com/hashicorp/hc-install/internal/releasesjson/releases.go @@ -79,7 +79,7 @@ func (r *Releases) ListProductVersions(ctx context.Context, productName string) } contentType := resp.Header.Get("content-type") - if contentType != "application/json" { + if contentType != "application/json" && contentType != "application/vnd+hashicorp.releases-api.v0+json" { return nil, fmt.Errorf("unexpected Content-Type: %q", contentType) } @@ -144,7 +144,7 @@ func (r *Releases) GetProductVersion(ctx context.Context, product string, versio } contentType := resp.Header.Get("content-type") - if contentType != "application/json" { + if contentType != "application/json" && contentType != "application/vnd+hashicorp.releases-api.v0+json" { return nil, fmt.Errorf("unexpected Content-Type: %q", contentType) } diff --git a/vendor/github.com/hashicorp/hc-install/product/consul.go b/vendor/github.com/hashicorp/hc-install/product/consul.go index b619d89eda54..aeeac946920b 100644 --- a/vendor/github.com/hashicorp/hc-install/product/consul.go +++ b/vendor/github.com/hashicorp/hc-install/product/consul.go @@ -15,9 +15,7 @@ import ( var consulVersionOutputRe = regexp.MustCompile(`Consul ` + simpleVersionRe) var ( - v1_16 = version.Must(version.NewVersion("1.16")) - // TODO: version.MustConstraint() ? - v1_16c, _ = version.NewConstraint("1.16") + v1_18 = version.Must(version.NewVersion("1.18")) ) var Consul = Product{ @@ -52,6 +50,6 @@ var Consul = Product{ BuildInstructions: &BuildInstructions{ GitRepoURL: "https://github.com/hashicorp/consul.git", PreCloneCheck: &build.GoIsInstalled{}, - Build: &build.GoBuild{Version: v1_16}, + Build: &build.GoBuild{Version: v1_18}, }, } diff --git a/vendor/modules.txt b/vendor/modules.txt index def803a69e65..bc39e0fefc67 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -9,7 +9,7 @@ github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimana github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2020-02-02/insights github.com/Azure/azure-sdk-for-go/services/azurestackhci/mgmt/2020-10-01/azurestackhci github.com/Azure/azure-sdk-for-go/services/batch/2020-03-01.11.0/batch -github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2021-06-01/batch +github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn github.com/Azure/azure-sdk-for-go/services/communication/mgmt/2020-08-20/communication @@ -182,8 +182,8 @@ github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/empty github.com/golang/protobuf/ptypes/timestamp -# github.com/google/go-cmp v0.5.6 -## explicit; go 1.8 +# github.com/google/go-cmp v0.5.8 +## explicit; go 1.13 github.com/google/go-cmp/cmp github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags @@ -249,7 +249,7 @@ github.com/hashicorp/go-uuid # github.com/hashicorp/go-version v1.4.0 ## explicit github.com/hashicorp/go-version -# github.com/hashicorp/hc-install v0.3.1 +# github.com/hashicorp/hc-install v0.3.2 ## explicit; go 1.16 github.com/hashicorp/hc-install github.com/hashicorp/hc-install/checkpoint