Skip to content

Commit 4cd1b06

Browse files
no cli
1 parent bcb42b6 commit 4cd1b06

5 files changed

Lines changed: 32 additions & 85 deletions

File tree

src/app/project_runner.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,6 @@ func (p *ProjectRunner) UpdateNamespace(processes *types.Processes) (map[string]
11571157

11581158
var errs []error
11591159
for _, process := range *processes {
1160-
process := process
11611160
if err := p.UpdateProcess(&process); err != nil {
11621161
status[process.ReplicaName] = err.Error()
11631162
errs = append(errs, err)

src/client/client.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,11 @@ func (p *PcClient) ReloadProject() (map[string]string, error) {
185185
func (p *PcClient) TruncateProcessLogs(name string) error {
186186
return p.truncateProcessLogs(name)
187187
}
188+
189+
func (p *PcClient) UpdateNamespace(processes *types.Processes) (map[string]string, error) {
190+
return nil, errors.New("update namespace not implemented for PC client")
191+
}
192+
193+
func (p *PcClient) RemoveNamespace(name string) (map[string]string, error) {
194+
return nil, errors.New("remove namespace not implemented for PC client")
195+
}

src/docs/docs.go

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const docTemplate = `{
4242
},
4343
"/namespace": {
4444
"post": {
45-
"description": "Merge processes from a partial config; all must share the same namespace",
45+
"description": "Merge processes from a partial config; all must share the same namespace/",
4646
"consumes": [
4747
"application/json"
4848
],
@@ -53,10 +53,10 @@ const docTemplate = `{
5353
"Namespace"
5454
],
5555
"summary": "Post config fragment with processes (single namespace)",
56-
"operationId": "PostNamespace",
56+
"operationId": "UpdateNamespace",
5757
"parameters": [
5858
{
59-
"description": "Processes, all in the same namespace",
59+
"description": "One or more processes, all in the same namespace",
6060
"name": "processes",
6161
"in": "body",
6262
"required": true,
@@ -67,16 +67,7 @@ const docTemplate = `{
6767
],
6868
"responses": {
6969
"200": {
70-
"description": "Process -\u003e status (added)",
71-
"schema": {
72-
"type": "object",
73-
"additionalProperties": {
74-
"type": "string"
75-
}
76-
}
77-
},
78-
"207": {
79-
"description": "Process -\u003e status with failures",
70+
"description": "All updated",
8071
"schema": {
8172
"type": "object",
8273
"additionalProperties": {
@@ -85,7 +76,7 @@ const docTemplate = `{
8576
}
8677
},
8778
"400": {
88-
"description": "Bad Request",
79+
"description": "Some processes failed to be updated. Returns error if all failed, else returns success and failures map",
8980
"schema": {
9081
"type": "object",
9182
"additionalProperties": {
@@ -116,16 +107,7 @@ const docTemplate = `{
116107
],
117108
"responses": {
118109
"200": {
119-
"description": "Process -\u003e status (removed)",
120-
"schema": {
121-
"type": "object",
122-
"additionalProperties": {
123-
"type": "string"
124-
}
125-
}
126-
},
127-
"207": {
128-
"description": "Process -\u003e status with failures",
110+
"description": "All processes removed, may be zero if non existent",
129111
"schema": {
130112
"type": "object",
131113
"additionalProperties": {
@@ -134,7 +116,7 @@ const docTemplate = `{
134116
}
135117
},
136118
"400": {
137-
"description": "Bad Request",
119+
"description": "Some processes failed to be removed, can happen if some have dependants or removed concurrently",
138120
"schema": {
139121
"type": "object",
140122
"additionalProperties": {
@@ -176,7 +158,7 @@ const docTemplate = `{
176158
}
177159
},
178160
"400": {
179-
"description": "Some processes in namespace failed to be disabled",
161+
"description": "Some processes in namespace failed to be disabled, can happen if several opposite updates to same namespace are happening",
180162
"schema": {
181163
"type": "object",
182164
"additionalProperties": {

src/docs/swagger.json

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -543,20 +543,7 @@
543543
}
544544
}
545545
},
546-
"description": "Process -\u003e status (removed)"
547-
},
548-
"207": {
549-
"content": {
550-
"application/json": {
551-
"schema": {
552-
"additionalProperties": {
553-
"type": "string"
554-
},
555-
"type": "object"
556-
}
557-
}
558-
},
559-
"description": "Process -\u003e status with failures"
546+
"description": "All processes removed, may be zero if non existent"
560547
},
561548
"400": {
562549
"content": {
@@ -569,7 +556,7 @@
569556
}
570557
}
571558
},
572-
"description": "Bad Request"
559+
"description": "Some processes failed to be removed, can happen if some have dependants or removed concurrently"
573560
}
574561
},
575562
"summary": "Delete namespace processes",
@@ -578,8 +565,8 @@
578565
]
579566
},
580567
"post": {
581-
"description": "Merge processes from a partial config; all must share the same namespace",
582-
"operationId": "PostNamespace",
568+
"description": "Merge processes from a partial config; all must share the same namespace/",
569+
"operationId": "UpdateNamespace",
583570
"requestBody": {
584571
"content": {
585572
"application/json": {
@@ -588,7 +575,7 @@
588575
}
589576
}
590577
},
591-
"description": "Processes, all in the same namespace",
578+
"description": "One or more processes, all in the same namespace",
592579
"required": true,
593580
"x-originalParamName": "processes"
594581
},
@@ -604,20 +591,7 @@
604591
}
605592
}
606593
},
607-
"description": "Process -\u003e status (added)"
608-
},
609-
"207": {
610-
"content": {
611-
"application/json": {
612-
"schema": {
613-
"additionalProperties": {
614-
"type": "string"
615-
},
616-
"type": "object"
617-
}
618-
}
619-
},
620-
"description": "Process -\u003e status with failures"
594+
"description": "All updated"
621595
},
622596
"400": {
623597
"content": {
@@ -630,7 +604,7 @@
630604
}
631605
}
632606
},
633-
"description": "Bad Request"
607+
"description": "Some processes failed to be updated. Returns error if all failed, else returns success and failures map"
634608
}
635609
},
636610
"summary": "Post config fragment with processes (single namespace)",
@@ -679,7 +653,7 @@
679653
}
680654
}
681655
},
682-
"description": "Some processes in namespace failed to be disabled"
656+
"description": "Some processes in namespace failed to be disabled, can happen if several opposite updates to same namespace are happening"
683657
},
684658
"404": {
685659
"content": {

src/docs/swagger.yaml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -369,35 +369,27 @@ paths:
369369
additionalProperties:
370370
type: string
371371
type: object
372-
description: Process -> status (removed)
373-
"207":
374-
content:
375-
application/json:
376-
schema:
377-
additionalProperties:
378-
type: string
379-
type: object
380-
description: Process -> status with failures
372+
description: All processes removed, may be zero if non existent
381373
"400":
382374
content:
383375
application/json:
384376
schema:
385377
additionalProperties:
386378
type: string
387379
type: object
388-
description: Bad Request
380+
description: Some processes failed to be removed, can happen if some have dependants or removed concurrently
389381
summary: Delete namespace processes
390382
tags:
391383
- Namespace
392384
post:
393-
description: Merge processes from a partial config; all must share the same namespace
394-
operationId: PostNamespace
385+
description: Merge processes from a partial config; all must share the same namespace/
386+
operationId: UpdateNamespace
395387
requestBody:
396388
content:
397389
application/json:
398390
schema:
399391
$ref: '#/components/schemas/types.Processes'
400-
description: Processes, all in the same namespace
392+
description: One or more processes, all in the same namespace
401393
required: true
402394
x-originalParamName: processes
403395
responses:
@@ -408,23 +400,15 @@ paths:
408400
additionalProperties:
409401
type: string
410402
type: object
411-
description: Process -> status (added)
412-
"207":
413-
content:
414-
application/json:
415-
schema:
416-
additionalProperties:
417-
type: string
418-
type: object
419-
description: Process -> status with failures
403+
description: All updated
420404
"400":
421405
content:
422406
application/json:
423407
schema:
424408
additionalProperties:
425409
type: string
426410
type: object
427-
description: Bad Request
411+
description: Some processes failed to be updated. Returns error if all failed, else returns success and failures map
428412
summary: Post config fragment with processes (single namespace)
429413
tags:
430414
- Namespace
@@ -455,7 +439,7 @@ paths:
455439
additionalProperties:
456440
type: string
457441
type: object
458-
description: Some processes in namespace failed to be disabled
442+
description: Some processes in namespace failed to be disabled, can happen if several opposite updates to same namespace are happening
459443
"404":
460444
content:
461445
application/json:

0 commit comments

Comments
 (0)