It would be really handy to be able to edit a Secret in the dashboard. Currently editing works, but it shows the base64 encoded values of the data map which means you have to mess around decoding/encoding base64 outside of the editor. It would be so much easier to just be able to edit them in the textarea directly ;)
Do we want to fix this?
I am asking because there is an explicit call of windows.atob in the secrets page.
refer: https://github.com/kubernetes/dashboard/search?utf8=%E2%9C%93&q=formatDataValue&type=
Correct me if I am wrong here.
I agree with jstrachan and this is a good to have feature.
This would be a useful feature. I'd like to work on it.
@kasisnu You are welcome to work on it.
Hi @floreks @jstrachan
I was looking at this, i'm new to this but willing to contribute :)
Was curious what will be the best way to tackle this ?
SInce the edit component is generic for all kind of resources, i guess having an extra logic for secret here is not ideal : https://github.com/kubernetes/dashboard/blob/28f4c132308f3c83450e17a82760ef9cb2e930c8/src/app/frontend/common/dialogs/editresource/dialog.ts#L46
Another way could be to add an http interceptor on get/secret ?
I guess modifying the backend is no go ?
WDYT ?
I think the stringData field of SecretSpec would be useful for this feature. I'll have a try
I think the
stringDatafield of SecretSpec would be useful for this feature. I'll have a try
@feloy Can you have a look at my PR for this issue and related issue #4255 ?
https://github.com/kubernetes/dashboard/pull/4290/files#diff-0ca22423fa7ae7f454e3081a82eafb18R124

If we can perhaps finalize on what's to be done, I can modify my existing PR to reflect the required changes.
I like that the Edit Secret modal shows everything as base64 encoded, since that matches the YAML file, and we probably want to still be able to copy and paste.
What I am working on instead is a quick edit. This would be next to the eye icon of the secret page, that will allow you to open a modal for one entry in the secret and save. This could be direct text unencoded, and should provide a good user experience.

I'm going to throw in some inspirations for this issue.
Openshift Console (functions exactly like Kubernetes Dashboard) allows creating and editing Kubernetes secrets as if a key-value collection:





I put together this dialog for Quick Edit, just working on wiring it up to save.

This is complete and the pull request is ready:
Added quick edit icon to Secrets page with dialog to decode and update a data value #5039
I re-implemented it as requested, with an inline edit.
Implemented inline editing for data entries on Secrets page. #5040

https://github.com/kubernetes/dashboard/pull/5040 covers that perfectly. You can edit the decoded value in the card and you can also edit the original value in the edit dialog.