[fips140][cmd/builder] Unit tests: Add GODEBUG=tlsmklem=0 if GODEBUG=fips140=only is set
          #14068
        
          
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Description
When #13926 is merged, all unit tests in this repository will be run with
GODEBUG=fips140=onlyto help surface any FIPS-140 violations in all the Go modules in this repository.The
cmd/buildermodule is not used when running the OpenTelemetry Collector. It is a tool used to build OpenTelemetry Collector distributions. As such, strictly speaking, we do not need to worry about FIPS-140 violations in this module.However, since unit tests for all modules will be run with
GODEBUG=fips140=only, it is convenient to address any FIPS-140 violations in this module as well.The module is responsible for building OpenTelemetry Collector distributions from a configuration file. The configuration file lists Go modules which are then downloaded in order to compile the distribution. During the download, if
GODEBUG=fips140=onlyis set, the following error will be thrown:To suppress this error, we append
tlsmklem=0to theGODEBUGenvironment variable. This is OK to do because a) we are only doing this from unit test code, not the module's code itself and b) as mentioned above, this particular module is not involved in the running of the OpenTelemetry Collector itself, i.e. we are not suppressing a legitimate FIPS violation in OpenTelemetry Collector code.Link to tracking issue
Fixes #13997
Testing
Run the existing unit tests in the
cmd/buildermodule with Go >= 1.24.6 andGODEBUG=fips140=only.