Skip to content

Commit

Permalink
Fix bundle not being read properly
Browse files Browse the repository at this point in the history
  • Loading branch information
imdawon committed Mar 26, 2024
1 parent 1417731 commit f1c5205
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ Emissary
# Builds
__debug_*
release/
bundle/
17 changes: 5 additions & 12 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,11 @@ func setUpLocalSeviceProxies(protectedServiceName string, localServiceProxies ma
}

func getEmissaryBundle() *string {
bundlePath := utils.CreateEmissaryFileReadPath("./bundle/drawbridge.txt")
// We don't call the file path builder function here because it doesn't work.
_, err := os.Stat(bundlePath)
if os.IsNotExist(err) {
return nil
bundleBytes := utils.ReadFile("./bundle/drawbridge.txt")
if bundleBytes != nil {
bundleData := strings.TrimSpace(string(*bundleBytes))
return &bundleData
} else {
bundleBytes := utils.ReadFile(bundlePath)
if bundleBytes != nil {
bundleData := strings.TrimSpace(string(*bundleBytes))
return &bundleData
} else {
return nil
}
return nil
}
}

0 comments on commit f1c5205

Please sign in to comment.