Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependencies: updating to v0.20240326.1143657 of github.com/hashicorp/go-azure-sdk #25416

Merged
merged 7 commits into from Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Expand Up @@ -17,8 +17,8 @@ require (
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.4.0
github.com/hashicorp/go-azure-helpers v0.67.0
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240321.1145953
github.com/hashicorp/go-azure-sdk/sdk v0.20240321.1145953
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240327.1161949
github.com/hashicorp/go-azure-sdk/sdk v0.20240327.1161949
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-uuid v1.0.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Expand Up @@ -95,10 +95,10 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-azure-helpers v0.67.0 h1:0RY6mY3W3Ym2I+jExLtyLx96fh6p5n9vidqisAKGUSE=
github.com/hashicorp/go-azure-helpers v0.67.0/go.mod h1:S4Bu66vyJvHA0trqHQB0YVGsISuF7HMH9tyEsMVlx8A=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240321.1145953 h1:eoU9iMmWgufB441trZJ45TsZ+0vJ79vGKdBuVVYUXwI=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240321.1145953/go.mod h1:zvsDltRIRr58vA0EpSmY+a6NcgGirQE/u02Ag+D8jmM=
github.com/hashicorp/go-azure-sdk/sdk v0.20240321.1145953 h1:WAcSZL5+H9Z/DjUZ0x0sluNoEno/mD4b+NWpY04vJrw=
github.com/hashicorp/go-azure-sdk/sdk v0.20240321.1145953/go.mod h1:POOjeoqNp+mvlLBuibJTziUAkBZ7FxXGeGestwemL/w=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240327.1161949 h1:6kiYPtSO7l08UshpjOkeBvqDOIOdRXhYFMAYRdosLoo=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240327.1161949/go.mod h1:6emA77HGPRTEV9n0VLpVfzsvinp6iDBqsf/W1C+eRhY=
github.com/hashicorp/go-azure-sdk/sdk v0.20240327.1161949 h1:Iu3U8RUGKQNza6MSFyTNjgasDaEcpehqr0Rn4ruBHBk=
github.com/hashicorp/go-azure-sdk/sdk v0.20240327.1161949/go.mod h1:POOjeoqNp+mvlLBuibJTziUAkBZ7FxXGeGestwemL/w=
github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU=
github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
Expand Down
9 changes: 6 additions & 3 deletions internal/services/containers/client/client.go
Expand Up @@ -41,8 +41,11 @@ type Client struct {
}

func NewContainersClient(o *common.ClientOptions) (*Client, error) {
containerInstanceClient := containerinstance.NewContainerInstanceClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&containerInstanceClient.Client, o.ResourceManagerAuthorizer)
containerInstanceClient, err := containerinstance.NewContainerInstanceClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Container Instance client : %+v", err)
}
o.Configure(containerInstanceClient.Client, o.Authorizers.ResourceManager)

containerRegistryClient_v2019_06_01_preview, err := containerregistry_v2019_06_01_preview.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) {
o.Configure(c, o.Authorizers.ResourceManager)
Expand Down Expand Up @@ -115,7 +118,7 @@ func NewContainersClient(o *common.ClientOptions) (*Client, error) {

return &Client{
AgentPoolsClient: agentPoolsClient,
ContainerInstanceClient: &containerInstanceClient,
ContainerInstanceClient: containerInstanceClient,
ContainerRegistryClient_v2021_08_01_preview: containerRegistryClient_v2021_08_01_preview,
ContainerRegistryClient_v2019_06_01_preview: containerRegistryClient_v2019_06_01_preview,
FleetUpdateRunsClient: fleetUpdateRunsClient,
Expand Down
5 changes: 5 additions & 0 deletions internal/services/containers/container_group_resource.go
Expand Up @@ -23,6 +23,7 @@
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/helpers/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
"github.com/hashicorp/terraform-provider-azurerm/internal/locks"
keyVaultParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/parse"
keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate"
Expand Down Expand Up @@ -1583,6 +1584,7 @@
scheme := x["scheme"].(string)

httpGetScheme := containerinstance.Scheme(scheme)

probe.HTTPGet = &containerinstance.ContainerHTTPGet{
Path: pointer.FromString(path),
Port: int64(port),
Expand Down Expand Up @@ -1942,6 +1944,9 @@
}
httpGet["port"] = get.Port
httpGet["scheme"] = get.Scheme
if !features.FourPointOh() {
httpGet["scheme"] = strings.Title(string(pointer.From(get.Scheme)))

Check failure on line 1948 in internal/services/containers/container_group_resource.go

View workflow job for this annotation

GitHub Actions / golint

SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
Copy link
Member

Choose a reason for hiding this comment

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

Rather than doing this, can we leave schema as it is and update the Schema instead?

}
httpGet["http_headers"] = flattenContainerProbeHttpHeaders(get.HTTPHeaders)
httpGets = append(httpGets, httpGet)
}
Expand Down
13 changes: 11 additions & 2 deletions internal/services/containers/probe.go
Expand Up @@ -5,13 +5,13 @@ package containers

import (
"github.com/hashicorp/terraform-provider-azurerm/helpers/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
)

func SchemaContainerGroupProbe() *pluginsdk.Schema {
//lintignore:XS003
return &pluginsdk.Schema{
schema := &pluginsdk.Schema{
Type: pluginsdk.TypeList,
Optional: true,
ForceNew: true,
Expand Down Expand Up @@ -100,4 +100,13 @@ func SchemaContainerGroupProbe() *pluginsdk.Schema {
},
},
}
if features.FourPointOh() {
httpGetSchema := schema.Elem.(*pluginsdk.Resource).Schema["http_get"]
httpGetSchema.Elem.(*pluginsdk.Resource).Schema["scheme"].ValidateFunc = validation.StringInSlice([]string{
"http",
"https",
}, false)
schema.Elem.(*pluginsdk.Resource).Schema["http_get"] = httpGetSchema
}
return schema
Copy link
Member

Choose a reason for hiding this comment

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

Rather than doing this, can we update the Validate func to use the Constant values - and then use ignore the casing on those until 4.0?

}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.