-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a Rolling deployment strategy
Implement a rolling deployment strategy which piggybacks on the upstream RollingUpdater functionality.
- Loading branch information
1 parent
3f3b951
commit 4ad08f1
Showing
26 changed files
with
918 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package v1beta1 | ||
|
||
import ( | ||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api" | ||
|
||
deployapi "github.com/openshift/origin/pkg/deploy/api" | ||
) | ||
|
||
func init() { | ||
mkintp := func(i int) *int64 { | ||
v := int64(i) | ||
return &v | ||
} | ||
|
||
err := api.Scheme.AddDefaultingFuncs( | ||
func(obj *deployapi.DeploymentStrategy) { | ||
if len(obj.Type) == 0 { | ||
obj.Type = deployapi.DeploymentStrategyTypeRolling | ||
} | ||
|
||
if obj.Type == deployapi.DeploymentStrategyTypeRolling && obj.RollingParams == nil { | ||
obj.RollingParams = &deployapi.RollingDeploymentStrategyParams{ | ||
IntervalSeconds: mkintp(1), | ||
UpdatePeriodSeconds: mkintp(1), | ||
TimeoutSeconds: mkintp(120), | ||
} | ||
} | ||
}, | ||
func(obj *deployapi.RollingDeploymentStrategyParams) { | ||
if obj.IntervalSeconds == nil { | ||
obj.IntervalSeconds = mkintp(1) | ||
} | ||
|
||
if obj.UpdatePeriodSeconds == nil { | ||
obj.UpdatePeriodSeconds = mkintp(1) | ||
} | ||
|
||
if obj.TimeoutSeconds == nil { | ||
obj.TimeoutSeconds = mkintp(120) | ||
} | ||
}, | ||
) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
Oops, something went wrong.