stacks: fix suggested command when lock file is out of date (#35616)

This commit is contained in:
Liam Cervante 2024-08-21 09:32:08 +02:00 committed by GitHub
parent 02c2aae12d
commit 7660d8d086
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -91,7 +91,7 @@ func CheckProviderInLockfile(locks depsfile.Locks, providerType *ProviderType, d
Severity: hcl.DiagError,
Summary: "Provider missing from lockfile",
Detail: fmt.Sprintf(
"Provider %q is not in the lockfile. This provider must be in the lockfile to be used in the configuration. Please run `tfstacks provider lock` to update the lockfile and run this operation again with an updated configuration.",
"Provider %q is not in the lockfile. This provider must be in the lockfile to be used in the configuration. Please run `tfstacks providers lock` to update the lockfile and run this operation again with an updated configuration.",
providerType.Addr(),
),
Subject: declRange.ToHCL().Ptr(),

View file

@ -486,7 +486,7 @@ func TestValidate_missing_provider_from_lockfile(t *testing.T) {
t.Fatalf("expected diagnostic summary 'Provider missing from lockfile', got %q", diag.Description().Summary)
}
if diag.Description().Detail != "Provider \"registry.terraform.io/hashicorp/testing\" is not in the lockfile. This provider must be in the lockfile to be used in the configuration. Please run `tfstacks provider lock` to update the lockfile and run this operation again with an updated configuration." {
if diag.Description().Detail != "Provider \"registry.terraform.io/hashicorp/testing\" is not in the lockfile. This provider must be in the lockfile to be used in the configuration. Please run `tfstacks providers lock` to update the lockfile and run this operation again with an updated configuration." {
t.Fatalf("expected diagnostic detail to be a specific message, got %q", diag.Description().Detail)
}
}