Skip to content

Commit

Permalink
Fail build on missingn data sources, like for resources (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas11 committed Jan 13, 2023
1 parent 7779eba commit 1042913
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/tfgen/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -1218,8 +1218,8 @@ func (g *Generator) gatherDataSources() (moduleMap, error) {
}
modules := make(moduleMap)

failBuildOnMissingMapError := isTruthy(os.Getenv("PULUMI_MISSING_MAPPING_ERROR")) ||
isTruthy(os.Getenv("PULUMI_PROVIDER_MAP_ERROR"))
skipFailBuildOnMissingMapError := isTruthy(os.Getenv("PULUMI_SKIP_MISSING_MAPPING_ERROR")) || isTruthy(os.Getenv(
"PULUMI_SKIP_PROVIDER_MAP_ERROR"))
failBuildOnExtraMapError := isTruthy(os.Getenv("PULUMI_EXTRA_MAPPING_ERROR"))

// let's keep a list of TF mapping errors that we can present to the user
Expand All @@ -1232,11 +1232,11 @@ func (g *Generator) gatherDataSources() (moduleMap, error) {
dsinfo := g.info.DataSources[ds]
if dsinfo == nil {
if ignoreMappingError(g.info.IgnoreMappings, ds) {
g.debug("TF data source %q not found in provider map", ds)
g.debug("TF data source %q not found in provider map but ignored", ds)
continue
}

if failBuildOnMissingMapError {
if !skipFailBuildOnMissingMapError {
dataSourceMappingErrors = multierror.Append(dataSourceMappingErrors,
fmt.Errorf("TF data source %q not mapped to the Pulumi provider", ds))
} else {
Expand Down

0 comments on commit 1042913

Please sign in to comment.