Skip to content

Commit ac13b52

Browse files
authored
fix: merge SendPort and ReceivePort into Port (#22)
1 parent 78735b3 commit ac13b52

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

internal/config/config.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ type Config struct {
1515

1616
type Worker struct {
1717
corev1.PodTemplate
18-
SendPort int16 `json:"sendPort"`
19-
ReceivePort int16 `json:"receivePort"`
18+
Port int16 `json:"port"`
2019
}
2120

2221
type PodMutation struct {
@@ -41,8 +40,7 @@ func LoadConfig(filename string) (*Config, error) {
4140
func NewDefaultConfig() *Config {
4241
return &Config{
4342
Worker: Worker{
44-
SendPort: 1234,
45-
ReceivePort: 4321,
43+
Port: 1234,
4644
PodTemplate: corev1.PodTemplate{
4745
Template: corev1.PodTemplateSpec{
4846
Spec: corev1.PodSpec{

internal/worker/worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type WorkerGenerator struct {
1515
}
1616

1717
func (wg *WorkerGenerator) GenerateConnectionURL(_gpu *tfv1.GPU, connection *tfv1.TensorFusionConnection, pod *corev1.Pod) string {
18-
return fmt.Sprintf("native+%s+%d+%d", pod.Status.PodIP, wg.WorkerConfig.ReceivePort, wg.WorkerConfig.SendPort)
18+
return fmt.Sprintf("native+%s+%d", pod.Status.PodIP, wg.WorkerConfig.Port)
1919
}
2020

2121
func (wg *WorkerGenerator) GenerateWorkerPod(

0 commit comments

Comments
 (0)