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

fix reconciliation error when prometheusremotewrite exporter is enabled #2029

Closed
wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 17, 2023

#1953 introduced the following error when prometheusremotewrite exporter is enabled

failed to reconcile the expected deployments: failed to apply changes: Deployment.apps "cluster-collector" is invalid: spec.template.spec.containers[0].ports[3].containerPort: Required value"

required configuration is:

exporters:
  prometheusremotewrite:
    endpoint: "https://example.com/api/v1/write"

getPrometheusExporterPorts() tries to parse this endpoint into a host:port pair, because the exporter name contains the string "prometheus", but prometheusremotewriteexporter's expected endpoint configuration is actually a URL, so that fails. additionally, due to a missing continue if the port parsing fails, an erroneous ContainerPort entry with port set to 0 is added to the configuration, causing the error.

#1953
introduced the following error when prometheusremotewrite exporter is
enabled

	failed to reconcile the expected deployments: failed to apply changes: Deployment.apps "cluster-collector" is invalid: spec.template.spec.containers[0].ports[3].containerPort: Required value"

required configuration is:

	exporters:
	  prometheusremotewrite:
	    endpoint: "https://example.com/api/v1/write"

getPrometheusExporterPorts() tries to parse this endpoint into a
host:port pair, because the exporter name contains the string
"prometheus", but prometheusremotewriteexporter's expected `endpoint`
configuration is actually a URL, so that fails. additionally, due to a
missing `continue` if the port parsing fails, an erroneous ContainerPort
entry with port set to 0 is added to the configuration, causing the
error.

Signed-off-by: Lauri Tirkkonen <[email protected]>
@ghost ghost self-requested a review August 17, 2023 08:04
@linux-foundation-easycla
Copy link

CLA Not Signed

@swiatekm
Copy link
Contributor

Looks like a duplicate of #2017, can you have a look and confirm @lauri-paypay ?

@ghost
Copy link
Author

ghost commented Aug 18, 2023

@swiatekm-sumo you're right, it's duplicate. closing this one.

@ghost ghost closed this Aug 18, 2023
This pull request was closed.
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.

1 participant