migrate role assignment cleanup from bash to Go#25
migrate role assignment cleanup from bash to Go#25nojnhuh wants to merge 1 commit intoAzure:masterfrom
Conversation
| FROM alpine:3.21 | ||
| COPY bin/rg-cleanup /usr/local/bin | ||
| ENTRYPOINT [ "rg-cleanup" ] |
There was a problem hiding this comment.
This is the same as before #22, but with a bumped alpine from 3.18 to the latest minor version.
| IMAGE_REGISTRY ?= k8sprowcomm.azurecr.io | ||
| IMAGE_NAME := rg-cleanup | ||
| IMAGE_VERSION ?= v0.4.6 | ||
| IMAGE_VERSION ?= v0.4.7 |
There was a problem hiding this comment.
The interface of the container should be the same since it keeps the --role-assignments flag, so I opted to only bump the patch version here.
| github.com/Azure/azure-sdk-for-go v36.2.0+incompatible | ||
| github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 | ||
| github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 | ||
| github.com/Azure/azure-sdk-for-go/sdk/azcore v1.15.0 |
There was a problem hiding this comment.
We should take a pass at updating these dependencies sometime, but these versions have been working for me locally for now.
There was a problem hiding this comment.
I was thinking the same, but its probably safer to make that a follow-on PR.
mboersma
left a comment
There was a problem hiding this comment.
This lgtm, but let me test it IRL.
| resourceGroupClient, err := armresources.NewResourceGroupsClient(o.subscriptionID, chain, &options) | ||
| idReq := serviceprincipals.NewGetByIdsPostRequestBody() | ||
| idReq.SetIds(assignedPrincipalIDs) | ||
| idRes, err := graph.ServicePrincipals().GetByIds().PostAsGetByIdsPostResponse(ctx, idReq, &serviceprincipals.GetByIdsRequestBuilderPostRequestConfiguration{}) |
There was a problem hiding this comment.
I give PostAsGetByIdsPostResponse 1 out of 5 stars as a function name. :-p
did this work? |
It didn't seem to--the container was still running after 20 minutes, so I cancelled it, not realizing that means we get no logs. I didn't have much time to test, so I reverted to our known-working version. I'd like to run the |
This PR migrates the role assignment cleanup logic driven by the
azCLI and bash from #22 to Go.