Skip to content

Commit 8f35a56

Browse files
committed
SREP-21: backplane API is now returning a remediation instance id when calling createRemediation; this id will be used in place of the remediation name at deleteRemediation time.
This will allow backplane to have several remediations with the same name in parallel without mixing up the resources created on the target cluster.
1 parent 0f66644 commit 8f35a56

File tree

2 files changed

+113
-89
lines changed

2 files changed

+113
-89
lines changed

openapi/openapi.yaml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,21 @@ paths:
9595
- *cluster-id-param
9696
post:
9797
operationId: createRemediation
98-
summary: Creates service account and RBAC for remediation
98+
summary: Instantiates a new remediation instance & creates the service account (SA) and RBAC on the target cluster used by that instance
9999
parameters:
100-
- name: remediation
100+
- name: remediationName
101101
in: query
102-
description: The name of a remediation for which RBAC should be created
102+
description: The name of a remediation which must be instantiated
103103
required: true
104104
schema:
105105
type: string
106106
responses:
107107
200:
108-
description: Returns a LoginResponse with the uri to proxy for
108+
description: Returns a RemediationLoginResponse with the uri to use to proxy oc commands; the response also contains the id to use to delete the remediation instance
109109
content:
110110
application/json:
111111
schema:
112-
$ref: "#/components/schemas/LoginResponse"
112+
$ref: "#/components/schemas/RemediationLoginResponse"
113113
400:
114114
<<: *base-errors
115115
403:
@@ -118,12 +118,12 @@ paths:
118118
<<: *base-errors
119119
delete:
120120
operationId: deleteRemediation
121-
summary: Deletes RBAC created for a remediation
121+
summary: Deletes an existing remediation instance; deletes the service account (SA) and RBAC created for the remediation instance
122122
parameters:
123-
- name: remediation
123+
- name: remediationInstanceId
124124
in: query
125-
description: remediation name ( locked down to remediation users + validation that SA is owned by remediation user )
126-
required: false
125+
description: the id of the remediation instance previously instantiated by backplane
126+
required: true
127127
schema:
128128
type: string
129129
responses:
@@ -969,6 +969,17 @@ components:
969969
message:
970970
type: string
971971
description: message
972+
973+
RemediationLoginResponse:
974+
allOf:
975+
- $ref: "#/components/schemas/LoginResponse"
976+
- type: object
977+
required:
978+
- remediationInstanceId
979+
properties:
980+
remediationInstanceId:
981+
type: string
982+
description: the id of the remediation instance - used to locate the SA & RBAC created by backplane on the target cluster
972983

973984
RBAC:
974985
description: RBAC declaration

pkg/client/BackplaneApi.go

Lines changed: 93 additions & 80 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)