File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -378,6 +378,11 @@ func (c *CanaryDeployer) createPrimaryDeployment(cd *flaggerv1.Canary) error {
378378 return err
379379 }
380380
381+ replicas := int32 (1 )
382+ if canaryDep .Spec .Replicas != nil && * canaryDep .Spec .Replicas > 0 {
383+ replicas = * canaryDep .Spec .Replicas
384+ }
385+
381386 // create primary deployment
382387 primaryDep = & appsv1.Deployment {
383388 ObjectMeta : metav1.ObjectMeta {
@@ -396,7 +401,7 @@ func (c *CanaryDeployer) createPrimaryDeployment(cd *flaggerv1.Canary) error {
396401 ProgressDeadlineSeconds : canaryDep .Spec .ProgressDeadlineSeconds ,
397402 MinReadySeconds : canaryDep .Spec .MinReadySeconds ,
398403 RevisionHistoryLimit : canaryDep .Spec .RevisionHistoryLimit ,
399- Replicas : canaryDep . Spec . Replicas ,
404+ Replicas : int32p ( replicas ) ,
400405 Strategy : canaryDep .Spec .Strategy ,
401406 Selector : & metav1.LabelSelector {
402407 MatchLabels : map [string ]string {
You can’t perform that action at this time.
0 commit comments