Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement(container): configurable deployment strategy #3293

Merged
merged 4 commits into from
Oct 12, 2022

Conversation

vvagaytsev
Copy link
Collaborator

What this PR does / why we need it:
This PR makes the deployment strategy configurable for container module type.

Which issue(s) this PR fixes:

Fixes #3237

Special notes for your reviewer:
Please check my comments in the change set.

The changes are backwards compatible.
The compatibility is ensured by the default values of the new configuration entry `deploymentStrategy`.
The default value is "RollingUpdate".
Validation ensures the informative error messages.
The new config option is still marked as required, despite there is a default value.
Haven't found a way to mark it as an optional in the generated docs.
@@ -742,6 +747,11 @@ const containerServiceSchema = () =>
),
addCapabilities: containerAddCapabilitiesSchema("service"),
dropCapabilities: containerDropCapabilitiesSchema("service"),
deploymentStrategy: joi
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compatibility is ensured by the default value here.
The default value is "RollingUpdate".
Validation ensures informative error messages.

@@ -134,6 +138,7 @@ export interface ContainerServiceSpec extends CommonServiceSpec {
tty?: boolean
addCapabilities?: string[]
dropCapabilities?: string[]
deploymentStrategy: DeploymentStrategy
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field is not optional, but the changes are backward compatible. There is a default value supplied by the validator, see the comment below.

I had to modify the tests, but it's better to prefer doing extra modifications in tests instead of having an optional field and extra (in fact, redundant) default value logic in the production code.

@vvagaytsev vvagaytsev marked this pull request as ready for review October 10, 2022 13:36
@vvagaytsev vvagaytsev marked this pull request as draft October 10, 2022 15:09
@vvagaytsev
Copy link
Collaborator Author

Converted to draft, there are some test failures.

@vvagaytsev vvagaytsev marked this pull request as ready for review October 10, 2022 17:47
@vvagaytsev vvagaytsev merged commit f6e7cfd into main Oct 12, 2022
@vvagaytsev vvagaytsev deleted the improvement/configurable-deployment-strategy branch October 12, 2022 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]: deploymentStrategy. should be available in container module
2 participants