| ... | ... |
@@ -21098,7 +21098,7 @@ |
| 21098 | 21098 |
"properties": {
|
| 21099 | 21099 |
"latestVersion": {
|
| 21100 | 21100 |
"type": "integer", |
| 21101 |
- "format": "int32", |
|
| 21101 |
+ "format": "int64", |
|
| 21102 | 21102 |
"description": "LatestVersion is used to determine whether the current deployment associated with a DeploymentConfig is out of sync." |
| 21103 | 21103 |
}, |
| 21104 | 21104 |
"details": {
|
| ... | ... |
@@ -21515,7 +21515,7 @@ |
| 21515 | 21515 |
"size": {
|
| 21516 | 21516 |
"type": "integer", |
| 21517 | 21517 |
"format": "int64", |
| 21518 |
- "description": "Size of the layer as defined by the underlying store." |
|
| 21518 |
+ "description": "Size of the layer in bytes as defined by the underlying store." |
|
| 21519 | 21519 |
} |
| 21520 | 21520 |
} |
| 21521 | 21521 |
}, |
| ... | ... |
@@ -1006,7 +1006,7 @@ func deepCopy_v1beta3_BuildRequest(in apiv1beta3.BuildRequest, out *apiv1beta3.B |
| 1006 | 1006 |
out.Binary = nil |
| 1007 | 1007 |
} |
| 1008 | 1008 |
if in.LastVersion != nil {
|
| 1009 |
- out.LastVersion = new(int) |
|
| 1009 |
+ out.LastVersion = new(int64) |
|
| 1010 | 1010 |
*out.LastVersion = *in.LastVersion |
| 1011 | 1011 |
} else {
|
| 1012 | 1012 |
out.LastVersion = nil |
| ... | ... |
@@ -1896,7 +1896,7 @@ func deepCopy_v1beta3_RollingDeploymentStrategyParams(in deployapiv1beta3.Rollin |
| 1896 | 1896 |
out.MaxSurge = nil |
| 1897 | 1897 |
} |
| 1898 | 1898 |
if in.UpdatePercent != nil {
|
| 1899 |
- out.UpdatePercent = new(int) |
|
| 1899 |
+ out.UpdatePercent = new(int32) |
|
| 1900 | 1900 |
*out.UpdatePercent = *in.UpdatePercent |
| 1901 | 1901 |
} else {
|
| 1902 | 1902 |
out.UpdatePercent = nil |
| ... | ... |
@@ -320,7 +320,7 @@ func DeepCopy_api_BuildRequest(in BuildRequest, out *BuildRequest, c *conversion |
| 320 | 320 |
} |
| 321 | 321 |
if in.LastVersion != nil {
|
| 322 | 322 |
in, out := in.LastVersion, &out.LastVersion |
| 323 |
- *out = new(int) |
|
| 323 |
+ *out = new(int64) |
|
| 324 | 324 |
**out = *in |
| 325 | 325 |
} else {
|
| 326 | 326 |
out.LastVersion = nil |
| ... | ... |
@@ -336,7 +336,7 @@ func Convert_api_BuildConfigSpec_To_v1_BuildConfigSpec(in *build_api.BuildConfig |
| 336 | 336 |
} |
| 337 | 337 |
|
| 338 | 338 |
func autoConvert_v1_BuildConfigStatus_To_api_BuildConfigStatus(in *BuildConfigStatus, out *build_api.BuildConfigStatus, s conversion.Scope) error {
|
| 339 |
- out.LastVersion = in.LastVersion |
|
| 339 |
+ out.LastVersion = int64(in.LastVersion) |
|
| 340 | 340 |
return nil |
| 341 | 341 |
} |
| 342 | 342 |
|
| ... | ... |
@@ -345,7 +345,7 @@ func Convert_v1_BuildConfigStatus_To_api_BuildConfigStatus(in *BuildConfigStatus |
| 345 | 345 |
} |
| 346 | 346 |
|
| 347 | 347 |
func autoConvert_api_BuildConfigStatus_To_v1_BuildConfigStatus(in *build_api.BuildConfigStatus, out *BuildConfigStatus, s conversion.Scope) error {
|
| 348 |
- out.LastVersion = in.LastVersion |
|
| 348 |
+ out.LastVersion = int(in.LastVersion) |
|
| 349 | 349 |
return nil |
| 350 | 350 |
} |
| 351 | 351 |
|
| ... | ... |
@@ -677,8 +677,8 @@ func autoConvert_v1_BuildRequest_To_api_BuildRequest(in *BuildRequest, out *buil |
| 677 | 677 |
} |
| 678 | 678 |
if in.LastVersion != nil {
|
| 679 | 679 |
in, out := &in.LastVersion, &out.LastVersion |
| 680 |
- *out = new(int) |
|
| 681 |
- **out = **in |
|
| 680 |
+ *out = new(int64) |
|
| 681 |
+ **out = int64(**in) |
|
| 682 | 682 |
} else {
|
| 683 | 683 |
out.LastVersion = nil |
| 684 | 684 |
} |
| ... | ... |
@@ -761,7 +761,7 @@ func autoConvert_api_BuildRequest_To_v1_BuildRequest(in *build_api.BuildRequest, |
| 761 | 761 |
if in.LastVersion != nil {
|
| 762 | 762 |
in, out := &in.LastVersion, &out.LastVersion |
| 763 | 763 |
*out = new(int) |
| 764 |
- **out = **in |
|
| 764 |
+ **out = int(**in) |
|
| 765 | 765 |
} else {
|
| 766 | 766 |
out.LastVersion = nil |
| 767 | 767 |
} |
| ... | ... |
@@ -62,7 +62,7 @@ func (c *BuildConfigController) HandleBuildConfig(bc *buildapi.BuildConfig) erro |
| 62 | 62 |
|
| 63 | 63 |
buildTriggerCauses := []buildapi.BuildTriggerCause{}
|
| 64 | 64 |
// instantiate new build |
| 65 |
- lastVersion := 0 |
|
| 65 |
+ lastVersion := int64(0) |
|
| 66 | 66 |
request := &buildapi.BuildRequest{
|
| 67 | 67 |
TriggeredBy: append(buildTriggerCauses, |
| 68 | 68 |
buildapi.BuildTriggerCause{
|
| ... | ... |
@@ -266,7 +266,7 @@ func (g *BuildGenerator) Instantiate(ctx kapi.Context, request *buildapi.BuildRe |
| 266 | 266 |
|
| 267 | 267 |
// checkBuildConfigLastVersion will return an error if the BuildConfig's LastVersion doesn't match the passed in lastVersion |
| 268 | 268 |
// when lastVersion is not nil |
| 269 |
-func (g *BuildGenerator) checkLastVersion(bc *buildapi.BuildConfig, lastVersion *int) error {
|
|
| 269 |
+func (g *BuildGenerator) checkLastVersion(bc *buildapi.BuildConfig, lastVersion *int64) error {
|
|
| 270 | 270 |
if lastVersion != nil && bc.Status.LastVersion != *lastVersion {
|
| 271 | 271 |
glog.V(2).Infof("Aborting version triggered build for BuildConfig %s/%s because the BuildConfig LastVersion (%d) does not match the requested LastVersion (%d)", bc.Namespace, bc.Name, bc.Status.LastVersion, *lastVersion)
|
| 272 | 272 |
return fmt.Errorf("the LastVersion(%v) on build config %s/%s does not match the build request LastVersion(%d)",
|
| ... | ... |
@@ -429,7 +429,7 @@ func (g *BuildGenerator) generateBuildFromConfig(ctx kapi.Context, bc *buildapi. |
| 429 | 429 |
if build.Annotations == nil {
|
| 430 | 430 |
build.Annotations = make(map[string]string) |
| 431 | 431 |
} |
| 432 |
- build.Annotations[buildapi.BuildNumberAnnotation] = strconv.Itoa(bc.Status.LastVersion) |
|
| 432 |
+ build.Annotations[buildapi.BuildNumberAnnotation] = strconv.FormatInt(bc.Status.LastVersion, 10) |
|
| 433 | 433 |
build.Annotations[buildapi.BuildConfigAnnotation] = bcCopy.Name |
| 434 | 434 |
if build.Labels == nil {
|
| 435 | 435 |
build.Labels = make(map[string]string) |
| ... | ... |
@@ -703,7 +703,7 @@ func generateBuildFromBuild(build *buildapi.Build, buildConfig *buildapi.BuildCo |
| 703 | 703 |
} |
| 704 | 704 |
newBuild.Annotations[buildapi.BuildCloneAnnotation] = build.Name |
| 705 | 705 |
if buildConfig != nil {
|
| 706 |
- newBuild.Annotations[buildapi.BuildNumberAnnotation] = strconv.Itoa(buildConfig.Status.LastVersion) |
|
| 706 |
+ newBuild.Annotations[buildapi.BuildNumberAnnotation] = strconv.FormatInt(buildConfig.Status.LastVersion, 10) |
|
| 707 | 707 |
} else {
|
| 708 | 708 |
// builds without a buildconfig don't have build numbers. |
| 709 | 709 |
delete(newBuild.Annotations, buildapi.BuildNumberAnnotation) |
| ... | ... |
@@ -327,7 +327,7 @@ func TestInstantiateWithLastVersion(t *testing.T) {
|
| 327 | 327 |
} |
| 328 | 328 |
|
| 329 | 329 |
// Version specified and it matches |
| 330 |
- lastVersion := 1 |
|
| 330 |
+ lastVersion := int64(1) |
|
| 331 | 331 |
_, err = g.Instantiate(kapi.NewDefaultContext(), &buildapi.BuildRequest{LastVersion: &lastVersion})
|
| 332 | 332 |
if err != nil {
|
| 333 | 333 |
t.Errorf("Unexpected error %v", err)
|
| ... | ... |
@@ -1177,7 +1177,7 @@ func TestGetNextBuildName(t *testing.T) {
|
| 1177 | 1177 |
if expected, actual := bc.Name+"-1", getNextBuildName(bc); expected != actual {
|
| 1178 | 1178 |
t.Errorf("Wrong buildName, expected %s, got %s", expected, actual)
|
| 1179 | 1179 |
} |
| 1180 |
- if expected, actual := 1, bc.Status.LastVersion; expected != actual {
|
|
| 1180 |
+ if expected, actual := int64(1), bc.Status.LastVersion; expected != actual {
|
|
| 1181 | 1181 |
t.Errorf("Wrong version, expected %d, got %d", expected, actual)
|
| 1182 | 1182 |
} |
| 1183 | 1183 |
} |
| ... | ... |
@@ -24,7 +24,7 @@ var ( |
| 24 | 24 |
configName = strings.Repeat("a", validation.DNS1123LabelMaxLength)
|
| 25 | 25 |
) |
| 26 | 26 |
|
| 27 |
-func makeBuildConfig(version int, deleting bool) *buildapi.BuildConfig {
|
|
| 27 |
+func makeBuildConfig(version int64, deleting bool) *buildapi.BuildConfig {
|
|
| 28 | 28 |
ret := &buildapi.BuildConfig{
|
| 29 | 29 |
ObjectMeta: kapi.ObjectMeta{
|
| 30 | 30 |
Name: configName, |
| ... | ... |
@@ -92,7 +92,7 @@ type RegistryConfig struct {
|
| 92 | 92 |
Type string |
| 93 | 93 |
ImageTemplate variable.ImageTemplate |
| 94 | 94 |
Ports string |
| 95 |
- Replicas int |
|
| 95 |
+ Replicas int32 |
|
| 96 | 96 |
Labels string |
| 97 | 97 |
Volume string |
| 98 | 98 |
HostMount string |
| ... | ... |
@@ -161,7 +161,7 @@ func NewCmdRegistry(f *clientcmd.Factory, parentName, name string, out io.Writer |
| 161 | 161 |
cmd.Flags().StringVar(&cfg.ImageTemplate.Format, "images", cfg.ImageTemplate.Format, "The image to base this registry on - ${component} will be replaced with --type")
|
| 162 | 162 |
cmd.Flags().BoolVar(&cfg.ImageTemplate.Latest, "latest-images", cfg.ImageTemplate.Latest, "If true, attempt to use the latest image for the registry instead of the latest release.") |
| 163 | 163 |
cmd.Flags().StringVar(&cfg.Ports, "ports", cfg.Ports, fmt.Sprintf("A comma delimited list of ports or port pairs to expose on the registry pod. The default is set for %d.", defaultPort))
|
| 164 |
- cmd.Flags().IntVar(&cfg.Replicas, "replicas", cfg.Replicas, "The replication factor of the registry; commonly 2 when high availability is desired.") |
|
| 164 |
+ cmd.Flags().Int32Var(&cfg.Replicas, "replicas", cfg.Replicas, "The replication factor of the registry; commonly 2 when high availability is desired.") |
|
| 165 | 165 |
cmd.Flags().StringVar(&cfg.Labels, "labels", cfg.Labels, "A set of labels to uniquely identify the registry and its components.") |
| 166 | 166 |
cmd.Flags().StringVar(&cfg.Volume, "volume", cfg.Volume, "The volume path to use for registry storage; defaults to /registry which is the default for origin-docker-registry.") |
| 167 | 167 |
cmd.Flags().StringVar(&cfg.HostMount, "mount-host", cfg.HostMount, "If set, the registry volume will be created as a host-mount at this path.") |
| ... | ... |
@@ -110,7 +110,7 @@ type RouterConfig struct {
|
| 110 | 110 |
Ports string |
| 111 | 111 |
|
| 112 | 112 |
// Replicas specifies the initial replica count for the router. |
| 113 |
- Replicas int |
|
| 113 |
+ Replicas int32 |
|
| 114 | 114 |
|
| 115 | 115 |
// Labels specifies the label or labels that will be assigned to the router |
| 116 | 116 |
// pod. |
| ... | ... |
@@ -248,7 +248,7 @@ func NewCmdRouter(f *clientcmd.Factory, parentName, name string, out io.Writer) |
| 248 | 248 |
cmd.Flags().StringVar(&cfg.ImageTemplate.Format, "images", cfg.ImageTemplate.Format, "The image to base this router on - ${component} will be replaced with --type")
|
| 249 | 249 |
cmd.Flags().BoolVar(&cfg.ImageTemplate.Latest, "latest-images", cfg.ImageTemplate.Latest, "If true, attempt to use the latest images for the router instead of the latest release.") |
| 250 | 250 |
cmd.Flags().StringVar(&cfg.Ports, "ports", cfg.Ports, "A comma delimited list of ports or port pairs to expose on the router pod. The default is set for HAProxy. Port pairs are applied to the service and to host ports (if specified).") |
| 251 |
- cmd.Flags().IntVar(&cfg.Replicas, "replicas", cfg.Replicas, "The replication factor of the router; commonly 2 when high availability is desired.") |
|
| 251 |
+ cmd.Flags().Int32Var(&cfg.Replicas, "replicas", cfg.Replicas, "The replication factor of the router; commonly 2 when high availability is desired.") |
|
| 252 | 252 |
cmd.Flags().StringVar(&cfg.Labels, "labels", cfg.Labels, "A set of labels to uniquely identify the router and its components.") |
| 253 | 253 |
cmd.Flags().BoolVar(&cfg.SecretsAsEnv, "secrets-as-env", cfg.SecretsAsEnv, "Use environment variables for master secrets.") |
| 254 | 254 |
cmd.Flags().Bool("create", false, "deprecated; this is now the default behavior")
|
| ... | ... |
@@ -711,7 +711,7 @@ func RunCmdRouter(f *clientcmd.Factory, cmd *cobra.Command, out io.Writer, cfg * |
| 711 | 711 |
}, |
| 712 | 712 |
) |
| 713 | 713 |
} |
| 714 |
- updatePercent := int(-25) |
|
| 714 |
+ updatePercent := int32(-25) |
|
| 715 | 715 |
objects = append(objects, &deployapi.DeploymentConfig{
|
| 716 | 716 |
ObjectMeta: kapi.ObjectMeta{
|
| 717 | 717 |
Name: name, |
| ... | ... |
@@ -336,7 +336,7 @@ func (o DeployOptions) cancel(config *deployapi.DeploymentConfig, out io.Writer) |
| 336 | 336 |
anyCancelled = true |
| 337 | 337 |
} else {
|
| 338 | 338 |
fmt.Fprintf(out, "Couldn't cancel deployment #%d (status: %s): %v\n", deployutil.DeploymentVersionFor(&deployment), status, err) |
| 339 |
- failedCancellations = append(failedCancellations, strconv.Itoa(deployutil.DeploymentVersionFor(&deployment))) |
|
| 339 |
+ failedCancellations = append(failedCancellations, strconv.FormatInt(deployutil.DeploymentVersionFor(&deployment), 10)) |
|
| 340 | 340 |
} |
| 341 | 341 |
} |
| 342 | 342 |
} |
| ... | ... |
@@ -207,12 +207,12 @@ func TestCmdDeploy_retryRejectNonFailed(t *testing.T) {
|
| 207 | 207 |
// and none of the completed/faild ones. |
| 208 | 208 |
func TestCmdDeploy_cancelOk(t *testing.T) {
|
| 209 | 209 |
type existing struct {
|
| 210 |
- version int |
|
| 210 |
+ version int64 |
|
| 211 | 211 |
status deployapi.DeploymentStatus |
| 212 | 212 |
shouldCancel bool |
| 213 | 213 |
} |
| 214 | 214 |
type scenario struct {
|
| 215 |
- version int |
|
| 215 |
+ version int64 |
|
| 216 | 216 |
existing []existing |
| 217 | 217 |
} |
| 218 | 218 |
|
| ... | ... |
@@ -262,8 +262,8 @@ func TestCmdDeploy_cancelOk(t *testing.T) {
|
| 262 | 262 |
t.Fatalf("unexpected error: %v", err)
|
| 263 | 263 |
} |
| 264 | 264 |
|
| 265 |
- expectedCancellations := []int{}
|
|
| 266 |
- actualCancellations := []int{}
|
|
| 265 |
+ expectedCancellations := []int64{}
|
|
| 266 |
+ actualCancellations := []int64{}
|
|
| 267 | 267 |
for _, e := range scenario.existing {
|
| 268 | 268 |
if e.shouldCancel {
|
| 269 | 269 |
expectedCancellations = append(expectedCancellations, e.version) |
| ... | ... |
@@ -273,14 +273,20 @@ func TestCmdDeploy_cancelOk(t *testing.T) {
|
| 273 | 273 |
actualCancellations = append(actualCancellations, deployutil.DeploymentVersionFor(&d)) |
| 274 | 274 |
} |
| 275 | 275 |
|
| 276 |
- sort.Ints(actualCancellations) |
|
| 277 |
- sort.Ints(expectedCancellations) |
|
| 276 |
+ sort.Sort(Int64Slice(actualCancellations)) |
|
| 277 |
+ sort.Sort(Int64Slice(expectedCancellations)) |
|
| 278 | 278 |
if !reflect.DeepEqual(actualCancellations, expectedCancellations) {
|
| 279 | 279 |
t.Fatalf("expected cancellations: %v, actual: %v", expectedCancellations, actualCancellations)
|
| 280 | 280 |
} |
| 281 | 281 |
} |
| 282 | 282 |
} |
| 283 | 283 |
|
| 284 |
+type Int64Slice []int64 |
|
| 285 |
+ |
|
| 286 |
+func (p Int64Slice) Len() int { return len(p) }
|
|
| 287 |
+func (p Int64Slice) Less(i, j int) bool { return p[i] < p[j] }
|
|
| 288 |
+func (p Int64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
|
|
| 289 |
+ |
|
| 284 | 290 |
func TestDeploy_reenableTriggers(t *testing.T) {
|
| 285 | 291 |
mktrigger := func() deployapi.DeploymentTriggerPolicy {
|
| 286 | 292 |
t := deploytest.OkImageChangeTrigger() |
| ... | ... |
@@ -87,7 +87,7 @@ func NewCmdRollback(fullName string, f *clientcmd.Factory, out io.Writer) *cobra |
| 87 | 87 |
cmd.Flags().StringVarP(&opts.Format, "output", "o", "", "Instead of performing the rollback, print the updated deployment configuration in the specified format (json|yaml|name|template|templatefile)") |
| 88 | 88 |
cmd.Flags().StringVarP(&opts.Template, "template", "t", "", "Template string or path to template file to use when -o=template or -o=templatefile.") |
| 89 | 89 |
cmd.MarkFlagFilename("template")
|
| 90 |
- cmd.Flags().IntVar(&opts.DesiredVersion, "to-version", 0, "A config version to rollback to. Specifying version 0 is the same as omitting a version (the version will be auto-detected). This option is ignored when specifying a deployment.") |
|
| 90 |
+ cmd.Flags().Int64Var(&opts.DesiredVersion, "to-version", 0, "A config version to rollback to. Specifying version 0 is the same as omitting a version (the version will be auto-detected). This option is ignored when specifying a deployment.") |
|
| 91 | 91 |
|
| 92 | 92 |
return cmd |
| 93 | 93 |
} |
| ... | ... |
@@ -96,7 +96,7 @@ func NewCmdRollback(fullName string, f *clientcmd.Factory, out io.Writer) *cobra |
| 96 | 96 |
type RollbackOptions struct {
|
| 97 | 97 |
Namespace string |
| 98 | 98 |
TargetName string |
| 99 |
- DesiredVersion int |
|
| 99 |
+ DesiredVersion int64 |
|
| 100 | 100 |
Format string |
| 101 | 101 |
Template string |
| 102 | 102 |
DryRun bool |
| ... | ... |
@@ -319,7 +319,7 @@ func (o *RollbackOptions) findResource(targetName string) (runtime.Object, error |
| 319 | 319 |
// the deployment matching desiredVersion will be returned. If desiredVersion |
| 320 | 320 |
// is <=0, the last completed deployment which is older than the config's |
| 321 | 321 |
// version will be returned. |
| 322 |
-func (o *RollbackOptions) findTargetDeployment(config *deployapi.DeploymentConfig, desiredVersion int) (*kapi.ReplicationController, error) {
|
|
| 322 |
+func (o *RollbackOptions) findTargetDeployment(config *deployapi.DeploymentConfig, desiredVersion int64) (*kapi.ReplicationController, error) {
|
|
| 323 | 323 |
// Find deployments for the config sorted by version descending. |
| 324 | 324 |
deployments, err := o.kc.ReplicationControllers(config.Namespace).List(kapi.ListOptions{LabelSelector: deployutil.ConfigSelector(config.Name)})
|
| 325 | 325 |
if err != nil {
|
| ... | ... |
@@ -13,15 +13,15 @@ import ( |
| 13 | 13 |
|
| 14 | 14 |
func TestRollbackOptions_findTargetDeployment(t *testing.T) {
|
| 15 | 15 |
type existingDeployment struct {
|
| 16 |
- version int |
|
| 16 |
+ version int64 |
|
| 17 | 17 |
status deployapi.DeploymentStatus |
| 18 | 18 |
} |
| 19 | 19 |
tests := []struct {
|
| 20 | 20 |
name string |
| 21 |
- configVersion int |
|
| 22 |
- desiredVersion int |
|
| 21 |
+ configVersion int64 |
|
| 22 |
+ desiredVersion int64 |
|
| 23 | 23 |
existing []existingDeployment |
| 24 |
- expectedVersion int |
|
| 24 |
+ expectedVersion int64 |
|
| 25 | 25 |
errorExpected bool |
| 26 | 26 |
}{
|
| 27 | 27 |
{
|
| ... | ... |
@@ -65,7 +65,7 @@ func (d *DeploymentConfigDescriber) Describe(namespace, name string, settings kc |
| 65 | 65 |
if deploymentConfig.Status.LatestVersion == 0 {
|
| 66 | 66 |
formatString(out, "Latest Version", "Not deployed") |
| 67 | 67 |
} else {
|
| 68 |
- formatString(out, "Latest Version", strconv.Itoa(deploymentConfig.Status.LatestVersion)) |
|
| 68 |
+ formatString(out, "Latest Version", strconv.FormatInt(deploymentConfig.Status.LatestVersion, 10)) |
|
| 69 | 69 |
} |
| 70 | 70 |
|
| 71 | 71 |
printDeploymentConfigSpec(d.kubeClient, *deploymentConfig, out) |
| ... | ... |
@@ -413,7 +413,7 @@ func (d *BuildConfigDescriber) Describe(namespace, name string, settings kctl.De |
| 413 | 413 |
if buildConfig.Status.LastVersion == 0 {
|
| 414 | 414 |
formatString(out, "Latest Version", "Never built") |
| 415 | 415 |
} else {
|
| 416 |
- formatString(out, "Latest Version", strconv.Itoa(buildConfig.Status.LastVersion)) |
|
| 416 |
+ formatString(out, "Latest Version", strconv.FormatInt(buildConfig.Status.LastVersion, 10)) |
|
| 417 | 417 |
} |
| 418 | 418 |
describeCommonSpec(buildConfig.Spec.CommonSpec, out) |
| 419 | 419 |
formatString(out, "\nBuild Run Policy", string(buildConfig.Spec.RunPolicy)) |
| ... | ... |
@@ -499,14 +499,14 @@ func describeImage(image *imageapi.Image, imageName string) (string, error) {
|
| 499 | 499 |
formatString(out, "Image Size", units.HumanSize(float64(image.DockerImageMetadata.Size))) |
| 500 | 500 |
default: |
| 501 | 501 |
info := []string{}
|
| 502 |
- if image.DockerImageLayers[0].Size > 0 {
|
|
| 503 |
- info = append(info, fmt.Sprintf("first layer %s", units.HumanSize(float64(image.DockerImageLayers[0].Size))))
|
|
| 502 |
+ if image.DockerImageLayers[0].LayerSize > 0 {
|
|
| 503 |
+ info = append(info, fmt.Sprintf("first layer %s", units.HumanSize(float64(image.DockerImageLayers[0].LayerSize))))
|
|
| 504 | 504 |
} |
| 505 | 505 |
for i := l - 1; i > 0; i-- {
|
| 506 |
- if image.DockerImageLayers[i].Size == 0 {
|
|
| 506 |
+ if image.DockerImageLayers[i].LayerSize == 0 {
|
|
| 507 | 507 |
continue |
| 508 | 508 |
} |
| 509 |
- info = append(info, fmt.Sprintf("last binary layer %s", units.HumanSize(float64(image.DockerImageLayers[i].Size))))
|
|
| 509 |
+ info = append(info, fmt.Sprintf("last binary layer %s", units.HumanSize(float64(image.DockerImageLayers[i].LayerSize))))
|
|
| 510 | 510 |
break |
| 511 | 511 |
} |
| 512 | 512 |
if len(info) > 0 {
|
| ... | ... |
@@ -92,7 +92,7 @@ func NewCmdIPFailoverConfig(f *clientcmd.Factory, parentName, name string, out, |
| 92 | 92 |
|
| 93 | 93 |
cmd.Flags().IntVarP(&options.WatchPort, "watch-port", "w", ipfailover.DefaultWatchPort, "Port to monitor or watch for resource availability.") |
| 94 | 94 |
cmd.Flags().IntVar(&options.VRRPIDOffset, "vrrp-id-offset", options.VRRPIDOffset, "Offset to use for setting ids of VRRP instances (default offset is 0). This allows multiple ipfailover instances to run within the same cluster.") |
| 95 |
- cmd.Flags().IntVarP(&options.Replicas, "replicas", "r", options.Replicas, "The replication factor of this IP failover configuration; commonly 2 when high availability is desired. Please ensure this matches the number of nodes that satisfy the selector (or default selector) specified.") |
|
| 95 |
+ cmd.Flags().Int32VarP(&options.Replicas, "replicas", "r", options.Replicas, "The replication factor of this IP failover configuration; commonly 2 when high availability is desired. Please ensure this matches the number of nodes that satisfy the selector (or default selector) specified.") |
|
| 96 | 96 |
|
| 97 | 97 |
// autocompletion hints |
| 98 | 98 |
cmd.MarkFlagFilename("credentials", "kubeconfig")
|
| ... | ... |
@@ -240,7 +240,7 @@ func (d *Deployer) Deploy(namespace, rcName string) error {
|
| 240 | 240 |
} |
| 241 | 241 |
|
| 242 | 242 |
// Perform the deployment. |
| 243 |
- if err := s.Deploy(from, to, desiredReplicas); err != nil {
|
|
| 243 |
+ if err := s.Deploy(from, to, int(desiredReplicas)); err != nil {
|
|
| 244 | 244 |
return err |
| 245 | 245 |
} |
| 246 | 246 |
fmt.Fprintf(d.out, "--> Success\n") |
| ... | ... |
@@ -43,23 +43,23 @@ func TestDeployer_getDeploymentFail(t *testing.T) {
|
| 43 | 43 |
} |
| 44 | 44 |
|
| 45 | 45 |
func TestDeployer_deployScenarios(t *testing.T) {
|
| 46 |
- mkd := func(version int, status deployapi.DeploymentStatus, replicas int, desired int) *kapi.ReplicationController {
|
|
| 46 |
+ mkd := func(version int64, status deployapi.DeploymentStatus, replicas int32, desired int32) *kapi.ReplicationController {
|
|
| 47 | 47 |
deployment := mkdeployment(version, status) |
| 48 | 48 |
deployment.Spec.Replicas = int32(replicas) |
| 49 | 49 |
if desired > 0 {
|
| 50 |
- deployment.Annotations[deployapi.DesiredReplicasAnnotation] = strconv.Itoa(desired) |
|
| 50 |
+ deployment.Annotations[deployapi.DesiredReplicasAnnotation] = strconv.Itoa(int(desired)) |
|
| 51 | 51 |
} |
| 52 | 52 |
return deployment |
| 53 | 53 |
} |
| 54 | 54 |
type scaleEvent struct {
|
| 55 |
- version int |
|
| 56 |
- size int |
|
| 55 |
+ version int64 |
|
| 56 |
+ size int32 |
|
| 57 | 57 |
} |
| 58 | 58 |
scenarios := []struct {
|
| 59 | 59 |
name string |
| 60 | 60 |
deployments []*kapi.ReplicationController |
| 61 |
- fromVersion int |
|
| 62 |
- toVersion int |
|
| 61 |
+ fromVersion int64 |
|
| 62 |
+ toVersion int64 |
|
| 63 | 63 |
scaleEvents []scaleEvent |
| 64 | 64 |
}{
|
| 65 | 65 |
{
|
| ... | ... |
@@ -121,7 +121,7 @@ func TestDeployer_deployScenarios(t *testing.T) {
|
| 121 | 121 |
|
| 122 | 122 |
for _, s := range scenarios {
|
| 123 | 123 |
t.Logf("executing scenario %s", s.name)
|
| 124 |
- findDeployment := func(version int) *kapi.ReplicationController {
|
|
| 124 |
+ findDeployment := func(version int64) *kapi.ReplicationController {
|
|
| 125 | 125 |
for _, d := range s.deployments {
|
| 126 | 126 |
if deployutil.DeploymentVersionFor(d) == version {
|
| 127 | 127 |
return d |
| ... | ... |
@@ -131,7 +131,7 @@ func TestDeployer_deployScenarios(t *testing.T) {
|
| 131 | 131 |
} |
| 132 | 132 |
|
| 133 | 133 |
var actualFrom, actualTo *kapi.ReplicationController |
| 134 |
- var actualDesired int |
|
| 134 |
+ var actualDesired int32 |
|
| 135 | 135 |
to := findDeployment(s.toVersion) |
| 136 | 136 |
scaler := &scalertest.FakeScaler{}
|
| 137 | 137 |
|
| ... | ... |
@@ -143,7 +143,7 @@ func TestDeployer_deployScenarios(t *testing.T) {
|
| 143 | 143 |
deployFunc: func(from *kapi.ReplicationController, to *kapi.ReplicationController, desiredReplicas int) error {
|
| 144 | 144 |
actualFrom = from |
| 145 | 145 |
actualTo = to |
| 146 |
- actualDesired = desiredReplicas |
|
| 146 |
+ actualDesired = int32(desiredReplicas) |
|
| 147 | 147 |
return nil |
| 148 | 148 |
}, |
| 149 | 149 |
}, nil |
| ... | ... |
@@ -196,7 +196,7 @@ func TestDeployer_deployScenarios(t *testing.T) {
|
| 196 | 196 |
} |
| 197 | 197 |
} |
| 198 | 198 |
|
| 199 |
-func mkdeployment(version int, status deployapi.DeploymentStatus) *kapi.ReplicationController {
|
|
| 199 |
+func mkdeployment(version int64, status deployapi.DeploymentStatus) *kapi.ReplicationController {
|
|
| 200 | 200 |
deployment, _ := deployutil.MakeDeployment(deploytest.OkDeploymentConfig(version), kapi.Codecs.LegacyCodec(deployapi.SchemeGroupVersion)) |
| 201 | 201 |
deployment.Annotations[deployapi.DeploymentStatusAnnotation] = string(status) |
| 202 | 202 |
return deployment |
| ... | ... |
@@ -475,7 +475,7 @@ func DeepCopy_api_RollingDeploymentStrategyParams(in RollingDeploymentStrategyPa |
| 475 | 475 |
} |
| 476 | 476 |
if in.UpdatePercent != nil {
|
| 477 | 477 |
in, out := in.UpdatePercent, &out.UpdatePercent |
| 478 |
- *out = new(int) |
|
| 478 |
+ *out = new(int32) |
|
| 479 | 479 |
**out = *in |
| 480 | 480 |
} else {
|
| 481 | 481 |
out.UpdatePercent = nil |
| ... | ... |
@@ -16,7 +16,7 @@ const ( |
| 16 | 16 |
DockerImageReference = "registry:5000/openshift/test-image-stream@sha256:00000000000000000000000000000001" |
| 17 | 17 |
) |
| 18 | 18 |
|
| 19 |
-func OkDeploymentConfig(version int) *deployapi.DeploymentConfig {
|
|
| 19 |
+func OkDeploymentConfig(version int64) *deployapi.DeploymentConfig {
|
|
| 20 | 20 |
return &deployapi.DeploymentConfig{
|
| 21 | 21 |
ObjectMeta: kapi.ObjectMeta{
|
| 22 | 22 |
Name: "config", |
| ... | ... |
@@ -39,7 +39,7 @@ func OkDeploymentConfigSpec() deployapi.DeploymentConfigSpec {
|
| 39 | 39 |
} |
| 40 | 40 |
} |
| 41 | 41 |
|
| 42 |
-func OkDeploymentConfigStatus(version int) deployapi.DeploymentConfigStatus {
|
|
| 42 |
+func OkDeploymentConfigStatus(version int64) deployapi.DeploymentConfigStatus {
|
|
| 43 | 43 |
return deployapi.DeploymentConfigStatus{
|
| 44 | 44 |
LatestVersion: version, |
| 45 | 45 |
} |
| ... | ... |
@@ -65,7 +65,7 @@ func Test_convert_v1_RollingDeploymentStrategyParams_To_api_RollingDeploymentStr |
| 65 | 65 |
UpdatePeriodSeconds: newInt64(5), |
| 66 | 66 |
IntervalSeconds: newInt64(6), |
| 67 | 67 |
TimeoutSeconds: newInt64(7), |
| 68 |
- UpdatePercent: newInt(-25), |
|
| 68 |
+ UpdatePercent: newInt32(-25), |
|
| 69 | 69 |
Pre: &LifecycleHook{
|
| 70 | 70 |
FailurePolicy: LifecycleHookFailurePolicyIgnore, |
| 71 | 71 |
}, |
| ... | ... |
@@ -77,7 +77,7 @@ func Test_convert_v1_RollingDeploymentStrategyParams_To_api_RollingDeploymentStr |
| 77 | 77 |
UpdatePeriodSeconds: newInt64(5), |
| 78 | 78 |
IntervalSeconds: newInt64(6), |
| 79 | 79 |
TimeoutSeconds: newInt64(7), |
| 80 |
- UpdatePercent: newInt(-25), |
|
| 80 |
+ UpdatePercent: newInt32(-25), |
|
| 81 | 81 |
MaxSurge: intstr.FromInt(0), |
| 82 | 82 |
MaxUnavailable: intstr.FromString("25%"),
|
| 83 | 83 |
Pre: &newer.LifecycleHook{
|
| ... | ... |
@@ -93,13 +93,13 @@ func Test_convert_v1_RollingDeploymentStrategyParams_To_api_RollingDeploymentStr |
| 93 | 93 |
UpdatePeriodSeconds: newInt64(5), |
| 94 | 94 |
IntervalSeconds: newInt64(6), |
| 95 | 95 |
TimeoutSeconds: newInt64(7), |
| 96 |
- UpdatePercent: newInt(25), |
|
| 96 |
+ UpdatePercent: newInt32(25), |
|
| 97 | 97 |
}, |
| 98 | 98 |
out: &newer.RollingDeploymentStrategyParams{
|
| 99 | 99 |
UpdatePeriodSeconds: newInt64(5), |
| 100 | 100 |
IntervalSeconds: newInt64(6), |
| 101 | 101 |
TimeoutSeconds: newInt64(7), |
| 102 |
- UpdatePercent: newInt(25), |
|
| 102 |
+ UpdatePercent: newInt32(25), |
|
| 103 | 103 |
MaxSurge: intstr.FromString("25%"),
|
| 104 | 104 |
MaxUnavailable: intstr.FromInt(0), |
| 105 | 105 |
}, |
| ... | ... |
@@ -143,7 +143,7 @@ func Test_convert_api_RollingDeploymentStrategyParams_To_v1_RollingDeploymentStr |
| 143 | 143 |
UpdatePeriodSeconds: newInt64(5), |
| 144 | 144 |
IntervalSeconds: newInt64(6), |
| 145 | 145 |
TimeoutSeconds: newInt64(7), |
| 146 |
- UpdatePercent: newInt(-25), |
|
| 146 |
+ UpdatePercent: newInt32(-25), |
|
| 147 | 147 |
MaxSurge: intstr.FromInt(0), |
| 148 | 148 |
MaxUnavailable: intstr.FromString("25%"),
|
| 149 | 149 |
}, |
| ... | ... |
@@ -151,7 +151,7 @@ func Test_convert_api_RollingDeploymentStrategyParams_To_v1_RollingDeploymentStr |
| 151 | 151 |
UpdatePeriodSeconds: newInt64(5), |
| 152 | 152 |
IntervalSeconds: newInt64(6), |
| 153 | 153 |
TimeoutSeconds: newInt64(7), |
| 154 |
- UpdatePercent: newInt(-25), |
|
| 154 |
+ UpdatePercent: newInt32(-25), |
|
| 155 | 155 |
MaxSurge: newIntOrString(intstr.FromInt(0)), |
| 156 | 156 |
MaxUnavailable: newIntOrString(intstr.FromString("25%")),
|
| 157 | 157 |
}, |
| ... | ... |
@@ -161,7 +161,7 @@ func Test_convert_api_RollingDeploymentStrategyParams_To_v1_RollingDeploymentStr |
| 161 | 161 |
UpdatePeriodSeconds: newInt64(5), |
| 162 | 162 |
IntervalSeconds: newInt64(6), |
| 163 | 163 |
TimeoutSeconds: newInt64(7), |
| 164 |
- UpdatePercent: newInt(25), |
|
| 164 |
+ UpdatePercent: newInt32(25), |
|
| 165 | 165 |
MaxSurge: intstr.FromString("25%"),
|
| 166 | 166 |
MaxUnavailable: intstr.FromInt(0), |
| 167 | 167 |
}, |
| ... | ... |
@@ -169,7 +169,7 @@ func Test_convert_api_RollingDeploymentStrategyParams_To_v1_RollingDeploymentStr |
| 169 | 169 |
UpdatePeriodSeconds: newInt64(5), |
| 170 | 170 |
IntervalSeconds: newInt64(6), |
| 171 | 171 |
TimeoutSeconds: newInt64(7), |
| 172 |
- UpdatePercent: newInt(25), |
|
| 172 |
+ UpdatePercent: newInt32(25), |
|
| 173 | 173 |
MaxSurge: newIntOrString(intstr.FromString("25%")),
|
| 174 | 174 |
MaxUnavailable: newIntOrString(intstr.FromInt(0)), |
| 175 | 175 |
}, |
| ... | ... |
@@ -207,7 +207,7 @@ func newInt64(val int64) *int64 {
|
| 207 | 207 |
return &val |
| 208 | 208 |
} |
| 209 | 209 |
|
| 210 |
-func newInt(val int) *int {
|
|
| 210 |
+func newInt32(val int32) *int32 {
|
|
| 211 | 211 |
return &val |
| 212 | 212 |
} |
| 213 | 213 |
|
| ... | ... |
@@ -486,7 +486,7 @@ func DeepCopy_v1_RollingDeploymentStrategyParams(in RollingDeploymentStrategyPar |
| 486 | 486 |
} |
| 487 | 487 |
if in.UpdatePercent != nil {
|
| 488 | 488 |
in, out := in.UpdatePercent, &out.UpdatePercent |
| 489 |
- *out = new(int) |
|
| 489 |
+ *out = new(int32) |
|
| 490 | 490 |
**out = *in |
| 491 | 491 |
} else {
|
| 492 | 492 |
out.UpdatePercent = nil |
| ... | ... |
@@ -163,7 +163,7 @@ func TestDefaults(t *testing.T) {
|
| 163 | 163 |
UpdatePeriodSeconds: newInt64(5), |
| 164 | 164 |
IntervalSeconds: newInt64(6), |
| 165 | 165 |
TimeoutSeconds: newInt64(7), |
| 166 |
- UpdatePercent: newInt(50), |
|
| 166 |
+ UpdatePercent: newInt32(50), |
|
| 167 | 167 |
}, |
| 168 | 168 |
}, |
| 169 | 169 |
Triggers: []deployv1.DeploymentTriggerPolicy{
|
| ... | ... |
@@ -181,7 +181,7 @@ func TestDefaults(t *testing.T) {
|
| 181 | 181 |
UpdatePeriodSeconds: newInt64(5), |
| 182 | 182 |
IntervalSeconds: newInt64(6), |
| 183 | 183 |
TimeoutSeconds: newInt64(7), |
| 184 |
- UpdatePercent: newInt(50), |
|
| 184 |
+ UpdatePercent: newInt32(50), |
|
| 185 | 185 |
MaxSurge: newIntOrString(intstr.FromString("50%")),
|
| 186 | 186 |
MaxUnavailable: newIntOrString(intstr.FromInt(0)), |
| 187 | 187 |
}, |
| ... | ... |
@@ -203,7 +203,7 @@ func TestDefaults(t *testing.T) {
|
| 203 | 203 |
UpdatePeriodSeconds: newInt64(5), |
| 204 | 204 |
IntervalSeconds: newInt64(6), |
| 205 | 205 |
TimeoutSeconds: newInt64(7), |
| 206 |
- UpdatePercent: newInt(-25), |
|
| 206 |
+ UpdatePercent: newInt32(-25), |
|
| 207 | 207 |
}, |
| 208 | 208 |
}, |
| 209 | 209 |
Triggers: []deployv1.DeploymentTriggerPolicy{
|
| ... | ... |
@@ -221,7 +221,7 @@ func TestDefaults(t *testing.T) {
|
| 221 | 221 |
UpdatePeriodSeconds: newInt64(5), |
| 222 | 222 |
IntervalSeconds: newInt64(6), |
| 223 | 223 |
TimeoutSeconds: newInt64(7), |
| 224 |
- UpdatePercent: newInt(-25), |
|
| 224 |
+ UpdatePercent: newInt32(-25), |
|
| 225 | 225 |
MaxSurge: newIntOrString(intstr.FromInt(0)), |
| 226 | 226 |
MaxUnavailable: newIntOrString(intstr.FromString("25%")),
|
| 227 | 227 |
}, |
| ... | ... |
@@ -276,7 +276,7 @@ func newInt64(val int64) *int64 {
|
| 276 | 276 |
return &val |
| 277 | 277 |
} |
| 278 | 278 |
|
| 279 |
-func newInt(val int) *int {
|
|
| 279 |
+func newInt32(val int32) *int32 {
|
|
| 280 | 280 |
return &val |
| 281 | 281 |
} |
| 282 | 282 |
|
| ... | ... |
@@ -64,7 +64,7 @@ func Test_convert_v1beta3_RollingDeploymentStrategyParams_To_api_RollingDeployme |
| 64 | 64 |
UpdatePeriodSeconds: newInt64(5), |
| 65 | 65 |
IntervalSeconds: newInt64(6), |
| 66 | 66 |
TimeoutSeconds: newInt64(7), |
| 67 |
- UpdatePercent: newInt(-25), |
|
| 67 |
+ UpdatePercent: newInt32(-25), |
|
| 68 | 68 |
Pre: &LifecycleHook{
|
| 69 | 69 |
FailurePolicy: LifecycleHookFailurePolicyIgnore, |
| 70 | 70 |
}, |
| ... | ... |
@@ -76,7 +76,7 @@ func Test_convert_v1beta3_RollingDeploymentStrategyParams_To_api_RollingDeployme |
| 76 | 76 |
UpdatePeriodSeconds: newInt64(5), |
| 77 | 77 |
IntervalSeconds: newInt64(6), |
| 78 | 78 |
TimeoutSeconds: newInt64(7), |
| 79 |
- UpdatePercent: newInt(-25), |
|
| 79 |
+ UpdatePercent: newInt32(-25), |
|
| 80 | 80 |
MaxSurge: intstr.FromInt(0), |
| 81 | 81 |
MaxUnavailable: intstr.FromString("25%"),
|
| 82 | 82 |
Pre: &newer.LifecycleHook{
|
| ... | ... |
@@ -92,13 +92,13 @@ func Test_convert_v1beta3_RollingDeploymentStrategyParams_To_api_RollingDeployme |
| 92 | 92 |
UpdatePeriodSeconds: newInt64(5), |
| 93 | 93 |
IntervalSeconds: newInt64(6), |
| 94 | 94 |
TimeoutSeconds: newInt64(7), |
| 95 |
- UpdatePercent: newInt(25), |
|
| 95 |
+ UpdatePercent: newInt32(25), |
|
| 96 | 96 |
}, |
| 97 | 97 |
out: &newer.RollingDeploymentStrategyParams{
|
| 98 | 98 |
UpdatePeriodSeconds: newInt64(5), |
| 99 | 99 |
IntervalSeconds: newInt64(6), |
| 100 | 100 |
TimeoutSeconds: newInt64(7), |
| 101 |
- UpdatePercent: newInt(25), |
|
| 101 |
+ UpdatePercent: newInt32(25), |
|
| 102 | 102 |
MaxSurge: intstr.FromString("25%"),
|
| 103 | 103 |
MaxUnavailable: intstr.FromInt(0), |
| 104 | 104 |
}, |
| ... | ... |
@@ -142,7 +142,7 @@ func Test_convert_api_RollingDeploymentStrategyParams_To_v1beta3_RollingDeployme |
| 142 | 142 |
UpdatePeriodSeconds: newInt64(5), |
| 143 | 143 |
IntervalSeconds: newInt64(6), |
| 144 | 144 |
TimeoutSeconds: newInt64(7), |
| 145 |
- UpdatePercent: newInt(-25), |
|
| 145 |
+ UpdatePercent: newInt32(-25), |
|
| 146 | 146 |
MaxSurge: intstr.FromInt(0), |
| 147 | 147 |
MaxUnavailable: intstr.FromString("25%"),
|
| 148 | 148 |
}, |
| ... | ... |
@@ -150,7 +150,7 @@ func Test_convert_api_RollingDeploymentStrategyParams_To_v1beta3_RollingDeployme |
| 150 | 150 |
UpdatePeriodSeconds: newInt64(5), |
| 151 | 151 |
IntervalSeconds: newInt64(6), |
| 152 | 152 |
TimeoutSeconds: newInt64(7), |
| 153 |
- UpdatePercent: newInt(-25), |
|
| 153 |
+ UpdatePercent: newInt32(-25), |
|
| 154 | 154 |
MaxSurge: newIntOrString(intstr.FromInt(0)), |
| 155 | 155 |
MaxUnavailable: newIntOrString(intstr.FromString("25%")),
|
| 156 | 156 |
}, |
| ... | ... |
@@ -160,7 +160,7 @@ func Test_convert_api_RollingDeploymentStrategyParams_To_v1beta3_RollingDeployme |
| 160 | 160 |
UpdatePeriodSeconds: newInt64(5), |
| 161 | 161 |
IntervalSeconds: newInt64(6), |
| 162 | 162 |
TimeoutSeconds: newInt64(7), |
| 163 |
- UpdatePercent: newInt(25), |
|
| 163 |
+ UpdatePercent: newInt32(25), |
|
| 164 | 164 |
MaxSurge: intstr.FromString("25%"),
|
| 165 | 165 |
MaxUnavailable: intstr.FromInt(0), |
| 166 | 166 |
}, |
| ... | ... |
@@ -168,7 +168,7 @@ func Test_convert_api_RollingDeploymentStrategyParams_To_v1beta3_RollingDeployme |
| 168 | 168 |
UpdatePeriodSeconds: newInt64(5), |
| 169 | 169 |
IntervalSeconds: newInt64(6), |
| 170 | 170 |
TimeoutSeconds: newInt64(7), |
| 171 |
- UpdatePercent: newInt(25), |
|
| 171 |
+ UpdatePercent: newInt32(25), |
|
| 172 | 172 |
MaxSurge: newIntOrString(intstr.FromString("25%")),
|
| 173 | 173 |
MaxUnavailable: newIntOrString(intstr.FromInt(0)), |
| 174 | 174 |
}, |
| ... | ... |
@@ -206,7 +206,7 @@ func newInt64(val int64) *int64 {
|
| 206 | 206 |
return &val |
| 207 | 207 |
} |
| 208 | 208 |
|
| 209 |
-func newInt(val int) *int {
|
|
| 209 |
+func newInt32(val int32) *int32 {
|
|
| 210 | 210 |
return &val |
| 211 | 211 |
} |
| 212 | 212 |
|
| ... | ... |
@@ -96,7 +96,7 @@ func TestDefaults(t *testing.T) {
|
| 96 | 96 |
UpdatePeriodSeconds: newInt64(5), |
| 97 | 97 |
IntervalSeconds: newInt64(6), |
| 98 | 98 |
TimeoutSeconds: newInt64(7), |
| 99 |
- UpdatePercent: newInt(50), |
|
| 99 |
+ UpdatePercent: newInt32(50), |
|
| 100 | 100 |
}, |
| 101 | 101 |
}, |
| 102 | 102 |
Triggers: []deployv1.DeploymentTriggerPolicy{
|
| ... | ... |
@@ -114,7 +114,7 @@ func TestDefaults(t *testing.T) {
|
| 114 | 114 |
UpdatePeriodSeconds: newInt64(5), |
| 115 | 115 |
IntervalSeconds: newInt64(6), |
| 116 | 116 |
TimeoutSeconds: newInt64(7), |
| 117 |
- UpdatePercent: newInt(50), |
|
| 117 |
+ UpdatePercent: newInt32(50), |
|
| 118 | 118 |
MaxSurge: newIntOrString(intstr.FromString("50%")),
|
| 119 | 119 |
MaxUnavailable: newIntOrString(intstr.FromInt(0)), |
| 120 | 120 |
}, |
| ... | ... |
@@ -136,7 +136,7 @@ func TestDefaults(t *testing.T) {
|
| 136 | 136 |
UpdatePeriodSeconds: newInt64(5), |
| 137 | 137 |
IntervalSeconds: newInt64(6), |
| 138 | 138 |
TimeoutSeconds: newInt64(7), |
| 139 |
- UpdatePercent: newInt(-50), |
|
| 139 |
+ UpdatePercent: newInt32(-50), |
|
| 140 | 140 |
}, |
| 141 | 141 |
}, |
| 142 | 142 |
Triggers: []deployv1.DeploymentTriggerPolicy{
|
| ... | ... |
@@ -154,7 +154,7 @@ func TestDefaults(t *testing.T) {
|
| 154 | 154 |
UpdatePeriodSeconds: newInt64(5), |
| 155 | 155 |
IntervalSeconds: newInt64(6), |
| 156 | 156 |
TimeoutSeconds: newInt64(7), |
| 157 |
- UpdatePercent: newInt(-50), |
|
| 157 |
+ UpdatePercent: newInt32(-50), |
|
| 158 | 158 |
MaxSurge: newIntOrString(intstr.FromInt(0)), |
| 159 | 159 |
MaxUnavailable: newIntOrString(intstr.FromString("50%")),
|
| 160 | 160 |
}, |
| ... | ... |
@@ -210,7 +210,7 @@ func newInt64(val int64) *int64 {
|
| 210 | 210 |
return &val |
| 211 | 211 |
} |
| 212 | 212 |
|
| 213 |
-func newInt(val int) *int {
|
|
| 213 |
+func newInt32(val int32) *int32 {
|
|
| 214 | 214 |
return &val |
| 215 | 215 |
} |
| 216 | 216 |
|
| ... | ... |
@@ -161,7 +161,7 @@ func (c *DeployerPodController) Handle(pod *kapi.Pod) error {
|
| 161 | 161 |
if config.Annotations == nil {
|
| 162 | 162 |
config.Annotations = make(map[string]string) |
| 163 | 163 |
} |
| 164 |
- config.Annotations[deployapi.DeploymentCancelledAnnotation] = strconv.Itoa(config.Status.LatestVersion) |
|
| 164 |
+ config.Annotations[deployapi.DeploymentCancelledAnnotation] = strconv.FormatInt(config.Status.LatestVersion, 10) |
|
| 165 | 165 |
_, err = c.client.DeploymentConfigs(config.Namespace).Update(config) |
| 166 | 166 |
return err |
| 167 | 167 |
}) |
| ... | ... |
@@ -186,8 +186,8 @@ func (c *DeploymentConfigController) reconcileDeployments(existingDeployments *k |
| 186 | 186 |
// The active/latest deployment follows the config unless this is its first |
| 187 | 187 |
// sync or if an external change to the deployment replicas is detected. |
| 188 | 188 |
lastActiveReplicas, hasLastActiveReplicas := deployutil.DeploymentReplicas(activeDeployment) |
| 189 |
- if !hasLastActiveReplicas || lastActiveReplicas != int(activeDeployment.Spec.Replicas) {
|
|
| 190 |
- activeReplicas = int(activeDeployment.Spec.Replicas) |
|
| 189 |
+ if !hasLastActiveReplicas || lastActiveReplicas != activeDeployment.Spec.Replicas {
|
|
| 190 |
+ activeReplicas = activeDeployment.Spec.Replicas |
|
| 191 | 191 |
source = fmt.Sprintf("the latest/active deployment %q which was scaled directly or has not previously been synced", deployutil.LabelForDeployment(activeDeployment))
|
| 192 | 192 |
} |
| 193 | 193 |
case activeDeploymentExists && !activeDeploymentIsLatest: |
| ... | ... |
@@ -203,7 +203,7 @@ func (c *DeploymentConfigController) reconcileDeployments(existingDeployments *k |
| 203 | 203 |
activeReplicas = latestDesiredReplicas |
| 204 | 204 |
source = fmt.Sprintf("the desired replicas of latest deployment %q which has not been previously synced", deployutil.LabelForDeployment(latestDeployment))
|
| 205 | 205 |
} else if activeDeployment.Spec.Replicas > 0 {
|
| 206 |
- activeReplicas = int(activeDeployment.Spec.Replicas) |
|
| 206 |
+ activeReplicas = activeDeployment.Spec.Replicas |
|
| 207 | 207 |
source = fmt.Sprintf("the active deployment %q which has not been previously synced", deployutil.LabelForDeployment(activeDeployment))
|
| 208 | 208 |
} |
| 209 | 209 |
case !activeDeploymentExists && latestHasDesiredReplicas: |
| ... | ... |
@@ -238,8 +238,8 @@ func (c *DeploymentConfigController) reconcileDeployments(existingDeployments *k |
| 238 | 238 |
for _, deployment := range existingDeployments.Items {
|
| 239 | 239 |
isActiveDeployment := activeDeployment != nil && deployment.Name == activeDeployment.Name |
| 240 | 240 |
|
| 241 |
- oldReplicaCount := int(deployment.Spec.Replicas) |
|
| 242 |
- newReplicaCount := 0 |
|
| 241 |
+ oldReplicaCount := deployment.Spec.Replicas |
|
| 242 |
+ newReplicaCount := int32(0) |
|
| 243 | 243 |
if isActiveDeployment {
|
| 244 | 244 |
newReplicaCount = activeReplicas |
| 245 | 245 |
} |
| ... | ... |
@@ -250,8 +250,8 @@ func (c *DeploymentConfigController) reconcileDeployments(existingDeployments *k |
| 250 | 250 |
lastReplicas, hasLastReplicas := deployutil.DeploymentReplicas(&deployment) |
| 251 | 251 |
// Only update if necessary. |
| 252 | 252 |
if !hasLastReplicas || newReplicaCount != oldReplicaCount || lastReplicas != newReplicaCount {
|
| 253 |
- deployment.Spec.Replicas = int32(newReplicaCount) |
|
| 254 |
- deployment.Annotations[deployapi.DeploymentReplicasAnnotation] = strconv.Itoa(newReplicaCount) |
|
| 253 |
+ deployment.Spec.Replicas = newReplicaCount |
|
| 254 |
+ deployment.Annotations[deployapi.DeploymentReplicasAnnotation] = strconv.Itoa(int(newReplicaCount)) |
|
| 255 | 255 |
_, err := c.kubeClient.ReplicationControllers(deployment.Namespace).Update(&deployment) |
| 256 | 256 |
if err != nil {
|
| 257 | 257 |
c.recorder.Eventf(config, kapi.EventTypeWarning, "DeploymentScaleFailed", |
| ... | ... |
@@ -21,14 +21,14 @@ import ( |
| 21 | 21 |
func TestHandleScenarios(t *testing.T) {
|
| 22 | 22 |
type deployment struct {
|
| 23 | 23 |
// version is the deployment version |
| 24 |
- version int |
|
| 24 |
+ version int64 |
|
| 25 | 25 |
// replicas is the spec replicas of the deployment |
| 26 |
- replicas int |
|
| 26 |
+ replicas int32 |
|
| 27 | 27 |
// test is whether this is a test deployment config |
| 28 | 28 |
test bool |
| 29 | 29 |
// replicasA is the annotated replica value for backwards compat checks |
| 30 |
- replicasA *int |
|
| 31 |
- desiredA *int |
|
| 30 |
+ replicasA *int32 |
|
| 31 |
+ desiredA *int32 |
|
| 32 | 32 |
status deployapi.DeploymentStatus |
| 33 | 33 |
cancelled bool |
| 34 | 34 |
} |
| ... | ... |
@@ -45,29 +45,29 @@ func TestHandleScenarios(t *testing.T) {
|
| 45 | 45 |
deployment.Annotations[deployapi.DeploymentStatusReasonAnnotation] = deployapi.DeploymentCancelledNewerDeploymentExists |
| 46 | 46 |
} |
| 47 | 47 |
if d.replicasA != nil {
|
| 48 |
- deployment.Annotations[deployapi.DeploymentReplicasAnnotation] = strconv.Itoa(*d.replicasA) |
|
| 48 |
+ deployment.Annotations[deployapi.DeploymentReplicasAnnotation] = strconv.Itoa(int(*d.replicasA)) |
|
| 49 | 49 |
} else {
|
| 50 | 50 |
delete(deployment.Annotations, deployapi.DeploymentReplicasAnnotation) |
| 51 | 51 |
} |
| 52 | 52 |
if d.desiredA != nil {
|
| 53 |
- deployment.Annotations[deployapi.DesiredReplicasAnnotation] = strconv.Itoa(*d.desiredA) |
|
| 53 |
+ deployment.Annotations[deployapi.DesiredReplicasAnnotation] = strconv.Itoa(int(*d.desiredA)) |
|
| 54 | 54 |
} else {
|
| 55 | 55 |
delete(deployment.Annotations, deployapi.DesiredReplicasAnnotation) |
| 56 | 56 |
} |
| 57 |
- deployment.Spec.Replicas = int32(d.replicas) |
|
| 57 |
+ deployment.Spec.Replicas = d.replicas |
|
| 58 | 58 |
return *deployment |
| 59 | 59 |
} |
| 60 | 60 |
|
| 61 | 61 |
tests := []struct {
|
| 62 | 62 |
name string |
| 63 | 63 |
// replicas is the config replicas prior to the update |
| 64 |
- replicas int |
|
| 64 |
+ replicas int32 |
|
| 65 | 65 |
// test is whether this is a test deployment config |
| 66 | 66 |
test bool |
| 67 | 67 |
// newVersion is the version of the config at the time of the update |
| 68 |
- newVersion int |
|
| 68 |
+ newVersion int64 |
|
| 69 | 69 |
// expectedReplicas is the expected config replica count after the update |
| 70 |
- expectedReplicas int |
|
| 70 |
+ expectedReplicas int32 |
|
| 71 | 71 |
// before is the state of all deployments prior to the update |
| 72 | 72 |
before []deployment |
| 73 | 73 |
// after is the expected state of all deployments after the update |
| ... | ... |
@@ -91,7 +91,7 @@ func TestHandleScenarios(t *testing.T) {
|
| 91 | 91 |
expectedReplicas: 1, |
| 92 | 92 |
before: []deployment{},
|
| 93 | 93 |
after: []deployment{
|
| 94 |
- {version: 1, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 94 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 95 | 95 |
}, |
| 96 | 96 |
errExpected: false, |
| 97 | 97 |
}, |
| ... | ... |
@@ -101,10 +101,10 @@ func TestHandleScenarios(t *testing.T) {
|
| 101 | 101 |
newVersion: 1, |
| 102 | 102 |
expectedReplicas: 1, |
| 103 | 103 |
before: []deployment{
|
| 104 |
- {version: 1, replicas: 1, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 104 |
+ {version: 1, replicas: 1, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 105 | 105 |
}, |
| 106 | 106 |
after: []deployment{
|
| 107 |
- {version: 1, replicas: 1, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 107 |
+ {version: 1, replicas: 1, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 108 | 108 |
}, |
| 109 | 109 |
errExpected: false, |
| 110 | 110 |
}, |
| ... | ... |
@@ -114,11 +114,11 @@ func TestHandleScenarios(t *testing.T) {
|
| 114 | 114 |
newVersion: 2, |
| 115 | 115 |
expectedReplicas: 1, |
| 116 | 116 |
before: []deployment{
|
| 117 |
- {version: 1, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 117 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 118 | 118 |
}, |
| 119 | 119 |
after: []deployment{
|
| 120 |
- {version: 1, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 121 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 120 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 121 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 122 | 122 |
}, |
| 123 | 123 |
errExpected: false, |
| 124 | 124 |
}, |
| ... | ... |
@@ -128,12 +128,12 @@ func TestHandleScenarios(t *testing.T) {
|
| 128 | 128 |
newVersion: 2, |
| 129 | 129 |
expectedReplicas: 1, |
| 130 | 130 |
before: []deployment{
|
| 131 |
- {version: 1, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 132 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 131 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 132 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 133 | 133 |
}, |
| 134 | 134 |
after: []deployment{
|
| 135 |
- {version: 1, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 136 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 135 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 136 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 137 | 137 |
}, |
| 138 | 138 |
errExpected: false, |
| 139 | 139 |
}, |
| ... | ... |
@@ -143,10 +143,10 @@ func TestHandleScenarios(t *testing.T) {
|
| 143 | 143 |
newVersion: 1, |
| 144 | 144 |
expectedReplicas: 1, |
| 145 | 145 |
before: []deployment{
|
| 146 |
- {version: 1, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 146 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 147 | 147 |
}, |
| 148 | 148 |
after: []deployment{
|
| 149 |
- {version: 1, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 149 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 150 | 150 |
}, |
| 151 | 151 |
errExpected: false, |
| 152 | 152 |
}, |
| ... | ... |
@@ -156,12 +156,12 @@ func TestHandleScenarios(t *testing.T) {
|
| 156 | 156 |
newVersion: 3, |
| 157 | 157 |
expectedReplicas: 1, |
| 158 | 158 |
before: []deployment{
|
| 159 |
- {version: 1, replicas: 1, replicasA: newint(1), desiredA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 160 |
- {version: 2, replicas: 1, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusRunning, cancelled: false},
|
|
| 159 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), desiredA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 160 |
+ {version: 2, replicas: 1, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusRunning, cancelled: false},
|
|
| 161 | 161 |
}, |
| 162 | 162 |
after: []deployment{
|
| 163 |
- {version: 1, replicas: 1, replicasA: newint(1), desiredA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 164 |
- {version: 2, replicas: 1, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusRunning, cancelled: true},
|
|
| 163 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), desiredA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 164 |
+ {version: 2, replicas: 1, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusRunning, cancelled: true},
|
|
| 165 | 165 |
}, |
| 166 | 166 |
errExpected: true, |
| 167 | 167 |
}, |
| ... | ... |
@@ -171,10 +171,10 @@ func TestHandleScenarios(t *testing.T) {
|
| 171 | 171 |
newVersion: 2, |
| 172 | 172 |
expectedReplicas: 1, |
| 173 | 173 |
before: []deployment{
|
| 174 |
- {version: 1, replicas: 1, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusRunning, cancelled: true},
|
|
| 174 |
+ {version: 1, replicas: 1, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusRunning, cancelled: true},
|
|
| 175 | 175 |
}, |
| 176 | 176 |
after: []deployment{
|
| 177 |
- {version: 1, replicas: 1, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusRunning, cancelled: true},
|
|
| 177 |
+ {version: 1, replicas: 1, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusRunning, cancelled: true},
|
|
| 178 | 178 |
}, |
| 179 | 179 |
errExpected: true, |
| 180 | 180 |
}, |
| ... | ... |
@@ -184,18 +184,18 @@ func TestHandleScenarios(t *testing.T) {
|
| 184 | 184 |
newVersion: 5, |
| 185 | 185 |
expectedReplicas: 1, |
| 186 | 186 |
before: []deployment{
|
| 187 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 188 |
- {version: 2, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 189 |
- {version: 3, replicas: 1, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 190 |
- {version: 4, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 191 |
- {version: 5, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 187 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 188 |
+ {version: 2, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 189 |
+ {version: 3, replicas: 1, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 190 |
+ {version: 4, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 191 |
+ {version: 5, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 192 | 192 |
}, |
| 193 | 193 |
after: []deployment{
|
| 194 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 195 |
- {version: 2, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 196 |
- {version: 3, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 197 |
- {version: 4, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 198 |
- {version: 5, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 194 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 195 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 196 |
+ {version: 3, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 197 |
+ {version: 4, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 198 |
+ {version: 5, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 199 | 199 |
}, |
| 200 | 200 |
errExpected: false, |
| 201 | 201 |
}, |
| ... | ... |
@@ -205,18 +205,18 @@ func TestHandleScenarios(t *testing.T) {
|
| 205 | 205 |
newVersion: 5, |
| 206 | 206 |
expectedReplicas: 1, |
| 207 | 207 |
before: []deployment{
|
| 208 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 209 |
- {version: 2, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 210 |
- {version: 3, replicas: 1, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 211 |
- {version: 4, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 212 |
- {version: 5, replicas: 1, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 208 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 209 |
+ {version: 2, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 210 |
+ {version: 3, replicas: 1, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 211 |
+ {version: 4, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 212 |
+ {version: 5, replicas: 1, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 213 | 213 |
}, |
| 214 | 214 |
after: []deployment{
|
| 215 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 216 |
- {version: 2, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 217 |
- {version: 3, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 218 |
- {version: 4, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 219 |
- {version: 5, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 215 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 216 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 217 |
+ {version: 3, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 218 |
+ {version: 4, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 219 |
+ {version: 5, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 220 | 220 |
}, |
| 221 | 221 |
errExpected: false, |
| 222 | 222 |
}, |
| ... | ... |
@@ -226,12 +226,12 @@ func TestHandleScenarios(t *testing.T) {
|
| 226 | 226 |
newVersion: 2, |
| 227 | 227 |
expectedReplicas: 1, |
| 228 | 228 |
before: []deployment{
|
| 229 |
- {version: 1, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 230 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 229 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 230 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 231 | 231 |
}, |
| 232 | 232 |
after: []deployment{
|
| 233 |
- {version: 1, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 234 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 233 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 234 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 235 | 235 |
}, |
| 236 | 236 |
errExpected: false, |
| 237 | 237 |
}, |
| ... | ... |
@@ -241,12 +241,12 @@ func TestHandleScenarios(t *testing.T) {
|
| 241 | 241 |
newVersion: 2, |
| 242 | 242 |
expectedReplicas: 5, |
| 243 | 243 |
before: []deployment{
|
| 244 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 245 |
- {version: 2, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 244 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 245 |
+ {version: 2, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 246 | 246 |
}, |
| 247 | 247 |
after: []deployment{
|
| 248 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 249 |
- {version: 2, replicas: 5, replicasA: newint(5), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 248 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 249 |
+ {version: 2, replicas: 5, replicasA: newInt32(5), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 250 | 250 |
}, |
| 251 | 251 |
errExpected: false, |
| 252 | 252 |
}, |
| ... | ... |
@@ -256,12 +256,12 @@ func TestHandleScenarios(t *testing.T) {
|
| 256 | 256 |
newVersion: 2, |
| 257 | 257 |
expectedReplicas: 5, |
| 258 | 258 |
before: []deployment{
|
| 259 |
- {version: 1, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 260 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 259 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 260 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 261 | 261 |
}, |
| 262 | 262 |
after: []deployment{
|
| 263 |
- {version: 1, replicas: 5, replicasA: newint(5), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 264 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 263 |
+ {version: 1, replicas: 5, replicasA: newInt32(5), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 264 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 265 | 265 |
}, |
| 266 | 266 |
errExpected: false, |
| 267 | 267 |
}, |
| ... | ... |
@@ -271,12 +271,12 @@ func TestHandleScenarios(t *testing.T) {
|
| 271 | 271 |
newVersion: 2, |
| 272 | 272 |
expectedReplicas: 1, |
| 273 | 273 |
before: []deployment{
|
| 274 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 275 |
- {version: 2, replicas: 5, replicasA: newint(5), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 274 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 275 |
+ {version: 2, replicas: 5, replicasA: newInt32(5), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 276 | 276 |
}, |
| 277 | 277 |
after: []deployment{
|
| 278 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 279 |
- {version: 2, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 278 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 279 |
+ {version: 2, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 280 | 280 |
}, |
| 281 | 281 |
errExpected: false, |
| 282 | 282 |
}, |
| ... | ... |
@@ -286,12 +286,12 @@ func TestHandleScenarios(t *testing.T) {
|
| 286 | 286 |
newVersion: 2, |
| 287 | 287 |
expectedReplicas: 1, |
| 288 | 288 |
before: []deployment{
|
| 289 |
- {version: 1, replicas: 5, replicasA: newint(5), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 290 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 289 |
+ {version: 1, replicas: 5, replicasA: newInt32(5), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 290 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 291 | 291 |
}, |
| 292 | 292 |
after: []deployment{
|
| 293 |
- {version: 1, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 294 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 293 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 294 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 295 | 295 |
}, |
| 296 | 296 |
errExpected: false, |
| 297 | 297 |
}, |
| ... | ... |
@@ -301,12 +301,12 @@ func TestHandleScenarios(t *testing.T) {
|
| 301 | 301 |
newVersion: 2, |
| 302 | 302 |
expectedReplicas: 1, |
| 303 | 303 |
before: []deployment{
|
| 304 |
- {version: 1, replicas: 0, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 305 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 304 |
+ {version: 1, replicas: 0, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 305 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 306 | 306 |
}, |
| 307 | 307 |
after: []deployment{
|
| 308 |
- {version: 1, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 309 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 308 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 309 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 310 | 310 |
}, |
| 311 | 311 |
errExpected: false, |
| 312 | 312 |
}, |
| ... | ... |
@@ -316,12 +316,12 @@ func TestHandleScenarios(t *testing.T) {
|
| 316 | 316 |
newVersion: 2, |
| 317 | 317 |
expectedReplicas: 5, |
| 318 | 318 |
before: []deployment{
|
| 319 |
- {version: 1, replicas: 2, replicasA: newint(5), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 320 |
- {version: 2, replicas: 2, replicasA: newint(0), desiredA: newint(5), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 319 |
+ {version: 1, replicas: 2, replicasA: newInt32(5), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 320 |
+ {version: 2, replicas: 2, replicasA: newInt32(0), desiredA: newInt32(5), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 321 | 321 |
}, |
| 322 | 322 |
after: []deployment{
|
| 323 |
- {version: 1, replicas: 5, replicasA: newint(5), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 324 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(5), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 323 |
+ {version: 1, replicas: 5, replicasA: newInt32(5), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 324 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(5), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 325 | 325 |
}, |
| 326 | 326 |
errExpected: false, |
| 327 | 327 |
}, |
| ... | ... |
@@ -333,10 +333,10 @@ func TestHandleScenarios(t *testing.T) {
|
| 333 | 333 |
newVersion: 1, |
| 334 | 334 |
expectedReplicas: 1, |
| 335 | 335 |
before: []deployment{
|
| 336 |
- {version: 1, replicas: 1, desiredA: newint(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 336 |
+ {version: 1, replicas: 1, desiredA: newInt32(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 337 | 337 |
}, |
| 338 | 338 |
after: []deployment{
|
| 339 |
- {version: 1, replicas: 1, desiredA: newint(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 339 |
+ {version: 1, replicas: 1, desiredA: newInt32(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 340 | 340 |
}, |
| 341 | 341 |
errExpected: false, |
| 342 | 342 |
}, |
| ... | ... |
@@ -350,7 +350,7 @@ func TestHandleScenarios(t *testing.T) {
|
| 350 | 350 |
}, |
| 351 | 351 |
after: []deployment{
|
| 352 | 352 |
{version: 1, replicas: 1, status: deployapi.DeploymentStatusComplete, cancelled: false},
|
| 353 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 353 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 354 | 354 |
}, |
| 355 | 355 |
errExpected: false, |
| 356 | 356 |
}, |
| ... | ... |
@@ -361,11 +361,11 @@ func TestHandleScenarios(t *testing.T) {
|
| 361 | 361 |
expectedReplicas: 1, |
| 362 | 362 |
before: []deployment{
|
| 363 | 363 |
{version: 1, replicas: 1, status: deployapi.DeploymentStatusComplete, cancelled: false},
|
| 364 |
- {version: 2, replicas: 0, desiredA: newint(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 364 |
+ {version: 2, replicas: 0, desiredA: newInt32(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 365 | 365 |
}, |
| 366 | 366 |
after: []deployment{
|
| 367 | 367 |
{version: 1, replicas: 1, status: deployapi.DeploymentStatusComplete, cancelled: false},
|
| 368 |
- {version: 2, replicas: 0, desiredA: newint(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 368 |
+ {version: 2, replicas: 0, desiredA: newInt32(1), status: deployapi.DeploymentStatusNew, cancelled: false},
|
|
| 369 | 369 |
}, |
| 370 | 370 |
errExpected: false, |
| 371 | 371 |
}, |
| ... | ... |
@@ -378,7 +378,7 @@ func TestHandleScenarios(t *testing.T) {
|
| 378 | 378 |
{version: 1, replicas: 1, status: deployapi.DeploymentStatusComplete, cancelled: false},
|
| 379 | 379 |
}, |
| 380 | 380 |
after: []deployment{
|
| 381 |
- {version: 1, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 381 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 382 | 382 |
}, |
| 383 | 383 |
errExpected: false, |
| 384 | 384 |
}, |
| ... | ... |
@@ -388,12 +388,12 @@ func TestHandleScenarios(t *testing.T) {
|
| 388 | 388 |
newVersion: 3, |
| 389 | 389 |
expectedReplicas: 1, |
| 390 | 390 |
before: []deployment{
|
| 391 |
- {version: 1, replicas: 1, desiredA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 392 |
- {version: 2, replicas: 1, desiredA: newint(1), status: deployapi.DeploymentStatusRunning, cancelled: false},
|
|
| 391 |
+ {version: 1, replicas: 1, desiredA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 392 |
+ {version: 2, replicas: 1, desiredA: newInt32(1), status: deployapi.DeploymentStatusRunning, cancelled: false},
|
|
| 393 | 393 |
}, |
| 394 | 394 |
after: []deployment{
|
| 395 |
- {version: 1, replicas: 1, desiredA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 396 |
- {version: 2, replicas: 1, desiredA: newint(1), status: deployapi.DeploymentStatusRunning, cancelled: true},
|
|
| 395 |
+ {version: 1, replicas: 1, desiredA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 396 |
+ {version: 2, replicas: 1, desiredA: newInt32(1), status: deployapi.DeploymentStatusRunning, cancelled: true},
|
|
| 397 | 397 |
}, |
| 398 | 398 |
errExpected: true, |
| 399 | 399 |
}, |
| ... | ... |
@@ -403,10 +403,10 @@ func TestHandleScenarios(t *testing.T) {
|
| 403 | 403 |
newVersion: 2, |
| 404 | 404 |
expectedReplicas: 1, |
| 405 | 405 |
before: []deployment{
|
| 406 |
- {version: 1, replicas: 1, desiredA: newint(1), status: deployapi.DeploymentStatusRunning, cancelled: true},
|
|
| 406 |
+ {version: 1, replicas: 1, desiredA: newInt32(1), status: deployapi.DeploymentStatusRunning, cancelled: true},
|
|
| 407 | 407 |
}, |
| 408 | 408 |
after: []deployment{
|
| 409 |
- {version: 1, replicas: 1, desiredA: newint(1), status: deployapi.DeploymentStatusRunning, cancelled: true},
|
|
| 409 |
+ {version: 1, replicas: 1, desiredA: newInt32(1), status: deployapi.DeploymentStatusRunning, cancelled: true},
|
|
| 410 | 410 |
}, |
| 411 | 411 |
errExpected: true, |
| 412 | 412 |
}, |
| ... | ... |
@@ -418,16 +418,16 @@ func TestHandleScenarios(t *testing.T) {
|
| 418 | 418 |
before: []deployment{
|
| 419 | 419 |
{version: 1, replicas: 0, status: deployapi.DeploymentStatusComplete, cancelled: false},
|
| 420 | 420 |
{version: 2, replicas: 1, status: deployapi.DeploymentStatusComplete, cancelled: false},
|
| 421 |
- {version: 3, replicas: 1, desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 422 |
- {version: 4, replicas: 0, desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 421 |
+ {version: 3, replicas: 1, desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 422 |
+ {version: 4, replicas: 0, desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 423 | 423 |
{version: 5, replicas: 1, status: deployapi.DeploymentStatusComplete, cancelled: false},
|
| 424 | 424 |
}, |
| 425 | 425 |
after: []deployment{
|
| 426 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 427 |
- {version: 2, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 428 |
- {version: 3, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 429 |
- {version: 4, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 430 |
- {version: 5, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 426 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 427 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 428 |
+ {version: 3, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 429 |
+ {version: 4, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 430 |
+ {version: 5, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 431 | 431 |
}, |
| 432 | 432 |
errExpected: false, |
| 433 | 433 |
}, |
| ... | ... |
@@ -440,16 +440,16 @@ func TestHandleScenarios(t *testing.T) {
|
| 440 | 440 |
before: []deployment{
|
| 441 | 441 |
{version: 1, replicas: 0, status: deployapi.DeploymentStatusComplete, cancelled: false, test: true},
|
| 442 | 442 |
{version: 2, replicas: 1, status: deployapi.DeploymentStatusComplete, cancelled: false, test: true},
|
| 443 |
- {version: 3, replicas: 1, desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true, test: true},
|
|
| 444 |
- {version: 4, replicas: 0, desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false, test: true},
|
|
| 443 |
+ {version: 3, replicas: 1, desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true, test: true},
|
|
| 444 |
+ {version: 4, replicas: 0, desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false, test: true},
|
|
| 445 | 445 |
{version: 5, replicas: 1, status: deployapi.DeploymentStatusComplete, cancelled: false, test: true},
|
| 446 | 446 |
}, |
| 447 | 447 |
after: []deployment{
|
| 448 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false, test: true},
|
|
| 449 |
- {version: 2, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false, test: true},
|
|
| 450 |
- {version: 3, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true, test: true},
|
|
| 451 |
- {version: 4, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false, test: true},
|
|
| 452 |
- {version: 5, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false, test: true},
|
|
| 448 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false, test: true},
|
|
| 449 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false, test: true},
|
|
| 450 |
+ {version: 3, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true, test: true},
|
|
| 451 |
+ {version: 4, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false, test: true},
|
|
| 452 |
+ {version: 5, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false, test: true},
|
|
| 453 | 453 |
}, |
| 454 | 454 |
errExpected: false, |
| 455 | 455 |
}, |
| ... | ... |
@@ -461,16 +461,16 @@ func TestHandleScenarios(t *testing.T) {
|
| 461 | 461 |
before: []deployment{
|
| 462 | 462 |
{version: 1, replicas: 0, status: deployapi.DeploymentStatusComplete, cancelled: false},
|
| 463 | 463 |
{version: 2, replicas: 1, status: deployapi.DeploymentStatusComplete, cancelled: false},
|
| 464 |
- {version: 3, replicas: 1, desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 464 |
+ {version: 3, replicas: 1, desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 465 | 465 |
{version: 4, replicas: 0, status: deployapi.DeploymentStatusComplete, cancelled: false},
|
| 466 |
- {version: 5, replicas: 0, desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 466 |
+ {version: 5, replicas: 0, desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 467 | 467 |
}, |
| 468 | 468 |
after: []deployment{
|
| 469 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 470 |
- {version: 2, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 471 |
- {version: 3, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 472 |
- {version: 4, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 473 |
- {version: 5, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 469 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 470 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 471 |
+ {version: 3, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 472 |
+ {version: 4, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 473 |
+ {version: 5, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 474 | 474 |
}, |
| 475 | 475 |
errExpected: false, |
| 476 | 476 |
}, |
| ... | ... |
@@ -480,12 +480,12 @@ func TestHandleScenarios(t *testing.T) {
|
| 480 | 480 |
newVersion: 2, |
| 481 | 481 |
expectedReplicas: 1, |
| 482 | 482 |
before: []deployment{
|
| 483 |
- {version: 1, replicas: 0, desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 484 |
- {version: 2, replicas: 0, desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 483 |
+ {version: 1, replicas: 0, desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 484 |
+ {version: 2, replicas: 0, desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 485 | 485 |
}, |
| 486 | 486 |
after: []deployment{
|
| 487 |
- {version: 1, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 488 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 487 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 488 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: false},
|
|
| 489 | 489 |
}, |
| 490 | 490 |
errExpected: false, |
| 491 | 491 |
}, |
| ... | ... |
@@ -499,8 +499,8 @@ func TestHandleScenarios(t *testing.T) {
|
| 499 | 499 |
{version: 2, replicas: 5, status: deployapi.DeploymentStatusComplete, cancelled: false},
|
| 500 | 500 |
}, |
| 501 | 501 |
after: []deployment{
|
| 502 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 503 |
- {version: 2, replicas: 5, replicasA: newint(5), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 502 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 503 |
+ {version: 2, replicas: 5, replicasA: newInt32(5), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 504 | 504 |
}, |
| 505 | 505 |
errExpected: false, |
| 506 | 506 |
}, |
| ... | ... |
@@ -515,8 +515,8 @@ func TestHandleScenarios(t *testing.T) {
|
| 515 | 515 |
{version: 2, replicas: 5, status: deployapi.DeploymentStatusComplete, cancelled: false, test: true},
|
| 516 | 516 |
}, |
| 517 | 517 |
after: []deployment{
|
| 518 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false, test: true},
|
|
| 519 |
- {version: 2, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false, test: true},
|
|
| 518 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false, test: true},
|
|
| 519 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false, test: true},
|
|
| 520 | 520 |
}, |
| 521 | 521 |
errExpected: false, |
| 522 | 522 |
}, |
| ... | ... |
@@ -544,11 +544,11 @@ func TestHandleScenarios(t *testing.T) {
|
| 544 | 544 |
expectedReplicas: 1, |
| 545 | 545 |
before: []deployment{
|
| 546 | 546 |
{version: 1, replicas: 5, status: deployapi.DeploymentStatusComplete, cancelled: false},
|
| 547 |
- {version: 2, replicas: 0, desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 547 |
+ {version: 2, replicas: 0, desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 548 | 548 |
}, |
| 549 | 549 |
after: []deployment{
|
| 550 |
- {version: 1, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 551 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 550 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 551 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 552 | 552 |
}, |
| 553 | 553 |
errExpected: false, |
| 554 | 554 |
}, |
| ... | ... |
@@ -559,11 +559,11 @@ func TestHandleScenarios(t *testing.T) {
|
| 559 | 559 |
expectedReplicas: 2, |
| 560 | 560 |
before: []deployment{
|
| 561 | 561 |
{version: 1, replicas: 2, status: deployapi.DeploymentStatusComplete, cancelled: false},
|
| 562 |
- {version: 2, replicas: 5, desiredA: newint(2), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 562 |
+ {version: 2, replicas: 5, desiredA: newInt32(2), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 563 | 563 |
}, |
| 564 | 564 |
after: []deployment{
|
| 565 |
- {version: 1, replicas: 2, replicasA: newint(2), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 566 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(2), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 565 |
+ {version: 1, replicas: 2, replicasA: newInt32(2), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 566 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(2), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 567 | 567 |
}, |
| 568 | 568 |
errExpected: false, |
| 569 | 569 |
}, |
| ... | ... |
@@ -574,11 +574,11 @@ func TestHandleScenarios(t *testing.T) {
|
| 574 | 574 |
expectedReplicas: 1, |
| 575 | 575 |
before: []deployment{
|
| 576 | 576 |
{version: 1, replicas: 0, status: deployapi.DeploymentStatusComplete, cancelled: false},
|
| 577 |
- {version: 2, replicas: 0, desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 577 |
+ {version: 2, replicas: 0, desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 578 | 578 |
}, |
| 579 | 579 |
after: []deployment{
|
| 580 |
- {version: 1, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 581 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 580 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 581 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 582 | 582 |
}, |
| 583 | 583 |
errExpected: false, |
| 584 | 584 |
}, |
| ... | ... |
@@ -590,12 +590,12 @@ func TestHandleScenarios(t *testing.T) {
|
| 590 | 590 |
newVersion: 2, |
| 591 | 591 |
expectedReplicas: 2, |
| 592 | 592 |
before: []deployment{
|
| 593 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 594 |
- {version: 2, replicas: 2, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 593 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 594 |
+ {version: 2, replicas: 2, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 595 | 595 |
}, |
| 596 | 596 |
after: []deployment{
|
| 597 |
- {version: 1, replicas: 0, replicasA: newint(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 598 |
- {version: 2, replicas: 2, replicasA: newint(2), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 597 |
+ {version: 1, replicas: 0, replicasA: newInt32(0), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 598 |
+ {version: 2, replicas: 2, replicasA: newInt32(2), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 599 | 599 |
}, |
| 600 | 600 |
errExpected: false, |
| 601 | 601 |
}, |
| ... | ... |
@@ -605,12 +605,12 @@ func TestHandleScenarios(t *testing.T) {
|
| 605 | 605 |
newVersion: 2, |
| 606 | 606 |
expectedReplicas: 1, |
| 607 | 607 |
before: []deployment{
|
| 608 |
- {version: 1, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 609 |
- {version: 2, replicas: 2, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 608 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 609 |
+ {version: 2, replicas: 2, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 610 | 610 |
}, |
| 611 | 611 |
after: []deployment{
|
| 612 |
- {version: 1, replicas: 1, replicasA: newint(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 613 |
- {version: 2, replicas: 0, replicasA: newint(0), desiredA: newint(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 612 |
+ {version: 1, replicas: 1, replicasA: newInt32(1), status: deployapi.DeploymentStatusComplete, cancelled: false},
|
|
| 613 |
+ {version: 2, replicas: 0, replicasA: newInt32(0), desiredA: newInt32(1), status: deployapi.DeploymentStatusFailed, cancelled: true},
|
|
| 614 | 614 |
}, |
| 615 | 615 |
errExpected: false, |
| 616 | 616 |
}, |
| ... | ... |
@@ -696,6 +696,6 @@ func TestHandleScenarios(t *testing.T) {
|
| 696 | 696 |
} |
| 697 | 697 |
} |
| 698 | 698 |
|
| 699 |
-func newint(i int) *int {
|
|
| 699 |
+func newInt32(i int32) *int32 {
|
|
| 700 | 700 |
return &i |
| 701 | 701 |
} |
| ... | ... |
@@ -62,7 +62,7 @@ func TestHandle_newConfigTriggers(t *testing.T) {
|
| 62 | 62 |
if updated == nil {
|
| 63 | 63 |
t.Fatalf("expected config to be updated")
|
| 64 | 64 |
} |
| 65 |
- if e, a := 1, updated.Status.LatestVersion; e != a {
|
|
| 65 |
+ if e, a := int64(1), updated.Status.LatestVersion; e != a {
|
|
| 66 | 66 |
t.Fatalf("expected update to latestversion=%d, got %d", e, a)
|
| 67 | 67 |
} |
| 68 | 68 |
if updated.Status.Details == nil {
|
| ... | ... |
@@ -143,7 +143,7 @@ func TestHandle_changeWithTemplateDiff(t *testing.T) {
|
| 143 | 143 |
t.Errorf("expected config to be updated")
|
| 144 | 144 |
continue |
| 145 | 145 |
} |
| 146 |
- if e, a := 2, updated.Status.LatestVersion; e != a {
|
|
| 146 |
+ if e, a := int64(2), updated.Status.LatestVersion; e != a {
|
|
| 147 | 147 |
t.Errorf("expected update to latestversion=%d, got %d", e, a)
|
| 148 | 148 |
continue |
| 149 | 149 |
} |
| ... | ... |
@@ -187,7 +187,7 @@ func TestHandle_automaticImageUpdates(t *testing.T) {
|
| 187 | 187 |
name string |
| 188 | 188 |
auto bool |
| 189 | 189 |
canTrigger bool |
| 190 |
- version int |
|
| 190 |
+ version int64 |
|
| 191 | 191 |
expectedUpdate bool |
| 192 | 192 |
}{
|
| 193 | 193 |
{
|
| ... | ... |
@@ -30,7 +30,7 @@ func (BasicDeploymentConfigController) Generate(genericParams map[string]interfa |
| 30 | 30 |
ObjectMeta: t.ObjectMeta, |
| 31 | 31 |
Spec: deployapi.DeploymentConfigSpec{
|
| 32 | 32 |
Selector: t.Spec.Selector, |
| 33 |
- Replicas: int(t.Spec.Replicas), |
|
| 33 |
+ Replicas: t.Spec.Replicas, |
|
| 34 | 34 |
Template: t.Spec.Template, |
| 35 | 35 |
}, |
| 36 | 36 |
} |
| ... | ... |
@@ -17,12 +17,12 @@ import ( |
| 17 | 17 |
deployutil "github.com/openshift/origin/pkg/deploy/util" |
| 18 | 18 |
) |
| 19 | 19 |
|
| 20 |
-func mkdeployment(version int) kapi.ReplicationController {
|
|
| 20 |
+func mkdeployment(version int64) kapi.ReplicationController {
|
|
| 21 | 21 |
deployment, _ := deployutil.MakeDeployment(deploytest.OkDeploymentConfig(version), kapi.Codecs.LegacyCodec(deployapi.SchemeGroupVersion)) |
| 22 | 22 |
return *deployment |
| 23 | 23 |
} |
| 24 | 24 |
|
| 25 |
-func mkdeploymentlist(versions ...int) *kapi.ReplicationControllerList {
|
|
| 25 |
+func mkdeploymentlist(versions ...int64) *kapi.ReplicationControllerList {
|
|
| 26 | 26 |
list := &kapi.ReplicationControllerList{}
|
| 27 | 27 |
for _, v := range versions {
|
| 28 | 28 |
list.Items = append(list.Items, mkdeployment(v)) |
| ... | ... |
@@ -155,25 +155,25 @@ func (r *ScaleREST) Update(ctx kapi.Context, obj runtime.Object) (runtime.Object |
| 155 | 155 |
} |
| 156 | 156 |
|
| 157 | 157 |
oldReplicas := deploymentConfig.Spec.Replicas |
| 158 |
- deploymentConfig.Spec.Replicas = int(scale.Spec.Replicas) |
|
| 158 |
+ deploymentConfig.Spec.Replicas = scale.Spec.Replicas |
|
| 159 | 159 |
if err := r.registry.UpdateDeploymentConfig(ctx, deploymentConfig); err != nil {
|
| 160 | 160 |
return nil, false, err |
| 161 | 161 |
} |
| 162 |
- scaleRet.Status.Replicas = int32(totalReplicas + (int(scale.Spec.Replicas) - int(oldReplicas))) |
|
| 162 |
+ scaleRet.Status.Replicas = totalReplicas + (scale.Spec.Replicas - oldReplicas) |
|
| 163 | 163 |
|
| 164 | 164 |
return scaleRet, false, nil |
| 165 | 165 |
} |
| 166 | 166 |
|
| 167 |
-func (r *ScaleREST) replicasForDeploymentConfig(namespace, configName string) (int, error) {
|
|
| 167 |
+func (r *ScaleREST) replicasForDeploymentConfig(namespace, configName string) (int32, error) {
|
|
| 168 | 168 |
options := kapi.ListOptions{LabelSelector: util.ConfigSelector(configName)}
|
| 169 | 169 |
rcList, err := r.rcNamespacer.ReplicationControllers(namespace).List(options) |
| 170 | 170 |
if err != nil {
|
| 171 | 171 |
return 0, err |
| 172 | 172 |
} |
| 173 | 173 |
|
| 174 |
- replicas := 0 |
|
| 174 |
+ replicas := int32(0) |
|
| 175 | 175 |
for _, rc := range rcList.Items {
|
| 176 |
- replicas += int(rc.Spec.Replicas) |
|
| 176 |
+ replicas += rc.Spec.Replicas |
|
| 177 | 177 |
} |
| 178 | 178 |
|
| 179 | 179 |
return replicas, nil |
| ... | ... |
@@ -100,11 +100,11 @@ func (r *REST) Get(ctx kapi.Context, name string, opts runtime.Object) (runtime. |
| 100 | 100 |
return nil, errors.NewBadRequest(fmt.Sprintf("no previous deployment exists for deploymentConfig %q", config.Name))
|
| 101 | 101 |
} |
| 102 | 102 |
} |
| 103 |
- case *deployLogOpts.Version <= 0 || int(*deployLogOpts.Version) > config.Status.LatestVersion: |
|
| 103 |
+ case *deployLogOpts.Version <= 0 || *deployLogOpts.Version > config.Status.LatestVersion: |
|
| 104 | 104 |
// Invalid version |
| 105 | 105 |
return nil, errors.NewBadRequest(fmt.Sprintf("invalid version for deploymentConfig %q: %d", config.Name, *deployLogOpts.Version))
|
| 106 | 106 |
default: |
| 107 |
- desiredVersion = int(*deployLogOpts.Version) |
|
| 107 |
+ desiredVersion = *deployLogOpts.Version |
|
| 108 | 108 |
} |
| 109 | 109 |
|
| 110 | 110 |
// Get desired deployment |
| ... | ... |
@@ -27,16 +27,16 @@ import ( |
| 27 | 27 |
|
| 28 | 28 |
var testSelector = map[string]string{"test": "rest"}
|
| 29 | 29 |
|
| 30 |
-func makeDeployment(version int) kapi.ReplicationController {
|
|
| 30 |
+func makeDeployment(version int64) kapi.ReplicationController {
|
|
| 31 | 31 |
deployment, _ := deployutil.MakeDeployment(deploytest.OkDeploymentConfig(version), kapi.Codecs.LegacyCodec(api.SchemeGroupVersion)) |
| 32 | 32 |
deployment.Namespace = kapi.NamespaceDefault |
| 33 | 33 |
deployment.Spec.Selector = testSelector |
| 34 | 34 |
return *deployment |
| 35 | 35 |
} |
| 36 | 36 |
|
| 37 |
-func makeDeploymentList(versions int) *kapi.ReplicationControllerList {
|
|
| 37 |
+func makeDeploymentList(versions int64) *kapi.ReplicationControllerList {
|
|
| 38 | 38 |
list := &kapi.ReplicationControllerList{}
|
| 39 |
- for v := 1; v <= versions; v++ {
|
|
| 39 |
+ for v := int64(1); v <= versions; v++ {
|
|
| 40 | 40 |
list.Items = append(list.Items, makeDeployment(v)) |
| 41 | 41 |
} |
| 42 | 42 |
return list |
| ... | ... |
@@ -82,7 +82,7 @@ var ( |
| 82 | 82 |
) |
| 83 | 83 |
|
| 84 | 84 |
// mockREST mocks a DeploymentLog REST |
| 85 |
-func mockREST(version, desired int, status api.DeploymentStatus) *REST {
|
|
| 85 |
+func mockREST(version, desired int64, status api.DeploymentStatus) *REST {
|
|
| 86 | 86 |
connectionInfo := &kubeletclient.HTTPKubeletClient{Config: &kubeletclient.KubeletClientConfig{EnableHttps: true, Port: 12345}, Client: &http.Client{}}
|
| 87 | 87 |
|
| 88 | 88 |
// Fake deploymentConfig |
| ... | ... |
@@ -84,7 +84,7 @@ func (scaler *DeploymentConfigScaler) ScaleSimple(namespace, name string, precon |
| 84 | 84 |
// unversioned.ControllerHasDesiredReplicas. This is necessary because when |
| 85 | 85 |
// scaling an RC via a DC, the RC spec replica count is not immediately |
| 86 | 86 |
// updated to match the owning DC. |
| 87 |
-func controllerHasSpecifiedReplicas(c kclient.Interface, controller *kapi.ReplicationController, specifiedReplicas int) wait.ConditionFunc {
|
|
| 87 |
+func controllerHasSpecifiedReplicas(c kclient.Interface, controller *kapi.ReplicationController, specifiedReplicas int32) wait.ConditionFunc {
|
|
| 88 | 88 |
// If we're given a controller where the status lags the spec, it either means that the controller is stale, |
| 89 | 89 |
// or that the rc manager hasn't noticed the update yet. Polling status.Replicas is not safe in the latter case. |
| 90 | 90 |
desiredGeneration := controller.Generation |
| ... | ... |
@@ -98,6 +98,6 @@ func controllerHasSpecifiedReplicas(c kclient.Interface, controller *kapi.Replic |
| 98 | 98 |
// or, after this check has passed, a modification causes the rc manager to create more pods. |
| 99 | 99 |
// This will not be an issue once we've implemented graceful delete for rcs, but till then |
| 100 | 100 |
// concurrent stop operations on the same rc might have unintended side effects. |
| 101 |
- return ctrl.Status.ObservedGeneration >= desiredGeneration && ctrl.Status.Replicas == int32(specifiedReplicas), nil |
|
| 101 |
+ return ctrl.Status.ObservedGeneration >= desiredGeneration && ctrl.Status.Replicas == specifiedReplicas, nil |
|
| 102 | 102 |
} |
| 103 | 103 |
} |
| ... | ... |
@@ -61,7 +61,7 @@ func TestScale(t *testing.T) {
|
| 61 | 61 |
// scale replica count. |
| 62 | 62 |
scale := action.(ktestclient.UpdateAction).GetObject().(*extensions.Scale) |
| 63 | 63 |
scale.Status.Replicas = scale.Spec.Replicas |
| 64 |
- config.Spec.Replicas = int(scale.Spec.Replicas) |
|
| 64 |
+ config.Spec.Replicas = scale.Spec.Replicas |
|
| 65 | 65 |
deployment.Spec.Replicas = scale.Spec.Replicas |
| 66 | 66 |
deployment.Status.Replicas = deployment.Spec.Replicas |
| 67 | 67 |
return true, scale, nil |
| ... | ... |
@@ -78,7 +78,7 @@ func TestScale(t *testing.T) {
|
| 78 | 78 |
} |
| 79 | 79 |
} |
| 80 | 80 |
|
| 81 |
- if e, a := config.Spec.Replicas, deployment.Spec.Replicas; e != int(a) {
|
|
| 81 |
+ if e, a := config.Spec.Replicas, deployment.Spec.Replicas; e != a {
|
|
| 82 | 82 |
t.Errorf("expected rc/%s replicas %d, got %d", deployment.Name, e, a)
|
| 83 | 83 |
} |
| 84 | 84 |
} |
| ... | ... |
@@ -66,7 +66,7 @@ func LabelForDeploymentConfig(config *deployapi.DeploymentConfig) string {
|
| 66 | 66 |
|
| 67 | 67 |
// DeploymentNameForConfigVersion returns the name of the version-th deployment |
| 68 | 68 |
// for the config that has the provided name |
| 69 |
-func DeploymentNameForConfigVersion(name string, version int) string {
|
|
| 69 |
+func DeploymentNameForConfigVersion(name string, version int64) string {
|
|
| 70 | 70 |
return fmt.Sprintf("%s-%d", name, version)
|
| 71 | 71 |
} |
| 72 | 72 |
|
| ... | ... |
@@ -176,7 +176,7 @@ func MakeDeployment(config *deployapi.DeploymentConfig, codec runtime.Codec) (*a |
| 176 | 176 |
} |
| 177 | 177 |
podAnnotations[deployapi.DeploymentAnnotation] = deploymentName |
| 178 | 178 |
podAnnotations[deployapi.DeploymentConfigAnnotation] = config.Name |
| 179 |
- podAnnotations[deployapi.DeploymentVersionAnnotation] = strconv.Itoa(config.Status.LatestVersion) |
|
| 179 |
+ podAnnotations[deployapi.DeploymentVersionAnnotation] = strconv.FormatInt(config.Status.LatestVersion, 10) |
|
| 180 | 180 |
|
| 181 | 181 |
deployment := &api.ReplicationController{
|
| 182 | 182 |
ObjectMeta: api.ObjectMeta{
|
| ... | ... |
@@ -185,9 +185,9 @@ func MakeDeployment(config *deployapi.DeploymentConfig, codec runtime.Codec) (*a |
| 185 | 185 |
deployapi.DeploymentConfigAnnotation: config.Name, |
| 186 | 186 |
deployapi.DeploymentStatusAnnotation: string(deployapi.DeploymentStatusNew), |
| 187 | 187 |
deployapi.DeploymentEncodedConfigAnnotation: encodedConfig, |
| 188 |
- deployapi.DeploymentVersionAnnotation: strconv.Itoa(config.Status.LatestVersion), |
|
| 188 |
+ deployapi.DeploymentVersionAnnotation: strconv.FormatInt(config.Status.LatestVersion, 10), |
|
| 189 | 189 |
// This is the target replica count for the new deployment. |
| 190 |
- deployapi.DesiredReplicasAnnotation: strconv.Itoa(config.Spec.Replicas), |
|
| 190 |
+ deployapi.DesiredReplicasAnnotation: strconv.Itoa(int(config.Spec.Replicas)), |
|
| 191 | 191 |
deployapi.DeploymentReplicasAnnotation: strconv.Itoa(0), |
| 192 | 192 |
}, |
| 193 | 193 |
Labels: controllerLabels, |
| ... | ... |
@@ -232,20 +232,20 @@ func DeploymentStatusReasonFor(obj runtime.Object) string {
|
| 232 | 232 |
return annotationFor(obj, deployapi.DeploymentStatusReasonAnnotation) |
| 233 | 233 |
} |
| 234 | 234 |
|
| 235 |
-func DeploymentDesiredReplicas(obj runtime.Object) (int, bool) {
|
|
| 236 |
- return intAnnotationFor(obj, deployapi.DesiredReplicasAnnotation) |
|
| 235 |
+func DeploymentDesiredReplicas(obj runtime.Object) (int32, bool) {
|
|
| 236 |
+ return int32AnnotationFor(obj, deployapi.DesiredReplicasAnnotation) |
|
| 237 | 237 |
} |
| 238 | 238 |
|
| 239 |
-func DeploymentReplicas(obj runtime.Object) (int, bool) {
|
|
| 240 |
- return intAnnotationFor(obj, deployapi.DeploymentReplicasAnnotation) |
|
| 239 |
+func DeploymentReplicas(obj runtime.Object) (int32, bool) {
|
|
| 240 |
+ return int32AnnotationFor(obj, deployapi.DeploymentReplicasAnnotation) |
|
| 241 | 241 |
} |
| 242 | 242 |
|
| 243 | 243 |
func EncodedDeploymentConfigFor(obj runtime.Object) string {
|
| 244 | 244 |
return annotationFor(obj, deployapi.DeploymentEncodedConfigAnnotation) |
| 245 | 245 |
} |
| 246 | 246 |
|
| 247 |
-func DeploymentVersionFor(obj runtime.Object) int {
|
|
| 248 |
- v, err := strconv.Atoi(annotationFor(obj, deployapi.DeploymentVersionAnnotation)) |
|
| 247 |
+func DeploymentVersionFor(obj runtime.Object) int64 {
|
|
| 248 |
+ v, err := strconv.ParseInt(annotationFor(obj, deployapi.DeploymentVersionAnnotation), 10, 64) |
|
| 249 | 249 |
if err != nil {
|
| 250 | 250 |
return -1 |
| 251 | 251 |
} |
| ... | ... |
@@ -316,16 +316,16 @@ func annotationFor(obj runtime.Object, key string) string {
|
| 316 | 316 |
return meta.Annotations[key] |
| 317 | 317 |
} |
| 318 | 318 |
|
| 319 |
-func intAnnotationFor(obj runtime.Object, key string) (int, bool) {
|
|
| 319 |
+func int32AnnotationFor(obj runtime.Object, key string) (int32, bool) {
|
|
| 320 | 320 |
s := annotationFor(obj, key) |
| 321 | 321 |
if len(s) == 0 {
|
| 322 | 322 |
return 0, false |
| 323 | 323 |
} |
| 324 |
- i, err := strconv.Atoi(s) |
|
| 324 |
+ i, err := strconv.ParseInt(s, 10, 32) |
|
| 325 | 325 |
if err != nil {
|
| 326 | 326 |
return 0, false |
| 327 | 327 |
} |
| 328 |
- return i, true |
|
| 328 |
+ return int32(i), true |
|
| 329 | 329 |
} |
| 330 | 330 |
|
| 331 | 331 |
// ByLatestVersionAsc sorts deployments by LatestVersion ascending. |
| ... | ... |
@@ -74,7 +74,7 @@ func TestMakeDeploymentOk(t *testing.T) {
|
| 74 | 74 |
expectedAnnotations := map[string]string{
|
| 75 | 75 |
deployapi.DeploymentConfigAnnotation: config.Name, |
| 76 | 76 |
deployapi.DeploymentStatusAnnotation: string(deployapi.DeploymentStatusNew), |
| 77 |
- deployapi.DeploymentVersionAnnotation: strconv.Itoa(config.Status.LatestVersion), |
|
| 77 |
+ deployapi.DeploymentVersionAnnotation: strconv.FormatInt(config.Status.LatestVersion, 10), |
|
| 78 | 78 |
} |
| 79 | 79 |
|
| 80 | 80 |
for key, expected := range expectedAnnotations {
|
| ... | ... |
@@ -86,7 +86,7 @@ func TestMakeDeploymentOk(t *testing.T) {
|
| 86 | 86 |
expectedAnnotations = map[string]string{
|
| 87 | 87 |
deployapi.DeploymentAnnotation: deployment.Name, |
| 88 | 88 |
deployapi.DeploymentConfigAnnotation: config.Name, |
| 89 |
- deployapi.DeploymentVersionAnnotation: strconv.Itoa(config.Status.LatestVersion), |
|
| 89 |
+ deployapi.DeploymentVersionAnnotation: strconv.FormatInt(config.Status.LatestVersion, 10), |
|
| 90 | 90 |
} |
| 91 | 91 |
|
| 92 | 92 |
for key, expected := range expectedAnnotations {
|
| ... | ... |
@@ -134,7 +134,7 @@ func TestMakeDeploymentOk(t *testing.T) {
|
| 134 | 134 |
} |
| 135 | 135 |
|
| 136 | 136 |
func TestDeploymentsByLatestVersion_sorting(t *testing.T) {
|
| 137 |
- mkdeployment := func(version int) kapi.ReplicationController {
|
|
| 137 |
+ mkdeployment := func(version int64) kapi.ReplicationController {
|
|
| 138 | 138 |
deployment, _ := MakeDeployment(deploytest.OkDeploymentConfig(version), kapi.Codecs.LegacyCodec(deployapi.SchemeGroupVersion)) |
| 139 | 139 |
return *deployment |
| 140 | 140 |
} |
| ... | ... |
@@ -145,13 +145,13 @@ func TestDeploymentsByLatestVersion_sorting(t *testing.T) {
|
| 145 | 145 |
mkdeployment(3), |
| 146 | 146 |
} |
| 147 | 147 |
sort.Sort(ByLatestVersionAsc(deployments)) |
| 148 |
- for i := 0; i < 4; i++ {
|
|
| 148 |
+ for i := int64(0); i < 4; i++ {
|
|
| 149 | 149 |
if e, a := i+1, DeploymentVersionFor(&deployments[i]); e != a {
|
| 150 | 150 |
t.Errorf("expected deployment[%d]=%d, got %d", i, e, a)
|
| 151 | 151 |
} |
| 152 | 152 |
} |
| 153 | 153 |
sort.Sort(ByLatestVersionDesc(deployments)) |
| 154 |
- for i := 0; i < 4; i++ {
|
|
| 154 |
+ for i := int64(0); i < 4; i++ {
|
|
| 155 | 155 |
if e, a := 4-i, DeploymentVersionFor(&deployments[i]); e != a {
|
| 156 | 156 |
t.Errorf("expected deployment[%d]=%d, got %d", i, e, a)
|
| 157 | 157 |
} |
| ... | ... |
@@ -478,7 +478,7 @@ func (r *repository) fillImageWithMetadata(manifest *schema1.SignedManifest, ima |
| 478 | 478 |
context.GetLogger(r.ctx).Errorf("failed to stat blobs %s of image %s", layer.Name, image.DockerImageReference)
|
| 479 | 479 |
return err |
| 480 | 480 |
} |
| 481 |
- layer.Size = desc.Size |
|
| 481 |
+ layer.LayerSize = desc.Size |
|
| 482 | 482 |
// count empty layer just once (empty layer may actually have non-zero size) |
| 483 | 483 |
if !layerSet.Has(layer.Name) {
|
| 484 | 484 |
size += desc.Size |
| ... | ... |
@@ -370,7 +370,7 @@ func DeepCopy_api_ImageImportStatus(in ImageImportStatus, out *ImageImportStatus |
| 370 | 370 |
|
| 371 | 371 |
func DeepCopy_api_ImageLayer(in ImageLayer, out *ImageLayer, c *conversion.Cloner) error {
|
| 372 | 372 |
out.Name = in.Name |
| 373 |
- out.Size = in.Size |
|
| 373 |
+ out.LayerSize = in.LayerSize |
|
| 374 | 374 |
return nil |
| 375 | 375 |
} |
| 376 | 376 |
|
| ... | ... |
@@ -432,14 +432,14 @@ func ImageWithMetadata(image *Image) error {
|
| 432 | 432 |
image.DockerImageLayers[i].Name = layer.DockerBlobSum |
| 433 | 433 |
} |
| 434 | 434 |
if len(manifest.History) == len(image.DockerImageLayers) {
|
| 435 |
- image.DockerImageLayers[0].Size = v1Metadata.Size |
|
| 435 |
+ image.DockerImageLayers[0].LayerSize = v1Metadata.Size |
|
| 436 | 436 |
var size = DockerV1CompatibilityImageSize{}
|
| 437 | 437 |
for i, obj := range manifest.History[1:] {
|
| 438 | 438 |
size.Size = 0 |
| 439 | 439 |
if err := json.Unmarshal([]byte(obj.DockerV1Compatibility), &size); err != nil {
|
| 440 | 440 |
continue |
| 441 | 441 |
} |
| 442 |
- image.DockerImageLayers[i+1].Size = size.Size |
|
| 442 |
+ image.DockerImageLayers[i+1].LayerSize = size.Size |
|
| 443 | 443 |
} |
| 444 | 444 |
} else {
|
| 445 | 445 |
glog.V(4).Infof("Imported image has mismatched layer count and history count, not updating image metadata: %s", image.Name)
|
| ... | ... |
@@ -462,7 +462,7 @@ func ImageWithMetadata(image *Image) error {
|
| 462 | 462 |
if len(image.DockerImageLayers) > 0 {
|
| 463 | 463 |
size := int64(0) |
| 464 | 464 |
for _, layer := range image.DockerImageLayers {
|
| 465 |
- size += layer.Size |
|
| 465 |
+ size += layer.LayerSize |
|
| 466 | 466 |
} |
| 467 | 467 |
image.DockerImageMetadata.Size = size |
| 468 | 468 |
} else {
|
| ... | ... |
@@ -671,11 +671,11 @@ func TestImageWithMetadata(t *testing.T) {
|
| 671 | 671 |
}, |
| 672 | 672 |
DockerImageManifest: validImageWithManifestData().DockerImageManifest, |
| 673 | 673 |
DockerImageLayers: []ImageLayer{
|
| 674 |
- {Name: "tarsum.dev+sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", Size: 0},
|
|
| 675 |
- {Name: "tarsum.dev+sha256:2aaacc362ac6be2b9e9ae8c6029f6f616bb50aec63746521858e47841b90fabd", Size: 188097705},
|
|
| 676 |
- {Name: "tarsum.dev+sha256:c937c4bb1c1a21cc6d94340812262c6472092028972ae69b551b1a70d4276171", Size: 194533},
|
|
| 677 |
- {Name: "tarsum.dev+sha256:b194de3772ebbcdc8f244f663669799ac1cb141834b7cb8b69100285d357a2b0", Size: 1895},
|
|
| 678 |
- {Name: "tarsum.dev+sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", Size: 0},
|
|
| 674 |
+ {Name: "tarsum.dev+sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", LayerSize: 0},
|
|
| 675 |
+ {Name: "tarsum.dev+sha256:2aaacc362ac6be2b9e9ae8c6029f6f616bb50aec63746521858e47841b90fabd", LayerSize: 188097705},
|
|
| 676 |
+ {Name: "tarsum.dev+sha256:c937c4bb1c1a21cc6d94340812262c6472092028972ae69b551b1a70d4276171", LayerSize: 194533},
|
|
| 677 |
+ {Name: "tarsum.dev+sha256:b194de3772ebbcdc8f244f663669799ac1cb141834b7cb8b69100285d357a2b0", LayerSize: 1895},
|
|
| 678 |
+ {Name: "tarsum.dev+sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", LayerSize: 0},
|
|
| 679 | 679 |
}, |
| 680 | 680 |
DockerImageMetadata: DockerImage{
|
| 681 | 681 |
ID: "2d24f826cb16146e2016ff349a8a33ed5830f3b938d45c0f82943f4ab8c097e7", |
| ... | ... |
@@ -45,7 +45,7 @@ func Convert_api_Image_To_v1_Image(in *newer.Image, out *Image, s conversion.Sco |
| 45 | 45 |
out.DockerImageLayers = make([]ImageLayer, len(in.DockerImageLayers)) |
| 46 | 46 |
for i := range in.DockerImageLayers {
|
| 47 | 47 |
out.DockerImageLayers[i].Name = in.DockerImageLayers[i].Name |
| 48 |
- out.DockerImageLayers[i].Size = in.DockerImageLayers[i].Size |
|
| 48 |
+ out.DockerImageLayers[i].LayerSize = in.DockerImageLayers[i].LayerSize |
|
| 49 | 49 |
} |
| 50 | 50 |
} else {
|
| 51 | 51 |
out.DockerImageLayers = nil |
| ... | ... |
@@ -96,7 +96,7 @@ func Convert_v1_Image_To_api_Image(in *Image, out *newer.Image, s conversion.Sco |
| 96 | 96 |
out.DockerImageLayers = make([]newer.ImageLayer, len(in.DockerImageLayers)) |
| 97 | 97 |
for i := range in.DockerImageLayers {
|
| 98 | 98 |
out.DockerImageLayers[i].Name = in.DockerImageLayers[i].Name |
| 99 |
- out.DockerImageLayers[i].Size = in.DockerImageLayers[i].Size |
|
| 99 |
+ out.DockerImageLayers[i].LayerSize = in.DockerImageLayers[i].LayerSize |
|
| 100 | 100 |
} |
| 101 | 101 |
} else {
|
| 102 | 102 |
out.DockerImageLayers = nil |
| ... | ... |
@@ -201,7 +201,7 @@ func Convert_api_ImageImportStatus_To_v1_ImageImportStatus(in *image_api.ImageIm |
| 201 | 201 |
|
| 202 | 202 |
func autoConvert_v1_ImageLayer_To_api_ImageLayer(in *ImageLayer, out *image_api.ImageLayer, s conversion.Scope) error {
|
| 203 | 203 |
out.Name = in.Name |
| 204 |
- out.Size = in.Size |
|
| 204 |
+ out.LayerSize = in.LayerSize |
|
| 205 | 205 |
return nil |
| 206 | 206 |
} |
| 207 | 207 |
|
| ... | ... |
@@ -211,7 +211,7 @@ func Convert_v1_ImageLayer_To_api_ImageLayer(in *ImageLayer, out *image_api.Imag |
| 211 | 211 |
|
| 212 | 212 |
func autoConvert_api_ImageLayer_To_v1_ImageLayer(in *image_api.ImageLayer, out *ImageLayer, s conversion.Scope) error {
|
| 213 | 213 |
out.Name = in.Name |
| 214 |
- out.Size = in.Size |
|
| 214 |
+ out.LayerSize = in.LayerSize |
|
| 215 | 215 |
return nil |
| 216 | 216 |
} |
| 217 | 217 |
|
| ... | ... |
@@ -24,7 +24,7 @@ func TestRoundTripVersionedObject(t *testing.T) {
|
| 24 | 24 |
i := &newer.Image{
|
| 25 | 25 |
ObjectMeta: kapi.ObjectMeta{Name: "foo"},
|
| 26 | 26 |
|
| 27 |
- DockerImageLayers: []newer.ImageLayer{{Name: "foo", Size: 10}},
|
|
| 27 |
+ DockerImageLayers: []newer.ImageLayer{{Name: "foo", LayerSize: 10}},
|
|
| 28 | 28 |
DockerImageMetadata: *d, |
| 29 | 29 |
DockerImageReference: "foo/bar/baz", |
| 30 | 30 |
} |
| ... | ... |
@@ -135,7 +135,7 @@ func DeepCopy_v1_ImageImportStatus(in ImageImportStatus, out *ImageImportStatus, |
| 135 | 135 |
|
| 136 | 136 |
func DeepCopy_v1_ImageLayer(in ImageLayer, out *ImageLayer, c *conversion.Cloner) error {
|
| 137 | 137 |
out.Name = in.Name |
| 138 |
- out.Size = in.Size |
|
| 138 |
+ out.LayerSize = in.LayerSize |
|
| 139 | 139 |
return nil |
| 140 | 140 |
} |
| 141 | 141 |
|
| ... | ... |
@@ -59,7 +59,7 @@ func (ImageImportStatus) SwaggerDoc() map[string]string {
|
| 59 | 59 |
var map_ImageLayer = map[string]string{
|
| 60 | 60 |
"": "ImageLayer represents a single layer of the image. Some images may have multiple layers. Some may have none.", |
| 61 | 61 |
"name": "Name of the layer as defined by the underlying store.", |
| 62 |
- "size": "Size of the layer as defined by the underlying store.", |
|
| 62 |
+ "size": "Size of the layer in bytes as defined by the underlying store.", |
|
| 63 | 63 |
} |
| 64 | 64 |
|
| 65 | 65 |
func (ImageLayer) SwaggerDoc() map[string]string {
|
| ... | ... |
@@ -40,7 +40,7 @@ type Image struct {
|
| 40 | 40 |
type ImageLayer struct {
|
| 41 | 41 |
// Name of the layer as defined by the underlying store. |
| 42 | 42 |
Name string `json:"name"` |
| 43 |
- // LayerSize of the layer as defined by the underlying store. |
|
| 43 |
+ // Size of the layer in bytes as defined by the underlying store. |
|
| 44 | 44 |
LayerSize int64 `json:"size"` |
| 45 | 45 |
} |
| 46 | 46 |
|
| ... | ... |
@@ -214,7 +214,7 @@ func TestCreateSetsMetadata(t *testing.T) {
|
| 214 | 214 |
t.Errorf("image had size %d", image.DockerImageMetadata.Size)
|
| 215 | 215 |
return false |
| 216 | 216 |
} |
| 217 |
- if len(image.DockerImageLayers) != 4 || image.DockerImageLayers[0].Name != "sha256:744b46d0ac8636c45870a03830d8d82c20b75fbfb9bc937d5e61005d23ad4cfe" || image.DockerImageLayers[0].Size != 15141568 {
|
|
| 217 |
+ if len(image.DockerImageLayers) != 4 || image.DockerImageLayers[0].Name != "sha256:744b46d0ac8636c45870a03830d8d82c20b75fbfb9bc937d5e61005d23ad4cfe" || image.DockerImageLayers[0].LayerSize != 15141568 {
|
|
| 218 | 218 |
t.Errorf("unexpected layers: %#v", image.DockerImageLayers)
|
| 219 | 219 |
return false |
| 220 | 220 |
} |
| ... | ... |
@@ -281,7 +281,7 @@ func TestUpdateResetsMetadata(t *testing.T) {
|
| 281 | 281 |
t.Errorf("image had size %d", image.DockerImageMetadata.Size)
|
| 282 | 282 |
return false |
| 283 | 283 |
} |
| 284 |
- if len(image.DockerImageLayers) != 1 && image.DockerImageLayers[0].Size != 10 {
|
|
| 284 |
+ if len(image.DockerImageLayers) != 1 && image.DockerImageLayers[0].LayerSize != 10 {
|
|
| 285 | 285 |
t.Errorf("unexpected layers: %#v", image.DockerImageLayers)
|
| 286 | 286 |
return false |
| 287 | 287 |
} |
| ... | ... |
@@ -290,7 +290,7 @@ func TestUpdateResetsMetadata(t *testing.T) {
|
| 290 | 290 |
existing: &api.Image{
|
| 291 | 291 |
ObjectMeta: kapi.ObjectMeta{Name: "foo", ResourceVersion: "1"},
|
| 292 | 292 |
DockerImageReference: "openshift/ruby-19-centos-2", |
| 293 |
- DockerImageLayers: []api.ImageLayer{{Name: "test", Size: 10}},
|
|
| 293 |
+ DockerImageLayers: []api.ImageLayer{{Name: "test", LayerSize: 10}},
|
|
| 294 | 294 |
DockerImageMetadata: api.DockerImage{ID: "foo"},
|
| 295 | 295 |
}, |
| 296 | 296 |
image: &api.Image{
|
| ... | ... |
@@ -318,7 +318,7 @@ func TestUpdateResetsMetadata(t *testing.T) {
|
| 318 | 318 |
t.Errorf("image had size %d", image.DockerImageMetadata.Size)
|
| 319 | 319 |
return false |
| 320 | 320 |
} |
| 321 |
- if len(image.DockerImageLayers) != 4 || image.DockerImageLayers[0].Name != "sha256:744b46d0ac8636c45870a03830d8d82c20b75fbfb9bc937d5e61005d23ad4cfe" || image.DockerImageLayers[0].Size != 15141568 {
|
|
| 321 |
+ if len(image.DockerImageLayers) != 4 || image.DockerImageLayers[0].Name != "sha256:744b46d0ac8636c45870a03830d8d82c20b75fbfb9bc937d5e61005d23ad4cfe" || image.DockerImageLayers[0].LayerSize != 15141568 {
|
|
| 322 | 322 |
t.Errorf("unexpected layers: %#v", image.DockerImageLayers)
|
| 323 | 323 |
return false |
| 324 | 324 |
} |
| ... | ... |
@@ -355,7 +355,7 @@ func TestUpdateResetsMetadata(t *testing.T) {
|
| 355 | 355 |
t.Errorf("image had size %d", image.DockerImageMetadata.Size)
|
| 356 | 356 |
return false |
| 357 | 357 |
} |
| 358 |
- if len(image.DockerImageLayers) != 4 || image.DockerImageLayers[0].Name != "sha256:744b46d0ac8636c45870a03830d8d82c20b75fbfb9bc937d5e61005d23ad4cfe" || image.DockerImageLayers[0].Size != 15141568 {
|
|
| 358 |
+ if len(image.DockerImageLayers) != 4 || image.DockerImageLayers[0].Name != "sha256:744b46d0ac8636c45870a03830d8d82c20b75fbfb9bc937d5e61005d23ad4cfe" || image.DockerImageLayers[0].LayerSize != 15141568 {
|
|
| 359 | 359 |
t.Errorf("unexpected layers: %#v", image.DockerImageLayers)
|
| 360 | 360 |
return false |
| 361 | 361 |
} |
| ... | ... |
@@ -45,7 +45,7 @@ func getClientConfig(path string) (*restclient.Config, error) {
|
| 45 | 45 |
// Generate the IP failover monitor (keepalived) container environment entries. |
| 46 | 46 |
func generateEnvEntries(name string, options *ipfailover.IPFailoverConfigCmdOptions, kconfig *restclient.Config) app.Environment {
|
| 47 | 47 |
watchPort := strconv.Itoa(options.WatchPort) |
| 48 |
- replicas := strconv.Itoa(options.Replicas) |
|
| 48 |
+ replicas := strconv.FormatInt(int64(options.Replicas), 10) |
|
| 49 | 49 |
insecureStr := strconv.FormatBool(kconfig.Insecure) |
| 50 | 50 |
VRRPIDOffset := strconv.Itoa(options.VRRPIDOffset) |
| 51 | 51 |
|
| ... | ... |
@@ -9,7 +9,7 @@ import ( |
| 9 | 9 |
"github.com/openshift/origin/pkg/ipfailover" |
| 10 | 10 |
) |
| 11 | 11 |
|
| 12 |
-func makeIPFailoverConfigOptions(selector string, replicas int, serviceAccount string) *ipfailover.IPFailoverConfigCmdOptions {
|
|
| 12 |
+func makeIPFailoverConfigOptions(selector string, replicas int32, serviceAccount string) *ipfailover.IPFailoverConfigCmdOptions {
|
|
| 13 | 13 |
return &ipfailover.IPFailoverConfigCmdOptions{
|
| 14 | 14 |
ImageTemplate: variable.NewDefaultImageTemplate(), |
| 15 | 15 |
Selector: selector, |
| ... | ... |
@@ -35,7 +35,7 @@ func TestGenerateDeploymentConfig(t *testing.T) {
|
| 35 | 35 |
tests := []struct {
|
| 36 | 36 |
Name string |
| 37 | 37 |
Selector string |
| 38 |
- Replicas int |
|
| 38 |
+ Replicas int32 |
|
| 39 | 39 |
PodSelectorLength int |
| 40 | 40 |
ServiceAccount string |
| 41 | 41 |
}{
|
| ... | ... |
@@ -84,7 +84,7 @@ func TestTriggers_manual(t *testing.T) {
|
| 84 | 84 |
if e, a := config.Name, deployutil.DeploymentConfigNameFor(deployment); e != a {
|
| 85 | 85 |
t.Fatalf("Expected deployment annotated with deploymentConfig '%s', got '%s'", e, a)
|
| 86 | 86 |
} |
| 87 |
- if e, a := 1, deployutil.DeploymentVersionFor(deployment); e != a {
|
|
| 87 |
+ if e, a := int64(1), deployutil.DeploymentVersionFor(deployment); e != a {
|
|
| 88 | 88 |
t.Fatalf("Deployment annotation version does not match: %#v", deployment)
|
| 89 | 89 |
} |
| 90 | 90 |
} |