Skip to content

Commit

Permalink
Updated method name
Browse files Browse the repository at this point in the history
4gust committed Nov 15, 2024
1 parent 4735991 commit 08353c9
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/managedidentity/managedidentity.go
Original file line number Diff line number Diff line change
@@ -85,7 +85,7 @@ var getAzureArcPlatformPath = func(platform string) string {
}
}

var getAzureArcFilePath = func(platform string) string {
var getAzureArcHimdsFilePath = func(platform string) string {
switch platform {
case "windows":
return filepath.Join(os.Getenv("ProgramData"), azureConnectedMachine, himdsExecutableName)
@@ -424,7 +424,7 @@ func isAzureArcEnvironment(identityEndpoint, imdsEndpoint string) bool {
if identityEndpoint != "" && imdsEndpoint != "" {
return true
}
himdsFilePath := getAzureArcFilePath(runtime.GOOS)
himdsFilePath := getAzureArcHimdsFilePath(runtime.GOOS)
if himdsFilePath != "" {
if _, err := os.Stat(himdsFilePath); err == nil {
return true
6 changes: 3 additions & 3 deletions apps/managedidentity/managedidentity_test.go
Original file line number Diff line number Diff line change
@@ -118,12 +118,12 @@ func setCustomAzureArcPlatformPath(t *testing.T, path string) {
}

func setCustomAzureArcFilePath(t *testing.T, path string) {
originalFunc := getAzureArcFilePath
getAzureArcFilePath = func(string) string {
originalFunc := getAzureArcHimdsFilePath
getAzureArcHimdsFilePath = func(string) string {
return path
}

t.Cleanup(func() { getAzureArcFilePath = originalFunc })
t.Cleanup(func() { getAzureArcHimdsFilePath = originalFunc })
}

func TestSource(t *testing.T) {

0 comments on commit 08353c9

Please sign in to comment.