Skip to content

Commit

Permalink
Merge pull request #873 from pwzgorilla/stop
Browse files Browse the repository at this point in the history
use vcluster name as cluster name
  • Loading branch information
gorilla authored Aug 11, 2017
2 parents 2fcf0f1 + f3186d4 commit 6d3d8ef
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ func (r *Server) createApp(w http.ResponseWriter, req *http.Request) {
return
}

cluster := r.driver.ClusterName()
if c := utils.StripSpaces(version.Cluster); c != "" {
cluster = c
}

var (
id = fmt.Sprintf("%s.%s.%s.%s", version.Name, compose, version.RunAs, r.driver.ClusterName())
id = fmt.Sprintf("%s.%s.%s.%s", version.Name, compose, version.RunAs, cluster)
count = int(version.Instances)
restart = version.RestartPolicy
retries = 3
Expand Down
1 change: 1 addition & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ Example request:
"mem": 32,
"disk": 0,
"runAs": "xcm",
"cluster": "cctv",
"instances": 10,
"constraints": [],
"container": {
Expand Down
1 change: 1 addition & 0 deletions docs/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"mem": 32,
"disk": 0,
"runAs": "xcm",
"cluster": "cctv",
"priority": 100,
"instances": 10,
"constraints": [],
Expand Down
1 change: 1 addition & 0 deletions types/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type Version struct {
Disk float64 `json:"disk"`
Instances int32 `json:"instances"`
RunAs string `json:"runAs"`
Cluster string `json:"cluster"`
Container *Container `json:"container"`
Labels map[string]string `json:"labels"`
HealthCheck *HealthCheck `json:"healthCheck"`
Expand Down

0 comments on commit 6d3d8ef

Please sign in to comment.