Skip to content
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

Merged
merged 2 commits into from
Feb 14, 2023
Merged

Kubernetes config payload fix #19184

merged 2 commits into from
Feb 14, 2023

Conversation

zofskeez
Copy link
Contributor

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.

@@ -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;
Copy link
Contributor Author

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.

Copy link
Contributor

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 ?

Copy link
Contributor Author

@zofskeez zofskeez Feb 14, 2023

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.

Copy link
Contributor

@hellobontempo hellobontempo Feb 14, 2023

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

@zofskeez zofskeez removed this from the 1.13.0-rc1 milestone Feb 14, 2023
@zofskeez zofskeez added this to the 1.13.0 milestone Feb 14, 2023
Copy link
Contributor

@hellobontempo hellobontempo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants