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

Updating mgmt/storage package version for rpStorageAccount() so that we can set SAS key permission to false #3596

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/deploy/assets/rp-production.json
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,9 @@
"sku": {
"name": "Standard_LRS"
},
"properties": {
"allowSharedKeyAccess": false
},
"location": "[resourceGroup().location]",
"name": "[substring(parameters('storageAccountDomain'), 0, indexOf(parameters('storageAccountDomain'), '.'))]",
"type": "Microsoft.Storage/storageAccounts",
Copy link
Contributor

Choose a reason for hiding this comment

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

should we update the apiVersion in L548 as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! Now that I took a better look at apiVersions, I understood that it must be updated.

Expand Down
2 changes: 1 addition & 1 deletion pkg/deploy/generator/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
mgmtkeyvault "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2019-09-01/keyvault"
mgmtnetwork "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-08-01/network"
mgmtinsights "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights"
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
Copy link
Contributor

Choose a reason for hiding this comment

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

L29 needs to be update as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm migrating the whole repo to the 2021 version of mgmtstorage. I'm also updating the entry on the apiVersions map for Microsoft.Storage now that we have a new version (2021-09-01) of it.

L29 is about Microsoft.Insights. I didn't use it directly during this task, so it sounds curious to me why I should change L29.
Do you mean you'd like me to upgrade the package mgmtinsights for the whole repo too, and then change the apiVersions map to list the new version?
It's currently on 2018-03-01 version in the imports, and the apiVersions map states 2018-03-01 too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I meant the line with Microsoft.Storage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, thanks! Then it's done.
I created a new PR to do the whole migration thing as I was scared to break things:
#3603
Will cleanup this PR later.

"github.com/Azure/go-autorest/autorest/to"

"github.com/Azure/ARO-RP/pkg/util/arm"
Expand Down
7 changes: 5 additions & 2 deletions pkg/deploy/generator/resources_rp.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
mgmtauthorization "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2018-09-01-preview/authorization"
mgmtcontainerregistry "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2020-11-01-preview/containerregistry"
mgmtinsights "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights"
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
"github.com/Azure/go-autorest/autorest/to"

"github.com/Azure/ARO-RP/pkg/env"
Expand Down Expand Up @@ -1561,5 +1561,8 @@ func (g *generator) rpVersionStorageAccount() []*arm.Resource {
}

func (g *generator) rpStorageAccount() *arm.Resource {
return g.storageAccount("[substring(parameters('storageAccountDomain'), 0, indexOf(parameters('storageAccountDomain'), '.'))]", nil, nil)
accountProperties := mgmtstorage.AccountProperties{
AllowSharedKeyAccess: to.BoolPtr(false),
}
return g.storageAccount("[substring(parameters('storageAccountDomain'), 0, indexOf(parameters('storageAccountDomain'), '.'))]", &accountProperties, nil)
}

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.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

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.

Loading
Loading