Add Replicas field to DeploymentParams struct#129
Conversation
pkg/devfile/generator/generators.go
Outdated
| Containers []corev1.Container | ||
| Volumes []corev1.Volume | ||
| PodSelectorLabels map[string]string | ||
| Replicas int32 |
There was a problem hiding this comment.
I would set the Replicas as a pointer, to make it optional (the nil value indicating the user does not want to set it). The 0 value on which you test below is a valid value a user would want to set.
pkg/devfile/generator/generators.go
Outdated
| } | ||
|
|
||
| if deployParams.Replicas != nil { | ||
| deployment.Spec.Replicas = deployParams.Replicas |
There was a problem hiding this comment.
I think that this affectation should be done in getDeploymentSpec which is the dedicated function for this.
There was a problem hiding this comment.
I agree. That's where I first looked. But that would mean changing the signature of getDeploymentSpec. I was not sure if that would be OK. But it's an internal function, so changing signature shouldn't be a big deal.
Pushed 4a544b1. PTAL.
|
the changes look good, just need to pass the ci, and I will add the label |
|
/approve |
|
@yangcao77 do I need to make any changes to the PR? Would |
|
@dharmit yes, please run |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dharmit, yangcao77 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What does this PR do?:
Adds
Replicasfield toDeploymentParamsstruct. This will help initialize a Deployment with Replica set to what the tooling would like to have. By default, library doesn't set it to anything at the moment.Which issue(s) this PR fixes:
redhat-developer/odo#5347
PR acceptance criteria:
Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened.
Unit/Functional tests
QE Integration test
Documentation
Client Impact
How to test changes / Special notes to the reviewer: