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

feat: allow project scoped generic kubernetes secrets #2975

Merged
merged 25 commits into from
Jan 11, 2025

Conversation

Marvin9
Copy link
Contributor

@Marvin9 Marvin9 commented Nov 20, 2024

This PR now allows create generic k8s secrets

TODO:

  • API - Update secret
  • Tests

Screenshot 2024-11-20 at 6 51 09 PM (2)
Screenshot 2024-11-20 at 6 55 23 PM (2)
Screenshot 2024-11-20 at 6 55 56 PM (2)

Copy link

netlify bot commented Nov 20, 2024

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit 793f29e
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/67821c65eb43fd00080a7ec7
😎 Deploy Preview https://deploy-preview-2975.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 50.98814% with 124 lines in your changes missing coverage. Please review.

Project coverage is 52.05%. Comparing base (6dfa01e) to head (793f29e).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
internal/api/update_project_secret_v1alpha1.go 53.94% 27 Missing and 8 partials ⚠️
internal/api/delete_project_secret_v1alpha1.go 30.23% 23 Missing and 7 partials ⚠️
internal/api/create_project_secret_v1alpha1.go 67.79% 13 Missing and 6 partials ⚠️
internal/api/delete_credentials_v1alpha1.go 0.00% 19 Missing ⚠️
internal/api/list_project_secrets_v1alpha1.go 63.82% 12 Missing and 5 partials ⚠️
internal/api/update_credentials_v1alpha1.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2975      +/-   ##
==========================================
+ Coverage   51.40%   52.05%   +0.64%     
==========================================
  Files         288      295       +7     
  Lines       26108    26695     +587     
==========================================
+ Hits        13421    13895     +474     
- Misses      11961    12041      +80     
- Partials      726      759      +33     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Marvin9
Copy link
Contributor Author

Marvin9 commented Nov 20, 2024

@krancour generic secret creation and listing those is ready. Till I figure out what to do for updates could you start looking at the backend code?

Also do you think its better to re-use the create resource API instead of modifying the create credentials?

@Marvin9 Marvin9 self-assigned this Nov 20, 2024
api/v1alpha1/labels.go Outdated Show resolved Hide resolved
Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>
@Marvin9 Marvin9 marked this pull request as ready for review November 21, 2024 19:43
@Marvin9 Marvin9 requested a review from a team as a code owner November 21, 2024 19:43
@Marvin9 Marvin9 requested a review from hiddeco November 21, 2024 19:43
Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>
Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>
Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>
Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>
@Marvin9
Copy link
Contributor Author

Marvin9 commented Dec 5, 2024

@krancour could you start looking.. I will bring code coverage to threshold

@krancour
Copy link
Member

Sorry this took me so long.

Overall, this looks fantastic. Test drive went really smoothly.

I have some small bits of feedback, that I think are easy to address.

Screenshot 2024-12-11 at 4 20 35 PM

In the screenshot above, I was initially thrown off by not seeing any kind of "Add Secret" button. It took me a while to realize that clicking "Add Credentials" would pop up a dialog that could be used for adding generic Secrets as well.

I think this could potentially be less confusing if each of the two sections of this page each got their own "Add Credentials" and "Add Secret" buttons.

In the same screen shot, upper right, the alt text for the tab says "Credentials". With Secrets being more broad/generic than credentials, I would suggest making the alt text there "Secrets." Credentials are a kind of Secret. (If it's not a problem, I think the URL of the page could also change to end in "/secrets".

Screenshot 2024-12-11 at 4 25 17 PM

Two things tripped me up in the screenshot above.

The title of the dialog is "Edit Credentials" even when I'm working on a generic Secret. Could it be at all practical to have two separate dialogs? One for creds and one for generic?

When editing an existing Secret, not seeing any ****** in the value fields left me wondering whether I was going to accidentally blank out those fields when I hit Update. I confirmed that this is not a problem, but seeing ****** in those fields would have stopped me from wondering.

Last -- a weird one. If I try to add a new key "foobar" above, the new line disappears the moment I hit the second "o" in "foobar". I assume there's some real time validation that keys aren't being duplicated and after hitting that second "o", it looks like I am duplicating "foo" although I wasn't done typing. If I type any other value not staring with the characters of an existing key, everything works fine.

I think/hope these are all relatively minor tweaks. As I said, overall, this worked great and did exactly what it's supposed to.

@Marvin9
Copy link
Contributor Author

Marvin9 commented Dec 17, 2024

Great suggestions! @krancour you might want to take a look now, except your last point (in progress) all other review points are addressed. Thanks

Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>
@Marvin9 Marvin9 requested a review from krancour January 8, 2025 16:49
Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>
Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>
Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>
@krancour
Copy link
Member

krancour commented Jan 9, 2025

@Marvin9 I promise I'll 👀 the latest changes tomorrow. Thank you for the hard work on this.

@krancour krancour self-assigned this Jan 10, 2025
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
@krancour krancour force-pushed the Marvin9/feat-generic-secrets branch from a7d4cd9 to 793f29e Compare January 11, 2025 07:23
@krancour krancour enabled auto-merge January 11, 2025 07:25
@krancour krancour added this pull request to the merge queue Jan 11, 2025
Merged via the queue into main with commit dfbf526 Jan 11, 2025
16 of 17 checks passed
@krancour krancour deleted the Marvin9/feat-generic-secrets branch January 11, 2025 07:46
fykaa pushed a commit to fykaa/kargo that referenced this pull request Jan 16, 2025
Signed-off-by: Mayursinh Sarvaiya <marvinduff97@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Co-authored-by: Kent Rancourt <kent.rancourt@gmail.com>
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.

4 participants