You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/08/03 14:21:02 UTC

[GitHub] [camel-k] astefanutti commented on a diff in pull request #3511: re-deployment strategies

astefanutti commented on code in PR #3511:
URL: https://github.com/apache/camel-k/pull/3511#discussion_r936715248


##########
pkg/apis/camel/v1/trait/deployment.go:
##########
@@ -26,4 +30,19 @@ type DeploymentTrait struct {
 	// The maximum time in seconds for the deployment to make progress before it
 	// is considered to be failed. It defaults to 60s.
 	ProgressDeadlineSeconds *int32 `property:"progress-deadline-seconds" json:"progressDeadlineSeconds,omitempty"`
+	// The deployment strategy to use to replace existing pods with new ones.
+	Strategy appsv1.DeploymentStrategyType `property:"strategy" json:"strategy,omitempty"`

Review Comment:
   The CRDs need to be regenerated.



##########
pkg/apis/camel/v1/trait/deployment.go:
##########
@@ -26,4 +30,19 @@ type DeploymentTrait struct {
 	// The maximum time in seconds for the deployment to make progress before it
 	// is considered to be failed. It defaults to 60s.
 	ProgressDeadlineSeconds *int32 `property:"progress-deadline-seconds" json:"progressDeadlineSeconds,omitempty"`
+	// The deployment strategy to use to replace existing pods with new ones.
+	Strategy appsv1.DeploymentStrategyType `property:"strategy" json:"strategy,omitempty"`
+	// The maximum number of pods that can be unavailable during the update.
+	// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
+	// Absolute number is calculated from percentage by rounding down.
+	// This can not be 0 if MaxSurge is 0.
+	// Defaults to 25%.
+	RollingUpdateMaxUnavailable *int `property:"rolling-update-max-unavailable" json:"rollingUpdateMaxUnavailable,omitempty"`

Review Comment:
   Ideally rules to the CRDs for validation that these can only be set when the strategy is `RollingUpdate`, should be added with `x-kubernetes-validations`, but I don't think kubebuilder supports that yet.



##########
pkg/apis/camel/v1/trait/deployment.go:
##########
@@ -26,4 +30,19 @@ type DeploymentTrait struct {
 	// The maximum time in seconds for the deployment to make progress before it
 	// is considered to be failed. It defaults to 60s.
 	ProgressDeadlineSeconds *int32 `property:"progress-deadline-seconds" json:"progressDeadlineSeconds,omitempty"`
+	// The deployment strategy to use to replace existing pods with new ones.
+	Strategy appsv1.DeploymentStrategyType `property:"strategy" json:"strategy,omitempty"`

Review Comment:
   I wonder if adding `// +kubebuilder:validation:Enum=Recreate;RollingUpdate` would work.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org