@@ -26,20 +26,18 @@ var (
26
26
"args" , "env" , "services" , "ports" , "unstable_permissions" , "permissions" , "probe" , "probes" , "security" ,
27
27
"sidecars" , "mounts" , "resources" , "requires" , "tolerations" , "annotations" ,
28
28
"resourceLimits" , "resourceRequests" , "terminationGracePeriodSeconds" ,
29
- "extensions" , "nodeSelector" ,
29
+ "extensions" , "nodeSelector" , "replicas" ,
30
30
// This is needed for the "spec" in server templates. This can't be a private field, otherwise it can't be overridden.
31
31
"spec" }
32
32
33
33
serverFields = append (slices .Clone (extensionFields ),
34
- "name" , "class" , "integration" , "image" , "imageFrom" , "unstable_naming" , "replicas" , " spec" )
34
+ "name" , "class" , "integration" , "image" , "imageFrom" , "unstable_naming" , "spec" )
35
35
)
36
36
37
37
type cueServer struct {
38
38
Name string `json:"name"`
39
39
Class string `json:"class"`
40
40
41
- Replicas int32 `json:"replicas"`
42
-
43
41
cueServerExtension
44
42
}
45
43
@@ -65,6 +63,8 @@ type cueServerExtension struct {
65
63
66
64
TerminationGracePeriodSeconds int64 `json:"terminationGracePeriodSeconds,omitempty"`
67
65
66
+ Replicas int32 `json:"replicas"`
67
+
68
68
Extensions []string `json:"extensions,omitempty"`
69
69
}
70
70
@@ -100,7 +100,6 @@ func parseCueServer(ctx context.Context, env *schema.Environment, pl parsing.Ear
100
100
Name : bits .Name ,
101
101
Framework : schema .Framework_OPAQUE ,
102
102
RunByDefault : true ,
103
- Replicas : bits .Replicas ,
104
103
Self : fragment ,
105
104
}
106
105
@@ -111,9 +110,6 @@ func parseCueServer(ctx context.Context, env *schema.Environment, pl parsing.Ear
111
110
out .DeployableClass = string (schema .DeployableClass_STATEFUL )
112
111
case "daemonset" , string (schema .DeployableClass_DAEMONSET ):
113
112
out .DeployableClass = string (schema .DeployableClass_DAEMONSET )
114
- if bits .Replicas > 0 {
115
- return nil , fnerrors .NewWithLocation (loc , "daemon set deployments do not support custom replica counts" )
116
- }
117
113
default :
118
114
return nil , fnerrors .NewWithLocation (loc , "%s: server class is not supported" , bits .Class )
119
115
}
@@ -388,6 +384,10 @@ func parseServerExtension(ctx context.Context, env *schema.Environment, pl parsi
388
384
})
389
385
}
390
386
387
+ if bits .Replicas > 0 {
388
+ out .Replicas = bits .Replicas
389
+ }
390
+
391
391
for _ , ext := range bits .Extensions {
392
392
pkg := schema .PackageName (ext )
393
393
if err := invariants .EnsurePackageLoaded (ctx , pl , loc .PackageName , pkg ); err != nil {
0 commit comments