-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix: Exclude system namespaces correctly #779
Conversation
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.
The unit test coverage is very thorough, but maybe let's add some basic E2E tests too (including the bug fix)?
@@ -28,16 +28,18 @@ func createInputSection(pipeline *telemetryv1alpha1.LogPipeline, includePath, ex | |||
func createIncludePath(pipeline *telemetryv1alpha1.LogPipeline) string { | |||
var toInclude []string |
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.
It took me quite some time to understand the meaning of the variables toInclude
and toExclude
. I know it's old code, but since we are touching it, maybe let's change them to includePath
/excludePath
?
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.
Makes sense. Renamed it
a3bbbdf
to
f908e57
Compare
Done |
var _ = Describe("Logs Include Namespaces", Label("logs"), Ordered, func() { | ||
const ( | ||
mockNs = "log-include-namespaces-mocks" | ||
systemNamespace = "kyma-system" |
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.
Please use kitkyma.SystemNamespaceName
in both new test suites. And maybe a constant for kube-system
in kitkyma?
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.
Done
WithSecretKeyRef(mockBackend.HostSecretRef()). | ||
WithHTTPOutput(). | ||
WithIncludeNamespaces([]string{"kyma-system", mockNs}). | ||
WithExcludeContainers([]string{logProducerName}) |
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.
Why are we excluding the log producer container? We do not assert it anywhere or am I missing something?
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.
Good catch, that was copy/pasted from another test by accident.
83b8c2f
to
c31dd0e
Compare
Description
Changes proposed in this pull request (what was done and why):
Changes refer to particular issues, PRs or documents:
Traceability
area
andkind
label.Related Issues
section.