Skip to content

Commit

Permalink
Merge pull request #4086 from Azure/bvesel/update-msi-naming-once-again
Browse files Browse the repository at this point in the history
Update msi secret name in key vault
  • Loading branch information
bennerv authored Feb 5, 2025
2 parents 5cf9da0 + 82c1c50 commit 8ac5757
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/cluster/clustermsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (m *manager) initializeClusterMsiClients(ctx context.Context) error {
// clusterMsiSecretName returns the name to store the cluster MSI certificate under in
// the cluster MSI key vault.
func (m *manager) clusterMsiSecretName() string {
return m.doc.ID
return dataplane.ManagedIdentityCredentialsStoragePrefix + m.doc.ID
}

func (m *manager) clusterIdentityIDs(ctx context.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/clustermsi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestEnsureClusterMsiCertificate(t *testing.T) {
clusterRGName := "aro-cluster"
miName := "aro-cluster-msi"
miResourceId := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ManagedIdentity/userAssignedIdentities/%s", mockGuid, clusterRGName, miName)
secretName := mockGuid
secretName := dataplane.ManagedIdentityCredentialsStoragePrefix + mockGuid

secretNotFoundError := autorest.DetailedError{
StatusCode: 404,
Expand Down
3 changes: 2 additions & 1 deletion pkg/cluster/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/msi-dataplane/pkg/dataplane"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"
Expand Down Expand Up @@ -372,7 +373,7 @@ func TestDisconnectSecurityGroup(t *testing.T) {
func TestDeleteClusterMsiCertificate(t *testing.T) {
ctx := context.Background()
mockGuid := "00000000-0000-0000-0000-000000000000"
secretName := mockGuid
secretName := dataplane.ManagedIdentityCredentialsStoragePrefix + mockGuid
clusterRGName := "aro-cluster"
miName := "aro-cluster-msi"
miResourceId := fmt.Sprintf("/subscriptions/%s/resourcegroups/%s/providers/Microsoft.ManagedIdentity/userAssignedIdentities/%s", mockGuid, clusterRGName, miName)
Expand Down

0 comments on commit 8ac5757

Please sign in to comment.