Skip to content

Add Kubernetes service connection as data source #577

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

Conversation

beschoenen
Copy link
Contributor

I was missing this data source, since the authentik helm chart comes with a service connection out of the box.

@beschoenen beschoenen requested a review from a team as a code owner October 20, 2024 15:13
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 6 lines in your changes missing coverage. Please review.

Project coverage is 78.94%. Comparing base (431220f) to head (112f6da).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/provider/data_source_outpost_sc_kubernetes.go 88.67% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #577      +/-   ##
==========================================
+ Coverage   78.92%   78.94%   +0.01%     
==========================================
  Files         106      107       +1     
  Lines       12184    12238      +54     
==========================================
+ Hits         9616     9661      +45     
- Misses       2073     2079       +6     
- Partials      495      498       +3     
Flag Coverage Δ
authentik-beta 78.94% <88.88%> (+0.04%) ⬆️
authentik-stable 78.94% <88.88%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@larstobi
Copy link
Contributor

I added some suggestions to tests to get the coverage above 80%. Hopefully this makes the PR able to be merged?

Copy link
Member

@BeryJu BeryJu left a comment

Choose a reason for hiding this comment

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

One small nit, otherwise LGTM


req := c.client.OutpostsApi.OutpostsServiceConnectionsKubernetesList(ctx)
if s, ok := d.GetOk("name"); ok {
req = req.Name(s.(string))
Copy link
Member

Choose a reason for hiding this comment

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

can remove the if here since name is marked as required and set that on the request inline

@BeryJu BeryJu force-pushed the feature/data-source-kubernetes-service-connection branch from 81d755a to d373545 Compare June 15, 2025 21:51
@BeryJu BeryJu merged commit 4b8ffc9 into goauthentik:main Jun 15, 2025
8 checks passed
@beschoenen beschoenen deleted the feature/data-source-kubernetes-service-connection branch June 16, 2025 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants