diff --git a/pkg/baremetal/options/options.go b/pkg/baremetal/options/options.go index 5a36f9abb3..31922f9557 100644 --- a/pkg/baremetal/options/options.go +++ b/pkg/baremetal/options/options.go @@ -51,6 +51,8 @@ type BaremetalOptions struct { StatusProbeIntervalSeconds int `help:"interval to probe baremetal status, default is 60 seconds" default:"60"` LogFetchIntervalSeconds int `help:"interval to fetch baremetal log, default is 900 seconds" default:"900"` SendMetricsIntervalSeconds int `help:"interval to send baremetal metrics, default is 300 seconds" default:"300"` + + TftpFileMap map[string]string `help:"map of filename to real file path for tftp"` } var ( diff --git a/pkg/baremetal/pxe/tftp.go b/pkg/baremetal/pxe/tftp.go index 8a238ab177..63a23720ba 100644 --- a/pkg/baremetal/pxe/tftp.go +++ b/pkg/baremetal/pxe/tftp.go @@ -123,6 +123,9 @@ func (h *TFTPHandler) sendFile(filename string, _ net.Addr) (io.ReadCloser, int6 } func (h *TFTPHandler) getFilePath(fileName string) string { + if path, ok := options.Options.TftpFileMap[fileName]; ok { + return path + } return filepath.Join(h.RootDir, fileName) }