Skip to content

Commit

Permalink
update strict mode error wording
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristina Pathak committed Apr 10, 2024
1 parent 5c43c8a commit cbda7d5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmd/builder/internal/builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
var (
// ErrGoNotFound is returned when a Go binary hasn't been found
ErrGoNotFound = errors.New("go binary not found")
ErrStrictMode = errors.New("failing due to strict mode")
ErrStrictMode = errors.New("mismatch in go.mod and builder configuration versions")
errFailedToDownload = errors.New("failed to download go modules")
)

Expand Down Expand Up @@ -192,7 +192,9 @@ func GetModules(cfg Config) error {

coremod, corever := cfg.coreModuleAndVersion()
if mvm[coremod] != corever {
return fmt.Errorf("core collector version calculated by component dependencies %q does not match configured version %q: %w. Use --skip-strict-versioning to temporarily disable this check. This flag will be removed in a future minor version", mvm[coremod], corever, ErrStrictMode)
return fmt.Errorf(
"%w: core collector version calculated by component dependencies %q does not match configured version %q. Use --skip-strict-versioning to temporarily disable this check. This flag will be removed in a future minor version",
ErrStrictMode, mvm[coremod], corever)
}

for _, mod := range cfg.allComponents() {
Expand All @@ -205,7 +207,9 @@ func GetModules(cfg Config) error {
}

if mvm[module] != version {
return fmt.Errorf("component %q version calculated by dependencies %q does not match configured version %q: %w. Use --skip-strict-versioning to temporarily disable this check. This flag will be removed in a future minor version", module, mvm[module], version, ErrStrictMode)
return fmt.Errorf(
"%w: component %q version calculated by dependencies %q does not match configured version %q. Use --skip-strict-versioning to temporarily disable this check. This flag will be removed in a future minor version",
ErrStrictMode, module, mvm[module], version)
}
}

Expand Down

0 comments on commit cbda7d5

Please sign in to comment.