Skip to content

Commit

Permalink
chore: tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
iziang committed Jun 6, 2023
1 parent de7484c commit d885035
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion controllers/apps/operations/vertical_scaling.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ func (vs verticalScalingHandler) GetRealAffectedComponentMap(opsRequest *appsv1a
// Cancel this function defines the cancel verticalScaling action.
func (vs verticalScalingHandler) Cancel(reqCxt intctrlutil.RequestCtx, cli client.Client, opsRes *OpsResource) error {
return cancelComponentOps(reqCxt.Ctx, cli, opsRes, func(lastConfig *appsv1alpha1.LastComponentConfiguration, comp *appsv1alpha1.ClusterComponentSpec) error {
comp.ClassDefRef = &appsv1alpha1.ClassDefRef{Class: lastConfig.Class}
comp.Resources = lastConfig.ResourceRequirements
if lastConfig.ClassDefRef != nil {
comp.ClassDefRef = lastConfig.ClassDefRef
}
return nil
})
}
4 changes: 2 additions & 2 deletions internal/cli/cmd/cluster/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ var _ = Describe("create", func() {
keyStorageClass: "test-other",
},
}
comps, err := buildClusterComp(cd, setsMap, componentClasses)
comps, err := buildClusterComp(cd, setsMap, clsMgr)
Expect(err).Should(Succeed())
checkComponent(comps, "10Gi", 10, "10", "2Gi", "test", 0)
checkComponent(comps, "5Gi", 5, "5", "1Gi", "test-other", 1)
setsMap[testing.ComponentDefName][keySwitchPolicy] = "invalid"
cd.Spec.ComponentDefs[0].WorkloadType = appsv1alpha1.Replication
_, err = buildClusterComp(cd, setsMap, componentClasses)
_, err = buildClusterComp(cd, setsMap, clsMgr)
Expect(err).Should(HaveOccurred())
})

Expand Down

0 comments on commit d885035

Please sign in to comment.