8000 Correct the prebuilds type · coder/coder@a87933a · GitHub
[go: up one dir, main page]

Skip to content

Commit a87933a

Browse files
committed
Correct the prebuilds type
1 parent 5d8de71 commit a87933a

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

provisioner/terraform/resources.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -887,16 +887,9 @@ func ConvertState(ctx context.Context, modules []*tfjson.StateModule, rawGraph s
887887
protoPreset := &proto.Preset{
888888
Name: preset.Name,
889889
Parameters: presetParameters,
890-
}
891-
892-
if len(preset.Prebuild) > 1 {
893-
// The provider template schema should prevent this, but we're being defensive here.
894-
logger.Info(ctx, "coder_workspace_preset has more than 1 prebuild, only using the first one", slog.F("name", preset.Name))
895-
}
896-
if len(preset.Prebuild) == 1 {
897-
protoPreset.Prebuild = &proto.Prebuild{
898-
Instances: int32(math.Min(math.MaxInt32, float64(preset.Prebuild[0].Instances))),
899-
}
890+
Prebuild: &proto.Prebuild{
891+
Instances: int32(math.Min(math.MaxInt32, float64(preset.Prebuilds[0].Instances))),
892+
},
900893
}
901894

902895
if slice.Contains(duplicatedPresetNames, preset.Name) {

0 commit comments

Comments
 (0)
< 156C /ghcc-consent>
0