open-telemetry/opentelemetry-collector-builder

Failed Collector build does not exit with error code

eroteme opened this issue · 4 comments

When running our pipeline for our opentelemetry collector build, a failure did not cause our pipeline to fail.

I think this is due to no errors being passed backup to main. Is there a reason why errors cannot be passed back to the main package and the run of the build return non zero exit code if there was an issue.

If not then I'll create a PR for proposal.

I'm not quite sure I understand the problem description. Are you talking about a runtime error, or is it about an error while building the distribution? Are you able to provide a manifest + otelcol config file that demonstrates the problem?

When I tried to build collector v0.22.0 in our pipeline the build of the collector failed (runtime error) due to issue fixed by Pull #19. However, the pipeline succeeded as the otelcol-builder did not return an error exit code. Looking at main() no errors are propagated back to the main run of the program and so any errors are effectively ignored in terms of return code.

My question is there a reason for this, or should I create a pull request that propagates the errors back to main so that builder can exit with a non-zero exit code. This would allow my pipeline to fail if the build of the collector fails.

Oh, I see what you mean now. You are not talking about the main that is generated as part of the builder, but the builder's main. Yes, agree that the builder should propagate any errors that it gets from the underlying commands it runs.

PR #28 closes this issue