From 08353c9d3cbac01eda83681a1e48c3adadde8686 Mon Sep 17 00:00:00 2001 From: Nilesh Choudhary Date: Fri, 15 Nov 2024 09:24:37 +0000 Subject: [PATCH] Updated method name --- apps/managedidentity/managedidentity.go | 4 ++-- apps/managedidentity/managedidentity_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/managedidentity/managedidentity.go b/apps/managedidentity/managedidentity.go index f85bd8e7..388d8cea 100644 --- a/apps/managedidentity/managedidentity.go +++ b/apps/managedidentity/managedidentity.go @@ -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 diff --git a/apps/managedidentity/managedidentity_test.go b/apps/managedidentity/managedidentity_test.go index 346c64f2..2ab7393f 100644 --- a/apps/managedidentity/managedidentity_test.go +++ b/apps/managedidentity/managedidentity_test.go @@ -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) {