Merge pull request #6536 from mxpv/runtime-name

Change file name for shim binary path
This commit is contained in:
Maksym Pavlenko 2022-02-09 12:53:50 -08:00 committed by GitHub
commit eb011d127b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -129,7 +129,7 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_
f.Close()
}
// Save runtime binary path for restore.
if err := os.WriteFile(filepath.Join(b.bundle.Path, "runtime"), []byte(b.runtime), 0600); err != nil {
if err := os.WriteFile(filepath.Join(b.bundle.Path, "shim-binary-path"), []byte(b.runtime), 0600); err != nil {
return nil, err
}
client := ttrpc.NewClient(conn, ttrpc.WithOnClose(onCloseWithShimLog))

View File

@ -93,8 +93,8 @@ func (m *ShimManager) loadShims(ctx context.Context) error {
runtime string
)
// If we're on 1.6+ and specified custom path to the runtime binary, path will be saved in 'runtime' file.
if data, err := os.ReadFile(filepath.Join(bundle.Path, "runtime")); err == nil {
// If we're on 1.6+ and specified custom path to the runtime binary, path will be saved in 'shim-binary-path' file.
if data, err := os.ReadFile(filepath.Join(bundle.Path, "shim-binary-path")); err == nil {
runtime = string(data)
} else if err != nil && !os.IsNotExist(err) {
log.G(ctx).WithError(err).Error("failed to read `runtime` path from bundle")