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

Add flags to override hardcoded images #449

Merged
merged 4 commits into from
Oct 7, 2021

Conversation

pavolloffay
Copy link
Member

Resolves #447

Signed-off-by: Pavol Loffay p.loffay@gmail.com

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
@pavolloffay pavolloffay requested review from a team and jpkrohling October 5, 2021 08:14
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
main.go Outdated
pflag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.")
pflag.BoolVar(&enableLeaderElection, "enable-leader-election", false,
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
pflag.StringVar(&collectorImage, "collector-image", "", "The default OpenTelemetry collector image. This image is used when no image is specified in the CustomResource.")
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this have a default?

Copy link
Member Author

Choose a reason for hiding this comment

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

The default images are hardcoded in the config package

o.collectorImage = fmt.Sprintf("otel/opentelemetry-collector:%s", o.version.OpenTelemetryCollector)
.

The config package hardcodes image name and sets the tag based on the version.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have made some changes and moved the logic to main. It looks better now and cleaner.

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
@pavolloffay
Copy link
Member Author

Fixed failing tests. I had to add a default (dummy) image names to config used in the tests.

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.

@VineethReddy02, would you mind reviewing as well?

@pavolloffay
Copy link
Member Author

@jpkrohling can we get this in before 0.36.0 goes out?

@jpkrohling jpkrohling merged commit 6ddfbed into open-telemetry:main Oct 7, 2021
shree007 pushed a commit to shree007/opentelemetry-operator that referenced this pull request Dec 12, 2021
* Add flags to override hardcoded images

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>

* Fix typos

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>

* Remove version from config

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>

* Fix tests

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
ItielOlenick pushed a commit to ItielOlenick/opentelemetry-operator that referenced this pull request May 1, 2024
* Add flags to override hardcoded images

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>

* Fix typos

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>

* Remove version from config

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>

* Fix tests

Signed-off-by: Pavol Loffay <p.loffay@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.

Add configuration/flag to override collector image
2 participants