Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Fluid + standard_legacy CPU validator for vercel_project #291

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions vercel/resource_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import (
)

var (
_ resource.Resource = &projectResource{}
_ resource.ResourceWithConfigure = &projectResource{}
_ resource.ResourceWithImportState = &projectResource{}
_ resource.ResourceWithModifyPlan = &projectResource{}
_ resource.ResourceWithConfigValidators = &projectResource{}
_ resource.Resource = &projectResource{}
_ resource.ResourceWithConfigure = &projectResource{}
_ resource.ResourceWithImportState = &projectResource{}
_ resource.ResourceWithModifyPlan = &projectResource{}
// _ resource.ResourceWithConfigValidators = &projectResource{}
)

func newProjectResource() resource.Resource {
Expand Down Expand Up @@ -556,11 +556,13 @@ At this time you cannot use a Vercel Project resource with in-line ` + "`environ
}
}

/*
func (r *projectResource) ConfigValidators(ctx context.Context) []resource.ConfigValidator {
return []resource.ConfigValidator{
&fluidComputeBasicCPUValidator{},
}
}
*/

// Project reflects the state terraform stores internally for a project.
type Project struct {
Expand Down
9 changes: 5 additions & 4 deletions vercel/resource_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,17 @@ func TestAcc_ProjectFluidCompute(t *testing.T) {
Steps: []resource.TestStep{
{
// check we get a sensible error if fluid + invalid CPU combination.
Config: `
Config: fmt.Sprintf(`
resource "vercel_project" "test" {
name = "foo"
name = "test-acc-fluid-%[1]s"
%[2]s
resource_config = {
fluid = true
function_default_cpu_type = "standard_legacy"
}
}
`,
ExpectError: regexp.MustCompile(strings.ReplaceAll("Fluid compute is only supported with the standard or performance CPU types.", " ", `\s*`)),
`, projectSuffix, teamIDConfig()),
ExpectError: regexp.MustCompile(strings.ReplaceAll("\"standard_legacy\" is not a valid memory type for Fluid compute", " ", `\s*`)),
},
{
// check creating a project with Fluid
Expand Down