Skip to content

Conversation

@Nexusrex18
Copy link

Implements env-value-from check from #705 as opt-in (via config.yaml 'include'). If maintainers prefer, can add to default checks in a follow-up.

@Nexusrex18 Nexusrex18 requested a review from rhybrillou as a code owner October 6, 2025 10:39
@codecov
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

❌ Patch coverage is 83.65385% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.16%. Comparing base (dbd7529) to head (4c224e9).
⚠️ Report is 189 commits behind head on main.

Files with missing lines Patch % Lines
pkg/templates/envvarvaluefrom/template.go 85.39% 9 Missing and 4 partials ⚠️
...ates/envvarvaluefrom/internal/params/gen-params.go 73.33% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1032       +/-   ##
===========================================
- Coverage   62.36%   28.16%   -34.20%     
===========================================
  Files         197      235       +38     
  Lines        4854     6295     +1441     
===========================================
- Hits         3027     1773     -1254     
- Misses       1439     4362     +2923     
+ Partials      388      160      -228     
Flag Coverage Δ
unit 28.16% <83.65%> (-34.20%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Nexusrex18 Nexusrex18 force-pushed the env-value-from-feature branch 2 times, most recently from 8a2e5bf to 34abcca Compare October 17, 2025 21:37
@Nexusrex18 Nexusrex18 force-pushed the env-value-from-feature branch from 68ddc2e to 4c224e9 Compare October 27, 2025 17:50
Comment on lines +132 to +138
func Keys[K comparable, V any](m map[K]V) []K {
r := make([]K, 0, len(m))
for k := range m {
r = append(r, k)
}
return r
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

func lintForEachContainer(lintCtx lintcontext.LintContext, object lintcontext.Object, ignoredSecrets, ignoredConfigMaps []*regexp.Regexp, secrets map[string]*v1.Secret, configmaps map[string]*v1.ConfigMap) []diagnostic.Diagnostic {
return util.PerContainerCheck(func(container *v1.Container) []diagnostic.Diagnostic {
var results []diagnostic.Diagnostic
for _, envVar := range container.Env {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Loop body looks like copied. How about having a type that will have common parts from secrets and config maps and additional type name [secret, config map] (that could be used in errors) so we can have simple code?

Copy link
Collaborator

@janisz janisz left a comment

Choose a reason for hiding this comment

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

Looks good, the only problem is duplicated code

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.

2 participants