Skip to content

Commit bd5bea5

Browse files
authored
Merge pull request #523 from onepanelio/fix/workspace.core.ip
fix: update core pod host to use name instead of static value
2 parents 7c67088 + 5d3345d commit bd5bea5

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

pkg/workflow_execution.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,17 +1555,8 @@ Will build a template that makes a CURL request to the onepanel-core API,
15551555
with statistics about the workflow that was just executed.
15561556
*/
15571557
func getCURLNodeTemplate(name, curlMethod, curlPath, curlBody string, inputs wfv1.Inputs) (template *wfv1.Template, err error) {
1558-
host := env.GetEnv("ONEPANEL_CORE_SERVICE_HOST", "onepanel-core.onepanel.svc.cluster.local")
1559-
if host == "" {
1560-
err = errors.New("ONEPANEL_CORE_SERVICE_HOST is empty.")
1561-
return
1562-
}
1563-
port := env.GetEnv("ONEPANEL_CORE_SERVICE_PORT", "80")
1564-
if port == "" {
1565-
err = errors.New("ONEPANEL_CORE_SERVICE_PORT is empty.")
1566-
return
1567-
}
1568-
endpoint := fmt.Sprintf("http://%s:%s%s", host, port, curlPath)
1558+
host := "onepanel-core.onepanel.svc.cluster.local"
1559+
endpoint := fmt.Sprintf("http://%s%s", host, curlPath)
15691560
template = &wfv1.Template{
15701561
Name: name,
15711562
Inputs: inputs,

server/workspace_server.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package server
22

33
import (
44
"context"
5+
"fmt"
56
"github.com/golang/protobuf/ptypes/empty"
67
"github.com/onepanelio/core/api"
78
v1 "github.com/onepanelio/core/pkg"
@@ -29,7 +30,7 @@ func apiWorkspace(wt *v1.Workspace, config v1.SystemConfig) *api.Workspace {
2930
log.WithFields(log.Fields{
3031
"Method": "apiWorkspace",
3132
"Error": "protocol is nil",
32-
})
33+
}).Error("apiWorkspace")
3334

3435
return nil
3536
}
@@ -38,7 +39,7 @@ func apiWorkspace(wt *v1.Workspace, config v1.SystemConfig) *api.Workspace {
3839
log.WithFields(log.Fields{
3940
"Method": "apiWorkspace",
4041
"Error": "domain is nil",
41-
})
42+
}).Error("apiWorkspace")
4243

4344
return nil
4445
}

0 commit comments

Comments
 (0)