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

Check exposed svc ports #778

Merged
merged 14 commits into from
Apr 8, 2022

Conversation

yuriolisa
Copy link
Contributor

@yuriolisa yuriolisa commented Mar 16, 2022

Signed-off-by: Yuri Sa yurimsa@gmail.com

[x] Created function ConfigValidate which checks if the services are present in the pipeline set.
[x] Created unit test to validate the new function.
[x] Included validation on ConfigToReceiverPorts function to open only ports for enabled receivers.
[x] Changed config_to_ports_test.go:
- Fixing indentation.
- Included service spec in tested config string.

Resolves #257

Signed-off-by: Yuri Sa <yurimsa@gmail.com>
Signed-off-by: Yuri Sa <yurimsa@gmail.com>
@yuriolisa yuriolisa requested a review from a team March 16, 2022 13:03
@yuriolisa
Copy link
Contributor Author

Resolves #257

pkg/collector/adapters/config_to_probe.go Outdated Show resolved Hide resolved
pkg/collector/adapters/config_to_ports.go Outdated Show resolved Hide resolved
pkg/collector/adapters/config_validate.go Outdated Show resolved Hide resolved
@yuriolisa yuriolisa marked this pull request as draft March 16, 2022 13:52
Signed-off-by: Yuri Sa <yurimsa@gmail.com>
Signed-off-by: Yuri Sa <yurimsa@gmail.com>
@yuriolisa yuriolisa marked this pull request as ready for review March 17, 2022 09:16
Signed-off-by: Yuri Sa <yurimsa@gmail.com>
Copy link
Member

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Yuri Sa <yurimsa@gmail.com>
@pavolloffay
Copy link
Member

@yuriolisa CI failed

Signed-off-by: Yuri Sa <yurimsa@gmail.com>
Signed-off-by: Yuri Sa <yurimsa@gmail.com>
@yuriolisa
Copy link
Contributor Author

@pavolloffay, CI is fixed.

@VineethReddy02
Copy link
Contributor

@yuriolisa IMO The changes in this PR are a bit tricky in operator we should not care much about otel-collector config, i.e. which is internal to the collector & let collector deal with issues in the config like no service/pipelines, etc..., except for opening the respective ports based on the config. The ValidateConfig is adding more complexity on the operator end, which ideally shouldn't be part of operator with such complex evaluations.

cc @pavolloffay @jpkrohling

If the others feel this adds value and make sense in the operator end. I would definitely recommend @yuriolisa to add e2e tests with different config types to completely validate the corner cases.

@jpkrohling
Copy link
Member

let collector deal with issues in the config like no service/pipelines

Correct, we should not fail or return errors when this happens, we should just ignore and continue. In this case, if there are no pipelines, there should be no ports being exposed.

Signed-off-by: Yuri Sa <yurimsa@gmail.com>
@yuriolisa
Copy link
Contributor Author

@jpkrohling , @VineethReddy02 , @pavolloffay . Could you please review it?

Signed-off-by: Yuri Sa <yurimsa@gmail.com>
Signed-off-by: Yuri Sa <yurimsa@gmail.com>
Signed-off-by: Yuri Sa <yurimsa@gmail.com>
Copy link
Member

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

LGTM, but would be good to have a review from a fresh pair of eyes. @pavolloffay, @VineethReddy02?

@jpkrohling
Copy link
Member

@VineethReddy02, given the outcome of your previous review, would you also be able to take a look at this?

@VineethReddy02 VineethReddy02 merged commit 90e4d31 into open-telemetry:main Apr 8, 2022
ItielOlenick pushed a commit to ItielOlenick/opentelemetry-operator that referenced this pull request May 1, 2024
* Creating check if services are configured properly

Signed-off-by: Yuri Sa <yurimsa@gmail.com>

* Creating check if services are configured properly

Signed-off-by: Yuri Sa <yurimsa@gmail.com>
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.

Service exposes ports for receivers which are not enabled
4 participants