diff --git a/cmd/networkcmd/helpers.go b/cmd/networkcmd/helpers.go index 9bf679888..ae6f3f179 100644 --- a/cmd/networkcmd/helpers.go +++ b/cmd/networkcmd/helpers.go @@ -63,11 +63,13 @@ func TrackSubnet( } pluginPath := filepath.Join(app.GetPluginsDir(), vmID.String()) - if err := utils.FileCopy(vmBin, pluginPath); err != nil { - return err - } - if err := os.Chmod(pluginPath, constants.DefaultPerms755); err != nil { - return err + if !utils.IsExecutable(pluginPath) { + if err := utils.FileCopy(vmBin, pluginPath); err != nil { + return err + } + if err := os.Chmod(pluginPath, constants.DefaultPerms755); err != nil { + return err + } } cli, err := binutils.NewGRPCClientWithEndpoint( diff --git a/pkg/node/local.go b/pkg/node/local.go index f5489fcf6..04788b4b4 100644 --- a/pkg/node/local.go +++ b/pkg/node/local.go @@ -78,12 +78,15 @@ func TrackSubnetWithLocalMachine( return fmt.Errorf("unknown vm: %s", sc.VM) } rootDir := app.GetLocalDir(clusterName) + pluginPath := filepath.Join(rootDir, "node1", "plugins", vmID.String()) - if err := utils.FileCopy(vmBin, pluginPath); err != nil { - return err - } - if err := os.Chmod(pluginPath, constants.DefaultPerms755); err != nil { - return err + if !utils.IsExecutable(pluginPath) { + if err := utils.FileCopy(vmBin, pluginPath); err != nil { + return err + } + if err := os.Chmod(pluginPath, constants.DefaultPerms755); err != nil { + return err + } } cli, err := binutils.NewGRPCClientWithEndpoint(