Skip to content

Commit

Permalink
Optimised fleet update function of e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: LiZhenCheng9527 <[email protected]>
  • Loading branch information
LiZhenCheng9527 committed Feb 20, 2024
1 parent 386cab0 commit e86b321
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion e2e/resources/fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ func CreateFleet(client kurator.Interface, fleet *fleetv1a1.Fleet) error {

// UpdateAttachedCluster update AttachedCluster
func UpdateFleet(client kurator.Interface, fleet *fleetv1a1.Fleet) error {
_, err := client.FleetV1alpha1().Fleets(fleet.Namespace).Update(context.TODO(), fleet, metav1.UpdateOptions{})
fleetOnCluster, fleetGetErr := client.FleetV1alpha1().Fleets(fleet.Namespace).Get(context.TODO(), fleet.Name, metav1.GetOptions{})
if fleetGetErr != nil {
return fleetGetErr
}
DCfleet := fleetOnCluster.DeepCopy()
DCfleet.Spec = fleet.Spec
_, err := client.FleetV1alpha1().Fleets(fleet.Namespace).Update(context.TODO(), DCfleet, metav1.UpdateOptions{})
if err != nil {
return err
}
Expand Down

0 comments on commit e86b321

Please sign in to comment.