From 2533453491a68628352a4a2deac04d4095f7c5f6 Mon Sep 17 00:00:00 2001 From: Lakshmi Gururaja Rao Date: Thu, 11 Jul 2019 15:05:03 -0700 Subject: [PATCH 01/10] First pass at adding a cancel deploy spec --- integ/simple_test.go | 56 +++++++++++++++++++ pkg/apis/app/v1alpha1/types.go | 1 + .../flinkapplication/flink_state_machine.go | 4 ++ .../flink_state_machine_test.go | 27 +++++++++ 4 files changed, 88 insertions(+) diff --git a/integ/simple_test.go b/integ/simple_test.go index 0eeb4137..a861d399 100644 --- a/integ/simple_test.go +++ b/integ/simple_test.go @@ -4,6 +4,8 @@ import ( "encoding/json" "fmt" + "k8s.io/apimachinery/pkg/api/resource" + "os" "time" @@ -170,6 +172,60 @@ func (s *IntegSuite) TestSimple(c *C) { }, "") } + // Test cancelling a deploy + + { + newApp, err := s.Util.GetFlinkApplication(config.Name) + c.Assert(err, IsNil) + // User sets large (bad) value for cluster update + var TaskManagerDefaultResources = corev1.ResourceRequirements{ + Requests: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("2"), + corev1.ResourceMemory: resource.MustParse("5Gi"), + }, + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("2"), + corev1.ResourceMemory: resource.MustParse("5Gi"), + }, + } + newApp.Spec.TaskManagerConfig.Resources = &TaskManagerDefaultResources + + _, _ = s.Util.FlinkApps().Update(newApp) + c.Assert(s.Util.WaitForPhase(newApp.Name, v1alpha1.FlinkApplicationClusterStarting, ""), IsNil) + + // User realizes error and cancels the deploy + log.Infof("Cancelling deploy...") + newApp.Spec.CancelDeploy = true + _, _ = s.Util.FlinkApps().Update(newApp) + + // we should end up in the DeployFailed phase + c.Assert(s.Util.WaitForPhase(newApp.Name, v1alpha1.FlinkApplicationDeployFailed, ""), IsNil) + c.Assert(newApp.Spec.CancelDeploy, Equals, true) + log.Info("User cancelled deploy. Job is in deploy failed, waiting for tasks to start") + + // but the job should still be running + c.Assert(newApp.Status.JobStatus.State, Equals, v1alpha1.Running) + + log.Info("Attempting to roll forward with fix") + + // Fixed resources + var TaskManagerFixedResources = corev1.ResourceRequirements{ + Requests: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("0.2"), + corev1.ResourceMemory: resource.MustParse("200Mi"), + }, + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("0.2"), + corev1.ResourceMemory: resource.MustParse("200Mi"), + }, + } + // and we should be able to roll forward by resubmitting with a fixed config + updateAndValidate(c, s, config.Name, func(app *v1alpha1.FlinkApplication) { + app.Spec.TaskManagerConfig.Resources = &TaskManagerFixedResources + app.Spec.CancelDeploy = false + }, "") + } + // delete the application and ensure everything is cleaned up successfully c.Assert(s.Util.FlinkApps().Delete(config.Name, &v1.DeleteOptions{}), IsNil) diff --git a/pkg/apis/app/v1alpha1/types.go b/pkg/apis/app/v1alpha1/types.go index da8ad9a1..7e8ef4ac 100644 --- a/pkg/apis/app/v1alpha1/types.go +++ b/pkg/apis/app/v1alpha1/types.go @@ -53,6 +53,7 @@ type FlinkApplicationSpec struct { RestartNonce string `json:"restartNonce"` DeleteMode DeleteMode `json:"deleteMode,omitempty"` AllowNonRestoredState bool `json:"allowNonRestoredState,omitempty"` + CancelDeploy bool `json:"cancelDeploy"` } type FlinkConfig map[string]interface{} diff --git a/pkg/controller/flinkapplication/flink_state_machine.go b/pkg/controller/flinkapplication/flink_state_machine.go index 50499aab..0c2577a3 100644 --- a/pkg/controller/flinkapplication/flink_state_machine.go +++ b/pkg/controller/flinkapplication/flink_state_machine.go @@ -80,6 +80,10 @@ func (s *FlinkStateMachine) updateApplicationPhase(ctx context.Context, applicat } func (s *FlinkStateMachine) shouldRollback(ctx context.Context, application *v1alpha1.FlinkApplication) bool { + if application.Spec.CancelDeploy { + //application.Spec.CancelDeploy = false + return true + } if application.Status.DeployHash == "" { // TODO: we may want some more sophisticated way of handling this case // there's no previous deploy for this application, so nothing to roll back to diff --git a/pkg/controller/flinkapplication/flink_state_machine_test.go b/pkg/controller/flinkapplication/flink_state_machine_test.go index 24956b6d..389866c5 100644 --- a/pkg/controller/flinkapplication/flink_state_machine_test.go +++ b/pkg/controller/flinkapplication/flink_state_machine_test.go @@ -1130,3 +1130,30 @@ func TestErrorHandlingInRunningPhase(t *testing.T) { assert.Nil(t, app.Status.LastSeenError) } + +func TestCancelDeploy(t *testing.T) { + app := v1alpha1.FlinkApplication{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-app", + Namespace: "flink", + }, + Spec: v1alpha1.FlinkApplicationSpec{ + JarName: "job.jar", + Parallelism: 5, + EntryClass: "com.my.Class", + ProgramArgs: "--test", + CancelDeploy: true, + }, + Status: v1alpha1.FlinkApplicationStatus{ + Phase: v1alpha1.FlinkApplicationClusterStarting, + DeployHash: "old-hash-retry-err", + }, + } + + stateMachineForTest := getTestStateMachine() + err := stateMachineForTest.Handle(context.Background(), &app) + assert.Nil(t, err) + // cancelled deploy while cluster is starting + assert.Equal(t, v1alpha1.FlinkApplicationDeployFailed, app.Status.Phase) + assert.True(t, app.Spec.CancelDeploy) +} From c4000a90889d327d725710f95d057a0f2c0ac0a6 Mon Sep 17 00:00:00 2001 From: Lakshmi Gururaja Rao Date: Thu, 11 Jul 2019 16:14:30 -0700 Subject: [PATCH 02/10] Increase integ test timeout to 22m --- integ/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integ/test.sh b/integ/test.sh index 6250af09..21e7bb3a 100755 --- a/integ/test.sh +++ b/integ/test.sh @@ -9,5 +9,5 @@ export OPERATOR_IMAGE=127.0.0.1:32000/flinkk8soperator:local umask 000 cd $(dirname "$0") -go test -timeout 20m -check.vv IntegSuite +go test -timeout 22m -check.vv IntegSuite From a23ba5803f01eb822cac7098ec052fbec26f7c13 Mon Sep 17 00:00:00 2001 From: Lakshmi Gururaja Rao Date: Fri, 12 Jul 2019 08:42:52 -0700 Subject: [PATCH 03/10] Add crd doc --- docs/crd.md | 3 +++ pkg/controller/flinkapplication/flink_state_machine.go | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/crd.md b/docs/crd.md index ef93c8e1..11c2decc 100644 --- a/docs/crd.md +++ b/docs/crd.md @@ -105,3 +105,6 @@ Below is the list of fields in the custom resource and their description * **VolumeMounts** `type:[]v1.VolumeMount` Describes a mounting of a Volume within a container. + + * **CancelDeploy** `type:bool` + Can be set to true to force cancel a deploy/update. Resetting to false or un-setting implies the deploy will continue. diff --git a/pkg/controller/flinkapplication/flink_state_machine.go b/pkg/controller/flinkapplication/flink_state_machine.go index 0c2577a3..dc41d6a0 100644 --- a/pkg/controller/flinkapplication/flink_state_machine.go +++ b/pkg/controller/flinkapplication/flink_state_machine.go @@ -81,7 +81,6 @@ func (s *FlinkStateMachine) updateApplicationPhase(ctx context.Context, applicat func (s *FlinkStateMachine) shouldRollback(ctx context.Context, application *v1alpha1.FlinkApplication) bool { if application.Spec.CancelDeploy { - //application.Spec.CancelDeploy = false return true } if application.Status.DeployHash == "" { From a24557a10e77f421f3a9d30bbd9649cba79d35bd Mon Sep 17 00:00:00 2001 From: Lakshmi Gururaja Rao Date: Thu, 25 Jul 2019 16:20:58 -0700 Subject: [PATCH 04/10] Change bool name to forceRollback and include rollbackHash in status --- integ/simple_test.go | 11 ++++++----- pkg/apis/app/v1alpha1/types.go | 3 ++- .../flinkapplication/flink_state_machine.go | 4 +++- .../flinkapplication/flink_state_machine_test.go | 16 ++++++++-------- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/integ/simple_test.go b/integ/simple_test.go index 54573b4d..e4b0613a 100644 --- a/integ/simple_test.go +++ b/integ/simple_test.go @@ -172,7 +172,7 @@ func (s *IntegSuite) TestSimple(c *C) { }, "") } - // Test cancelling a deploy + // Test force rollback of an active deploy { newApp, err := s.Util.GetFlinkApplication(config.Name) @@ -195,12 +195,13 @@ func (s *IntegSuite) TestSimple(c *C) { // User realizes error and cancels the deploy log.Infof("Cancelling deploy...") - newApp.Spec.CancelDeploy = true + newApp.Spec.ForceRollback = true _, _ = s.Util.FlinkApps().Update(newApp) // we should end up in the DeployFailed phase c.Assert(s.Util.WaitForPhase(newApp.Name, v1alpha1.FlinkApplicationDeployFailed, ""), IsNil) - c.Assert(newApp.Spec.CancelDeploy, Equals, true) + c.Assert(newApp.Spec.ForceRollback, Equals, true) + c.Assert(newApp.Status.RollbackHash, Equals, newApp.Status.DeployHash) log.Info("User cancelled deploy. Job is in deploy failed, waiting for tasks to start") // but the job should still be running @@ -208,7 +209,7 @@ func (s *IntegSuite) TestSimple(c *C) { log.Info("Attempting to roll forward with fix") - // Fixed resources + // Fixing update var TaskManagerFixedResources = corev1.ResourceRequirements{ Requests: corev1.ResourceList{ corev1.ResourceCPU: resource.MustParse("0.2"), @@ -222,7 +223,7 @@ func (s *IntegSuite) TestSimple(c *C) { // and we should be able to roll forward by resubmitting with a fixed config updateAndValidate(c, s, config.Name, func(app *v1alpha1.FlinkApplication) { app.Spec.TaskManagerConfig.Resources = &TaskManagerFixedResources - app.Spec.CancelDeploy = false + app.Spec.ForceRollback = false }, "") } diff --git a/pkg/apis/app/v1alpha1/types.go b/pkg/apis/app/v1alpha1/types.go index d43048bd..c4d951dd 100644 --- a/pkg/apis/app/v1alpha1/types.go +++ b/pkg/apis/app/v1alpha1/types.go @@ -53,7 +53,7 @@ type FlinkApplicationSpec struct { RestartNonce string `json:"restartNonce"` DeleteMode DeleteMode `json:"deleteMode,omitempty"` AllowNonRestoredState bool `json:"allowNonRestoredState,omitempty"` - CancelDeploy bool `json:"cancelDeploy"` + ForceRollback bool `json:"forceRollback"` } type FlinkConfig map[string]interface{} @@ -163,6 +163,7 @@ type FlinkApplicationStatus struct { ClusterStatus FlinkClusterStatus `json:"clusterStatus,omitempty"` JobStatus FlinkJobStatus `json:"jobStatus"` FailedDeployHash string `json:"failedDeployHash,omitEmpty"` + RollbackHash string `json:"rollbackHash,omitEmpty"` DeployHash string `json:"deployHash"` RetryCount int32 `json:"retryCount,omitEmpty"` LastSeenError *client.FlinkApplicationError `json:"lastSeenError,omitEmpty"` diff --git a/pkg/controller/flinkapplication/flink_state_machine.go b/pkg/controller/flinkapplication/flink_state_machine.go index 20bccea6..cf21f477 100644 --- a/pkg/controller/flinkapplication/flink_state_machine.go +++ b/pkg/controller/flinkapplication/flink_state_machine.go @@ -78,7 +78,7 @@ func (s *FlinkStateMachine) updateApplicationPhase(application *v1alpha1.FlinkAp } func (s *FlinkStateMachine) shouldRollback(ctx context.Context, application *v1alpha1.FlinkApplication) bool { - if application.Spec.CancelDeploy { + if application.Spec.ForceRollback { return true } if application.Status.DeployHash == "" { @@ -487,6 +487,8 @@ func (s *FlinkStateMachine) handleRollingBack(ctx context.Context, app *v1alpha1 app.Status.JobStatus.EntryClass, app.Status.JobStatus.ProgramArgs, app.Status.JobStatus.AllowNonRestoredState) + // set rollbackHash + app.Status.RollbackHash = app.Status.DeployHash if err != nil { return applicationUnchanged, err } diff --git a/pkg/controller/flinkapplication/flink_state_machine_test.go b/pkg/controller/flinkapplication/flink_state_machine_test.go index ed2d9ef7..77646435 100644 --- a/pkg/controller/flinkapplication/flink_state_machine_test.go +++ b/pkg/controller/flinkapplication/flink_state_machine_test.go @@ -1129,18 +1129,18 @@ func TestErrorHandlingInRunningPhase(t *testing.T) { } -func TestCancelDeploy(t *testing.T) { +func TestForceRollback(t *testing.T) { app := v1alpha1.FlinkApplication{ ObjectMeta: metav1.ObjectMeta{ Name: "test-app", Namespace: "flink", }, Spec: v1alpha1.FlinkApplicationSpec{ - JarName: "job.jar", - Parallelism: 5, - EntryClass: "com.my.Class", - ProgramArgs: "--test", - CancelDeploy: true, + JarName: "job.jar", + Parallelism: 5, + EntryClass: "com.my.Class", + ProgramArgs: "--test", + ForceRollback: true, }, Status: v1alpha1.FlinkApplicationStatus{ Phase: v1alpha1.FlinkApplicationClusterStarting, @@ -1153,5 +1153,5 @@ func TestCancelDeploy(t *testing.T) { assert.Nil(t, err) // cancelled deploy while cluster is starting assert.Equal(t, v1alpha1.FlinkApplicationDeployFailed, app.Status.Phase) - assert.True(t, app.Spec.CancelDeploy) -} + assert.True(t, app.Spec.ForceRollback) +} \ No newline at end of file From a9975b0d0d3900d30972bc1530bd85b47e2c8ab4 Mon Sep 17 00:00:00 2001 From: Lakshmi Gururaja Rao Date: Thu, 25 Jul 2019 16:22:19 -0700 Subject: [PATCH 05/10] Fix goimports and add doc --- docs/crd.md | 6 ++++-- pkg/controller/flinkapplication/flink_state_machine_test.go | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/crd.md b/docs/crd.md index e53be15b..934a6e74 100644 --- a/docs/crd.md +++ b/docs/crd.md @@ -106,5 +106,7 @@ Below is the list of fields in the custom resource and their description * **VolumeMounts** `type:[]v1.VolumeMount` Describes a mounting of a Volume within a container. - * **CancelDeploy** `type:bool` - Can be set to true to force cancel a deploy/update. Resetting to false or un-setting implies the deploy will continue. + * **ForceRollback** `type:bool` + Can be set to true to force rollback a deploy/update. The rollback is **not** performed when the application is in a **RUNNING** phase. + If an application is successfully rolled back, it is moved to a *DeployFailed* phase. Un-setting or setting `ForceRollback` to `False` will allow updates to progress normally. + \ No newline at end of file diff --git a/pkg/controller/flinkapplication/flink_state_machine_test.go b/pkg/controller/flinkapplication/flink_state_machine_test.go index 77646435..9a95bca3 100644 --- a/pkg/controller/flinkapplication/flink_state_machine_test.go +++ b/pkg/controller/flinkapplication/flink_state_machine_test.go @@ -1151,7 +1151,7 @@ func TestForceRollback(t *testing.T) { stateMachineForTest := getTestStateMachine() err := stateMachineForTest.Handle(context.Background(), &app) assert.Nil(t, err) - // cancelled deploy while cluster is starting + // rolled deploy while cluster is starting assert.Equal(t, v1alpha1.FlinkApplicationDeployFailed, app.Status.Phase) assert.True(t, app.Spec.ForceRollback) -} \ No newline at end of file +} From 5b99547ca7753ddf34e2906f7eb6cc2d70bb7996 Mon Sep 17 00:00:00 2001 From: Lakshmi Gururaja Rao Date: Fri, 26 Jul 2019 09:05:42 -0700 Subject: [PATCH 06/10] Dont rollback while rolling back --- .../flinkapplication/flink_state_machine.go | 2 +- .../flink_state_machine_test.go | 47 +++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/pkg/controller/flinkapplication/flink_state_machine.go b/pkg/controller/flinkapplication/flink_state_machine.go index cf21f477..c2d40185 100644 --- a/pkg/controller/flinkapplication/flink_state_machine.go +++ b/pkg/controller/flinkapplication/flink_state_machine.go @@ -78,7 +78,7 @@ func (s *FlinkStateMachine) updateApplicationPhase(application *v1alpha1.FlinkAp } func (s *FlinkStateMachine) shouldRollback(ctx context.Context, application *v1alpha1.FlinkApplication) bool { - if application.Spec.ForceRollback { + if application.Spec.ForceRollback && application.Status.Phase != v1alpha1.FlinkApplicationRollingBackJob { return true } if application.Status.DeployHash == "" { diff --git a/pkg/controller/flinkapplication/flink_state_machine_test.go b/pkg/controller/flinkapplication/flink_state_machine_test.go index 9a95bca3..d94e6be6 100644 --- a/pkg/controller/flinkapplication/flink_state_machine_test.go +++ b/pkg/controller/flinkapplication/flink_state_machine_test.go @@ -1130,6 +1130,7 @@ func TestErrorHandlingInRunningPhase(t *testing.T) { } func TestForceRollback(t *testing.T) { + oldHash := "old-hash-force-rollback" app := v1alpha1.FlinkApplication{ ObjectMeta: metav1.ObjectMeta{ Name: "test-app", @@ -1143,15 +1144,55 @@ func TestForceRollback(t *testing.T) { ForceRollback: true, }, Status: v1alpha1.FlinkApplicationStatus{ - Phase: v1alpha1.FlinkApplicationClusterStarting, - DeployHash: "old-hash-retry-err", + Phase: v1alpha1.FlinkApplicationSubmittingJob, + DeployHash: oldHash, }, } stateMachineForTest := getTestStateMachine() + stateMachineForTest.clock.(*clock.FakeClock).SetTime(time.Now()) + + mockRetryHandler := stateMachineForTest.retryHandler.(*mock.RetryHandler) + mockRetryHandler.WaitOnErrorFunc = func(clock clock.Clock, lastUpdatedTime time.Time) (duration time.Duration, b bool) { + return time.Millisecond, true + } + + mockK8Cluster := stateMachineForTest.k8Cluster.(*k8mock.K8Cluster) + + getServiceCount := 0 + mockK8Cluster.GetServiceFunc = func(ctx context.Context, namespace string, name string) (*v1.Service, error) { + hash := oldHash + if getServiceCount > 0 { + hash = oldHash + } + + getServiceCount++ + return &v1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-app", + Namespace: "flink", + }, + Spec: v1.ServiceSpec{ + Selector: map[string]string{ + "flink-app-hash": hash, + }, + }, + }, nil + } + + mockFlinkController := stateMachineForTest.flinkController.(*mock.FlinkController) + mockFlinkController.IsServiceReadyFunc = func(ctx context.Context, application *v1alpha1.FlinkApplication, hash string) (bool, error) { + return true, nil + } + err := stateMachineForTest.Handle(context.Background(), &app) assert.Nil(t, err) // rolled deploy while cluster is starting - assert.Equal(t, v1alpha1.FlinkApplicationDeployFailed, app.Status.Phase) + assert.Equal(t, v1alpha1.FlinkApplicationRollingBackJob, app.Status.Phase) assert.True(t, app.Spec.ForceRollback) + + err = stateMachineForTest.Handle(context.Background(), &app) + // Check if rollback hash is set + assert.Nil(t, err) + assert.Equal(t, oldHash, app.Status.RollbackHash) } From 8a94a90575804fd622ef2a9bd3567355d3795076 Mon Sep 17 00:00:00 2001 From: Lakshmi Gururaja Rao Date: Fri, 26 Jul 2019 09:45:22 -0700 Subject: [PATCH 07/10] Fix integ test' --- integ/simple_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/integ/simple_test.go b/integ/simple_test.go index e4b0613a..2f057218 100644 --- a/integ/simple_test.go +++ b/integ/simple_test.go @@ -201,7 +201,6 @@ func (s *IntegSuite) TestSimple(c *C) { // we should end up in the DeployFailed phase c.Assert(s.Util.WaitForPhase(newApp.Name, v1alpha1.FlinkApplicationDeployFailed, ""), IsNil) c.Assert(newApp.Spec.ForceRollback, Equals, true) - c.Assert(newApp.Status.RollbackHash, Equals, newApp.Status.DeployHash) log.Info("User cancelled deploy. Job is in deploy failed, waiting for tasks to start") // but the job should still be running From e1b664423da8dd3c5791cf1bdf1966fa49b5862c Mon Sep 17 00:00:00 2001 From: Lakshmi Gururaja Rao Date: Fri, 26 Jul 2019 11:55:45 -0700 Subject: [PATCH 08/10] Set rollbackHash in deployFailed and assert in integ test --- integ/simple_test.go | 2 +- pkg/controller/flinkapplication/flink_state_machine.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/integ/simple_test.go b/integ/simple_test.go index 2f057218..7c949173 100644 --- a/integ/simple_test.go +++ b/integ/simple_test.go @@ -205,7 +205,7 @@ func (s *IntegSuite) TestSimple(c *C) { // but the job should still be running c.Assert(newApp.Status.JobStatus.State, Equals, v1alpha1.Running) - + c.Assert(newApp.Status.RollbackHash, Equals, newApp.Status.DeployHash) log.Info("Attempting to roll forward with fix") // Fixing update diff --git a/pkg/controller/flinkapplication/flink_state_machine.go b/pkg/controller/flinkapplication/flink_state_machine.go index c2d40185..1585e8d9 100644 --- a/pkg/controller/flinkapplication/flink_state_machine.go +++ b/pkg/controller/flinkapplication/flink_state_machine.go @@ -231,7 +231,8 @@ func (s *FlinkStateMachine) deployFailed(ctx context.Context, app *v1alpha1.Flin s.flinkController.LogEvent(ctx, app, corev1.EventTypeWarning, "RolledBackDeploy", fmt.Sprintf("Successfull rolled back deploy %s", hash)) app.Status.FailedDeployHash = hash - + // set rollbackHash to deployHash + app.Status.RollbackHash = app.Status.DeployHash // Reset error and retry count app.Status.LastSeenError = nil app.Status.RetryCount = 0 From 22efe8e359e89775c02cfbb9e50f8f7d3300db81 Mon Sep 17 00:00:00 2001 From: Lakshmi Gururaja Rao Date: Fri, 26 Jul 2019 13:20:45 -0700 Subject: [PATCH 09/10] Integration test fix --- integ/simple_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integ/simple_test.go b/integ/simple_test.go index 7c949173..3641f4fb 100644 --- a/integ/simple_test.go +++ b/integ/simple_test.go @@ -176,6 +176,7 @@ func (s *IntegSuite) TestSimple(c *C) { { newApp, err := s.Util.GetFlinkApplication(config.Name) + currHash := newApp.Status.DeployHash c.Assert(err, IsNil) // User sets large (bad) value for cluster update var TaskManagerDefaultResources = corev1.ResourceRequirements{ @@ -205,7 +206,7 @@ func (s *IntegSuite) TestSimple(c *C) { // but the job should still be running c.Assert(newApp.Status.JobStatus.State, Equals, v1alpha1.Running) - c.Assert(newApp.Status.RollbackHash, Equals, newApp.Status.DeployHash) + c.Assert(newApp.Status.RollbackHash, Equals, currHash) log.Info("Attempting to roll forward with fix") // Fixing update From 9800d47b776e4b6667825e399bb21631b39b87bb Mon Sep 17 00:00:00 2001 From: Lakshmi Gururaja Rao Date: Fri, 26 Jul 2019 15:48:53 -0700 Subject: [PATCH 10/10] Fixes --- integ/simple_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/integ/simple_test.go b/integ/simple_test.go index 3641f4fb..9cdae5fb 100644 --- a/integ/simple_test.go +++ b/integ/simple_test.go @@ -176,7 +176,6 @@ func (s *IntegSuite) TestSimple(c *C) { { newApp, err := s.Util.GetFlinkApplication(config.Name) - currHash := newApp.Status.DeployHash c.Assert(err, IsNil) // User sets large (bad) value for cluster update var TaskManagerDefaultResources = corev1.ResourceRequirements{ @@ -206,7 +205,6 @@ func (s *IntegSuite) TestSimple(c *C) { // but the job should still be running c.Assert(newApp.Status.JobStatus.State, Equals, v1alpha1.Running) - c.Assert(newApp.Status.RollbackHash, Equals, currHash) log.Info("Attempting to roll forward with fix") // Fixing update