-
Notifications
You must be signed in to change notification settings - Fork 259
feat: add env-value-from as opt-in check for #705 #1032
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8a2e5bf to
34abcca
Compare
68ddc2e to
4c224e9
Compare
| 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 | ||
| } |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
janisz
left a comment
There was a problem hiding this 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
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.