- Notifications
You must be signed in to change notification settings - Fork1.1k
feat: persist prebuild definitions on template import#16951
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
5ecc277bc5f4f448c5372b16d1262c255428e491d8514fdbf390a1fd07e9613a07c2b2300e80fb7882378122595bfb7c286639167769ae1de7e9c2739360478bdcafb412d19851773ec23773c2bc3ff44baa3076ed14fb33cc74fbfc32154d7b4ec4e8b53f79df6554ccc309eee1f16ad040ddd83a6722cd707100f3bda0a7c7cd297cc4ff4d59039205d6afe489e1b1b2968620470e46fc18897b9c8cee189a0b692c0e5f747db03166a42aa6b490bc4e7d2f167b928fd34ab7a8ec49a64d661865998bc787cd2bd38603097f9c34cfdd6f4a34d528d9cd45f870d7e18ad9314667171a26c094bf4ab53a84b1bb6ed4121e8b15022312f414540a555c41ba9d09b75761e86f61419df06589221b15b97add656a7508b244e1f585d7d4f1b943f82b95d8de71a87933a798cfa1dc87f457c17fcdFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -884,11 +884,21 @@ func ConvertState(ctx context.Context, modules []*tfjson.StateModule, rawGraph s | ||
| ) | ||
| } | ||
| if len(preset.Prebuilds) != 1 { | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Will this not warn incorrectly when there are no prebuilds defined at all (which is perfectly valid)? Shouldn't this be | ||
| logger.Warn( | ||
| ctx, | ||
| "coder_workspace_preset must have exactly one prebuild block", | ||
| ) | ||
| } | ||
| var prebuildInstances int32 | ||
| if len(preset.Prebuilds) > 0 { | ||
| prebuildInstances = int32(math.Min(math.MaxInt32, float64(preset.Prebuilds[0].Instances))) | ||
| } | ||
| protoPreset := &proto.Preset{ | ||
| Name: preset.Name, | ||
| Parameters: presetParameters, | ||
| Prebuild: &proto.Prebuild{ | ||
| Instances:prebuildInstances, | ||
| }, | ||
| } | ||
Uh oh!
There was an error while loading.Please reload this page.