mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: persist prebuild definitions on template import (#16951)
This PR allows provisioners to recognise and report prebuild definitions to the coder control plane. It also allows the coder control plane to then persist these to its store. closes https://github.com/coder/internal/issues/507 --------- Signed-off-by: Danny Kopping <dannykopping@gmail.com> Co-authored-by: Danny Kopping <dannykopping@gmail.com> Co-authored-by: evgeniy-scherbina <evgeniy.shcherbina.es@gmail.com>
This commit is contained in:
co-authored by
Danny Kopping
evgeniy-scherbina
parent
074ec2887d
commit
0b2b643ce2
Generated
+25
@@ -94,10 +94,15 @@ export interface RichParameterValue {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface Prebuild {
|
||||
instances: number;
|
||||
}
|
||||
|
||||
/** Preset represents a set of preset parameters for a template version. */
|
||||
export interface Preset {
|
||||
name: string;
|
||||
parameters: PresetParameter[];
|
||||
prebuild: Prebuild | undefined;
|
||||
}
|
||||
|
||||
export interface PresetParameter {
|
||||
@@ -302,6 +307,8 @@ export interface Metadata {
|
||||
workspaceBuildId: string;
|
||||
workspaceOwnerLoginType: string;
|
||||
workspaceOwnerRbacRoles: Role[];
|
||||
isPrebuild: boolean;
|
||||
runningWorkspaceAgentToken: string;
|
||||
}
|
||||
|
||||
/** Config represents execution configuration shared by all subsequent requests in the Session */
|
||||
@@ -511,6 +518,15 @@ export const RichParameterValue = {
|
||||
},
|
||||
};
|
||||
|
||||
export const Prebuild = {
|
||||
encode(message: Prebuild, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.instances !== 0) {
|
||||
writer.uint32(8).int32(message.instances);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
};
|
||||
|
||||
export const Preset = {
|
||||
encode(message: Preset, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.name !== "") {
|
||||
@@ -519,6 +535,9 @@ export const Preset = {
|
||||
for (const v of message.parameters) {
|
||||
PresetParameter.encode(v!, writer.uint32(18).fork()).ldelim();
|
||||
}
|
||||
if (message.prebuild !== undefined) {
|
||||
Prebuild.encode(message.prebuild, writer.uint32(26).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
};
|
||||
@@ -1008,6 +1027,12 @@ export const Metadata = {
|
||||
for (const v of message.workspaceOwnerRbacRoles) {
|
||||
Role.encode(v!, writer.uint32(154).fork()).ldelim();
|
||||
}
|
||||
if (message.isPrebuild === true) {
|
||||
writer.uint32(160).bool(message.isPrebuild);
|
||||
}
|
||||
if (message.runningWorkspaceAgentToken !== "") {
|
||||
writer.uint32(170).string(message.runningWorkspaceAgentToken);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user