Skip to content

feat: Add resource detection on project import #181

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

Closed
wants to merge 1 commit into from
Closed
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
1 change: 1 addition & 0 deletions coderd/projectversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func TestProjectVersionParametersByOrganizationAndName(t *testing.T) {
},
},
}},
Provision: echo.ProvisionComplete,
})
coderdtest.AwaitProjectVersionImported(t, client, user.Organization, project.Name, version.Name)
params, err := client.ProjectVersionParameters(context.Background(), user.Organization, project.Name, version.Name)
Expand Down
1 change: 1 addition & 0 deletions provisioner/terraform/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ func (t *terraform) runTerraformPlan(ctx context.Context, terraform *tfexec.Terr
if err != nil {
return xerrors.Errorf("apply terraform: %w", err)
}
_ = reader.Close()
t.logger.Debug(ctx, "ran plan")
<-closeChan

Expand Down
1 change: 1 addition & 0 deletions provisioner/terraform/provision_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func TestProvision(t *testing.T) {
for {
msg, err := response.Recv()
if msg != nil && msg.GetLog() != nil {
t.Logf("log: [%s] %s", msg.GetLog().Level, msg.GetLog().Output)
continue
}
if testCase.Error {
Expand Down
150 changes: 81 additions & 69 deletions provisionerd/proto/provisionerd.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion provisionerd/proto/provisionerd.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ message CompletedJob {
}
message ProjectImport {
repeated provisioner.ParameterSchema parameter_schemas = 1;
repeated TransitionedResource resources = 2;
repeated provisioner.Resource start_resources = 2;
repeated provisioner.Resource stop_resources = 3;
}
string job_id = 1;
oneof type {
Expand Down
Loading