feat: update OPENAPI spec for Service Account#121
Conversation
585078e to
df923e9
Compare
| paths: | ||
| /api/managed-services-api/v1/serviceAccount: | ||
| get: | ||
| /api/managed-services-api/v1/serviceaccounts: |
There was a problem hiding this comment.
I have manually added this, because the MAS API does not have it yet.
|
@craicoverflow ACK. Generally good work that will allow us to stay in line with recent API so whatever it will arrive. As for non mocked usage for credentials we can put extra message for 404 |
df923e9 to
f939763
Compare
| response, _, err := client.DefaultApi.CreateServiceAccount(context.Background()) | ||
|
|
||
| t := time.Now() | ||
| serviceAcct := &managedservices.ServiceAccountRequest{Name: fmt.Sprintf("srvc-acct-%v", t.String())} |
There was a problem hiding this comment.
Do we want the user to be able to name their service accounts too?
bcd41b6 to
e6a931d
Compare
|
Rebase recomended |
e6a931d to
5d0dc5f
Compare
5d0dc5f to
6c4f063
Compare
|
WDYT about? https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-em-serviceaccount-em- |
|
|
||
| // define api | ||
| const api = new OpenAPIBackend({ definition: path.join(__dirname, "../managed-services-api.yaml") }); | ||
| const api = new OpenAPIBackend({ definition: path.join(__dirname, "../../openapi/managed-services-api.yaml") }); |
There was a problem hiding this comment.
The pattern was that we always have managed-services that reflect top level and mock could have our own additions. Cool with this approach as well.
There was a problem hiding this comment.
Okay, I can do that. But how did you generate the MAS client with two different API spec files?
There was a problem hiding this comment.
You could overwrite it, but then the managed services client not being representative of the OpenAPI spec anyway
There was a problem hiding this comment.
All good here. I was just trying to tell how this worked. It is better this way and by the end of the week we should have API in master.
470df2e to
b5330eb
Compare
craicoverflow
left a comment
There was a problem hiding this comment.
WDYT about?
rhoas service-accountvsrhoas serviceAccountvsrhoas serviceaccountkubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-em-serviceaccount-em-
I'm not a fan of camelCase in a CLI, and it is not usual practice. Best to stick with kubectl/oc norms so I will use serviceaccount
Yep. I have no strong opinion either. Just wanted for us to pick something. Best to not have |
Not sure what you mean by that. |
|
|
|
Yes but..hyphens are not purely reserved for flags/args. Only if the word begins with a hyphen then yes. Without hyphens longer commands would be hard to read. Anyway, we are not using it due to Kubectl style so this is a non-issue. |
Closes #115
Based on discussions in #115 the command has been changed to a second-level
service-accountcommand group.Tasks
--outputa mandatory flag with no default. This is to prevent the user having to create more than one service account because they did not want .env which is the default--output-fileflag to let the user customise the location the credentials are written to.