-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kubernetes config payload fix #19184
Conversation
@@ -32,7 +32,7 @@ export default class KubernetesRoleAdapter extends NamedPathAdapter { | |||
} | |||
generateCredentials(backend, data) { | |||
const generateCredentialsUrl = `${this.buildURL()}/${encodePath(backend)}/creds/${data.role}`; | |||
|
|||
delete data.role; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed that this was causing a warning to display since role is not an accepted value in the post body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this also be added to the serializer as serialize: false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a custom adapter method the serializer is not hit. We decided not to have a dedicated model for role credentials since they are not persisted in the app which is why we are using the role adapter for the request. The payload is also not the role model but a pojo of values from the form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right! I missed the method - thanks for explaining
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
After entering in values in the manual configuration form for a Kuberenetes secrets engine and either changing to the local cluster option or saving and then editing and changing to local cluster, the previously entered values would be sent to the server and saved. This was causing issues so the solution was to unset them in the serializer.